Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/locales.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDean Karn <Dean.Karn@metricaid.com>2016-09-12 05:47:51 +0300
committerDean Karn <Dean.Karn@metricaid.com>2016-09-12 05:47:51 +0300
commit016991eda3ac6dd8d88c3834f02ca24b50129789 (patch)
tree24ea070d58b6250c5789cd5ec9c047f83a65bcec
parent6616ab2bf0b439eca1f2266c2ba7ea74d79ebce2 (diff)
add generated testsv0.10.0
- tests are all setup, just need persons with locale knowledge to fill in the actual test cases.
-rw-r--r--README.md2
-rw-r--r--af/af.go2
-rw-r--r--af/af_test.go1120
-rw-r--r--af_NA/af_NA.go2
-rw-r--r--af_NA/af_NA_test.go1120
-rw-r--r--af_ZA/af_ZA.go2
-rw-r--r--af_ZA/af_ZA_test.go1120
-rw-r--r--agq/agq.go2
-rw-r--r--agq/agq_test.go1120
-rw-r--r--agq_CM/agq_CM.go2
-rw-r--r--agq_CM/agq_CM_test.go1120
-rw-r--r--ak/ak.go4
-rw-r--r--ak/ak_test.go1120
-rw-r--r--ak_GH/ak_GH.go4
-rw-r--r--ak_GH/ak_GH_test.go1120
-rw-r--r--am/am.go2
-rw-r--r--am/am_test.go1120
-rw-r--r--am_ET/am_ET.go4
-rw-r--r--am_ET/am_ET_test.go1120
-rw-r--r--ar/ar.go4
-rw-r--r--ar/ar_test.go1120
-rw-r--r--ar_001/ar_001.go4
-rw-r--r--ar_001/ar_001_test.go1120
-rw-r--r--ar_AE/ar_AE.go4
-rw-r--r--ar_AE/ar_AE_test.go1120
-rw-r--r--ar_BH/ar_BH.go4
-rw-r--r--ar_BH/ar_BH_test.go1120
-rw-r--r--ar_DJ/ar_DJ.go2
-rw-r--r--ar_DJ/ar_DJ_test.go1120
-rw-r--r--ar_DZ/ar_DZ.go4
-rw-r--r--ar_DZ/ar_DZ_test.go1120
-rw-r--r--ar_EG/ar_EG.go4
-rw-r--r--ar_EG/ar_EG_test.go1120
-rw-r--r--ar_EH/ar_EH.go2
-rw-r--r--ar_EH/ar_EH_test.go1120
-rw-r--r--ar_ER/ar_ER.go4
-rw-r--r--ar_ER/ar_ER_test.go1120
-rw-r--r--ar_IL/ar_IL.go4
-rw-r--r--ar_IL/ar_IL_test.go1120
-rw-r--r--ar_IQ/ar_IQ.go4
-rw-r--r--ar_IQ/ar_IQ_test.go1120
-rw-r--r--ar_JO/ar_JO.go2
-rw-r--r--ar_JO/ar_JO_test.go1120
-rw-r--r--ar_KM/ar_KM.go2
-rw-r--r--ar_KM/ar_KM_test.go1120
-rw-r--r--ar_KW/ar_KW.go4
-rw-r--r--ar_KW/ar_KW_test.go1120
-rw-r--r--ar_LB/ar_LB.go4
-rw-r--r--ar_LB/ar_LB_test.go1120
-rw-r--r--ar_LY/ar_LY.go4
-rw-r--r--ar_LY/ar_LY_test.go1120
-rw-r--r--ar_MA/ar_MA.go2
-rw-r--r--ar_MA/ar_MA_test.go1120
-rw-r--r--ar_MR/ar_MR.go4
-rw-r--r--ar_MR/ar_MR_test.go1120
-rw-r--r--ar_OM/ar_OM.go4
-rw-r--r--ar_OM/ar_OM_test.go1120
-rw-r--r--ar_PS/ar_PS.go2
-rw-r--r--ar_PS/ar_PS_test.go1120
-rw-r--r--ar_QA/ar_QA.go4
-rw-r--r--ar_QA/ar_QA_test.go1120
-rw-r--r--ar_SA/ar_SA.go2
-rw-r--r--ar_SA/ar_SA_test.go1120
-rw-r--r--ar_SD/ar_SD.go2
-rw-r--r--ar_SD/ar_SD_test.go1120
-rw-r--r--ar_SO/ar_SO.go4
-rw-r--r--ar_SO/ar_SO_test.go1120
-rw-r--r--ar_SS/ar_SS.go2
-rw-r--r--ar_SS/ar_SS_test.go1120
-rw-r--r--ar_SY/ar_SY.go2
-rw-r--r--ar_SY/ar_SY_test.go1120
-rw-r--r--ar_TD/ar_TD.go4
-rw-r--r--ar_TD/ar_TD_test.go1120
-rw-r--r--ar_TN/ar_TN.go4
-rw-r--r--ar_TN/ar_TN_test.go1120
-rw-r--r--ar_YE/ar_YE.go2
-rw-r--r--ar_YE/ar_YE_test.go1120
-rw-r--r--as/as.go4
-rw-r--r--as/as_test.go1120
-rw-r--r--as_IN/as_IN.go4
-rw-r--r--as_IN/as_IN_test.go1120
-rw-r--r--asa/asa.go2
-rw-r--r--asa/asa_test.go1120
-rw-r--r--asa_TZ/asa_TZ.go2
-rw-r--r--asa_TZ/asa_TZ_test.go1120
-rw-r--r--ast/ast.go2
-rw-r--r--ast/ast_test.go1120
-rw-r--r--ast_ES/ast_ES.go2
-rw-r--r--ast_ES/ast_ES_test.go1120
-rw-r--r--az/az.go4
-rw-r--r--az/az_test.go1120
-rw-r--r--az_Cyrl/az_Cyrl.go2
-rw-r--r--az_Cyrl/az_Cyrl_test.go1120
-rw-r--r--az_Cyrl_AZ/az_Cyrl_AZ.go2
-rw-r--r--az_Cyrl_AZ/az_Cyrl_AZ_test.go1120
-rw-r--r--az_Latn/az_Latn.go2
-rw-r--r--az_Latn/az_Latn_test.go1120
-rw-r--r--az_Latn_AZ/az_Latn_AZ.go4
-rw-r--r--az_Latn_AZ/az_Latn_AZ_test.go1120
-rw-r--r--bas/bas.go2
-rw-r--r--bas/bas_test.go1120
-rw-r--r--bas_CM/bas_CM.go2
-rw-r--r--bas_CM/bas_CM_test.go1120
-rw-r--r--be/be.go2
-rw-r--r--be/be_test.go1120
-rw-r--r--be_BY/be_BY.go4
-rw-r--r--be_BY/be_BY_test.go1120
-rw-r--r--bem/bem.go2
-rw-r--r--bem/bem_test.go1120
-rw-r--r--bem_ZM/bem_ZM.go2
-rw-r--r--bem_ZM/bem_ZM_test.go1120
-rw-r--r--bez/bez.go2
-rw-r--r--bez/bez_test.go1120
-rw-r--r--bez_TZ/bez_TZ.go2
-rw-r--r--bez_TZ/bez_TZ_test.go1120
-rw-r--r--bg/bg.go2
-rw-r--r--bg/bg_test.go1120
-rw-r--r--bg_BG/bg_BG.go2
-rw-r--r--bg_BG/bg_BG_test.go1120
-rw-r--r--bm/bm.go2
-rw-r--r--bm/bm_test.go1120
-rw-r--r--bm_ML/bm_ML.go2
-rw-r--r--bm_ML/bm_ML_test.go1120
-rw-r--r--bn/bn.go2
-rw-r--r--bn/bn_test.go1120
-rw-r--r--bn_BD/bn_BD.go2
-rw-r--r--bn_BD/bn_BD_test.go1120
-rw-r--r--bn_IN/bn_IN.go2
-rw-r--r--bn_IN/bn_IN_test.go1120
-rw-r--r--bo/bo.go4
-rw-r--r--bo/bo_test.go1120
-rw-r--r--bo_CN/bo_CN.go4
-rw-r--r--bo_CN/bo_CN_test.go1120
-rw-r--r--bo_IN/bo_IN.go4
-rw-r--r--bo_IN/bo_IN_test.go1120
-rw-r--r--br/br.go2
-rw-r--r--br/br_test.go1120
-rw-r--r--br_FR/br_FR.go2
-rw-r--r--br_FR/br_FR_test.go1120
-rw-r--r--brx/brx.go4
-rw-r--r--brx/brx_test.go1120
-rw-r--r--brx_IN/brx_IN.go4
-rw-r--r--brx_IN/brx_IN_test.go1120
-rw-r--r--bs/bs.go4
-rw-r--r--bs/bs_test.go1120
-rw-r--r--bs_Cyrl/bs_Cyrl.go4
-rw-r--r--bs_Cyrl/bs_Cyrl_test.go1120
-rw-r--r--bs_Cyrl_BA/bs_Cyrl_BA.go4
-rw-r--r--bs_Cyrl_BA/bs_Cyrl_BA_test.go1120
-rw-r--r--bs_Latn/bs_Latn.go2
-rw-r--r--bs_Latn/bs_Latn_test.go1120
-rw-r--r--bs_Latn_BA/bs_Latn_BA.go6
-rw-r--r--bs_Latn_BA/bs_Latn_BA_test.go1120
-rw-r--r--ca/ca.go2
-rw-r--r--ca/ca_test.go1120
-rw-r--r--ca_AD/ca_AD.go2
-rw-r--r--ca_AD/ca_AD_test.go1120
-rw-r--r--ca_ES/ca_ES.go2
-rw-r--r--ca_ES/ca_ES_test.go1120
-rw-r--r--ca_ES_VALENCIA/ca_ES_VALENCIA.go2
-rw-r--r--ca_ES_VALENCIA/ca_ES_VALENCIA_test.go1120
-rw-r--r--ca_FR/ca_FR.go2
-rw-r--r--ca_FR/ca_FR_test.go1120
-rw-r--r--ca_IT/ca_IT.go2
-rw-r--r--ca_IT/ca_IT_test.go1120
-rw-r--r--ce/ce.go4
-rw-r--r--ce/ce_test.go1120
-rw-r--r--ce_RU/ce_RU.go4
-rw-r--r--ce_RU/ce_RU_test.go1120
-rw-r--r--cgg/cgg.go2
-rw-r--r--cgg/cgg_test.go1120
-rw-r--r--cgg_UG/cgg_UG.go2
-rw-r--r--cgg_UG/cgg_UG_test.go1120
-rw-r--r--chr/chr.go2
-rw-r--r--chr/chr_test.go1120
-rw-r--r--chr_US/chr_US.go2
-rw-r--r--chr_US/chr_US_test.go1120
-rw-r--r--ckb/ckb.go4
-rw-r--r--ckb/ckb_test.go1120
-rw-r--r--ckb_IQ/ckb_IQ.go4
-rw-r--r--ckb_IQ/ckb_IQ_test.go1120
-rw-r--r--ckb_IR/ckb_IR.go4
-rw-r--r--ckb_IR/ckb_IR_test.go1120
-rw-r--r--cmd/generate_resources.go31
-rw-r--r--cmd/tests.tmpl1123
-rw-r--r--cmd/translator.tmpl12
-rw-r--r--cs/cs.go4
-rw-r--r--cs/cs_test.go1120
-rw-r--r--cs_CZ/cs_CZ.go4
-rw-r--r--cs_CZ/cs_CZ_test.go1120
-rw-r--r--cu/cu.go2
-rw-r--r--cu/cu_test.go1120
-rw-r--r--cu_RU/cu_RU.go2
-rw-r--r--cu_RU/cu_RU_test.go1120
-rw-r--r--cy/cy.go2
-rw-r--r--cy/cy_test.go1120
-rw-r--r--cy_GB/cy_GB.go2
-rw-r--r--cy_GB/cy_GB_test.go1120
-rw-r--r--da/da.go2
-rw-r--r--da/da_test.go1120
-rw-r--r--da_DK/da_DK.go2
-rw-r--r--da_DK/da_DK_test.go1120
-rw-r--r--da_GL/da_GL.go2
-rw-r--r--da_GL/da_GL_test.go1120
-rw-r--r--dav/dav.go2
-rw-r--r--dav/dav_test.go1120
-rw-r--r--dav_KE/dav_KE.go2
-rw-r--r--dav_KE/dav_KE_test.go1120
-rw-r--r--de/de.go2
-rw-r--r--de/de_test.go1120
-rw-r--r--de_AT/de_AT.go2
-rw-r--r--de_AT/de_AT_test.go1120
-rw-r--r--de_BE/de_BE.go2
-rw-r--r--de_BE/de_BE_test.go1120
-rw-r--r--de_CH/de_CH.go2
-rw-r--r--de_CH/de_CH_test.go1120
-rw-r--r--de_DE/de_DE.go2
-rw-r--r--de_DE/de_DE_test.go1120
-rw-r--r--de_LI/de_LI.go2
-rw-r--r--de_LI/de_LI_test.go1120
-rw-r--r--de_LU/de_LU.go2
-rw-r--r--de_LU/de_LU_test.go1120
-rw-r--r--dje/dje.go2
-rw-r--r--dje/dje_test.go1120
-rw-r--r--dje_NE/dje_NE.go2
-rw-r--r--dje_NE/dje_NE_test.go1120
-rw-r--r--dsb/dsb.go2
-rw-r--r--dsb/dsb_test.go1120
-rw-r--r--dsb_DE/dsb_DE.go2
-rw-r--r--dsb_DE/dsb_DE_test.go1120
-rw-r--r--dua/dua.go2
-rw-r--r--dua/dua_test.go1120
-rw-r--r--dua_CM/dua_CM.go2
-rw-r--r--dua_CM/dua_CM_test.go1120
-rw-r--r--dyo/dyo.go2
-rw-r--r--dyo/dyo_test.go1120
-rw-r--r--dyo_SN/dyo_SN.go2
-rw-r--r--dyo_SN/dyo_SN_test.go1120
-rw-r--r--dz/dz.go2
-rw-r--r--dz/dz_test.go1120
-rw-r--r--dz_BT/dz_BT.go2
-rw-r--r--dz_BT/dz_BT_test.go1120
-rw-r--r--ebu/ebu.go2
-rw-r--r--ebu/ebu_test.go1120
-rw-r--r--ebu_KE/ebu_KE.go2
-rw-r--r--ebu_KE/ebu_KE_test.go1120
-rw-r--r--ee/ee.go2
-rw-r--r--ee/ee_test.go1120
-rw-r--r--ee_GH/ee_GH.go2
-rw-r--r--ee_GH/ee_GH_test.go1120
-rw-r--r--ee_TG/ee_TG.go2
-rw-r--r--ee_TG/ee_TG_test.go1120
-rw-r--r--el/el.go2
-rw-r--r--el/el_test.go1120
-rw-r--r--el_CY/el_CY.go4
-rw-r--r--el_CY/el_CY_test.go1120
-rw-r--r--el_GR/el_GR.go2
-rw-r--r--el_GR/el_GR_test.go1120
-rw-r--r--en/en.go4
-rw-r--r--en_001/en_001.go2
-rw-r--r--en_001/en_001_test.go1120
-rw-r--r--en_150/en_150.go2
-rw-r--r--en_150/en_150_test.go1120
-rw-r--r--en_AG/en_AG.go2
-rw-r--r--en_AG/en_AG_test.go1120
-rw-r--r--en_AI/en_AI.go2
-rw-r--r--en_AI/en_AI_test.go1120
-rw-r--r--en_AS/en_AS.go2
-rw-r--r--en_AS/en_AS_test.go1120
-rw-r--r--en_AT/en_AT.go2
-rw-r--r--en_AT/en_AT_test.go1120
-rw-r--r--en_AU/en_AU.go2
-rw-r--r--en_AU/en_AU_test.go1120
-rw-r--r--en_BB/en_BB.go4
-rw-r--r--en_BB/en_BB_test.go1120
-rw-r--r--en_BE/en_BE.go2
-rw-r--r--en_BE/en_BE_test.go1120
-rw-r--r--en_BI/en_BI.go2
-rw-r--r--en_BI/en_BI_test.go1120
-rw-r--r--en_BM/en_BM.go2
-rw-r--r--en_BM/en_BM_test.go1120
-rw-r--r--en_BS/en_BS.go2
-rw-r--r--en_BS/en_BS_test.go1120
-rw-r--r--en_BW/en_BW.go4
-rw-r--r--en_BW/en_BW_test.go1120
-rw-r--r--en_BZ/en_BZ.go2
-rw-r--r--en_BZ/en_BZ_test.go1120
-rw-r--r--en_CA/en_CA.go2
-rw-r--r--en_CA/en_CA_test.go1120
-rw-r--r--en_CC/en_CC.go2
-rw-r--r--en_CC/en_CC_test.go1120
-rw-r--r--en_CH/en_CH.go2
-rw-r--r--en_CH/en_CH_test.go1120
-rw-r--r--en_CK/en_CK.go2
-rw-r--r--en_CK/en_CK_test.go1120
-rw-r--r--en_CM/en_CM.go2
-rw-r--r--en_CM/en_CM_test.go1120
-rw-r--r--en_CX/en_CX.go2
-rw-r--r--en_CX/en_CX_test.go1120
-rw-r--r--en_CY/en_CY.go2
-rw-r--r--en_CY/en_CY_test.go1120
-rw-r--r--en_DE/en_DE.go4
-rw-r--r--en_DE/en_DE_test.go1120
-rw-r--r--en_DG/en_DG.go2
-rw-r--r--en_DG/en_DG_test.go1120
-rw-r--r--en_DK/en_DK.go2
-rw-r--r--en_DK/en_DK_test.go1120
-rw-r--r--en_DM/en_DM.go2
-rw-r--r--en_DM/en_DM_test.go1120
-rw-r--r--en_ER/en_ER.go2
-rw-r--r--en_ER/en_ER_test.go1120
-rw-r--r--en_FI/en_FI.go4
-rw-r--r--en_FI/en_FI_test.go1120
-rw-r--r--en_FJ/en_FJ.go2
-rw-r--r--en_FJ/en_FJ_test.go1120
-rw-r--r--en_FK/en_FK.go2
-rw-r--r--en_FK/en_FK_test.go1120
-rw-r--r--en_FM/en_FM.go2
-rw-r--r--en_FM/en_FM_test.go1120
-rw-r--r--en_GB/en_GB.go2
-rw-r--r--en_GB/en_GB_test.go1120
-rw-r--r--en_GD/en_GD.go2
-rw-r--r--en_GD/en_GD_test.go1120
-rw-r--r--en_GG/en_GG.go2
-rw-r--r--en_GG/en_GG_test.go1120
-rw-r--r--en_GH/en_GH.go2
-rw-r--r--en_GH/en_GH_test.go1120
-rw-r--r--en_GI/en_GI.go2
-rw-r--r--en_GI/en_GI_test.go1120
-rw-r--r--en_GM/en_GM.go2
-rw-r--r--en_GM/en_GM_test.go1120
-rw-r--r--en_GU/en_GU.go2
-rw-r--r--en_GU/en_GU_test.go1120
-rw-r--r--en_GY/en_GY.go2
-rw-r--r--en_GY/en_GY_test.go1120
-rw-r--r--en_HK/en_HK.go2
-rw-r--r--en_HK/en_HK_test.go1120
-rw-r--r--en_IE/en_IE.go4
-rw-r--r--en_IE/en_IE_test.go1120
-rw-r--r--en_IL/en_IL.go2
-rw-r--r--en_IL/en_IL_test.go1120
-rw-r--r--en_IM/en_IM.go2
-rw-r--r--en_IM/en_IM_test.go1120
-rw-r--r--en_IN/en_IN.go2
-rw-r--r--en_IN/en_IN_test.go1120
-rw-r--r--en_IO/en_IO.go2
-rw-r--r--en_IO/en_IO_test.go1120
-rw-r--r--en_JE/en_JE.go2
-rw-r--r--en_JE/en_JE_test.go1120
-rw-r--r--en_JM/en_JM.go2
-rw-r--r--en_JM/en_JM_test.go1120
-rw-r--r--en_KE/en_KE.go2
-rw-r--r--en_KE/en_KE_test.go1120
-rw-r--r--en_KI/en_KI.go2
-rw-r--r--en_KI/en_KI_test.go1120
-rw-r--r--en_KN/en_KN.go2
-rw-r--r--en_KN/en_KN_test.go1120
-rw-r--r--en_KY/en_KY.go2
-rw-r--r--en_KY/en_KY_test.go1120
-rw-r--r--en_LC/en_LC.go2
-rw-r--r--en_LC/en_LC_test.go1120
-rw-r--r--en_LR/en_LR.go4
-rw-r--r--en_LR/en_LR_test.go1120
-rw-r--r--en_LS/en_LS.go4
-rw-r--r--en_LS/en_LS_test.go1120
-rw-r--r--en_MG/en_MG.go2
-rw-r--r--en_MG/en_MG_test.go1120
-rw-r--r--en_MH/en_MH.go2
-rw-r--r--en_MH/en_MH_test.go1120
-rw-r--r--en_MO/en_MO.go2
-rw-r--r--en_MO/en_MO_test.go1120
-rw-r--r--en_MP/en_MP.go2
-rw-r--r--en_MP/en_MP_test.go1120
-rw-r--r--en_MS/en_MS.go2
-rw-r--r--en_MS/en_MS_test.go1120
-rw-r--r--en_MT/en_MT.go2
-rw-r--r--en_MT/en_MT_test.go1120
-rw-r--r--en_MU/en_MU.go2
-rw-r--r--en_MU/en_MU_test.go1120
-rw-r--r--en_MW/en_MW.go2
-rw-r--r--en_MW/en_MW_test.go1120
-rw-r--r--en_MY/en_MY.go2
-rw-r--r--en_MY/en_MY_test.go1120
-rw-r--r--en_NA/en_NA.go2
-rw-r--r--en_NA/en_NA_test.go1120
-rw-r--r--en_NF/en_NF.go4
-rw-r--r--en_NF/en_NF_test.go1120
-rw-r--r--en_NG/en_NG.go2
-rw-r--r--en_NG/en_NG_test.go1120
-rw-r--r--en_NL/en_NL.go2
-rw-r--r--en_NL/en_NL_test.go1120
-rw-r--r--en_NR/en_NR.go2
-rw-r--r--en_NR/en_NR_test.go1120
-rw-r--r--en_NU/en_NU.go2
-rw-r--r--en_NU/en_NU_test.go1120
-rw-r--r--en_NZ/en_NZ.go2
-rw-r--r--en_NZ/en_NZ_test.go1120
-rw-r--r--en_PG/en_PG.go4
-rw-r--r--en_PG/en_PG_test.go1120
-rw-r--r--en_PH/en_PH.go2
-rw-r--r--en_PH/en_PH_test.go1120
-rw-r--r--en_PK/en_PK.go2
-rw-r--r--en_PK/en_PK_test.go1120
-rw-r--r--en_PN/en_PN.go2
-rw-r--r--en_PN/en_PN_test.go1120
-rw-r--r--en_PR/en_PR.go2
-rw-r--r--en_PR/en_PR_test.go1120
-rw-r--r--en_PW/en_PW.go4
-rw-r--r--en_PW/en_PW_test.go1120
-rw-r--r--en_RW/en_RW.go4
-rw-r--r--en_RW/en_RW_test.go1120
-rw-r--r--en_SB/en_SB.go2
-rw-r--r--en_SB/en_SB_test.go1120
-rw-r--r--en_SC/en_SC.go4
-rw-r--r--en_SC/en_SC_test.go1120
-rw-r--r--en_SD/en_SD.go2
-rw-r--r--en_SD/en_SD_test.go1120
-rw-r--r--en_SE/en_SE.go2
-rw-r--r--en_SE/en_SE_test.go1120
-rw-r--r--en_SG/en_SG.go4
-rw-r--r--en_SG/en_SG_test.go1120
-rw-r--r--en_SH/en_SH.go2
-rw-r--r--en_SH/en_SH_test.go1120
-rw-r--r--en_SI/en_SI.go2
-rw-r--r--en_SI/en_SI_test.go1120
-rw-r--r--en_SL/en_SL.go2
-rw-r--r--en_SL/en_SL_test.go1120
-rw-r--r--en_SS/en_SS.go4
-rw-r--r--en_SS/en_SS_test.go1120
-rw-r--r--en_SX/en_SX.go2
-rw-r--r--en_SX/en_SX_test.go1120
-rw-r--r--en_SZ/en_SZ.go2
-rw-r--r--en_SZ/en_SZ_test.go1120
-rw-r--r--en_TC/en_TC.go2
-rw-r--r--en_TC/en_TC_test.go1120
-rw-r--r--en_TK/en_TK.go2
-rw-r--r--en_TK/en_TK_test.go1120
-rw-r--r--en_TO/en_TO.go2
-rw-r--r--en_TO/en_TO_test.go1120
-rw-r--r--en_TT/en_TT.go2
-rw-r--r--en_TT/en_TT_test.go1120
-rw-r--r--en_TV/en_TV.go2
-rw-r--r--en_TV/en_TV_test.go1120
-rw-r--r--en_TZ/en_TZ.go2
-rw-r--r--en_TZ/en_TZ_test.go1120
-rw-r--r--en_UG/en_UG.go2
-rw-r--r--en_UG/en_UG_test.go1120
-rw-r--r--en_UM/en_UM.go2
-rw-r--r--en_UM/en_UM_test.go1120
-rw-r--r--en_US/en_US.go2
-rw-r--r--en_US/en_US_test.go1120
-rw-r--r--en_US_POSIX/en_US_POSIX.go2
-rw-r--r--en_US_POSIX/en_US_POSIX_test.go1120
-rw-r--r--en_VC/en_VC.go2
-rw-r--r--en_VC/en_VC_test.go1120
-rw-r--r--en_VG/en_VG.go4
-rw-r--r--en_VG/en_VG_test.go1120
-rw-r--r--en_VI/en_VI.go2
-rw-r--r--en_VI/en_VI_test.go1120
-rw-r--r--en_VU/en_VU.go2
-rw-r--r--en_VU/en_VU_test.go1120
-rw-r--r--en_WS/en_WS.go4
-rw-r--r--en_WS/en_WS_test.go1120
-rw-r--r--en_ZA/en_ZA.go2
-rw-r--r--en_ZA/en_ZA_test.go1120
-rw-r--r--en_ZM/en_ZM.go2
-rw-r--r--en_ZM/en_ZM_test.go1120
-rw-r--r--en_ZW/en_ZW.go2
-rw-r--r--en_ZW/en_ZW_test.go1120
-rw-r--r--eo/eo.go2
-rw-r--r--eo/eo_test.go1120
-rw-r--r--eo_001/eo_001.go2
-rw-r--r--eo_001/eo_001_test.go1120
-rw-r--r--es/es.go2
-rw-r--r--es/es_test.go1120
-rw-r--r--es_419/es_419.go2
-rw-r--r--es_419/es_419_test.go1120
-rw-r--r--es_AR/es_AR.go2
-rw-r--r--es_AR/es_AR_test.go1120
-rw-r--r--es_BO/es_BO.go2
-rw-r--r--es_BO/es_BO_test.go1120
-rw-r--r--es_BR/es_BR.go2
-rw-r--r--es_BR/es_BR_test.go1120
-rw-r--r--es_CL/es_CL.go2
-rw-r--r--es_CL/es_CL_test.go1120
-rw-r--r--es_CO/es_CO.go2
-rw-r--r--es_CO/es_CO_test.go1120
-rw-r--r--es_CR/es_CR.go2
-rw-r--r--es_CR/es_CR_test.go1120
-rw-r--r--es_CU/es_CU.go2
-rw-r--r--es_CU/es_CU_test.go1120
-rw-r--r--es_DO/es_DO.go2
-rw-r--r--es_DO/es_DO_test.go1120
-rw-r--r--es_EA/es_EA.go2
-rw-r--r--es_EA/es_EA_test.go1120
-rw-r--r--es_EC/es_EC.go2
-rw-r--r--es_EC/es_EC_test.go1120
-rw-r--r--es_ES/es_ES.go2
-rw-r--r--es_ES/es_ES_test.go1120
-rw-r--r--es_GQ/es_GQ.go2
-rw-r--r--es_GQ/es_GQ_test.go1120
-rw-r--r--es_GT/es_GT.go2
-rw-r--r--es_GT/es_GT_test.go1120
-rw-r--r--es_HN/es_HN.go2
-rw-r--r--es_HN/es_HN_test.go1120
-rw-r--r--es_IC/es_IC.go2
-rw-r--r--es_IC/es_IC_test.go1120
-rw-r--r--es_MX/es_MX.go2
-rw-r--r--es_MX/es_MX_test.go1120
-rw-r--r--es_NI/es_NI.go2
-rw-r--r--es_NI/es_NI_test.go1120
-rw-r--r--es_PA/es_PA.go2
-rw-r--r--es_PA/es_PA_test.go1120
-rw-r--r--es_PE/es_PE.go2
-rw-r--r--es_PE/es_PE_test.go1120
-rw-r--r--es_PH/es_PH.go2
-rw-r--r--es_PH/es_PH_test.go1120
-rw-r--r--es_PR/es_PR.go2
-rw-r--r--es_PR/es_PR_test.go1120
-rw-r--r--es_PY/es_PY.go2
-rw-r--r--es_PY/es_PY_test.go1120
-rw-r--r--es_SV/es_SV.go2
-rw-r--r--es_SV/es_SV_test.go1120
-rw-r--r--es_US/es_US.go2
-rw-r--r--es_US/es_US_test.go1120
-rw-r--r--es_UY/es_UY.go2
-rw-r--r--es_UY/es_UY_test.go1120
-rw-r--r--es_VE/es_VE.go2
-rw-r--r--es_VE/es_VE_test.go1120
-rw-r--r--et/et.go2
-rw-r--r--et/et_test.go1120
-rw-r--r--et_EE/et_EE.go2
-rw-r--r--et_EE/et_EE_test.go1120
-rw-r--r--eu/eu.go2
-rw-r--r--eu/eu_test.go1120
-rw-r--r--eu_ES/eu_ES.go2
-rw-r--r--eu_ES/eu_ES_test.go1120
-rw-r--r--ewo/ewo.go2
-rw-r--r--ewo/ewo_test.go1120
-rw-r--r--ewo_CM/ewo_CM.go2
-rw-r--r--ewo_CM/ewo_CM_test.go1120
-rw-r--r--fa/fa.go2
-rw-r--r--fa/fa_test.go1120
-rw-r--r--fa_AF/fa_AF.go2
-rw-r--r--fa_AF/fa_AF_test.go1120
-rw-r--r--fa_IR/fa_IR.go2
-rw-r--r--fa_IR/fa_IR_test.go1120
-rw-r--r--ff/ff.go2
-rw-r--r--ff/ff_test.go1120
-rw-r--r--ff_CM/ff_CM.go2
-rw-r--r--ff_CM/ff_CM_test.go1120
-rw-r--r--ff_GN/ff_GN.go2
-rw-r--r--ff_GN/ff_GN_test.go1120
-rw-r--r--ff_MR/ff_MR.go2
-rw-r--r--ff_MR/ff_MR_test.go1120
-rw-r--r--ff_SN/ff_SN.go2
-rw-r--r--ff_SN/ff_SN_test.go1120
-rw-r--r--fi/fi.go2
-rw-r--r--fi/fi_test.go1120
-rw-r--r--fi_FI/fi_FI.go2
-rw-r--r--fi_FI/fi_FI_test.go1120
-rw-r--r--fil/fil.go4
-rw-r--r--fil/fil_test.go1120
-rw-r--r--fil_PH/fil_PH.go2
-rw-r--r--fil_PH/fil_PH_test.go1120
-rw-r--r--fo/fo.go2
-rw-r--r--fo/fo_test.go1120
-rw-r--r--fo_DK/fo_DK.go2
-rw-r--r--fo_DK/fo_DK_test.go1120
-rw-r--r--fo_FO/fo_FO.go2
-rw-r--r--fo_FO/fo_FO_test.go1120
-rw-r--r--fr/fr.go2
-rw-r--r--fr/fr_test.go1120
-rw-r--r--fr_BE/fr_BE.go2
-rw-r--r--fr_BE/fr_BE_test.go1120
-rw-r--r--fr_BF/fr_BF.go4
-rw-r--r--fr_BF/fr_BF_test.go1120
-rw-r--r--fr_BI/fr_BI.go2
-rw-r--r--fr_BI/fr_BI_test.go1120
-rw-r--r--fr_BJ/fr_BJ.go2
-rw-r--r--fr_BJ/fr_BJ_test.go1120
-rw-r--r--fr_BL/fr_BL.go2
-rw-r--r--fr_BL/fr_BL_test.go1120
-rw-r--r--fr_CA/fr_CA.go2
-rw-r--r--fr_CA/fr_CA_test.go1120
-rw-r--r--fr_CD/fr_CD.go2
-rw-r--r--fr_CD/fr_CD_test.go1120
-rw-r--r--fr_CF/fr_CF.go2
-rw-r--r--fr_CF/fr_CF_test.go1120
-rw-r--r--fr_CG/fr_CG.go2
-rw-r--r--fr_CG/fr_CG_test.go1120
-rw-r--r--fr_CH/fr_CH.go2
-rw-r--r--fr_CH/fr_CH_test.go1120
-rw-r--r--fr_CI/fr_CI.go2
-rw-r--r--fr_CI/fr_CI_test.go1120
-rw-r--r--fr_CM/fr_CM.go2
-rw-r--r--fr_CM/fr_CM_test.go1120
-rw-r--r--fr_DJ/fr_DJ.go2
-rw-r--r--fr_DJ/fr_DJ_test.go1120
-rw-r--r--fr_DZ/fr_DZ.go2
-rw-r--r--fr_DZ/fr_DZ_test.go1120
-rw-r--r--fr_FR/fr_FR.go2
-rw-r--r--fr_FR/fr_FR_test.go1120
-rw-r--r--fr_GA/fr_GA.go2
-rw-r--r--fr_GA/fr_GA_test.go1120
-rw-r--r--fr_GF/fr_GF.go4
-rw-r--r--fr_GF/fr_GF_test.go1120
-rw-r--r--fr_GN/fr_GN.go2
-rw-r--r--fr_GN/fr_GN_test.go1120
-rw-r--r--fr_GP/fr_GP.go2
-rw-r--r--fr_GP/fr_GP_test.go1120
-rw-r--r--fr_GQ/fr_GQ.go4
-rw-r--r--fr_GQ/fr_GQ_test.go1120
-rw-r--r--fr_HT/fr_HT.go2
-rw-r--r--fr_HT/fr_HT_test.go1120
-rw-r--r--fr_KM/fr_KM.go2
-rw-r--r--fr_KM/fr_KM_test.go1120
-rw-r--r--fr_LU/fr_LU.go2
-rw-r--r--fr_LU/fr_LU_test.go1120
-rw-r--r--fr_MA/fr_MA.go2
-rw-r--r--fr_MA/fr_MA_test.go1120
-rw-r--r--fr_MC/fr_MC.go4
-rw-r--r--fr_MC/fr_MC_test.go1120
-rw-r--r--fr_MF/fr_MF.go2
-rw-r--r--fr_MF/fr_MF_test.go1120
-rw-r--r--fr_MG/fr_MG.go2
-rw-r--r--fr_MG/fr_MG_test.go1120
-rw-r--r--fr_ML/fr_ML.go2
-rw-r--r--fr_ML/fr_ML_test.go1120
-rw-r--r--fr_MQ/fr_MQ.go2
-rw-r--r--fr_MQ/fr_MQ_test.go1120
-rw-r--r--fr_MR/fr_MR.go2
-rw-r--r--fr_MR/fr_MR_test.go1120
-rw-r--r--fr_MU/fr_MU.go4
-rw-r--r--fr_MU/fr_MU_test.go1120
-rw-r--r--fr_NC/fr_NC.go4
-rw-r--r--fr_NC/fr_NC_test.go1120
-rw-r--r--fr_NE/fr_NE.go2
-rw-r--r--fr_NE/fr_NE_test.go1120
-rw-r--r--fr_PF/fr_PF.go2
-rw-r--r--fr_PF/fr_PF_test.go1120
-rw-r--r--fr_PM/fr_PM.go4
-rw-r--r--fr_PM/fr_PM_test.go1120
-rw-r--r--fr_RE/fr_RE.go4
-rw-r--r--fr_RE/fr_RE_test.go1120
-rw-r--r--fr_RW/fr_RW.go2
-rw-r--r--fr_RW/fr_RW_test.go1120
-rw-r--r--fr_SC/fr_SC.go4
-rw-r--r--fr_SC/fr_SC_test.go1120
-rw-r--r--fr_SN/fr_SN.go2
-rw-r--r--fr_SN/fr_SN_test.go1120
-rw-r--r--fr_SY/fr_SY.go2
-rw-r--r--fr_SY/fr_SY_test.go1120
-rw-r--r--fr_TD/fr_TD.go4
-rw-r--r--fr_TD/fr_TD_test.go1120
-rw-r--r--fr_TG/fr_TG.go2
-rw-r--r--fr_TG/fr_TG_test.go1120
-rw-r--r--fr_TN/fr_TN.go2
-rw-r--r--fr_TN/fr_TN_test.go1120
-rw-r--r--fr_VU/fr_VU.go2
-rw-r--r--fr_VU/fr_VU_test.go1120
-rw-r--r--fr_WF/fr_WF.go2
-rw-r--r--fr_WF/fr_WF_test.go1120
-rw-r--r--fr_YT/fr_YT.go2
-rw-r--r--fr_YT/fr_YT_test.go1120
-rw-r--r--fur/fur.go2
-rw-r--r--fur/fur_test.go1120
-rw-r--r--fur_IT/fur_IT.go2
-rw-r--r--fur_IT/fur_IT_test.go1120
-rw-r--r--fy/fy.go2
-rw-r--r--fy/fy_test.go1120
-rw-r--r--fy_NL/fy_NL.go2
-rw-r--r--fy_NL/fy_NL_test.go1120
-rw-r--r--ga/ga.go2
-rw-r--r--ga/ga_test.go1120
-rw-r--r--ga_IE/ga_IE.go2
-rw-r--r--ga_IE/ga_IE_test.go1120
-rw-r--r--gd/gd.go2
-rw-r--r--gd/gd_test.go1120
-rw-r--r--gd_GB/gd_GB.go2
-rw-r--r--gd_GB/gd_GB_test.go1120
-rw-r--r--gl/gl.go2
-rw-r--r--gl/gl_test.go1120
-rw-r--r--gl_ES/gl_ES.go2
-rw-r--r--gl_ES/gl_ES_test.go1120
-rw-r--r--gsw/gsw.go2
-rw-r--r--gsw/gsw_test.go1120
-rw-r--r--gsw_CH/gsw_CH.go2
-rw-r--r--gsw_CH/gsw_CH_test.go1120
-rw-r--r--gsw_FR/gsw_FR.go2
-rw-r--r--gsw_FR/gsw_FR_test.go1120
-rw-r--r--gsw_LI/gsw_LI.go2
-rw-r--r--gsw_LI/gsw_LI_test.go1120
-rw-r--r--gu/gu.go2
-rw-r--r--gu/gu_test.go1120
-rw-r--r--gu_IN/gu_IN.go2
-rw-r--r--gu_IN/gu_IN_test.go1120
-rw-r--r--guz/guz.go2
-rw-r--r--guz/guz_test.go1120
-rw-r--r--guz_KE/guz_KE.go2
-rw-r--r--guz_KE/guz_KE_test.go1120
-rw-r--r--gv/gv.go4
-rw-r--r--gv/gv_test.go1120
-rw-r--r--gv_IM/gv_IM.go4
-rw-r--r--gv_IM/gv_IM_test.go1120
-rw-r--r--ha/ha.go2
-rw-r--r--ha/ha_test.go1120
-rw-r--r--ha_GH/ha_GH.go2
-rw-r--r--ha_GH/ha_GH_test.go1120
-rw-r--r--ha_NE/ha_NE.go2
-rw-r--r--ha_NE/ha_NE_test.go1120
-rw-r--r--ha_NG/ha_NG.go2
-rw-r--r--ha_NG/ha_NG_test.go1120
-rw-r--r--haw/haw.go4
-rw-r--r--haw/haw_test.go1120
-rw-r--r--haw_US/haw_US.go4
-rw-r--r--haw_US/haw_US_test.go1120
-rw-r--r--he/he.go2
-rw-r--r--he/he_test.go1120
-rw-r--r--he_IL/he_IL.go2
-rw-r--r--he_IL/he_IL_test.go1120
-rw-r--r--hi/hi.go2
-rw-r--r--hi/hi_test.go1120
-rw-r--r--hi_IN/hi_IN.go4
-rw-r--r--hi_IN/hi_IN_test.go1120
-rw-r--r--hr/hr.go4
-rw-r--r--hr/hr_test.go1120
-rw-r--r--hr_BA/hr_BA.go2
-rw-r--r--hr_BA/hr_BA_test.go1120
-rw-r--r--hr_HR/hr_HR.go6
-rw-r--r--hr_HR/hr_HR_test.go1120
-rw-r--r--hsb/hsb.go2
-rw-r--r--hsb/hsb_test.go1120
-rw-r--r--hsb_DE/hsb_DE.go2
-rw-r--r--hsb_DE/hsb_DE_test.go1120
-rw-r--r--hu/hu.go2
-rw-r--r--hu/hu_test.go1120
-rw-r--r--hu_HU/hu_HU.go2
-rw-r--r--hu_HU/hu_HU_test.go1120
-rw-r--r--hy/hy.go2
-rw-r--r--hy/hy_test.go1120
-rw-r--r--hy_AM/hy_AM.go2
-rw-r--r--hy_AM/hy_AM_test.go1120
-rw-r--r--id/id.go2
-rw-r--r--id/id_test.go1120
-rw-r--r--id_ID/id_ID.go2
-rw-r--r--id_ID/id_ID_test.go1120
-rw-r--r--ig/ig.go4
-rw-r--r--ig/ig_test.go1120
-rw-r--r--ig_NG/ig_NG.go4
-rw-r--r--ig_NG/ig_NG_test.go1120
-rw-r--r--ii/ii.go4
-rw-r--r--ii/ii_test.go1120
-rw-r--r--ii_CN/ii_CN.go4
-rw-r--r--ii_CN/ii_CN_test.go1120
-rw-r--r--is/is.go2
-rw-r--r--is/is_test.go1120
-rw-r--r--is_IS/is_IS.go2
-rw-r--r--is_IS/is_IS_test.go1120
-rw-r--r--it/it.go2
-rw-r--r--it/it_test.go1120
-rw-r--r--it_CH/it_CH.go2
-rw-r--r--it_CH/it_CH_test.go1120
-rw-r--r--it_IT/it_IT.go2
-rw-r--r--it_IT/it_IT_test.go1120
-rw-r--r--it_SM/it_SM.go2
-rw-r--r--it_SM/it_SM_test.go1120
-rw-r--r--ja/ja.go2
-rw-r--r--ja/ja_test.go1120
-rw-r--r--ja_JP/ja_JP.go2
-rw-r--r--ja_JP/ja_JP_test.go1120
-rw-r--r--jgo/jgo.go2
-rw-r--r--jgo/jgo_test.go1120
-rw-r--r--jgo_CM/jgo_CM.go2
-rw-r--r--jgo_CM/jgo_CM_test.go1120
-rw-r--r--jmc/jmc.go2
-rw-r--r--jmc/jmc_test.go1120
-rw-r--r--jmc_TZ/jmc_TZ.go2
-rw-r--r--jmc_TZ/jmc_TZ_test.go1120
-rw-r--r--ka/ka.go2
-rw-r--r--ka/ka_test.go1120
-rw-r--r--ka_GE/ka_GE.go2
-rw-r--r--ka_GE/ka_GE_test.go1120
-rw-r--r--kab/kab.go2
-rw-r--r--kab/kab_test.go1120
-rw-r--r--kab_DZ/kab_DZ.go2
-rw-r--r--kab_DZ/kab_DZ_test.go1120
-rw-r--r--kam/kam.go2
-rw-r--r--kam/kam_test.go1120
-rw-r--r--kam_KE/kam_KE.go2
-rw-r--r--kam_KE/kam_KE_test.go1120
-rw-r--r--kde/kde.go2
-rw-r--r--kde/kde_test.go1120
-rw-r--r--kde_TZ/kde_TZ.go2
-rw-r--r--kde_TZ/kde_TZ_test.go1120
-rw-r--r--kea/kea.go2
-rw-r--r--kea/kea_test.go1120
-rw-r--r--kea_CV/kea_CV.go2
-rw-r--r--kea_CV/kea_CV_test.go1120
-rw-r--r--khq/khq.go2
-rw-r--r--khq/khq_test.go1120
-rw-r--r--khq_ML/khq_ML.go2
-rw-r--r--khq_ML/khq_ML_test.go1120
-rw-r--r--ki/ki.go2
-rw-r--r--ki/ki_test.go1120
-rw-r--r--ki_KE/ki_KE.go2
-rw-r--r--ki_KE/ki_KE_test.go1120
-rw-r--r--kk/kk.go2
-rw-r--r--kk/kk_test.go1120
-rw-r--r--kk_KZ/kk_KZ.go2
-rw-r--r--kk_KZ/kk_KZ_test.go1120
-rw-r--r--kkj/kkj.go6
-rw-r--r--kkj/kkj_test.go1120
-rw-r--r--kkj_CM/kkj_CM.go6
-rw-r--r--kkj_CM/kkj_CM_test.go1120
-rw-r--r--kl/kl.go2
-rw-r--r--kl/kl_test.go1120
-rw-r--r--kl_GL/kl_GL.go2
-rw-r--r--kl_GL/kl_GL_test.go1120
-rw-r--r--kln/kln.go2
-rw-r--r--kln/kln_test.go1120
-rw-r--r--kln_KE/kln_KE.go2
-rw-r--r--kln_KE/kln_KE_test.go1120
-rw-r--r--km/km.go2
-rw-r--r--km/km_test.go1120
-rw-r--r--km_KH/km_KH.go2
-rw-r--r--km_KH/km_KH_test.go1120
-rw-r--r--kn/kn.go2
-rw-r--r--kn/kn_test.go1120
-rw-r--r--kn_IN/kn_IN.go2
-rw-r--r--kn_IN/kn_IN_test.go1120
-rw-r--r--ko/ko.go2
-rw-r--r--ko/ko_test.go1120
-rw-r--r--ko_KP/ko_KP.go2
-rw-r--r--ko_KP/ko_KP_test.go1120
-rw-r--r--ko_KR/ko_KR.go2
-rw-r--r--ko_KR/ko_KR_test.go1120
-rw-r--r--kok/kok.go6
-rw-r--r--kok/kok_test.go1120
-rw-r--r--kok_IN/kok_IN.go6
-rw-r--r--kok_IN/kok_IN_test.go1120
-rw-r--r--ks/ks.go4
-rw-r--r--ks/ks_test.go1120
-rw-r--r--ks_IN/ks_IN.go4
-rw-r--r--ks_IN/ks_IN_test.go1120
-rw-r--r--ksb/ksb.go2
-rw-r--r--ksb/ksb_test.go1120
-rw-r--r--ksb_TZ/ksb_TZ.go2
-rw-r--r--ksb_TZ/ksb_TZ_test.go1120
-rw-r--r--ksf/ksf.go4
-rw-r--r--ksf/ksf_test.go1120
-rw-r--r--ksf_CM/ksf_CM.go4
-rw-r--r--ksf_CM/ksf_CM_test.go1120
-rw-r--r--ksh/ksh.go2
-rw-r--r--ksh/ksh_test.go1120
-rw-r--r--ksh_DE/ksh_DE.go2
-rw-r--r--ksh_DE/ksh_DE_test.go1120
-rw-r--r--kw/kw.go4
-rw-r--r--kw/kw_test.go1120
-rw-r--r--kw_GB/kw_GB.go4
-rw-r--r--kw_GB/kw_GB_test.go1120
-rw-r--r--ky/ky.go2
-rw-r--r--ky/ky_test.go1120
-rw-r--r--ky_KG/ky_KG.go2
-rw-r--r--ky_KG/ky_KG_test.go1120
-rw-r--r--lag/lag.go2
-rw-r--r--lag/lag_test.go1120
-rw-r--r--lag_TZ/lag_TZ.go2
-rw-r--r--lag_TZ/lag_TZ_test.go1120
-rw-r--r--lb/lb.go2
-rw-r--r--lb/lb_test.go1120
-rw-r--r--lb_LU/lb_LU.go2
-rw-r--r--lb_LU/lb_LU_test.go1120
-rw-r--r--lg/lg.go2
-rw-r--r--lg/lg_test.go1120
-rw-r--r--lg_UG/lg_UG.go2
-rw-r--r--lg_UG/lg_UG_test.go1120
-rw-r--r--lkt/lkt.go6
-rw-r--r--lkt/lkt_test.go1120
-rw-r--r--lkt_US/lkt_US.go6
-rw-r--r--lkt_US/lkt_US_test.go1120
-rw-r--r--ln/ln.go2
-rw-r--r--ln/ln_test.go1120
-rw-r--r--ln_AO/ln_AO.go2
-rw-r--r--ln_AO/ln_AO_test.go1120
-rw-r--r--ln_CD/ln_CD.go2
-rw-r--r--ln_CD/ln_CD_test.go1120
-rw-r--r--ln_CF/ln_CF.go2
-rw-r--r--ln_CF/ln_CF_test.go1120
-rw-r--r--ln_CG/ln_CG.go2
-rw-r--r--ln_CG/ln_CG_test.go1120
-rw-r--r--lo/lo.go2
-rw-r--r--lo/lo_test.go1120
-rw-r--r--lo_LA/lo_LA.go2
-rw-r--r--lo_LA/lo_LA_test.go1120
-rw-r--r--lrc/lrc.go2
-rw-r--r--lrc/lrc_test.go1120
-rw-r--r--lrc_IQ/lrc_IQ.go2
-rw-r--r--lrc_IQ/lrc_IQ_test.go1120
-rw-r--r--lrc_IR/lrc_IR.go2
-rw-r--r--lrc_IR/lrc_IR_test.go1120
-rw-r--r--lt/lt.go6
-rw-r--r--lt/lt_test.go1120
-rw-r--r--lt_LT/lt_LT.go2
-rw-r--r--lt_LT/lt_LT_test.go1120
-rw-r--r--lu/lu.go2
-rw-r--r--lu/lu_test.go1120
-rw-r--r--lu_CD/lu_CD.go2
-rw-r--r--lu_CD/lu_CD_test.go1120
-rw-r--r--luo/luo.go2
-rw-r--r--luo/luo_test.go1120
-rw-r--r--luo_KE/luo_KE.go2
-rw-r--r--luo_KE/luo_KE_test.go1120
-rw-r--r--luy/luy.go2
-rw-r--r--luy/luy_test.go1120
-rw-r--r--luy_KE/luy_KE.go2
-rw-r--r--luy_KE/luy_KE_test.go1120
-rw-r--r--lv/lv.go2
-rw-r--r--lv/lv_test.go1120
-rw-r--r--lv_LV/lv_LV.go6
-rw-r--r--lv_LV/lv_LV_test.go1120
-rw-r--r--mas/mas.go4
-rw-r--r--mas/mas_test.go1120
-rw-r--r--mas_KE/mas_KE.go4
-rw-r--r--mas_KE/mas_KE_test.go1120
-rw-r--r--mas_TZ/mas_TZ.go4
-rw-r--r--mas_TZ/mas_TZ_test.go1120
-rw-r--r--mer/mer.go2
-rw-r--r--mer/mer_test.go1120
-rw-r--r--mer_KE/mer_KE.go2
-rw-r--r--mer_KE/mer_KE_test.go1120
-rw-r--r--mfe/mfe.go2
-rw-r--r--mfe/mfe_test.go1120
-rw-r--r--mfe_MU/mfe_MU.go2
-rw-r--r--mfe_MU/mfe_MU_test.go1120
-rw-r--r--mg/mg.go2
-rw-r--r--mg/mg_test.go1120
-rw-r--r--mg_MG/mg_MG.go2
-rw-r--r--mg_MG/mg_MG_test.go1120
-rw-r--r--mgh/mgh.go2
-rw-r--r--mgh/mgh_test.go1120
-rw-r--r--mgh_MZ/mgh_MZ.go2
-rw-r--r--mgh_MZ/mgh_MZ_test.go1120
-rw-r--r--mgo/mgo.go2
-rw-r--r--mgo/mgo_test.go1120
-rw-r--r--mgo_CM/mgo_CM.go2
-rw-r--r--mgo_CM/mgo_CM_test.go1120
-rw-r--r--mk/mk.go4
-rw-r--r--mk/mk_test.go1120
-rw-r--r--mk_MK/mk_MK.go2
-rw-r--r--mk_MK/mk_MK_test.go1120
-rw-r--r--ml/ml.go4
-rw-r--r--ml/ml_test.go1120
-rw-r--r--ml_IN/ml_IN.go2
-rw-r--r--ml_IN/ml_IN_test.go1120
-rw-r--r--mn/mn.go2
-rw-r--r--mn/mn_test.go1120
-rw-r--r--mn_MN/mn_MN.go2
-rw-r--r--mn_MN/mn_MN_test.go1120
-rw-r--r--mr/mr.go2
-rw-r--r--mr/mr_test.go1120
-rw-r--r--mr_IN/mr_IN.go2
-rw-r--r--mr_IN/mr_IN_test.go1111
-rw-r--r--ms/ms.go2
-rw-r--r--ms/ms_test.go1120
-rw-r--r--ms_BN/ms_BN.go2
-rw-r--r--ms_BN/ms_BN_test.go1120
-rw-r--r--ms_MY/ms_MY.go2
-rw-r--r--ms_MY/ms_MY_test.go1120
-rw-r--r--ms_SG/ms_SG.go2
-rw-r--r--ms_SG/ms_SG_test.go1120
-rw-r--r--mt/mt.go2
-rw-r--r--mt/mt_test.go1120
-rw-r--r--mt_MT/mt_MT.go2
-rw-r--r--mt_MT/mt_MT_test.go1120
-rw-r--r--mua/mua.go2
-rw-r--r--mua/mua_test.go1120
-rw-r--r--mua_CM/mua_CM.go2
-rw-r--r--mua_CM/mua_CM_test.go1120
-rw-r--r--my/my.go2
-rw-r--r--my/my_test.go1120
-rw-r--r--my_MM/my_MM.go2
-rw-r--r--my_MM/my_MM_test.go1120
-rw-r--r--mzn/mzn.go4
-rw-r--r--mzn/mzn_test.go1120
-rw-r--r--mzn_IR/mzn_IR.go4
-rw-r--r--mzn_IR/mzn_IR_test.go1120
-rw-r--r--naq/naq.go2
-rw-r--r--naq/naq_test.go1120
-rw-r--r--naq_NA/naq_NA.go2
-rw-r--r--naq_NA/naq_NA_test.go1120
-rw-r--r--nb/nb.go2
-rw-r--r--nb/nb_test.go1120
-rw-r--r--nb_NO/nb_NO.go2
-rw-r--r--nb_NO/nb_NO_test.go1120
-rw-r--r--nb_SJ/nb_SJ.go2
-rw-r--r--nb_SJ/nb_SJ_test.go1120
-rw-r--r--nd/nd.go2
-rw-r--r--nd/nd_test.go1120
-rw-r--r--nd_ZW/nd_ZW.go2
-rw-r--r--nd_ZW/nd_ZW_test.go1120
-rw-r--r--ne/ne.go2
-rw-r--r--ne/ne_test.go1120
-rw-r--r--ne_IN/ne_IN.go2
-rw-r--r--ne_IN/ne_IN_test.go1120
-rw-r--r--ne_NP/ne_NP.go2
-rw-r--r--ne_NP/ne_NP_test.go1120
-rw-r--r--nl/nl.go2
-rw-r--r--nl/nl_test.go1120
-rw-r--r--nl_AW/nl_AW.go2
-rw-r--r--nl_AW/nl_AW_test.go1120
-rw-r--r--nl_BE/nl_BE.go4
-rw-r--r--nl_BE/nl_BE_test.go1120
-rw-r--r--nl_BQ/nl_BQ.go4
-rw-r--r--nl_BQ/nl_BQ_test.go1120
-rw-r--r--nl_CW/nl_CW.go2
-rw-r--r--nl_CW/nl_CW_test.go1120
-rw-r--r--nl_NL/nl_NL.go2
-rw-r--r--nl_NL/nl_NL_test.go1120
-rw-r--r--nl_SR/nl_SR.go2
-rw-r--r--nl_SR/nl_SR_test.go1120
-rw-r--r--nl_SX/nl_SX.go2
-rw-r--r--nl_SX/nl_SX_test.go1120
-rw-r--r--nmg/nmg.go4
-rw-r--r--nmg/nmg_test.go1120
-rw-r--r--nmg_CM/nmg_CM.go4
-rw-r--r--nmg_CM/nmg_CM_test.go1120
-rw-r--r--nn/nn.go2
-rw-r--r--nn/nn_test.go1120
-rw-r--r--nn_NO/nn_NO.go2
-rw-r--r--nn_NO/nn_NO_test.go1120
-rw-r--r--nnh/nnh.go4
-rw-r--r--nnh/nnh_test.go1120
-rw-r--r--nnh_CM/nnh_CM.go4
-rw-r--r--nnh_CM/nnh_CM_test.go1120
-rw-r--r--nus/nus.go2
-rw-r--r--nus/nus_test.go1120
-rw-r--r--nus_SS/nus_SS.go2
-rw-r--r--nus_SS/nus_SS_test.go1120
-rw-r--r--nyn/nyn.go2
-rw-r--r--nyn/nyn_test.go1120
-rw-r--r--nyn_UG/nyn_UG.go2
-rw-r--r--nyn_UG/nyn_UG_test.go1120
-rw-r--r--om/om.go2
-rw-r--r--om/om_test.go1120
-rw-r--r--om_ET/om_ET.go2
-rw-r--r--om_ET/om_ET_test.go1120
-rw-r--r--om_KE/om_KE.go2
-rw-r--r--om_KE/om_KE_test.go1120
-rw-r--r--or/or.go2
-rw-r--r--or/or_test.go1120
-rw-r--r--or_IN/or_IN.go2
-rw-r--r--or_IN/or_IN_test.go1120
-rw-r--r--os/os.go2
-rw-r--r--os/os_test.go1120
-rw-r--r--os_GE/os_GE.go2
-rw-r--r--os_GE/os_GE_test.go1120
-rw-r--r--os_RU/os_RU.go2
-rw-r--r--os_RU/os_RU_test.go1120
-rw-r--r--pa/pa.go2
-rw-r--r--pa/pa_test.go1120
-rw-r--r--pa_Arab/pa_Arab.go2
-rw-r--r--pa_Arab/pa_Arab_test.go1120
-rw-r--r--pa_Arab_PK/pa_Arab_PK.go2
-rw-r--r--pa_Arab_PK/pa_Arab_PK_test.go1120
-rw-r--r--pa_Guru/pa_Guru.go2
-rw-r--r--pa_Guru/pa_Guru_test.go1120
-rw-r--r--pa_Guru_IN/pa_Guru_IN.go2
-rw-r--r--pa_Guru_IN/pa_Guru_IN_test.go1120
-rw-r--r--pl/pl.go4
-rw-r--r--pl/pl_test.go1120
-rw-r--r--pl_PL/pl_PL.go2
-rw-r--r--pl_PL/pl_PL_test.go1120
-rw-r--r--prg/prg.go2
-rw-r--r--prg/prg_test.go1120
-rw-r--r--prg_001/prg_001.go4
-rw-r--r--prg_001/prg_001_test.go1120
-rw-r--r--ps/ps.go6
-rw-r--r--ps/ps_test.go1120
-rw-r--r--ps_AF/ps_AF.go6
-rw-r--r--ps_AF/ps_AF_test.go1120
-rw-r--r--pt/pt.go2
-rw-r--r--pt/pt_test.go1120
-rw-r--r--pt_AO/pt_AO.go2
-rw-r--r--pt_AO/pt_AO_test.go1120
-rw-r--r--pt_BR/pt_BR.go2
-rw-r--r--pt_BR/pt_BR_test.go1120
-rw-r--r--pt_CH/pt_CH.go4
-rw-r--r--pt_CH/pt_CH_test.go1120
-rw-r--r--pt_CV/pt_CV.go2
-rw-r--r--pt_CV/pt_CV_test.go1120
-rw-r--r--pt_GQ/pt_GQ.go2
-rw-r--r--pt_GQ/pt_GQ_test.go1120
-rw-r--r--pt_GW/pt_GW.go2
-rw-r--r--pt_GW/pt_GW_test.go1120
-rw-r--r--pt_LU/pt_LU.go4
-rw-r--r--pt_LU/pt_LU_test.go1120
-rw-r--r--pt_MO/pt_MO.go2
-rw-r--r--pt_MO/pt_MO_test.go1120
-rw-r--r--pt_MZ/pt_MZ.go2
-rw-r--r--pt_MZ/pt_MZ_test.go1120
-rw-r--r--pt_PT/pt_PT.go2
-rw-r--r--pt_PT/pt_PT_test.go1120
-rw-r--r--pt_ST/pt_ST.go4
-rw-r--r--pt_ST/pt_ST_test.go1120
-rw-r--r--pt_TL/pt_TL.go2
-rw-r--r--pt_TL/pt_TL_test.go1120
-rw-r--r--qu/qu.go4
-rw-r--r--qu/qu_test.go1120
-rw-r--r--qu_BO/qu_BO.go4
-rw-r--r--qu_BO/qu_BO_test.go1120
-rw-r--r--qu_EC/qu_EC.go4
-rw-r--r--qu_EC/qu_EC_test.go1120
-rw-r--r--qu_PE/qu_PE.go4
-rw-r--r--qu_PE/qu_PE_test.go1120
-rw-r--r--rm/rm.go2
-rw-r--r--rm/rm_test.go1120
-rw-r--r--rm_CH/rm_CH.go2
-rw-r--r--rm_CH/rm_CH_test.go1120
-rw-r--r--rn/rn.go4
-rw-r--r--rn/rn_test.go1120
-rw-r--r--rn_BI/rn_BI.go4
-rw-r--r--rn_BI/rn_BI_test.go1120
-rw-r--r--ro/ro.go4
-rw-r--r--ro/ro_test.go1120
-rw-r--r--ro_MD/ro_MD.go4
-rw-r--r--ro_MD/ro_MD_test.go1120
-rw-r--r--ro_RO/ro_RO.go2
-rw-r--r--ro_RO/ro_RO_test.go1120
-rw-r--r--rof/rof.go2
-rw-r--r--rof/rof_test.go1120
-rw-r--r--rof_TZ/rof_TZ.go2
-rw-r--r--rof_TZ/rof_TZ_test.go1120
-rw-r--r--root/root.go4
-rw-r--r--root/root_test.go1120
-rw-r--r--ru/ru.go4
-rw-r--r--ru/ru_test.go1120
-rw-r--r--ru_BY/ru_BY.go4
-rw-r--r--ru_BY/ru_BY_test.go1120
-rw-r--r--ru_KG/ru_KG.go4
-rw-r--r--ru_KG/ru_KG_test.go1120
-rw-r--r--ru_KZ/ru_KZ.go2
-rw-r--r--ru_KZ/ru_KZ_test.go1120
-rw-r--r--ru_MD/ru_MD.go2
-rw-r--r--ru_MD/ru_MD_test.go1120
-rw-r--r--ru_RU/ru_RU.go4
-rw-r--r--ru_RU/ru_RU_test.go1120
-rw-r--r--ru_UA/ru_UA.go4
-rw-r--r--ru_UA/ru_UA_test.go1120
-rw-r--r--rw/rw.go4
-rw-r--r--rw/rw_test.go1120
-rw-r--r--rw_RW/rw_RW.go4
-rw-r--r--rw_RW/rw_RW_test.go1120
-rw-r--r--rwk/rwk.go2
-rw-r--r--rwk/rwk_test.go1120
-rw-r--r--rwk_TZ/rwk_TZ.go2
-rw-r--r--rwk_TZ/rwk_TZ_test.go1120
-rw-r--r--sah/sah.go2
-rw-r--r--sah/sah_test.go1120
-rw-r--r--sah_RU/sah_RU.go2
-rw-r--r--sah_RU/sah_RU_test.go1120
-rw-r--r--saq/saq.go2
-rw-r--r--saq/saq_test.go1120
-rw-r--r--saq_KE/saq_KE.go2
-rw-r--r--saq_KE/saq_KE_test.go1120
-rw-r--r--sbp/sbp.go4
-rw-r--r--sbp/sbp_test.go1120
-rw-r--r--sbp_TZ/sbp_TZ.go4
-rw-r--r--sbp_TZ/sbp_TZ_test.go1120
-rw-r--r--se/se.go2
-rw-r--r--se/se_test.go1120
-rw-r--r--se_FI/se_FI.go2
-rw-r--r--se_FI/se_FI_test.go1120
-rw-r--r--se_NO/se_NO.go2
-rw-r--r--se_NO/se_NO_test.go1120
-rw-r--r--se_SE/se_SE.go2
-rw-r--r--se_SE/se_SE_test.go1120
-rw-r--r--seh/seh.go2
-rw-r--r--seh/seh_test.go1120
-rw-r--r--seh_MZ/seh_MZ.go2
-rw-r--r--seh_MZ/seh_MZ_test.go1120
-rw-r--r--ses/ses.go2
-rw-r--r--ses/ses_test.go1120
-rw-r--r--ses_ML/ses_ML.go2
-rw-r--r--ses_ML/ses_ML_test.go1120
-rw-r--r--sg/sg.go2
-rw-r--r--sg/sg_test.go1120
-rw-r--r--sg_CF/sg_CF.go2
-rw-r--r--sg_CF/sg_CF_test.go1120
-rw-r--r--shi/shi.go2
-rw-r--r--shi/shi_test.go1120
-rw-r--r--shi_Latn/shi_Latn.go2
-rw-r--r--shi_Latn/shi_Latn_test.go1120
-rw-r--r--shi_Latn_MA/shi_Latn_MA.go2
-rw-r--r--shi_Latn_MA/shi_Latn_MA_test.go1120
-rw-r--r--shi_Tfng/shi_Tfng.go2
-rw-r--r--shi_Tfng/shi_Tfng_test.go1120
-rw-r--r--shi_Tfng_MA/shi_Tfng_MA.go2
-rw-r--r--shi_Tfng_MA/shi_Tfng_MA_test.go1120
-rw-r--r--si/si.go2
-rw-r--r--si/si_test.go1120
-rw-r--r--si_LK/si_LK.go2
-rw-r--r--si_LK/si_LK_test.go1120
-rw-r--r--sk/sk.go4
-rw-r--r--sk/sk_test.go1120
-rw-r--r--sk_SK/sk_SK.go2
-rw-r--r--sk_SK/sk_SK_test.go1120
-rw-r--r--sl/sl.go2
-rw-r--r--sl/sl_test.go1120
-rw-r--r--sl_SI/sl_SI.go2
-rw-r--r--sl_SI/sl_SI_test.go1120
-rw-r--r--smn/smn.go6
-rw-r--r--smn/smn_test.go1120
-rw-r--r--smn_FI/smn_FI.go6
-rw-r--r--smn_FI/smn_FI_test.go1120
-rw-r--r--sn/sn.go2
-rw-r--r--sn/sn_test.go1120
-rw-r--r--sn_ZW/sn_ZW.go2
-rw-r--r--sn_ZW/sn_ZW_test.go1120
-rw-r--r--so/so.go2
-rw-r--r--so/so_test.go1120
-rw-r--r--so_DJ/so_DJ.go2
-rw-r--r--so_DJ/so_DJ_test.go1120
-rw-r--r--so_ET/so_ET.go2
-rw-r--r--so_ET/so_ET_test.go1120
-rw-r--r--so_KE/so_KE.go2
-rw-r--r--so_KE/so_KE_test.go1120
-rw-r--r--so_SO/so_SO.go2
-rw-r--r--so_SO/so_SO_test.go1120
-rw-r--r--sq/sq.go2
-rw-r--r--sq/sq_test.go1120
-rw-r--r--sq_AL/sq_AL.go2
-rw-r--r--sq_AL/sq_AL_test.go1120
-rw-r--r--sq_MK/sq_MK.go4
-rw-r--r--sq_MK/sq_MK_test.go1120
-rw-r--r--sq_XK/sq_XK.go4
-rw-r--r--sq_XK/sq_XK_test.go1120
-rw-r--r--sr/sr.go2
-rw-r--r--sr/sr_test.go1120
-rw-r--r--sr_Cyrl/sr_Cyrl.go2
-rw-r--r--sr_Cyrl/sr_Cyrl_test.go1120
-rw-r--r--sr_Cyrl_BA/sr_Cyrl_BA.go6
-rw-r--r--sr_Cyrl_BA/sr_Cyrl_BA_test.go1120
-rw-r--r--sr_Cyrl_ME/sr_Cyrl_ME.go4
-rw-r--r--sr_Cyrl_ME/sr_Cyrl_ME_test.go1120
-rw-r--r--sr_Cyrl_RS/sr_Cyrl_RS.go4
-rw-r--r--sr_Cyrl_RS/sr_Cyrl_RS_test.go1120
-rw-r--r--sr_Cyrl_XK/sr_Cyrl_XK.go2
-rw-r--r--sr_Cyrl_XK/sr_Cyrl_XK_test.go1120
-rw-r--r--sr_Latn/sr_Latn.go4
-rw-r--r--sr_Latn/sr_Latn_test.go1120
-rw-r--r--sr_Latn_BA/sr_Latn_BA.go4
-rw-r--r--sr_Latn_BA/sr_Latn_BA_test.go1120
-rw-r--r--sr_Latn_ME/sr_Latn_ME.go4
-rw-r--r--sr_Latn_ME/sr_Latn_ME_test.go1120
-rw-r--r--sr_Latn_RS/sr_Latn_RS.go2
-rw-r--r--sr_Latn_RS/sr_Latn_RS_test.go1120
-rw-r--r--sr_Latn_XK/sr_Latn_XK.go4
-rw-r--r--sr_Latn_XK/sr_Latn_XK_test.go1120
-rw-r--r--sv/sv.go2
-rw-r--r--sv/sv_test.go1120
-rw-r--r--sv_AX/sv_AX.go2
-rw-r--r--sv_AX/sv_AX_test.go1120
-rw-r--r--sv_FI/sv_FI.go2
-rw-r--r--sv_FI/sv_FI_test.go1120
-rw-r--r--sv_SE/sv_SE.go4
-rw-r--r--sv_SE/sv_SE_test.go1120
-rw-r--r--sw/sw.go4
-rw-r--r--sw/sw_test.go1120
-rw-r--r--sw_CD/sw_CD.go2
-rw-r--r--sw_CD/sw_CD_test.go1120
-rw-r--r--sw_KE/sw_KE.go2
-rw-r--r--sw_KE/sw_KE_test.go1120
-rw-r--r--sw_TZ/sw_TZ.go2
-rw-r--r--sw_TZ/sw_TZ_test.go1120
-rw-r--r--sw_UG/sw_UG.go2
-rw-r--r--sw_UG/sw_UG_test.go1120
-rw-r--r--ta/ta.go2
-rw-r--r--ta/ta_test.go1120
-rw-r--r--ta_IN/ta_IN.go2
-rw-r--r--ta_IN/ta_IN_test.go1120
-rw-r--r--ta_LK/ta_LK.go2
-rw-r--r--ta_LK/ta_LK_test.go1120
-rw-r--r--ta_MY/ta_MY.go2
-rw-r--r--ta_MY/ta_MY_test.go1120
-rw-r--r--ta_SG/ta_SG.go2
-rw-r--r--ta_SG/ta_SG_test.go1120
-rw-r--r--te/te.go2
-rw-r--r--te/te_test.go1120
-rw-r--r--te_IN/te_IN.go4
-rw-r--r--te_IN/te_IN_test.go1120
-rw-r--r--teo/teo.go2
-rw-r--r--teo/teo_test.go1120
-rw-r--r--teo_KE/teo_KE.go2
-rw-r--r--teo_KE/teo_KE_test.go1120
-rw-r--r--teo_UG/teo_UG.go2
-rw-r--r--teo_UG/teo_UG_test.go1120
-rw-r--r--th/th.go2
-rw-r--r--th/th_test.go1120
-rw-r--r--th_TH/th_TH.go2
-rw-r--r--th_TH/th_TH_test.go1120
-rw-r--r--ti/ti.go2
-rw-r--r--ti/ti_test.go1120
-rw-r--r--ti_ER/ti_ER.go2
-rw-r--r--ti_ER/ti_ER_test.go1120
-rw-r--r--ti_ET/ti_ET.go2
-rw-r--r--ti_ET/ti_ET_test.go1120
-rw-r--r--tk/tk.go2
-rw-r--r--tk/tk_test.go1120
-rw-r--r--tk_TM/tk_TM.go2
-rw-r--r--tk_TM/tk_TM_test.go1120
-rw-r--r--to/to.go2
-rw-r--r--to/to_test.go1120
-rw-r--r--to_TO/to_TO.go2
-rw-r--r--to_TO/to_TO_test.go1120
-rw-r--r--tr/tr.go2
-rw-r--r--tr/tr_test.go1120
-rw-r--r--tr_CY/tr_CY.go4
-rw-r--r--tr_CY/tr_CY_test.go1120
-rw-r--r--tr_TR/tr_TR.go2
-rw-r--r--tr_TR/tr_TR_test.go1120
-rw-r--r--twq/twq.go2
-rw-r--r--twq/twq_test.go1120
-rw-r--r--twq_NE/twq_NE.go2
-rw-r--r--twq_NE/twq_NE_test.go1120
-rw-r--r--tzm/tzm.go2
-rw-r--r--tzm/tzm_test.go1120
-rw-r--r--tzm_MA/tzm_MA.go2
-rw-r--r--tzm_MA/tzm_MA_test.go1120
-rw-r--r--ug/ug.go2
-rw-r--r--ug/ug_test.go1120
-rw-r--r--ug_CN/ug_CN.go2
-rw-r--r--ug_CN/ug_CN_test.go1120
-rw-r--r--uk/uk.go8
-rw-r--r--uk/uk_test.go1120
-rw-r--r--uk_UA/uk_UA.go6
-rw-r--r--uk_UA/uk_UA_test.go1120
-rw-r--r--ur/ur.go2
-rw-r--r--ur/ur_test.go1120
-rw-r--r--ur_IN/ur_IN.go2
-rw-r--r--ur_IN/ur_IN_test.go1120
-rw-r--r--ur_PK/ur_PK.go2
-rw-r--r--ur_PK/ur_PK_test.go1120
-rw-r--r--uz/uz.go2
-rw-r--r--uz/uz_test.go1120
-rw-r--r--uz_Arab/uz_Arab.go2
-rw-r--r--uz_Arab/uz_Arab_test.go1120
-rw-r--r--uz_Arab_AF/uz_Arab_AF.go4
-rw-r--r--uz_Arab_AF/uz_Arab_AF_test.go1120
-rw-r--r--uz_Cyrl/uz_Cyrl.go2
-rw-r--r--uz_Cyrl/uz_Cyrl_test.go1120
-rw-r--r--uz_Cyrl_UZ/uz_Cyrl_UZ.go2
-rw-r--r--uz_Cyrl_UZ/uz_Cyrl_UZ_test.go1120
-rw-r--r--uz_Latn/uz_Latn.go2
-rw-r--r--uz_Latn/uz_Latn_test.go1120
-rw-r--r--uz_Latn_UZ/uz_Latn_UZ.go4
-rw-r--r--uz_Latn_UZ/uz_Latn_UZ_test.go1120
-rw-r--r--vai/vai.go6
-rw-r--r--vai/vai_test.go1120
-rw-r--r--vai_Latn/vai_Latn.go6
-rw-r--r--vai_Latn/vai_Latn_test.go1120
-rw-r--r--vai_Latn_LR/vai_Latn_LR.go6
-rw-r--r--vai_Latn_LR/vai_Latn_LR_test.go1120
-rw-r--r--vai_Vaii/vai_Vaii.go6
-rw-r--r--vai_Vaii/vai_Vaii_test.go1120
-rw-r--r--vai_Vaii_LR/vai_Vaii_LR.go6
-rw-r--r--vai_Vaii_LR/vai_Vaii_LR_test.go1120
-rw-r--r--vi/vi.go2
-rw-r--r--vi/vi_test.go1120
-rw-r--r--vi_VN/vi_VN.go2
-rw-r--r--vi_VN/vi_VN_test.go1120
-rw-r--r--vo/vo.go2
-rw-r--r--vo/vo_test.go1120
-rw-r--r--vo_001/vo_001.go2
-rw-r--r--vo_001/vo_001_test.go1120
-rw-r--r--vun/vun.go2
-rw-r--r--vun/vun_test.go1120
-rw-r--r--vun_TZ/vun_TZ.go2
-rw-r--r--vun_TZ/vun_TZ_test.go1120
-rw-r--r--wae/wae.go2
-rw-r--r--wae/wae_test.go1120
-rw-r--r--wae_CH/wae_CH.go2
-rw-r--r--wae_CH/wae_CH_test.go1120
-rw-r--r--xog/xog.go2
-rw-r--r--xog/xog_test.go1120
-rw-r--r--xog_UG/xog_UG.go2
-rw-r--r--xog_UG/xog_UG_test.go1120
-rw-r--r--yav/yav.go4
-rw-r--r--yav/yav_test.go1120
-rw-r--r--yav_CM/yav_CM.go4
-rw-r--r--yav_CM/yav_CM_test.go1120
-rw-r--r--yi/yi.go4
-rw-r--r--yi/yi_test.go1120
-rw-r--r--yi_001/yi_001.go4
-rw-r--r--yi_001/yi_001_test.go1120
-rw-r--r--yo/yo.go4
-rw-r--r--yo/yo_test.go1120
-rw-r--r--yo_BJ/yo_BJ.go4
-rw-r--r--yo_BJ/yo_BJ_test.go1120
-rw-r--r--yo_NG/yo_NG.go4
-rw-r--r--yo_NG/yo_NG_test.go1120
-rw-r--r--yue/yue.go2
-rw-r--r--yue/yue_test.go1120
-rw-r--r--yue_HK/yue_HK.go2
-rw-r--r--yue_HK/yue_HK_test.go1120
-rw-r--r--zgh/zgh.go2
-rw-r--r--zgh/zgh_test.go1120
-rw-r--r--zgh_MA/zgh_MA.go2
-rw-r--r--zgh_MA/zgh_MA_test.go1120
-rw-r--r--zh/zh.go2
-rw-r--r--zh/zh_test.go1120
-rw-r--r--zh_Hans/zh_Hans.go2
-rw-r--r--zh_Hans/zh_Hans_test.go1120
-rw-r--r--zh_Hans_CN/zh_Hans_CN.go2
-rw-r--r--zh_Hans_CN/zh_Hans_CN_test.go1120
-rw-r--r--zh_Hans_HK/zh_Hans_HK.go2
-rw-r--r--zh_Hans_HK/zh_Hans_HK_test.go1120
-rw-r--r--zh_Hans_MO/zh_Hans_MO.go2
-rw-r--r--zh_Hans_MO/zh_Hans_MO_test.go1120
-rw-r--r--zh_Hans_SG/zh_Hans_SG.go2
-rw-r--r--zh_Hans_SG/zh_Hans_SG_test.go1120
-rw-r--r--zh_Hant/zh_Hant.go2
-rw-r--r--zh_Hant/zh_Hant_test.go1120
-rw-r--r--zh_Hant_HK/zh_Hant_HK.go2
-rw-r--r--zh_Hant_HK/zh_Hant_HK_test.go1120
-rw-r--r--zh_Hant_MO/zh_Hant_MO.go2
-rw-r--r--zh_Hant_MO/zh_Hant_MO_test.go1120
-rw-r--r--zh_Hant_TW/zh_Hant_TW.go2
-rw-r--r--zh_Hant_TW/zh_Hant_TW_test.go1120
-rw-r--r--zu/zu.go2
-rw-r--r--zu/zu_test.go1120
-rw-r--r--zu_ZA/zu_ZA.go2
-rw-r--r--zu_ZA/zu_ZA_test.go1120
1433 files changed, 801733 insertions, 914 deletions
diff --git a/README.md b/README.md
index fb878b31..e6e04bb1 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
## locales
<img align="right" src="https://raw.githubusercontent.com/go-playground/locales/master/logo.png">
-![Project status](https://img.shields.io/badge/version-0.9.1-green.svg)
+![Project status](https://img.shields.io/badge/version-0.10.0-green.svg)
[![Build Status](https://semaphoreci.com/api/v1/joeybloggs/locales/branches/master/badge.svg)](https://semaphoreci.com/joeybloggs/locales)
[![Coverage Status](https://coveralls.io/repos/github/go-playground/locales/badge.svg?branch=master)](https://coveralls.io/github/go-playground/locales?branch=master)
[![GoDoc](https://godoc.org/github.com/go-playground/locales?status.svg)](https://godoc.org/github.com/go-playground/locales)
diff --git a/af/af.go b/af/af.go
index d97413a6..9174017f 100644
--- a/af/af.go
+++ b/af/af.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"v.C.", "n.C."},
erasNarrow: []string{"v.C.", "n.C."},
erasWide: []string{"voor Christus", "na Christus"},
- timezones: map[string]string{"IST": "Indië-standaardtyd", "JDT": "Japan-dagligtyd", "UYST": "Uruguay-somertyd", "COT": "Colombië-standaardtyd", "AST": "Atlantiese standaardtyd", "HNT": "Newfoundland-standaardtyd", "WIT": "Oos-Indonesië-tyd", "ACDT": "Australiese sentrale dagligtyd", "ART": "Argentinië-standaardtyd", "AKST": "Alaska-standaardtyd", "VET": "Venezuela-tyd", "TMT": "Turkmenistan-standaardtyd", "∅∅∅": "Asore-somertyd", "ACWDT": "Australiese sentraal-Westelike dagligtyd", "OESZ": "Oos-Europese somertyd", "AWST": "Australiese Westelike standaardtyd", "GYT": "Guyana-tyd", "CLST": "Chili-somertyd", "ADT": "Atlantiese dagligtyd", "SAST": "Suid-Afrika-standaardtyd", "CDT": "Sentrale dagligtyd", "AEDT": "Australiese Oostelike dagligtyd", "MDT": "Berg-dagligtyd", "HAT": "Newfoundland-dagligtyd", "AEST": "Australiese Oostelike standaardtyd", "HAST": "Hawaii-Aleusiër-standaardtyd", "HKT": "Hongkong-standaardtyd", "AWDT": "Australiese Westelike dagligtyd", "AKDT": "Alaska-dagligtyd", "WAT": "Wes-Afrika-standaardtyd", "GFT": "Frans-Guiana-tyd", "ECT": "Ecuador-tyd", "BT": "Bhoetan-tyd", "MST": "Berg-standaardtyd", "WITA": "Sentraal Indonesië-tyd", "LHST": "Lord Howe-standaardtyd", "LHDT": "Lord Howe-dagligtyd", "CST": "Sentrale standaardtyd", "MEZ": "Sentraal-Europese standaardtyd", "WESZ": "Wes-Europese somertyd", "CAT": "Sentraal-Afrika-tyd", "NZST": "Nieu-Seeland-standaardtyd", "BOT": "Bolivia-tyd", "GMT": "Greenwich-mediaantyd", "EAT": "Oos-Afrika-tyd", "UYT": "Uruguay-standaardtyd", "HKST": "Hongkong-somertyd", "MESZ": "Sentraal-Europese somertyd", "WARST": "Wes-Argentinië-somertyd", "OEZ": "Oos-Europese standaardtyd", "PST": "Pasifiese standaardtyd", "NZDT": "Nieu-Seeland-dagligtyd", "CLT": "Chili-standaardtyd", "ChST": "Chamorro-standaardtyd", "CHAST": "Chatham-standaardtyd", "SGT": "Singapoer-standaardtyd", "WAST": "Wes-Afrika-somertyd", "WIB": "Wes-Indonesië-tyd", "SRT": "Suriname-tyd", "ACWST": "Australiese sentraal-Westelike standaard-tyd", "EST": "Oostelike standaardtyd", "HADT": "Hawaii-Aleusiër-dagligtyd", "ACST": "Australiese sentraal-standaardtyd", "MYT": "Maleisië-tyd", "JST": "Japan-standaardtyd", "CHADT": "Chatham-dagligtyd", "WART": "Wes-Argentinië-standaardtyd", "COST": "Colombië-somertyd", "EDT": "Oostelike dagligtyd", "ARST": "Argentinië-somertyd", "TMST": "Turkmenistan-somertyd", "PDT": "Pasifiese dagligtyd", "WEZ": "Wes-Europese standaardtyd"},
+ timezones: map[string]string{"MDT": "MDT", "HNT": "Newfoundland-standaardtyd", "MYT": "Maleisië-tyd", "WESZ": "Wes-Europese somertyd", "CST": "Sentrale standaardtyd", "CDT": "Sentrale dagligtyd", "GFT": "Frans-Guiana-tyd", "NZST": "Nieu-Seeland-standaardtyd", "BOT": "Bolivia-tyd", "WIB": "Wes-Indonesië-tyd", "OEZ": "Oos-Europese standaardtyd", "AEDT": "Australiese Oostelike dagligtyd", "CLT": "Chili-standaardtyd", "ACWDT": "Australiese sentraal-Westelike dagligtyd", "AWDT": "Australiese Westelike dagligtyd", "EDT": "Oostelike dagligtyd", "WEZ": "Wes-Europese standaardtyd", "VET": "Venezuela-tyd", "ACDT": "Australiese sentrale dagligtyd", "WARST": "Wes-Argentinië-somertyd", "SRT": "Suriname-tyd", "MESZ": "Sentraal-Europese somertyd", "PST": "Pasifiese standaardtyd", "AEST": "Australiese Oostelike standaardtyd", "WART": "Wes-Argentinië-standaardtyd", "OESZ": "Oos-Europese somertyd", "UYST": "Uruguay-somertyd", "CHADT": "Chatham-dagligtyd", "ACWST": "Australiese sentraal-Westelike standaard-tyd", "EST": "Oostelike standaardtyd", "GYT": "Guyana-tyd", "MST": "MST", "WAST": "Wes-Afrika-somertyd", "EAT": "Oos-Afrika-tyd", "ACST": "Australiese sentraal-standaardtyd", "WITA": "Sentraal Indonesië-tyd", "AST": "Atlantiese standaardtyd", "CHAST": "Chatham-standaardtyd", "JST": "Japan-standaardtyd", "HAST": "Hawaii-Aleusiër-standaardtyd", "HADT": "Hawaii-Aleusiër-dagligtyd", "COST": "Colombië-somertyd", "LHDT": "Lord Howe-dagligtyd", "∅∅∅": "Asore-somertyd", "HKST": "Hongkong-somertyd", "ARST": "Argentinië-somertyd", "PDT": "Pasifiese dagligtyd", "GMT": "Greenwich-mediaantyd", "UYT": "Uruguay-standaardtyd", "BT": "Bhoetan-tyd", "COT": "Colombië-standaardtyd", "TMST": "Turkmenistan-somertyd", "CAT": "Sentraal-Afrika-tyd", "HAT": "Newfoundland-dagligtyd", "HKT": "Hongkong-standaardtyd", "JDT": "Japan-dagligtyd", "NZDT": "Nieu-Seeland-dagligtyd", "CLST": "Chili-somertyd", "MEZ": "Sentraal-Europese standaardtyd", "SAST": "Suid-Afrika-standaardtyd", "TMT": "Turkmenistan-standaardtyd", "LHST": "Lord Howe-standaardtyd", "ECT": "Ecuador-tyd", "AKST": "Alaska-standaardtyd", "AKDT": "Alaska-dagligtyd", "ADT": "Atlantiese dagligtyd", "AWST": "Australiese Westelike standaardtyd", "ChST": "Chamorro-standaardtyd", "WIT": "Oos-Indonesië-tyd", "ART": "Argentinië-standaardtyd", "IST": "Indië-standaardtyd", "SGT": "Singapoer-standaardtyd", "WAT": "Wes-Afrika-standaardtyd"},
}
}
diff --git a/af/af_test.go b/af/af_test.go
new file mode 100644
index 00000000..84a36153
--- /dev/null
+++ b/af/af_test.go
@@ -0,0 +1,1120 @@
+package af
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "af"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/af_NA/af_NA.go b/af_NA/af_NA.go
index ac90d260..4b5e928e 100644
--- a/af_NA/af_NA.go
+++ b/af_NA/af_NA.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"v.C.", "n.C."},
erasNarrow: []string{"v.C.", "n.C."},
erasWide: []string{"voor Christus", "na Christus"},
- timezones: map[string]string{"ART": "Argentinië-standaardtyd", "WIT": "Oos-Indonesië-tyd", "WAT": "Wes-Afrika-standaardtyd", "ChST": "Chamorro-standaardtyd", "EDT": "Oostelike dagligtyd", "COST": "Colombië-somertyd", "HADT": "Hawaii-Aleusiër-dagligtyd", "MST": "MST", "LHST": "Lord Howe-standaardtyd", "NZST": "Nieu-Seeland-standaardtyd", "VET": "Venezuela-tyd", "CHAST": "Chatham-standaardtyd", "EST": "Oostelike standaardtyd", "HKT": "Hongkong-standaardtyd", "MDT": "MDT", "ACST": "Australiese sentraal-standaardtyd", "ACDT": "Australiese sentrale dagligtyd", "ARST": "Argentinië-somertyd", "∅∅∅": "Amasone-somertyd", "CDT": "Sentrale dagligtyd", "WESZ": "Wes-Europese somertyd", "EAT": "Oos-Afrika-tyd", "PDT": "Pasifiese dagligtyd", "AWST": "Australiese Westelike standaardtyd", "ACWDT": "Australiese sentraal-Westelike dagligtyd", "HNT": "Newfoundland-standaardtyd", "TMT": "Turkmenistan-standaardtyd", "GYT": "Guyana-tyd", "ECT": "Ecuador-tyd", "BT": "Bhoetan-tyd", "IST": "Indië-standaardtyd", "CST": "Sentrale standaardtyd", "CLT": "Chili-standaardtyd", "CAT": "Sentraal-Afrika-tyd", "WITA": "Sentraal Indonesië-tyd", "WART": "Wes-Argentinië-standaardtyd", "WARST": "Wes-Argentinië-somertyd", "OEZ": "Oos-Europese standaardtyd", "UYST": "Uruguay-somertyd", "NZDT": "Nieu-Seeland-dagligtyd", "COT": "Colombië-standaardtyd", "ADT": "Atlantiese dagligtyd", "WAST": "Wes-Afrika-somertyd", "AKDT": "Alaska-dagligtyd", "AWDT": "Australiese Westelike dagligtyd", "CLST": "Chili-somertyd", "WEZ": "Wes-Europese standaardtyd", "AKST": "Alaska-standaardtyd", "PST": "Pasifiese standaardtyd", "LHDT": "Lord Howe-dagligtyd", "MEZ": "Sentraal-Europese standaardtyd", "OESZ": "Oos-Europese somertyd", "HAT": "Newfoundland-dagligtyd", "JST": "Japan-standaardtyd", "JDT": "Japan-dagligtyd", "AEDT": "Australiese Oostelike dagligtyd", "HAST": "Hawaii-Aleusiër-standaardtyd", "SGT": "Singapoer-standaardtyd", "SAST": "Suid-Afrika-standaardtyd", "SRT": "Suriname-tyd", "CHADT": "Chatham-dagligtyd", "UYT": "Uruguay-standaardtyd", "ACWST": "Australiese sentraal-Westelike standaard-tyd", "MESZ": "Sentraal-Europese somertyd", "BOT": "Bolivia-tyd", "AEST": "Australiese Oostelike standaardtyd", "AST": "Atlantiese standaardtyd", "GFT": "Frans-Guiana-tyd", "WIB": "Wes-Indonesië-tyd", "GMT": "Greenwich-mediaantyd", "TMST": "Turkmenistan-somertyd", "MYT": "Maleisië-tyd", "HKST": "Hongkong-somertyd"},
+ timezones: map[string]string{"ARST": "Argentinië-somertyd", "ADT": "Atlantiese dagligtyd", "EDT": "Oostelike dagligtyd", "HAT": "Newfoundland-dagligtyd", "EAT": "Oos-Afrika-tyd", "ART": "Argentinië-standaardtyd", "ACWST": "Australiese sentraal-Westelike standaard-tyd", "BOT": "Bolivia-tyd", "OEZ": "Oos-Europese standaardtyd", "UYT": "Uruguay-standaardtyd", "∅∅∅": "Amasone-somertyd", "ChST": "Chamorro-standaardtyd", "WIT": "Oos-Indonesië-tyd", "ACST": "Australiese sentraal-standaardtyd", "WART": "Wes-Argentinië-standaardtyd", "HKST": "Hongkong-somertyd", "CHADT": "Chatham-dagligtyd", "MESZ": "Sentraal-Europese somertyd", "LHDT": "Lord Howe-dagligtyd", "SAST": "Suid-Afrika-standaardtyd", "SGT": "Singapoer-standaardtyd", "WIB": "Wes-Indonesië-tyd", "WAST": "Wes-Afrika-somertyd", "GYT": "Guyana-tyd", "WITA": "Sentraal Indonesië-tyd", "NZDT": "Nieu-Seeland-dagligtyd", "EST": "Oostelike standaardtyd", "UYST": "Uruguay-somertyd", "BT": "Bhoetan-tyd", "MST": "MST", "JST": "Japan-standaardtyd", "PDT": "Pasifiese dagligtyd", "HAST": "Hawaii-Aleusiër-standaardtyd", "GFT": "Frans-Guiana-tyd", "VET": "Venezuela-tyd", "CAT": "Sentraal-Afrika-tyd", "GMT": "Greenwich-mediaantyd", "AEDT": "Australiese Oostelike dagligtyd", "MYT": "Maleisië-tyd", "HADT": "Hawaii-Aleusiër-dagligtyd", "WAT": "Wes-Afrika-standaardtyd", "WARST": "Wes-Argentinië-somertyd", "AKST": "Alaska-standaardtyd", "COT": "Colombië-standaardtyd", "OESZ": "Oos-Europese somertyd", "SRT": "Suriname-tyd", "JDT": "Japan-dagligtyd", "ACWDT": "Australiese sentraal-Westelike dagligtyd", "HKT": "Hongkong-standaardtyd", "LHST": "Lord Howe-standaardtyd", "CLST": "Chili-somertyd", "ACDT": "Australiese sentrale dagligtyd", "MDT": "MDT", "AKDT": "Alaska-dagligtyd", "IST": "Indië-standaardtyd", "TMST": "Turkmenistan-somertyd", "AEST": "Australiese Oostelike standaardtyd", "COST": "Colombië-somertyd", "WEZ": "Wes-Europese standaardtyd", "CLT": "Chili-standaardtyd", "CHAST": "Chatham-standaardtyd", "AWST": "Australiese Westelike standaardtyd", "AST": "Atlantiese standaardtyd", "MEZ": "Sentraal-Europese standaardtyd", "HNT": "Newfoundland-standaardtyd", "WESZ": "Wes-Europese somertyd", "CST": "Sentrale standaardtyd", "CDT": "Sentrale dagligtyd", "ECT": "Ecuador-tyd", "AWDT": "Australiese Westelike dagligtyd", "PST": "Pasifiese standaardtyd", "NZST": "Nieu-Seeland-standaardtyd", "TMT": "Turkmenistan-standaardtyd"},
}
}
diff --git a/af_NA/af_NA_test.go b/af_NA/af_NA_test.go
new file mode 100644
index 00000000..ce7baee0
--- /dev/null
+++ b/af_NA/af_NA_test.go
@@ -0,0 +1,1120 @@
+package af_NA
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "af_NA"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/af_ZA/af_ZA.go b/af_ZA/af_ZA.go
index e373c1cf..0a6460e0 100644
--- a/af_ZA/af_ZA.go
+++ b/af_ZA/af_ZA.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"v.C.", "n.C."},
erasNarrow: []string{"v.C.", "n.C."},
erasWide: []string{"voor Christus", "na Christus"},
- timezones: map[string]string{"WESZ": "Wes-Europese somertyd", "∅∅∅": "Brasilië somertyd", "LHST": "Lord Howe-standaardtyd", "ChST": "Chamorro-standaardtyd", "COT": "Colombië-standaardtyd", "COST": "Colombië-somertyd", "EAT": "Oos-Afrika-tyd", "UYST": "Uruguay-somertyd", "HKT": "Hongkong-standaardtyd", "GFT": "Frans-Guiana-tyd", "PDT": "Pasifiese dagligtyd", "LHDT": "Lord Howe-dagligtyd", "UYT": "Uruguay-standaardtyd", "SGT": "Singapoer-standaardtyd", "IST": "Indië-standaardtyd", "GMT": "Greenwich-mediaantyd", "CDT": "Sentrale dagligtyd", "VET": "Venezuela-tyd", "ACWDT": "Australiese sentraal-Westelike dagligtyd", "CHADT": "Chatham-dagligtyd", "OESZ": "Oos-Europese somertyd", "JDT": "Japan-dagligtyd", "MEZ": "Sentraal-Europese standaardtyd", "CLT": "Chili-standaardtyd", "AEDT": "Australiese Oostelike dagligtyd", "CAT": "Sentraal-Afrika-tyd", "ADT": "Atlantiese dagligtyd", "ARST": "Argentinië-somertyd", "TMT": "Turkmenistan-standaardtyd", "MYT": "Maleisië-tyd", "BOT": "Bolivia-tyd", "HAST": "Hawaii-Aleusiër-standaardtyd", "NZST": "Nieu-Seeland-standaardtyd", "MST": "Berg-standaardtyd", "WART": "Wes-Argentinië-standaardtyd", "WIT": "Oos-Indonesië-tyd", "HNT": "Newfoundland-standaardtyd", "TMST": "Turkmenistan-somertyd", "EDT": "Oostelike dagligtyd", "SAST": "Suid-Afrika-standaardtyd", "WITA": "Sentraal Indonesië-tyd", "ACDT": "Australiese sentrale dagligtyd", "AKST": "Alaska-standaardtyd", "HKST": "Hongkong-somertyd", "HAT": "Newfoundland-dagligtyd", "JST": "Japan-standaardtyd", "AKDT": "Alaska-dagligtyd", "WEZ": "Wes-Europese standaardtyd", "ACWST": "Australiese sentraal-Westelike standaard-tyd", "MDT": "Berg-dagligtyd", "HADT": "Hawaii-Aleusiër-dagligtyd", "WAT": "Wes-Afrika-standaardtyd", "OEZ": "Oos-Europese standaardtyd", "PST": "Pasifiese standaardtyd", "ECT": "Ecuador-tyd", "MESZ": "Sentraal-Europese somertyd", "AEST": "Australiese Oostelike standaardtyd", "ART": "Argentinië-standaardtyd", "AWDT": "Australiese Westelike dagligtyd", "CLST": "Chili-somertyd", "CHAST": "Chatham-standaardtyd", "BT": "Bhoetan-tyd", "WARST": "Wes-Argentinië-somertyd", "AWST": "Australiese Westelike standaardtyd", "NZDT": "Nieu-Seeland-dagligtyd", "AST": "Atlantiese standaardtyd", "WAST": "Wes-Afrika-somertyd", "WIB": "Wes-Indonesië-tyd", "GYT": "Guyana-tyd", "CST": "Sentrale standaardtyd", "EST": "Oostelike standaardtyd", "ACST": "Australiese sentraal-standaardtyd", "SRT": "Suriname-tyd"},
+ timezones: map[string]string{"CST": "Sentrale standaardtyd", "ACST": "Australiese sentraal-standaardtyd", "CHAST": "Chatham-standaardtyd", "ART": "Argentinië-standaardtyd", "ACWDT": "Australiese sentraal-Westelike dagligtyd", "HNT": "Newfoundland-standaardtyd", "UYST": "Uruguay-somertyd", "AEST": "Australiese Oostelike standaardtyd", "MESZ": "Sentraal-Europese somertyd", "EST": "Oostelike standaardtyd", "TMST": "Turkmenistan-somertyd", "WEZ": "Wes-Europese standaardtyd", "OEZ": "Oos-Europese standaardtyd", "OESZ": "Oos-Europese somertyd", "CLST": "Chili-somertyd", "LHDT": "Lord Howe-dagligtyd", "∅∅∅": "Brasilië somertyd", "HKST": "Hongkong-somertyd", "COST": "Colombië-somertyd", "WIB": "Wes-Indonesië-tyd", "ACWST": "Australiese sentraal-Westelike standaard-tyd", "AWST": "Australiese Westelike standaardtyd", "AKDT": "Alaska-dagligtyd", "ADT": "Atlantiese dagligtyd", "AEDT": "Australiese Oostelike dagligtyd", "MYT": "Maleisië-tyd", "COT": "Colombië-standaardtyd", "WARST": "Wes-Argentinië-somertyd", "AKST": "Alaska-standaardtyd", "CAT": "Sentraal-Afrika-tyd", "SRT": "Suriname-tyd", "PDT": "Pasifiese dagligtyd", "WITA": "Sentraal Indonesië-tyd", "CHADT": "Chatham-dagligtyd", "ARST": "Argentinië-somertyd", "HADT": "Hawaii-Aleusiër-dagligtyd", "NZST": "Nieu-Seeland-standaardtyd", "SAST": "Suid-Afrika-standaardtyd", "PST": "Pasifiese standaardtyd", "WART": "Wes-Argentinië-standaardtyd", "JST": "Japan-standaardtyd", "IST": "Indië-standaardtyd", "WAT": "Wes-Afrika-standaardtyd", "CDT": "Sentrale dagligtyd", "ChST": "Chamorro-standaardtyd", "BT": "Bhoetan-tyd", "GFT": "Frans-Guiana-tyd", "NZDT": "Nieu-Seeland-dagligtyd", "SGT": "Singapoer-standaardtyd", "WESZ": "Wes-Europese somertyd", "BOT": "Bolivia-tyd", "EAT": "Oos-Afrika-tyd", "HAST": "Hawaii-Aleusiër-standaardtyd", "UYT": "Uruguay-standaardtyd", "ACDT": "Australiese sentrale dagligtyd", "HKT": "Hongkong-standaardtyd", "AST": "Atlantiese standaardtyd", "AWDT": "Australiese Westelike dagligtyd", "WAST": "Wes-Afrika-somertyd", "HAT": "Newfoundland-dagligtyd", "JDT": "Japan-dagligtyd", "MEZ": "Sentraal-Europese standaardtyd", "EDT": "Oostelike dagligtyd", "TMT": "Turkmenistan-standaardtyd", "MDT": "Berg-dagligtyd", "WIT": "Oos-Indonesië-tyd", "GYT": "Guyana-tyd", "CLT": "Chili-standaardtyd", "MST": "Berg-standaardtyd", "VET": "Venezuela-tyd", "ECT": "Ecuador-tyd", "GMT": "Greenwich-mediaantyd", "LHST": "Lord Howe-standaardtyd"},
}
}
diff --git a/af_ZA/af_ZA_test.go b/af_ZA/af_ZA_test.go
new file mode 100644
index 00000000..67ed4c66
--- /dev/null
+++ b/af_ZA/af_ZA_test.go
@@ -0,0 +1,1120 @@
+package af_ZA
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "af_ZA"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/agq/agq.go b/agq/agq.go
index 0ed0bdc7..ce99978f 100644
--- a/agq/agq.go
+++ b/agq/agq.go
@@ -61,7 +61,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"SK", "BK"},
erasNarrow: []string{"", ""},
erasWide: []string{"Sěe Kɨ̀lesto", "Bǎa Kɨ̀lesto"},
- timezones: map[string]string{"AWDT": "AWDT", "WEZ": "WEZ", "AEDT": "AEDT", "EDT": "EDT", "ACWST": "ACWST", "WAST": "WAST", "WITA": "WITA", "AWST": "AWST", "CST": "CST", "CDT": "CDT", "CLST": "CLST", "ART": "ART", "MESZ": "MESZ", "UYT": "UYT", "CHAST": "CHAST", "AST": "AST", "WARST": "WARST", "WIB": "WIB", "ACDT": "ACDT", "JDT": "JDT", "SRT": "SRT", "BOT": "BOT", "BT": "BT", "AKDT": "AKDT", "PST": "PST", "MEZ": "MEZ", "EST": "EST", "TMST": "TMST", "WART": "WART", "ARST": "ARST", "COT": "COT", "IST": "IST", "GMT": "GMT", "MDT": "MDT", "JST": "JST", "WAT": "WAT", "HKST": "HKST", "OESZ": "OESZ", "AKST": "AKST", "ADT": "ADT", "HKT": "HKT", "WIT": "WIT", "UYST": "UYST", "HAT": "HAT", "EAT": "EAT", "MST": "MST", "PDT": "PDT", "VET": "VET", "COST": "COST", "SAST": "SAST", "∅∅∅": "∅∅∅", "LHDT": "LHDT", "NZDT": "NZDT", "CLT": "CLT", "SGT": "SGT", "HNT": "HNT", "GFT": "GFT", "TMT": "TMT", "LHST": "LHST", "NZST": "NZST", "ECT": "ECT", "HADT": "HADT", "AEST": "AEST", "ChST": "ChST", "OEZ": "OEZ", "ACST": "ACST", "GYT": "GYT", "MYT": "MYT", "WESZ": "WESZ", "ACWDT": "ACWDT", "CHADT": "CHADT", "CAT": "CAT", "HAST": "HAST"},
+ timezones: map[string]string{"COST": "COST", "LHDT": "LHDT", "CLT": "CLT", "ACDT": "ACDT", "HKST": "HKST", "ACWDT": "ACWDT", "AEST": "AEST", "IST": "IST", "MESZ": "MESZ", "JDT": "JDT", "ART": "ART", "BOT": "BOT", "MDT": "MDT", "WITA": "WITA", "MYT": "MYT", "SGT": "SGT", "CDT": "CDT", "GFT": "GFT", "NZST": "NZST", "WAST": "WAST", "ARST": "ARST", "PST": "PST", "WARST": "WARST", "SRT": "SRT", "BT": "BT", "PDT": "PDT", "HAT": "HAT", "OESZ": "OESZ", "NZDT": "NZDT", "EAT": "EAT", "WEZ": "WEZ", "AKDT": "AKDT", "EDT": "EDT", "CAT": "CAT", "AWST": "AWST", "HNT": "HNT", "GMT": "GMT", "ChST": "ChST", "ACST": "ACST", "VET": "VET", "JST": "JST", "AKST": "AKST", "WAT": "WAT", "AEDT": "AEDT", "GYT": "GYT", "CLST": "CLST", "MST": "MST", "HADT": "HADT", "SAST": "SAST", "LHST": "LHST", "CHAST": "CHAST", "AST": "AST", "ADT": "ADT", "TMT": "TMT", "UYST": "UYST", "CST": "CST", "AWDT": "AWDT", "MEZ": "MEZ", "COT": "COT", "HAST": "HAST", "EST": "EST", "TMST": "TMST", "UYT": "UYT", "WIT": "WIT", "HKT": "HKT", "CHADT": "CHADT", "ECT": "ECT", "WART": "WART", "WESZ": "WESZ", "OEZ": "OEZ", "∅∅∅": "∅∅∅", "ACWST": "ACWST", "WIB": "WIB"},
}
}
diff --git a/agq/agq_test.go b/agq/agq_test.go
new file mode 100644
index 00000000..cb5082d5
--- /dev/null
+++ b/agq/agq_test.go
@@ -0,0 +1,1120 @@
+package agq
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "agq"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/agq_CM/agq_CM.go b/agq_CM/agq_CM.go
index 09a14dfa..83dcc3b5 100644
--- a/agq_CM/agq_CM.go
+++ b/agq_CM/agq_CM.go
@@ -61,7 +61,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"SK", "BK"},
erasNarrow: []string{"", ""},
erasWide: []string{"Sěe Kɨ̀lesto", "Bǎa Kɨ̀lesto"},
- timezones: map[string]string{"SRT": "SRT", "PDT": "PDT", "MESZ": "MESZ", "∅∅∅": "∅∅∅", "ARST": "ARST", "TMT": "TMT", "AWST": "AWST", "WIB": "WIB", "ChST": "ChST", "MST": "MST", "WESZ": "WESZ", "AST": "AST", "WITA": "WITA", "UYST": "UYST", "VET": "VET", "COST": "COST", "EDT": "EDT", "BT": "BT", "SGT": "SGT", "NZST": "NZST", "UYT": "UYT", "ACDT": "ACDT", "MDT": "MDT", "WEZ": "WEZ", "HADT": "HADT", "OEZ": "OEZ", "MYT": "MYT", "AEST": "AEST", "ECT": "ECT", "HKT": "HKT", "LHDT": "LHDT", "CDT": "CDT", "MEZ": "MEZ", "ACWST": "ACWST", "WARST": "WARST", "GFT": "GFT", "AKDT": "AKDT", "HAST": "HAST", "HAT": "HAT", "CLT": "CLT", "CLST": "CLST", "ART": "ART", "BOT": "BOT", "HKST": "HKST", "GMT": "GMT", "TMST": "TMST", "LHST": "LHST", "GYT": "GYT", "NZDT": "NZDT", "CHADT": "CHADT", "CAT": "CAT", "SAST": "SAST", "WAT": "WAT", "ACWDT": "ACWDT", "AWDT": "AWDT", "AKST": "AKST", "AEDT": "AEDT", "WAST": "WAST", "IST": "IST", "JDT": "JDT", "PST": "PST", "COT": "COT", "EST": "EST", "WIT": "WIT", "OESZ": "OESZ", "WART": "WART", "EAT": "EAT", "CST": "CST", "JST": "JST", "CHAST": "CHAST", "ADT": "ADT", "HNT": "HNT", "ACST": "ACST"},
+ timezones: map[string]string{"MST": "MST", "CHAST": "CHAST", "TMST": "TMST", "CST": "CST", "BOT": "BOT", "TMT": "TMT", "GMT": "GMT", "ART": "ART", "CHADT": "CHADT", "AWST": "AWST", "ECT": "ECT", "AST": "AST", "MEZ": "MEZ", "EAT": "EAT", "BT": "BT", "MDT": "MDT", "AWDT": "AWDT", "NZST": "NZST", "EST": "EST", "MESZ": "MESZ", "AEST": "AEST", "SRT": "SRT", "∅∅∅": "∅∅∅", "AKDT": "AKDT", "EDT": "EDT", "WIB": "WIB", "OEZ": "OEZ", "OESZ": "OESZ", "HKST": "HKST", "ARST": "ARST", "HAST": "HAST", "LHDT": "LHDT", "ACST": "ACST", "WART": "WART", "GFT": "GFT", "ACWST": "ACWST", "ChST": "ChST", "GYT": "GYT", "CLST": "CLST", "ACDT": "ACDT", "SAST": "SAST", "IST": "IST", "HADT": "HADT", "HNT": "HNT", "MYT": "MYT", "WARST": "WARST", "JDT": "JDT", "AKST": "AKST", "NZDT": "NZDT", "WAST": "WAST", "CLT": "CLT", "WAT": "WAT", "CDT": "CDT", "HKT": "HKT", "VET": "VET", "SGT": "SGT", "COT": "COT", "UYT": "UYT", "ADT": "ADT", "WITA": "WITA", "PDT": "PDT", "CAT": "CAT", "WEZ": "WEZ", "UYST": "UYST", "PST": "PST", "WIT": "WIT", "LHST": "LHST", "JST": "JST", "ACWDT": "ACWDT", "WESZ": "WESZ", "HAT": "HAT", "COST": "COST", "AEDT": "AEDT"},
}
}
diff --git a/agq_CM/agq_CM_test.go b/agq_CM/agq_CM_test.go
new file mode 100644
index 00000000..bf4e4630
--- /dev/null
+++ b/agq_CM/agq_CM_test.go
@@ -0,0 +1,1120 @@
+package agq_CM
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "agq_CM"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ak/ak.go b/ak/ak.go
index a048f4ba..9b8d8480 100644
--- a/ak/ak.go
+++ b/ak/ak.go
@@ -60,7 +60,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"AK", "KE"},
erasNarrow: []string{"", ""},
erasWide: []string{"Ansa Kristo", "Kristo Ekyiri"},
- timezones: map[string]string{"EDT": "EDT", "LHDT": "LHDT", "UYT": "UYT", "UYST": "UYST", "MST": "MST", "AST": "AST", "IST": "IST", "CHADT": "CHADT", "COST": "COST", "BT": "BT", "HNT": "HNT", "HKT": "HKT", "HAT": "HAT", "WESZ": "WESZ", "ACWST": "ACWST", "SGT": "SGT", "WARST": "WARST", "AWST": "AWST", "∅∅∅": "∅∅∅", "WART": "WART", "WAST": "WAST", "OESZ": "OESZ", "CLST": "CLST", "VET": "VET", "GMT": "GMT", "PDT": "PDT", "CHAST": "CHAST", "AEST": "AEST", "GFT": "GFT", "ART": "ART", "AKDT": "AKDT", "BOT": "BOT", "CLT": "CLT", "ECT": "ECT", "JST": "JST", "ACWDT": "ACWDT", "SAST": "SAST", "TMT": "TMT", "MEZ": "MEZ", "LHST": "LHST", "OEZ": "OEZ", "TMST": "TMST", "JDT": "JDT", "AWDT": "AWDT", "MDT": "MDT", "WAT": "WAT", "WIB": "WIB", "ACDT": "ACDT", "NZDT": "NZDT", "AEDT": "AEDT", "EST": "EST", "ADT": "ADT", "CST": "CST", "CDT": "CDT", "MESZ": "MESZ", "NZST": "NZST", "SRT": "SRT", "AKST": "AKST", "PST": "PST", "HAST": "HAST", "EAT": "EAT", "ACST": "ACST", "MYT": "MYT", "COT": "COT", "HADT": "HADT", "WIT": "WIT", "ARST": "ARST", "WITA": "WITA", "GYT": "GYT", "WEZ": "WEZ", "ChST": "ChST", "CAT": "CAT", "HKST": "HKST"},
+ timezones: map[string]string{"GYT": "GYT", "SRT": "SRT", "AEST": "AEST", "HAST": "HAST", "BOT": "BOT", "OEZ": "OEZ", "OESZ": "OESZ", "HKST": "HKST", "LHDT": "LHDT", "EAT": "EAT", "BT": "BT", "WIB": "WIB", "CST": "CST", "HNT": "HNT", "ART": "ART", "WITA": "WITA", "WEZ": "WEZ", "GMT": "GMT", "CDT": "CDT", "CHAST": "CHAST", "VET": "VET", "TMST": "TMST", "ECT": "ECT", "COT": "COT", "LHST": "LHST", "PST": "PST", "NZDT": "NZDT", "WART": "WART", "AWDT": "AWDT", "JDT": "JDT", "∅∅∅": "∅∅∅", "AEDT": "AEDT", "ACST": "ACST", "MST": "MST", "AKDT": "AKDT", "MESZ": "MESZ", "NZST": "NZST", "WAST": "WAST", "WESZ": "WESZ", "CLST": "CLST", "WIT": "WIT", "ACWDT": "ACWDT", "GFT": "GFT", "ARST": "ARST", "TMT": "TMT", "CAT": "CAT", "HKT": "HKT", "AKST": "AKST", "EST": "EST", "PDT": "PDT", "ACDT": "ACDT", "WARST": "WARST", "MDT": "MDT", "HADT": "HADT", "COST": "COST", "UYT": "UYT", "ADT": "ADT", "JST": "JST", "SAST": "SAST", "CLT": "CLT", "CHADT": "CHADT", "IST": "IST", "EDT": "EDT", "WAT": "WAT", "SGT": "SGT", "MYT": "MYT", "UYST": "UYST", "AST": "AST", "AWST": "AWST", "MEZ": "MEZ", "HAT": "HAT", "ChST": "ChST", "ACWST": "ACWST"},
}
}
@@ -123,7 +123,7 @@ func (ak *ak) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (ak *ak) MonthsNarrow() []string {
- return ak.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/ak/ak_test.go b/ak/ak_test.go
new file mode 100644
index 00000000..4199279e
--- /dev/null
+++ b/ak/ak_test.go
@@ -0,0 +1,1120 @@
+package ak
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ak"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ak_GH/ak_GH.go b/ak_GH/ak_GH.go
index 85f75d8c..1187daef 100644
--- a/ak_GH/ak_GH.go
+++ b/ak_GH/ak_GH.go
@@ -60,7 +60,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"AK", "KE"},
erasNarrow: []string{"", ""},
erasWide: []string{"Ansa Kristo", "Kristo Ekyiri"},
- timezones: map[string]string{"WAT": "WAT", "OEZ": "OEZ", "MYT": "MYT", "NZST": "NZST", "EST": "EST", "IST": "IST", "ACST": "ACST", "WEZ": "WEZ", "CHAST": "CHAST", "COST": "COST", "HAST": "HAST", "AKDT": "AKDT", "MEZ": "MEZ", "CLT": "CLT", "ECT": "ECT", "HAT": "HAT", "GYT": "GYT", "BOT": "BOT", "UYST": "UYST", "WAST": "WAST", "VET": "VET", "AST": "AST", "SAST": "SAST", "ARST": "ARST", "PST": "PST", "CDT": "CDT", "AEST": "AEST", "CLST": "CLST", "WITA": "WITA", "WIB": "WIB", "CAT": "CAT", "AWST": "AWST", "ACWST": "ACWST", "PDT": "PDT", "SGT": "SGT", "WARST": "WARST", "GMT": "GMT", "HNT": "HNT", "MDT": "MDT", "ACDT": "ACDT", "ART": "ART", "JDT": "JDT", "MESZ": "MESZ", "ACWDT": "ACWDT", "HADT": "HADT", "BT": "BT", "HKST": "HKST", "WIT": "WIT", "EAT": "EAT", "MST": "MST", "AKST": "AKST", "UYT": "UYT", "ADT": "ADT", "WART": "WART", "AWDT": "AWDT", "LHST": "LHST", "SRT": "SRT", "HKT": "HKT", "OESZ": "OESZ", "CST": "CST", "WESZ": "WESZ", "CHADT": "CHADT", "EDT": "EDT", "GFT": "GFT", "LHDT": "LHDT", "JST": "JST", "NZDT": "NZDT", "ChST": "ChST", "COT": "COT", "∅∅∅": "∅∅∅", "TMT": "TMT", "AEDT": "AEDT", "TMST": "TMST"},
+ timezones: map[string]string{"COST": "COST", "OESZ": "OESZ", "AEST": "AEST", "ChST": "ChST", "CLST": "CLST", "CDT": "CDT", "AKDT": "AKDT", "AWST": "AWST", "PST": "PST", "CAT": "CAT", "MDT": "MDT", "HKST": "HKST", "BOT": "BOT", "EDT": "EDT", "COT": "COT", "GYT": "GYT", "BT": "BT", "WART": "WART", "JDT": "JDT", "ACWDT": "ACWDT", "AEDT": "AEDT", "ACST": "ACST", "HAST": "HAST", "HADT": "HADT", "UYST": "UYST", "WIT": "WIT", "TMST": "TMST", "WESZ": "WESZ", "OEZ": "OEZ", "MYT": "MYT", "LHST": "LHST", "ADT": "ADT", "ACWST": "ACWST", "IST": "IST", "ART": "ART", "JST": "JST", "UYT": "UYT", "ECT": "ECT", "WITA": "WITA", "NZDT": "NZDT", "HAT": "HAT", "AWDT": "AWDT", "TMT": "TMT", "∅∅∅": "∅∅∅", "CLT": "CLT", "CST": "CST", "SRT": "SRT", "ARST": "ARST", "EST": "EST", "SAST": "SAST", "PDT": "PDT", "WAT": "WAT", "HKT": "HKT", "CHAST": "CHAST", "AST": "AST", "MESZ": "MESZ", "AKST": "AKST", "GFT": "GFT", "GMT": "GMT", "WIB": "WIB", "WEZ": "WEZ", "VET": "VET", "CHADT": "CHADT", "SGT": "SGT", "LHDT": "LHDT", "MST": "MST", "WARST": "WARST", "WAST": "WAST", "EAT": "EAT", "HNT": "HNT", "ACDT": "ACDT", "MEZ": "MEZ", "NZST": "NZST"},
}
}
@@ -123,7 +123,7 @@ func (ak *ak_GH) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (ak *ak_GH) MonthsNarrow() []string {
- return ak.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/ak_GH/ak_GH_test.go b/ak_GH/ak_GH_test.go
new file mode 100644
index 00000000..515acbe8
--- /dev/null
+++ b/ak_GH/ak_GH_test.go
@@ -0,0 +1,1120 @@
+package ak_GH
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ak_GH"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/am/am.go b/am/am.go
index 5196f937..17ccd4d3 100644
--- a/am/am.go
+++ b/am/am.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"", ""},
erasNarrow: []string{"ዓ/ዓ", "ዓ/ም"},
erasWide: []string{"ዓመተ ዓለም", "ዓመተ ምሕረት"},
- timezones: map[string]string{"MST": "MST", "TMT": "የቱርክመኒስታን መደበኛ ሰዓት", "MEZ": "የመካከለኛው አውሮፓ መደበኛ ሰዓት", "CLT": "የቺሊ መደበኛ ሰዓት", "MESZ": "የመካከለኛው አውሮፓ ክረምት ሰዓት", "WEZ": "የምዕራባዊ አውሮፓ መደበኛ ሰዓት", "IST": "የህንድ መደበኛ ሰዓት", "AWST": "የአውስትራሊያ ምስራቃዊ መደበኛ ሰዓት አቆጣጠር", "CDT": "የመካከለኛ የቀን ሰዓት አቆጣጠር", "WESZ": "የምዕራባዊ አውሮፓ ክረምት ሰዓት", "ADT": "የአትላንቲክ የቀን ሰዓት አቆጣጠር", "ACST": "የአውስትራሊያ መካከለኛ መደበኛ የሰዓት አቆጣጠር", "LHST": "የሎርድ ሆዌ መደበኛ የሰዓት አቆጣጠር", "AEDT": "የአውስትራሊያ ምዕራባዊ የቀን ሰዓት አቆጣጠር", "CAT": "የመካከለኛው አፍሪካ ሰዓት", "GFT": "የፈረንሳይ ጉያና ሰዓት", "WITA": "የመካከለኛው ኢንዶኔዢያ ሰዓት", "GYT": "የጉያና ሰዓት", "ChST": "የቻሞሮ መደበኛ ሰዓት", "EST": "የምዕራባዊ መደበኛ የሰዓት አቆጣጠር", "WIB": "የምዕራባዊ ኢንዶኔዢያ ሰዓት", "AKST": "የአላስካ መደበኛ የሰዓት አቆጣጠር", "SAST": "የደቡብ አፍሪካ መደበኛ ሰዓት", "HAT": "የኒውፋውንድላንድ የቀን የሰዓት አቆጣጠር", "HKT": "የሆንግ ኮንግ መደበኛ ሰዓት", "EAT": "የምስራቅ አፍሪካ ሰዓት", "MDT": "MDT", "ART": "የአርጀንቲና መደበኛ ጊዜ", "∅∅∅": "የአማዞን የቀን ሰዓት አቆጣጠር", "TMST": "የቱርክመኒስታን ክረምት ሰዓት", "MYT": "የማሌይዢያ ሰዓት", "COT": "የኮሎምቢያ መደበኛ ሰዓት", "WARST": "የአርጀንቲና ምስራቃዊ በጋ ሰዓት አቆጣጠር", "UYST": "የኡራጓይ ክረምት ሰዓት", "WART": "የምዕራባዊ አርጀንቲና መደበኛ ሰዓት አቆጣጠር", "AKDT": "የአላስካ የቀን ሰዓት አቆጣጠር", "NZST": "የኒው ዚላንድ መደበኛ ሰዓት", "UYT": "የኡራጓይ መደበኛ ሰዓት", "CLST": "የቺሊ ክረምት ሰዓት", "OEZ": "የምስራቃዊ አውሮፓ መደበኛ ሰዓት", "LHDT": "የሎርድ ሆዌ የቀን ሰዓት አቆጣጠር", "CHAST": "የቻታም መደበኛ ሰዓት", "COST": "የኮሎምቢያ ክረምት ሰዓት", "HNT": "የኒውፋውንድላንድ መደበኛ የሰዓት አቆጣጠር", "SRT": "የሱሪናም ሰዓት", "AWDT": "የአውስትራሊያ ምስራቃዊ የቀን ሰዓት አቆጣጠር", "JST": "የጃፓን መደበኛ ሰዓት", "JDT": "የጃፓን የቀን ብርሃን ሰዓት", "BOT": "የቦሊቪያ ሰዓት", "AEST": "የአውስትራሊያ ምዕራባዊ መደበኛ የሰዓት አቆጣጠር", "CHADT": "የቻታም የቀን ብርሃን ሰዓት", "PST": "የፓስፊክ መደበኛ ሰዓት አቆጣጠር", "VET": "የቬኔዝዌላ ሰዓት", "ARST": "የአርጀንቲና የበጋ ሰዓት አቆጣጠር", "AST": "የአትላንቲክ መደበኛ የሰዓት አቆጣጠር", "HAST": "የሃዋይ አሌኡት መደበኛ ሰዓት አቆጣጠር", "WAT": "የምዕራብ አፍሪካ መደበኛ ሰዓት", "WAST": "የምዕራብ አፍሪካ ክረምት ሰዓት", "ACDT": "የአውስትራሊያ መካከለኛ የቀን ሰዓት አቆጣጠር", "NZDT": "የኒው ዚላንድ የቀን ብርሃን ሰዓት", "SGT": "የሲንጋፒር መደበኛ ሰዓት", "BT": "የቡታን ሰዓት", "PDT": "የፓስፊክ የቀን ሰዓት አቆጣጠር", "CST": "የመካከለኛ መደበኛ ሰዓት አቆጣጠር", "GMT": "ግሪንዊች ማዕከላዊ ሰዓት", "WIT": "የምስራቃዊ ኢንዶኔዢያ ሰዓት", "ACWST": "የአውስትራሊያ መካከለኛ ምስራቃዊ መደበኛ ሰዓት አቆጣጠር", "ACWDT": "የአውስትራሊያ መካከለኛው ምስራቅ የቀን ሰዓት አቆጣጠር", "EDT": "የምዕራባዊ የቀን ሰዓት አቆጣጠር", "ECT": "የኢኳዶር ሰዓት", "HADT": "የሃዋይ አሌኡት የቀን ሰዓት አቆጣጠር", "HKST": "የሆንግ ኮንግ ክረምት ሰዓት", "OESZ": "የምስራቃዊ አውሮፓ ክረምት ሰዓት"},
+ timezones: map[string]string{"NZDT": "የኒው ዚላንድ የቀን ብርሃን ሰዓት", "GYT": "የጉያና ሰዓት", "GMT": "ግሪንዊች ማዕከላዊ ሰዓት", "AEDT": "የአውስትራሊያ ምዕራባዊ የቀን ሰዓት አቆጣጠር", "WARST": "የአርጀንቲና ምስራቃዊ በጋ ሰዓት አቆጣጠር", "VET": "የቬኔዝዌላ ሰዓት", "WART": "የምዕራባዊ አርጀንቲና መደበኛ ሰዓት አቆጣጠር", "OESZ": "የምስራቃዊ አውሮፓ ክረምት ሰዓት", "ADT": "የአትላንቲክ የቀን ሰዓት አቆጣጠር", "CAT": "የመካከለኛው አፍሪካ ሰዓት", "JDT": "የጃፓን የቀን ብርሃን ሰዓት", "MDT": "የተራራ የቀንሰዓት አቆጣጠር", "GFT": "የፈረንሳይ ጉያና ሰዓት", "ARST": "የአርጀንቲና የበጋ ሰዓት አቆጣጠር", "HAST": "የሃዋይ አሌኡት መደበኛ ሰዓት አቆጣጠር", "BOT": "የቦሊቪያ ሰዓት", "LHDT": "የሎርድ ሆዌ የቀን ሰዓት አቆጣጠር", "CHAST": "የቻታም መደበኛ ሰዓት", "ACWST": "የአውስትራሊያ መካከለኛ ምስራቃዊ መደበኛ ሰዓት አቆጣጠር", "COST": "የኮሎምቢያ ክረምት ሰዓት", "TMT": "የቱርክመኒስታን መደበኛ ሰዓት", "TMST": "የቱርክመኒስታን ክረምት ሰዓት", "WAT": "የምዕራብ አፍሪካ መደበኛ ሰዓት", "WEZ": "የምዕራባዊ አውሮፓ መደበኛ ሰዓት", "∅∅∅": "የብራዚላ የበጋ ሰዓት አቆጣጠር", "ART": "የአርጀንቲና መደበኛ ጊዜ", "HNT": "የኒውፋውንድላንድ መደበኛ የሰዓት አቆጣጠር", "AEST": "የአውስትራሊያ ምዕራባዊ መደበኛ የሰዓት አቆጣጠር", "MST": "የተራራ መደበኛ የሰዓት አቆጣጠር", "HKT": "የሆንግ ኮንግ መደበኛ ሰዓት", "JST": "የጃፓን መደበኛ ሰዓት", "AKDT": "የአላስካ የቀን ሰዓት አቆጣጠር", "MEZ": "የመካከለኛው አውሮፓ መደበኛ ሰዓት", "EAT": "የምስራቅ አፍሪካ ሰዓት", "CST": "የመካከለኛ መደበኛ ሰዓት አቆጣጠር", "HADT": "የሃዋይ አሌኡት የቀን ሰዓት አቆጣጠር", "SAST": "የደቡብ አፍሪካ መደበኛ ሰዓት", "WIB": "የምዕራባዊ ኢንዶኔዢያ ሰዓት", "UYST": "የኡራጓይ ክረምት ሰዓት", "SRT": "የሱሪናም ሰዓት", "AWST": "የአውስትራሊያ ምስራቃዊ መደበኛ ሰዓት አቆጣጠር", "PDT": "የፓስፊክ የቀን ሰዓት አቆጣጠር", "COT": "የኮሎምቢያ መደበኛ ሰዓት", "WAST": "የምዕራብ አፍሪካ ክረምት ሰዓት", "OEZ": "የምስራቃዊ አውሮፓ መደበኛ ሰዓት", "ECT": "የኢኳዶር ሰዓት", "PST": "የፓስፊክ መደበኛ ሰዓት አቆጣጠር", "SGT": "የሲንጋፒር መደበኛ ሰዓት", "AKST": "የአላስካ መደበኛ የሰዓት አቆጣጠር", "EST": "የምዕራባዊ መደበኛ የሰዓት አቆጣጠር", "LHST": "የሎርድ ሆዌ መደበኛ የሰዓት አቆጣጠር", "IST": "የህንድ መደበኛ ሰዓት", "EDT": "የምዕራባዊ የቀን ሰዓት አቆጣጠር", "HAT": "የኒውፋውንድላንድ የቀን የሰዓት አቆጣጠር", "CLT": "የቺሊ መደበኛ ሰዓት", "UYT": "የኡራጓይ መደበኛ ሰዓት", "HKST": "የሆንግ ኮንግ ክረምት ሰዓት", "WITA": "የመካከለኛው ኢንዶኔዢያ ሰዓት", "AST": "የአትላንቲክ መደበኛ የሰዓት አቆጣጠር", "NZST": "የኒው ዚላንድ መደበኛ ሰዓት", "WESZ": "የምዕራባዊ አውሮፓ ክረምት ሰዓት", "CLST": "የቺሊ ክረምት ሰዓት", "BT": "የቡታን ሰዓት", "ACDT": "የአውስትራሊያ መካከለኛ የቀን ሰዓት አቆጣጠር", "CHADT": "የቻታም የቀን ብርሃን ሰዓት", "ACWDT": "የአውስትራሊያ መካከለኛው ምስራቅ የቀን ሰዓት አቆጣጠር", "AWDT": "የአውስትራሊያ ምስራቃዊ የቀን ሰዓት አቆጣጠር", "MYT": "የማሌይዢያ ሰዓት", "CDT": "የመካከለኛ የቀን ሰዓት አቆጣጠር", "MESZ": "የመካከለኛው አውሮፓ ክረምት ሰዓት", "ChST": "የቻሞሮ መደበኛ ሰዓት", "WIT": "የምስራቃዊ ኢንዶኔዢያ ሰዓት", "ACST": "የአውስትራሊያ መካከለኛ መደበኛ የሰዓት አቆጣጠር"},
}
}
diff --git a/am/am_test.go b/am/am_test.go
new file mode 100644
index 00000000..a8c42769
--- /dev/null
+++ b/am/am_test.go
@@ -0,0 +1,1120 @@
+package am
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "am"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/am_ET/am_ET.go b/am_ET/am_ET.go
index 1e3bc8e8..8caabc99 100644
--- a/am_ET/am_ET.go
+++ b/am_ET/am_ET.go
@@ -47,7 +47,7 @@ func New() locales.Translator {
locale: "am_ET",
pluralsCardinal: []locales.PluralRule{2, 6},
pluralsOrdinal: []locales.PluralRule{6},
- pluralsRange: []locales.PluralRule{2, 6},
+ pluralsRange: []locales.PluralRule{6, 2},
decimal: ".",
group: ",",
minus: "-",
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"", ""},
erasNarrow: []string{"ዓ/ዓ", "ዓ/ም"},
erasWide: []string{"ዓመተ ዓለም", "ዓመተ ምሕረት"},
- timezones: map[string]string{"ARST": "የአርጀንቲና የበጋ ሰዓት አቆጣጠር", "GYT": "የጉያና ሰዓት", "SRT": "የሱሪናም ሰዓት", "CDT": "የመካከለኛ የቀን ሰዓት አቆጣጠር", "NZST": "የኒው ዚላንድ መደበኛ ሰዓት", "ADT": "የአትላንቲክ የቀን ሰዓት አቆጣጠር", "HAST": "የሃዋይ አሌኡት መደበኛ ሰዓት አቆጣጠር", "WIB": "የምዕራባዊ ኢንዶኔዢያ ሰዓት", "TMST": "የቱርክመኒስታን ክረምት ሰዓት", "HADT": "የሃዋይ አሌኡት የቀን ሰዓት አቆጣጠር", "GFT": "የፈረንሳይ ጉያና ሰዓት", "ACWST": "የአውስትራሊያ መካከለኛ ምስራቃዊ መደበኛ ሰዓት አቆጣጠር", "AEST": "የአውስትራሊያ ምዕራባዊ መደበኛ የሰዓት አቆጣጠር", "EST": "የምዕራባዊ መደበኛ የሰዓት አቆጣጠር", "MEZ": "የመካከለኛው አውሮፓ መደበኛ ሰዓት", "WESZ": "የምዕራባዊ አውሮፓ ክረምት ሰዓት", "EAT": "የምስራቅ አፍሪካ ሰዓት", "PDT": "የፓስፊክ የቀን ሰዓት አቆጣጠር", "HAT": "የኒውፋውንድላንድ የቀን የሰዓት አቆጣጠር", "TMT": "የቱርክመኒስታን መደበኛ ሰዓት", "UYST": "የኡራጓይ ክረምት ሰዓት", "SAST": "የደቡብ አፍሪካ መደበኛ ሰዓት", "HNT": "የኒውፋውንድላንድ መደበኛ የሰዓት አቆጣጠር", "LHST": "የሎርድ ሆዌ መደበኛ የሰዓት አቆጣጠር", "VET": "የቬኔዝዌላ ሰዓት", "AEDT": "የአውስትራሊያ ምዕራባዊ የቀን ሰዓት አቆጣጠር", "ChST": "የቻሞሮ መደበኛ ሰዓት", "WAT": "የምዕራብ አፍሪካ መደበኛ ሰዓት", "WAST": "የምዕራብ አፍሪካ ክረምት ሰዓት", "HKT": "የሆንግ ኮንግ መደበኛ ሰዓት", "AKST": "የአላስካ መደበኛ የሰዓት አቆጣጠር", "UYT": "የኡራጓይ መደበኛ ሰዓት", "JST": "የጃፓን መደበኛ ሰዓት", "LHDT": "የሎርድ ሆዌ የቀን ሰዓት አቆጣጠር", "BT": "የቡታን ሰዓት", "WIT": "የምስራቃዊ ኢንዶኔዢያ ሰዓት", "GMT": "ግሪንዊች ማዕከላዊ ሰዓት", "CLT": "የቺሊ መደበኛ ሰዓት", "AST": "የአትላንቲክ መደበኛ የሰዓት አቆጣጠር", "OESZ": "የምስራቃዊ አውሮፓ ክረምት ሰዓት", "CHAST": "የቻታም መደበኛ ሰዓት", "CST": "የመካከለኛ መደበኛ ሰዓት አቆጣጠር", "BOT": "የቦሊቪያ ሰዓት", "CLST": "የቺሊ ክረምት ሰዓት", "SGT": "የሲንጋፒር መደበኛ ሰዓት", "ACDT": "የአውስትራሊያ መካከለኛ የቀን ሰዓት አቆጣጠር", "ART": "የአርጀንቲና መደበኛ ጊዜ", "CAT": "የመካከለኛው አፍሪካ ሰዓት", "WARST": "የአርጀንቲና ምስራቃዊ በጋ ሰዓት አቆጣጠር", "MYT": "የማሌይዢያ ሰዓት", "CHADT": "የቻታም የቀን ብርሃን ሰዓት", "∅∅∅": "የአማዞን የቀን ሰዓት አቆጣጠር", "ACWDT": "የአውስትራሊያ መካከለኛው ምስራቅ የቀን ሰዓት አቆጣጠር", "IST": "የህንድ መደበኛ ሰዓት", "OEZ": "የምስራቃዊ አውሮፓ መደበኛ ሰዓት", "MST": "MST", "MESZ": "የመካከለኛው አውሮፓ ክረምት ሰዓት", "AWST": "የአውስትራሊያ ምስራቃዊ መደበኛ ሰዓት አቆጣጠር", "AWDT": "የአውስትራሊያ ምስራቃዊ የቀን ሰዓት አቆጣጠር", "EDT": "የምዕራባዊ የቀን ሰዓት አቆጣጠር", "COST": "የኮሎምቢያ ክረምት ሰዓት", "WART": "የምዕራባዊ አርጀንቲና መደበኛ ሰዓት አቆጣጠር", "HKST": "የሆንግ ኮንግ ክረምት ሰዓት", "MDT": "MDT", "ACST": "የአውስትራሊያ መካከለኛ መደበኛ የሰዓት አቆጣጠር", "PST": "የፓስፊክ መደበኛ ሰዓት አቆጣጠር", "NZDT": "የኒው ዚላንድ የቀን ብርሃን ሰዓት", "COT": "የኮሎምቢያ መደበኛ ሰዓት", "ECT": "የኢኳዶር ሰዓት", "WITA": "የመካከለኛው ኢንዶኔዢያ ሰዓት", "JDT": "የጃፓን የቀን ብርሃን ሰዓት", "AKDT": "የአላስካ የቀን ሰዓት አቆጣጠር", "WEZ": "የምዕራባዊ አውሮፓ መደበኛ ሰዓት"},
+ timezones: map[string]string{"HAST": "የሃዋይ አሌኡት መደበኛ ሰዓት አቆጣጠር", "OESZ": "የምስራቃዊ አውሮፓ ክረምት ሰዓት", "CST": "የመካከለኛ መደበኛ ሰዓት አቆጣጠር", "ECT": "የኢኳዶር ሰዓት", "ACWST": "የአውስትራሊያ መካከለኛ ምስራቃዊ መደበኛ ሰዓት አቆጣጠር", "MESZ": "የመካከለኛው አውሮፓ ክረምት ሰዓት", "NZST": "የኒው ዚላንድ መደበኛ ሰዓት", "WAST": "የምዕራብ አፍሪካ ክረምት ሰዓት", "MST": "የተራራ መደበኛ የሰዓት አቆጣጠር", "ACDT": "የአውስትራሊያ መካከለኛ የቀን ሰዓት አቆጣጠር", "MEZ": "የመካከለኛው አውሮፓ መደበኛ ሰዓት", "EST": "የምዕራባዊ መደበኛ የሰዓት አቆጣጠር", "HKST": "የሆንግ ኮንግ ክረምት ሰዓት", "WITA": "የመካከለኛው ኢንዶኔዢያ ሰዓት", "WIB": "የምዕራባዊ ኢንዶኔዢያ ሰዓት", "TMST": "የቱርክመኒስታን ክረምት ሰዓት", "HAT": "የኒውፋውንድላንድ የቀን የሰዓት አቆጣጠር", "EAT": "የምስራቅ አፍሪካ ሰዓት", "SRT": "የሱሪናም ሰዓት", "WAT": "የምዕራብ አፍሪካ መደበኛ ሰዓት", "AEST": "የአውስትራሊያ ምዕራባዊ መደበኛ የሰዓት አቆጣጠር", "ARST": "የአርጀንቲና የበጋ ሰዓት አቆጣጠር", "SAST": "የደቡብ አፍሪካ መደበኛ ሰዓት", "ART": "የአርጀንቲና መደበኛ ጊዜ", "AKST": "የአላስካ መደበኛ የሰዓት አቆጣጠር", "WEZ": "የምዕራባዊ አውሮፓ መደበኛ ሰዓት", "GMT": "ግሪንዊች ማዕከላዊ ሰዓት", "AEDT": "የአውስትራሊያ ምዕራባዊ የቀን ሰዓት አቆጣጠር", "WIT": "የምስራቃዊ ኢንዶኔዢያ ሰዓት", "MDT": "የተራራ የቀንሰዓት አቆጣጠር", "JST": "የጃፓን መደበኛ ሰዓት", "ADT": "የአትላንቲክ የቀን ሰዓት አቆጣጠር", "COT": "የኮሎምቢያ መደበኛ ሰዓት", "GYT": "የጉያና ሰዓት", "MYT": "የማሌይዢያ ሰዓት", "LHST": "የሎርድ ሆዌ መደበኛ የሰዓት አቆጣጠር", "EDT": "የምዕራባዊ የቀን ሰዓት አቆጣጠር", "TMT": "የቱርክመኒስታን መደበኛ ሰዓት", "ACST": "የአውስትራሊያ መካከለኛ መደበኛ የሰዓት አቆጣጠር", "AWST": "የአውስትራሊያ ምስራቃዊ መደበኛ ሰዓት አቆጣጠር", "CHAST": "የቻታም መደበኛ ሰዓት", "CHADT": "የቻታም የቀን ብርሃን ሰዓት", "AST": "የአትላንቲክ መደበኛ የሰዓት አቆጣጠር", "ACWDT": "የአውስትራሊያ መካከለኛው ምስራቅ የቀን ሰዓት አቆጣጠር", "ChST": "የቻሞሮ መደበኛ ሰዓት", "LHDT": "የሎርድ ሆዌ የቀን ሰዓት አቆጣጠር", "WART": "የምዕራባዊ አርጀንቲና መደበኛ ሰዓት አቆጣጠር", "JDT": "የጃፓን የቀን ብርሃን ሰዓት", "CLST": "የቺሊ ክረምት ሰዓት", "CDT": "የመካከለኛ የቀን ሰዓት አቆጣጠር", "HKT": "የሆንግ ኮንግ መደበኛ ሰዓት", "UYST": "የኡራጓይ ክረምት ሰዓት", "WARST": "የአርጀንቲና ምስራቃዊ በጋ ሰዓት አቆጣጠር", "IST": "የህንድ መደበኛ ሰዓት", "PST": "የፓስፊክ መደበኛ ሰዓት አቆጣጠር", "CAT": "የመካከለኛው አፍሪካ ሰዓት", "CLT": "የቺሊ መደበኛ ሰዓት", "AWDT": "የአውስትራሊያ ምስራቃዊ የቀን ሰዓት አቆጣጠር", "GFT": "የፈረንሳይ ጉያና ሰዓት", "WESZ": "የምዕራባዊ አውሮፓ ክረምት ሰዓት", "BT": "የቡታን ሰዓት", "∅∅∅": "የብራዚላ የበጋ ሰዓት አቆጣጠር", "BOT": "የቦሊቪያ ሰዓት", "COST": "የኮሎምቢያ ክረምት ሰዓት", "NZDT": "የኒው ዚላንድ የቀን ብርሃን ሰዓት", "UYT": "የኡራጓይ መደበኛ ሰዓት", "AKDT": "የአላስካ የቀን ሰዓት አቆጣጠር", "PDT": "የፓስፊክ የቀን ሰዓት አቆጣጠር", "SGT": "የሲንጋፒር መደበኛ ሰዓት", "HNT": "የኒውፋውንድላንድ መደበኛ የሰዓት አቆጣጠር", "OEZ": "የምስራቃዊ አውሮፓ መደበኛ ሰዓት", "VET": "የቬኔዝዌላ ሰዓት", "HADT": "የሃዋይ አሌኡት የቀን ሰዓት አቆጣጠር"},
}
}
diff --git a/am_ET/am_ET_test.go b/am_ET/am_ET_test.go
new file mode 100644
index 00000000..1f5f4118
--- /dev/null
+++ b/am_ET/am_ET_test.go
@@ -0,0 +1,1120 @@
+package am_ET
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "am_ET"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ar/ar.go b/ar/ar.go
index 0da03f5b..ea0607a8 100644
--- a/ar/ar.go
+++ b/ar/ar.go
@@ -47,7 +47,7 @@ func New() locales.Translator {
locale: "ar",
pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
pluralsOrdinal: []locales.PluralRule{6},
- pluralsRange: []locales.PluralRule{6, 1, 4, 5},
+ pluralsRange: []locales.PluralRule{1, 4, 5, 6},
decimal: "٫",
group: "٬",
minus: "‏-",
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"", ""},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"HAT": "توقيت نيوفاوندلاند الصيفي", "NZST": "توقيت نيوزيلندا الرسمي", "HAST": "توقيت هاواي ألوتيان الرسمي", "WAST": "توقيت غرب أفريقيا الصيفي", "HKT": "توقيت هونغ كونغ الرسمي", "IST": "توقيت الهند", "OESZ": "توقيت شرق أوروبا الصيفي", "HNT": "توقيت نيوفاوندلاند الرسمي", "PDT": "توقيت المحيط الهادي الصيفي", "AWST": "توقيت غرب أستراليا الرسمي", "COST": "توقيت كولومبيا الصيفي", "SAST": "توقيت جنوب أفريقيا", "ARST": "توقيت الأرجنتين الصيفي", "∅∅∅": "توقيت الأمازون الصيفي", "LHDT": "التوقيت الصيفي للورد هاو", "AEST": "توقيت شرق أستراليا الرسمي", "ART": "توقيت الأرجنتين الرسمي", "TMST": "توقيت تركمانستان الصيفي", "MESZ": "توقيت وسط أوروبا الصيفي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "AEDT": "توقيت شرق أستراليا الصيفي", "GFT": "توقيت غايانا الفرنسية", "EAT": "توقيت شرق أفريقيا", "JST": "توقيت اليابان الرسمي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "WEZ": "توقيت غرب أوروبا الرسمي", "AWDT": "توقيت غرب أستراليا الصيفي", "WESZ": "توقيت غرب أوروبا الصيفي", "CHADT": "توقيت تشاتام الصيفي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "ECT": "توقيت الإكوادور", "ADT": "التوقيت الصيفي الأطلسي", "WIB": "توقيت غرب إندونيسيا", "TMT": "توقيت تركمانستان الرسمي", "MYT": "توقيت ماليزيا", "UYST": "توقيت أورغواي الصيفي", "CLT": "توقيت شيلي الرسمي", "CAT": "توقيت وسط أفريقيا", "AST": "التوقيت الرسمي الأطلسي", "WITA": "توقيت وسط إندونيسيا", "MDT": "MDT", "JDT": "توقيت اليابان الصيفي", "HADT": "توقيت هاواي ألوتيان الصيفي", "ACST": "توقيت وسط أستراليا الرسمي", "AKST": "التوقيت الرسمي لألاسكا", "MEZ": "توقيت وسط أوروبا الرسمي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "SGT": "توقيت سنغافورة", "COT": "توقيت كولومبيا الرسمي", "BT": "توقيت بوتان", "HKST": "توقيت هونغ كونغ الصيفي", "VET": "توقيت فنزويلا", "WART": "توقيت غرب الأرجنتين الرسمي", "GYT": "توقيت غيانا", "OEZ": "توقيت شرق أوروبا الرسمي", "AKDT": "توقيت ألاسكا الصيفي", "LHST": "توقيت لورد هاو الرسمي", "SRT": "توقيت سورينام", "BOT": "توقيت بوليفيا", "CHAST": "توقيت تشاتام الرسمي", "WAT": "توقيت غرب أفريقيا الرسمي", "WARST": "توقيت غرب الأرجنتين الصيفي", "GMT": "توقيت غرينتش", "WIT": "توقيت شرق إندونيسيا", "NZDT": "توقيت نيوزيلندا الصيفي", "ChST": "توقيت تشامورو", "CLST": "توقيت شيلي الصيفي", "ACDT": "توقيت وسط أستراليا الصيفي", "PST": "توقيت المحيط الهادي الرسمي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "MST": "MST", "UYT": "توقيت أورغواي الرسمي"},
+ timezones: map[string]string{"EAT": "توقيت شرق أفريقيا", "WARST": "توقيت غرب الأرجنتين الصيفي", "CHAST": "توقيت تشاتام الرسمي", "JDT": "توقيت اليابان الصيفي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "WIT": "توقيت شرق إندونيسيا", "WAT": "توقيت غرب أفريقيا الرسمي", "AKDT": "توقيت ألاسكا الصيفي", "SAST": "توقيت جنوب أفريقيا", "CAT": "توقيت وسط أفريقيا", "SGT": "توقيت سنغافورة", "GMT": "توقيت غرينتش", "MESZ": "توقيت وسط أوروبا الصيفي", "WAST": "توقيت غرب أفريقيا الصيفي", "∅∅∅": "توقيت برازيليا الصيفي", "ECT": "توقيت الإكوادور", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "MEZ": "توقيت وسط أوروبا الرسمي", "AKST": "التوقيت الرسمي لألاسكا", "PDT": "توقيت المحيط الهادي الصيفي", "WEZ": "توقيت غرب أوروبا الرسمي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "HAST": "توقيت هاواي ألوتيان الرسمي", "ChST": "توقيت تشامورو", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "VET": "توقيت فنزويلا", "BOT": "توقيت بوليفيا", "TMT": "توقيت تركمانستان الرسمي", "WESZ": "توقيت غرب أوروبا الصيفي", "LHST": "توقيت لورد هاو الرسمي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "PST": "توقيت المحيط الهادي الرسمي", "AEDT": "توقيت شرق أستراليا الصيفي", "GYT": "توقيت غيانا", "OESZ": "توقيت شرق أوروبا الصيفي", "MYT": "توقيت ماليزيا", "GFT": "توقيت غايانا الفرنسية", "JST": "توقيت اليابان الرسمي", "AWST": "توقيت غرب أستراليا الرسمي", "OEZ": "توقيت شرق أوروبا الرسمي", "BT": "توقيت بوتان", "SRT": "توقيت سورينام", "HKT": "توقيت هونغ كونغ الرسمي", "AWDT": "توقيت غرب أستراليا الصيفي", "HAT": "توقيت نيوفاوندلاند الصيفي", "NZST": "توقيت نيوزيلندا الرسمي", "WIB": "توقيت غرب إندونيسيا", "UYST": "توقيت أورغواي الصيفي", "LHDT": "التوقيت الصيفي للورد هاو", "ACST": "توقيت وسط أستراليا الرسمي", "AST": "التوقيت الرسمي الأطلسي", "ADT": "التوقيت الصيفي الأطلسي", "ARST": "توقيت الأرجنتين الصيفي", "HADT": "توقيت هاواي ألوتيان الصيفي", "COT": "توقيت كولومبيا الرسمي", "UYT": "توقيت أورغواي الرسمي", "ACDT": "توقيت وسط أستراليا الصيفي", "HKST": "توقيت هونغ كونغ الصيفي", "CHADT": "توقيت تشاتام الصيفي", "ART": "توقيت الأرجنتين الرسمي", "COST": "توقيت كولومبيا الصيفي", "TMST": "توقيت تركمانستان الصيفي", "CLST": "توقيت شيلي الصيفي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "NZDT": "توقيت نيوزيلندا الصيفي", "IST": "توقيت الهند", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية", "WART": "توقيت غرب الأرجنتين الرسمي", "WITA": "توقيت وسط إندونيسيا", "AEST": "توقيت شرق أستراليا الرسمي", "CLT": "توقيت شيلي الرسمي", "HNT": "توقيت نيوفاوندلاند الرسمي"},
}
}
diff --git a/ar/ar_test.go b/ar/ar_test.go
new file mode 100644
index 00000000..b9d28aca
--- /dev/null
+++ b/ar/ar_test.go
@@ -0,0 +1,1120 @@
+package ar
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ar_001/ar_001.go b/ar_001/ar_001.go
index 14979b47..627aba31 100644
--- a/ar_001/ar_001.go
+++ b/ar_001/ar_001.go
@@ -47,7 +47,7 @@ func New() locales.Translator {
locale: "ar_001",
pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
pluralsOrdinal: []locales.PluralRule{6},
- pluralsRange: []locales.PluralRule{4, 5, 6, 1},
+ pluralsRange: []locales.PluralRule{1, 4, 5, 6},
decimal: "٫",
group: "٬",
minus: "‏-",
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"", ""},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"AKDT": "توقيت ألاسكا الصيفي", "AWST": "توقيت غرب أستراليا الرسمي", "CHAST": "توقيت تشاتام الرسمي", "EAT": "توقيت شرق أفريقيا", "JDT": "توقيت اليابان الصيفي", "AKST": "التوقيت الرسمي لألاسكا", "SAST": "توقيت جنوب أفريقيا", "MYT": "توقيت ماليزيا", "TMST": "توقيت تركمانستان الصيفي", "UYST": "توقيت أورغواي الصيفي", "MEZ": "توقيت وسط أوروبا الرسمي", "NZST": "توقيت نيوزيلندا الرسمي", "AEST": "توقيت شرق أستراليا الرسمي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "HAST": "توقيت هاواي ألوتيان الرسمي", "HKST": "توقيت هونغ كونغ الصيفي", "GYT": "توقيت غيانا", "CAT": "توقيت وسط أفريقيا", "GFT": "توقيت غايانا الفرنسية", "OESZ": "توقيت شرق أوروبا الصيفي", "AWDT": "توقيت غرب أستراليا الصيفي", "CLT": "توقيت شيلي الرسمي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "ADT": "التوقيت الصيفي الأطلسي", "WAT": "توقيت غرب أفريقيا الرسمي", "LHST": "توقيت لورد هاو الرسمي", "BOT": "توقيت بوليفيا", "ChST": "توقيت تشامورو", "IST": "توقيت الهند", "GMT": "توقيت غرينتش", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "LHDT": "التوقيت الصيفي للورد هاو", "MESZ": "توقيت وسط أوروبا الصيفي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "HNT": "توقيت نيوفاوندلاند الرسمي", "CLST": "توقيت شيلي الصيفي", "WITA": "توقيت وسط إندونيسيا", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "∅∅∅": "∅∅∅", "BT": "توقيت بوتان", "PDT": "توقيت المحيط الهادي الصيفي", "ECT": "توقيت الإكوادور", "CHADT": "توقيت تشاتام الصيفي", "COT": "توقيت كولومبيا الرسمي", "AST": "التوقيت الرسمي الأطلسي", "PST": "توقيت المحيط الهادي الرسمي", "ACDT": "توقيت وسط أستراليا الصيفي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "NZDT": "توقيت نيوزيلندا الصيفي", "WIB": "توقيت غرب إندونيسيا", "ACST": "توقيت وسط أستراليا الرسمي", "HKT": "توقيت هونغ كونغ الرسمي", "OEZ": "توقيت شرق أوروبا الرسمي", "TMT": "توقيت تركمانستان الرسمي", "MDT": "MDT", "ART": "توقيت الأرجنتين الرسمي", "SRT": "توقيت سورينام", "SGT": "توقيت سنغافورة", "WARST": "توقيت غرب الأرجنتين الصيفي", "COST": "توقيت كولومبيا الصيفي", "JST": "توقيت اليابان الرسمي", "UYT": "توقيت أورغواي الرسمي", "HADT": "توقيت هاواي ألوتيان الصيفي", "WAST": "توقيت غرب أفريقيا الصيفي", "WEZ": "توقيت غرب أوروبا الرسمي", "AEDT": "توقيت شرق أستراليا الصيفي", "WIT": "توقيت شرق إندونيسيا", "VET": "توقيت فنزويلا", "MST": "MST", "ARST": "توقيت الأرجنتين الصيفي", "WESZ": "توقيت غرب أوروبا الصيفي", "WART": "توقيت غرب الأرجنتين الرسمي", "HAT": "توقيت نيوفاوندلاند الصيفي"},
+ timezones: map[string]string{"TMT": "توقيت تركمانستان الرسمي", "WESZ": "توقيت غرب أوروبا الصيفي", "GYT": "توقيت غيانا", "AKDT": "توقيت ألاسكا الصيفي", "PST": "توقيت المحيط الهادي الرسمي", "WAST": "توقيت غرب أفريقيا الصيفي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "AWDT": "توقيت غرب أستراليا الصيفي", "MESZ": "توقيت وسط أوروبا الصيفي", "HAT": "توقيت نيوفاوندلاند الصيفي", "EAT": "توقيت شرق أفريقيا", "ADT": "التوقيت الصيفي الأطلسي", "HADT": "توقيت هاواي ألوتيان الصيفي", "ChST": "توقيت تشامورو", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية", "MYT": "توقيت ماليزيا", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "AST": "التوقيت الرسمي الأطلسي", "WIB": "توقيت غرب إندونيسيا", "CLT": "توقيت شيلي الرسمي", "GFT": "توقيت غايانا الفرنسية", "HNT": "توقيت نيوفاوندلاند الرسمي", "AEDT": "توقيت شرق أستراليا الصيفي", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "CHAST": "توقيت تشاتام الرسمي", "IST": "توقيت الهند", "GMT": "توقيت غرينتش", "UYT": "توقيت أورغواي الرسمي", "CHADT": "توقيت تشاتام الصيفي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "JDT": "توقيت اليابان الصيفي", "WEZ": "توقيت غرب أوروبا الرسمي", "COST": "توقيت كولومبيا الصيفي", "ACDT": "توقيت وسط أستراليا الصيفي", "AWST": "توقيت غرب أستراليا الرسمي", "ART": "توقيت الأرجنتين الرسمي", "HAST": "توقيت هاواي ألوتيان الرسمي", "HKST": "توقيت هونغ كونغ الصيفي", "BOT": "توقيت بوليفيا", "ACST": "توقيت وسط أستراليا الرسمي", "ECT": "توقيت الإكوادور", "VET": "توقيت فنزويلا", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "AEST": "توقيت شرق أستراليا الرسمي", "LHDT": "التوقيت الصيفي للورد هاو", "CLST": "توقيت شيلي الصيفي", "WART": "توقيت غرب الأرجنتين الرسمي", "TMST": "توقيت تركمانستان الصيفي", "CAT": "توقيت وسط أفريقيا", "WAT": "توقيت غرب أفريقيا الرسمي", "SGT": "توقيت سنغافورة", "WARST": "توقيت غرب الأرجنتين الصيفي", "AKST": "التوقيت الرسمي لألاسكا", "SAST": "توقيت جنوب أفريقيا", "MEZ": "توقيت وسط أوروبا الرسمي", "SRT": "توقيت سورينام", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "PDT": "توقيت المحيط الهادي الصيفي", "NZDT": "توقيت نيوزيلندا الصيفي", "OESZ": "توقيت شرق أوروبا الصيفي", "WIT": "توقيت شرق إندونيسيا", "HKT": "توقيت هونغ كونغ الرسمي", "LHST": "توقيت لورد هاو الرسمي", "ARST": "توقيت الأرجنتين الصيفي", "WITA": "توقيت وسط إندونيسيا", "JST": "توقيت اليابان الرسمي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "∅∅∅": "توقيت الأمازون الصيفي", "COT": "توقيت كولومبيا الرسمي", "OEZ": "توقيت شرق أوروبا الرسمي", "NZST": "توقيت نيوزيلندا الرسمي", "BT": "توقيت بوتان", "UYST": "توقيت أورغواي الصيفي"},
}
}
diff --git a/ar_001/ar_001_test.go b/ar_001/ar_001_test.go
new file mode 100644
index 00000000..cdd4cb34
--- /dev/null
+++ b/ar_001/ar_001_test.go
@@ -0,0 +1,1120 @@
+package ar_001
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_001"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ar_AE/ar_AE.go b/ar_AE/ar_AE.go
index 6037245f..e1b9f179 100644
--- a/ar_AE/ar_AE.go
+++ b/ar_AE/ar_AE.go
@@ -47,7 +47,7 @@ func New() locales.Translator {
locale: "ar_AE",
pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
pluralsOrdinal: []locales.PluralRule{6},
- pluralsRange: []locales.PluralRule{1, 4, 5, 6},
+ pluralsRange: []locales.PluralRule{4, 5, 6, 1},
decimal: "٫",
group: "٬",
minus: "‏-",
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"", ""},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"UYT": "توقيت أورغواي الرسمي", "HKST": "توقيت هونغ كونغ الصيفي", "GMT": "توقيت غرينتش", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "MYT": "توقيت ماليزيا", "BT": "توقيت بوتان", "WIB": "توقيت غرب إندونيسيا", "HNT": "توقيت نيوفاوندلاند الرسمي", "UYST": "توقيت أورغواي الصيفي", "CLST": "توقيت شيلي الصيفي", "WEZ": "توقيت غرب أوروبا الرسمي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "WARST": "توقيت غرب الأرجنتين الصيفي", "WAST": "توقيت غرب أفريقيا الصيفي", "HAT": "توقيت نيوفاوندلاند الصيفي", "COST": "توقيت كولومبيا الصيفي", "AEST": "توقيت شرق أستراليا الرسمي", "CAT": "توقيت وسط أفريقيا", "HAST": "توقيت هاواي ألوتيان الرسمي", "SGT": "توقيت سنغافورة", "GYT": "توقيت غيانا", "CHAST": "توقيت تشاتام الرسمي", "CLT": "توقيت شيلي الرسمي", "WESZ": "توقيت غرب أوروبا الصيفي", "WIT": "توقيت شرق إندونيسيا", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "ACST": "توقيت وسط أستراليا الرسمي", "ART": "توقيت الأرجنتين الرسمي", "ARST": "توقيت الأرجنتين الصيفي", "AKDT": "توقيت ألاسكا الصيفي", "MEZ": "توقيت وسط أوروبا الرسمي", "VET": "توقيت فنزويلا", "OEZ": "توقيت شرق أوروبا الرسمي", "MST": "MST", "AEDT": "توقيت شرق أستراليا الصيفي", "MDT": "MDT", "LHDT": "التوقيت الصيفي للورد هاو", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "ADT": "التوقيت الصيفي الأطلسي", "SAST": "توقيت جنوب أفريقيا", "TMST": "توقيت تركمانستان الصيفي", "HKT": "توقيت هونغ كونغ الرسمي", "IST": "توقيت الهند", "∅∅∅": "توقيت الأمازون الصيفي", "PDT": "توقيت المحيط الهادي الصيفي", "AWST": "توقيت غرب أستراليا الرسمي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "WART": "توقيت غرب الأرجنتين الرسمي", "WAT": "توقيت غرب أفريقيا الرسمي", "ECT": "توقيت الإكوادور", "AST": "التوقيت الرسمي الأطلسي", "JDT": "توقيت اليابان الصيفي", "AKST": "التوقيت الرسمي لألاسكا", "NZDT": "توقيت نيوزيلندا الصيفي", "CHADT": "توقيت تشاتام الصيفي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "ChST": "توقيت تشامورو", "EAT": "توقيت شرق أفريقيا", "ACDT": "توقيت وسط أستراليا الصيفي", "HADT": "توقيت هاواي ألوتيان الصيفي", "PST": "توقيت المحيط الهادي الرسمي", "OESZ": "توقيت شرق أوروبا الصيفي", "SRT": "توقيت سورينام", "AWDT": "توقيت غرب أستراليا الصيفي", "COT": "توقيت كولومبيا الرسمي", "LHST": "توقيت لورد هاو الرسمي", "MESZ": "توقيت وسط أوروبا الصيفي", "BOT": "توقيت بوليفيا", "WITA": "توقيت وسط إندونيسيا", "JST": "توقيت اليابان الرسمي", "NZST": "توقيت نيوزيلندا الرسمي", "GFT": "توقيت غايانا الفرنسية", "TMT": "توقيت تركمانستان الرسمي"},
+ timezones: map[string]string{"MESZ": "توقيت وسط أوروبا الصيفي", "GMT": "توقيت غرينتش", "AEDT": "توقيت شرق أستراليا الصيفي", "EAT": "توقيت شرق أفريقيا", "AST": "التوقيت الرسمي الأطلسي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "ACDT": "توقيت وسط أستراليا الصيفي", "GFT": "توقيت غايانا الفرنسية", "NZST": "توقيت نيوزيلندا الرسمي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "AEST": "توقيت شرق أستراليا الرسمي", "CHADT": "توقيت تشاتام الصيفي", "BOT": "توقيت بوليفيا", "PST": "توقيت المحيط الهادي الرسمي", "HAST": "توقيت هاواي ألوتيان الرسمي", "COT": "توقيت كولومبيا الرسمي", "HKST": "توقيت هونغ كونغ الصيفي", "VET": "توقيت فنزويلا", "ARST": "توقيت الأرجنتين الصيفي", "WITA": "توقيت وسط إندونيسيا", "IST": "توقيت الهند", "WAT": "توقيت غرب أفريقيا الرسمي", "SGT": "توقيت سنغافورة", "OESZ": "توقيت شرق أوروبا الصيفي", "GYT": "توقيت غيانا", "WART": "توقيت غرب الأرجنتين الرسمي", "AWST": "توقيت غرب أستراليا الرسمي", "CHAST": "توقيت تشاتام الرسمي", "AKST": "التوقيت الرسمي لألاسكا", "ADT": "التوقيت الصيفي الأطلسي", "SAST": "توقيت جنوب أفريقيا", "PDT": "توقيت المحيط الهادي الصيفي", "∅∅∅": "توقيت الأمازون الصيفي", "WEZ": "توقيت غرب أوروبا الرسمي", "UYT": "توقيت أورغواي الرسمي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "HADT": "توقيت هاواي ألوتيان الصيفي", "ACST": "توقيت وسط أستراليا الرسمي", "ECT": "توقيت الإكوادور", "NZDT": "توقيت نيوزيلندا الصيفي", "MEZ": "توقيت وسط أوروبا الرسمي", "CAT": "توقيت وسط أفريقيا", "HNT": "توقيت نيوفاوندلاند الرسمي", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "LHDT": "التوقيت الصيفي للورد هاو", "ART": "توقيت الأرجنتين الرسمي", "UYST": "توقيت أورغواي الصيفي", "JDT": "توقيت اليابان الصيفي", "COST": "توقيت كولومبيا الصيفي", "AWDT": "توقيت غرب أستراليا الصيفي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "OEZ": "توقيت شرق أوروبا الرسمي", "WIT": "توقيت شرق إندونيسيا", "WARST": "توقيت غرب الأرجنتين الصيفي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "WIB": "توقيت غرب إندونيسيا", "WESZ": "توقيت غرب أوروبا الصيفي", "ChST": "توقيت تشامورو", "MYT": "توقيت ماليزيا", "JST": "توقيت اليابان الرسمي", "TMT": "توقيت تركمانستان الرسمي", "HAT": "توقيت نيوفاوندلاند الصيفي", "BT": "توقيت بوتان", "AKDT": "توقيت ألاسكا الصيفي", "TMST": "توقيت تركمانستان الصيفي", "WAST": "توقيت غرب أفريقيا الصيفي", "LHST": "توقيت لورد هاو الرسمي", "CLT": "توقيت شيلي الرسمي", "CLST": "توقيت شيلي الصيفي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "SRT": "توقيت سورينام", "HKT": "توقيت هونغ كونغ الرسمي"},
}
}
diff --git a/ar_AE/ar_AE_test.go b/ar_AE/ar_AE_test.go
new file mode 100644
index 00000000..420d048a
--- /dev/null
+++ b/ar_AE/ar_AE_test.go
@@ -0,0 +1,1120 @@
+package ar_AE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_AE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ar_BH/ar_BH.go b/ar_BH/ar_BH.go
index f9603d1b..104ad35b 100644
--- a/ar_BH/ar_BH.go
+++ b/ar_BH/ar_BH.go
@@ -47,7 +47,7 @@ func New() locales.Translator {
locale: "ar_BH",
pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
pluralsOrdinal: []locales.PluralRule{6},
- pluralsRange: []locales.PluralRule{6, 1, 4, 5},
+ pluralsRange: []locales.PluralRule{1, 4, 5, 6},
decimal: "٫",
group: "٬",
minus: "‏-",
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"", ""},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"AWDT": "توقيت غرب أستراليا الصيفي", "JDT": "توقيت اليابان الصيفي", "BOT": "توقيت بوليفيا", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "TMT": "توقيت تركمانستان الرسمي", "HKT": "توقيت هونغ كونغ الرسمي", "TMST": "توقيت تركمانستان الصيفي", "PST": "توقيت المحيط الهادي الرسمي", "MYT": "توقيت ماليزيا", "NZDT": "توقيت نيوزيلندا الصيفي", "HAST": "توقيت هاواي ألوتيان الرسمي", "OESZ": "توقيت شرق أوروبا الصيفي", "UYT": "توقيت أورغواي الرسمي", "VET": "توقيت فنزويلا", "ADT": "التوقيت الصيفي الأطلسي", "LHST": "توقيت لورد هاو الرسمي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "ARST": "توقيت الأرجنتين الصيفي", "SGT": "توقيت سنغافورة", "WIT": "توقيت شرق إندونيسيا", "EAT": "توقيت شرق أفريقيا", "ACST": "توقيت وسط أستراليا الرسمي", "ART": "توقيت الأرجنتين الرسمي", "GYT": "توقيت غيانا", "CHAST": "توقيت تشاتام الرسمي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "HNT": "توقيت نيوفاوندلاند الرسمي", "WESZ": "توقيت غرب أوروبا الصيفي", "∅∅∅": "توقيت برازيليا الصيفي", "UYST": "توقيت أورغواي الصيفي", "LHDT": "التوقيت الصيفي للورد هاو", "HKST": "توقيت هونغ كونغ الصيفي", "SRT": "توقيت سورينام", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "AEST": "توقيت شرق أستراليا الرسمي", "ECT": "توقيت الإكوادور", "WAT": "توقيت غرب أفريقيا الرسمي", "GFT": "توقيت غايانا الفرنسية", "WEZ": "توقيت غرب أوروبا الرسمي", "SAST": "توقيت جنوب أفريقيا", "WITA": "توقيت وسط إندونيسيا", "MEZ": "توقيت وسط أوروبا الرسمي", "MESZ": "توقيت وسط أوروبا الصيفي", "ChST": "توقيت تشامورو", "COT": "توقيت كولومبيا الرسمي", "WAST": "توقيت غرب أفريقيا الصيفي", "CLT": "توقيت شيلي الرسمي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "WIB": "توقيت غرب إندونيسيا", "COST": "توقيت كولومبيا الصيفي", "WART": "توقيت غرب الأرجنتين الرسمي", "HAT": "توقيت نيوفاوندلاند الصيفي", "MST": "MST", "AKDT": "توقيت ألاسكا الصيفي", "AWST": "توقيت غرب أستراليا الرسمي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "CHADT": "توقيت تشاتام الصيفي", "AST": "التوقيت الرسمي الأطلسي", "GMT": "توقيت غرينتش", "MDT": "MDT", "PDT": "توقيت المحيط الهادي الصيفي", "WARST": "توقيت غرب الأرجنتين الصيفي", "IST": "توقيت الهند", "OEZ": "توقيت شرق أوروبا الرسمي", "AKST": "التوقيت الرسمي لألاسكا", "NZST": "توقيت نيوزيلندا الرسمي", "AEDT": "توقيت شرق أستراليا الصيفي", "CAT": "توقيت وسط أفريقيا", "BT": "توقيت بوتان", "ACDT": "توقيت وسط أستراليا الصيفي", "JST": "توقيت اليابان الرسمي", "CLST": "توقيت شيلي الصيفي", "HADT": "توقيت هاواي ألوتيان الصيفي"},
+ timezones: map[string]string{"ART": "توقيت الأرجنتين الرسمي", "SAST": "توقيت جنوب أفريقيا", "AKST": "التوقيت الرسمي لألاسكا", "BOT": "توقيت بوليفيا", "WAST": "توقيت غرب أفريقيا الصيفي", "MYT": "توقيت ماليزيا", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "MEZ": "توقيت وسط أوروبا الرسمي", "PST": "توقيت المحيط الهادي الرسمي", "WIB": "توقيت غرب إندونيسيا", "OEZ": "توقيت شرق أوروبا الرسمي", "ChST": "توقيت تشامورو", "ADT": "التوقيت الصيفي الأطلسي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "ARST": "توقيت الأرجنتين الصيفي", "AWDT": "توقيت غرب أستراليا الصيفي", "CLST": "توقيت شيلي الصيفي", "WIT": "توقيت شرق إندونيسيا", "GMT": "توقيت غرينتش", "AEST": "توقيت شرق أستراليا الرسمي", "WARST": "توقيت غرب الأرجنتين الصيفي", "WEZ": "توقيت غرب أوروبا الرسمي", "HADT": "توقيت هاواي ألوتيان الصيفي", "WESZ": "توقيت غرب أوروبا الصيفي", "UYST": "توقيت أورغواي الصيفي", "LHDT": "التوقيت الصيفي للورد هاو", "WART": "توقيت غرب الأرجنتين الرسمي", "AWST": "توقيت غرب أستراليا الرسمي", "NZDT": "توقيت نيوزيلندا الصيفي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "SGT": "توقيت سنغافورة", "COST": "توقيت كولومبيا الصيفي", "LHST": "توقيت لورد هاو الرسمي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "CAT": "توقيت وسط أفريقيا", "GYT": "توقيت غيانا", "HKST": "توقيت هونغ كونغ الصيفي", "ECT": "توقيت الإكوادور", "TMT": "توقيت تركمانستان الرسمي", "WAT": "توقيت غرب أفريقيا الرسمي", "EAT": "توقيت شرق أفريقيا", "SRT": "توقيت سورينام", "HAST": "توقيت هاواي ألوتيان الرسمي", "HAT": "توقيت نيوفاوندلاند الصيفي", "IST": "توقيت الهند", "GFT": "توقيت غايانا الفرنسية", "VET": "توقيت فنزويلا", "MESZ": "توقيت وسط أوروبا الصيفي", "UYT": "توقيت أورغواي الرسمي", "BT": "توقيت بوتان", "CHADT": "توقيت تشاتام الصيفي", "WITA": "توقيت وسط إندونيسيا", "JST": "توقيت اليابان الرسمي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "AEDT": "توقيت شرق أستراليا الصيفي", "ACDT": "توقيت وسط أستراليا الصيفي", "HKT": "توقيت هونغ كونغ الرسمي", "ACST": "توقيت وسط أستراليا الرسمي", "JDT": "توقيت اليابان الصيفي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "NZST": "توقيت نيوزيلندا الرسمي", "PDT": "توقيت المحيط الهادي الصيفي", "COT": "توقيت كولومبيا الرسمي", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "∅∅∅": "توقيت برازيليا الصيفي", "OESZ": "توقيت شرق أوروبا الصيفي", "CHAST": "توقيت تشاتام الرسمي", "AKDT": "توقيت ألاسكا الصيفي", "AST": "التوقيت الرسمي الأطلسي", "TMST": "توقيت تركمانستان الصيفي", "HNT": "توقيت نيوفاوندلاند الرسمي", "CLT": "توقيت شيلي الرسمي", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية"},
}
}
diff --git a/ar_BH/ar_BH_test.go b/ar_BH/ar_BH_test.go
new file mode 100644
index 00000000..0a907551
--- /dev/null
+++ b/ar_BH/ar_BH_test.go
@@ -0,0 +1,1120 @@
+package ar_BH
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_BH"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ar_DJ/ar_DJ.go b/ar_DJ/ar_DJ.go
index 8a6ef9cd..71a73037 100644
--- a/ar_DJ/ar_DJ.go
+++ b/ar_DJ/ar_DJ.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"", ""},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"ART": "توقيت الأرجنتين الرسمي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "ECT": "توقيت الإكوادور", "WARST": "توقيت غرب الأرجنتين الصيفي", "GMT": "توقيت غرينتش", "MST": "MST", "SAST": "توقيت جنوب أفريقيا", "HNT": "توقيت نيوفاوندلاند الرسمي", "MDT": "MDT", "AKDT": "توقيت ألاسكا الصيفي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "NZDT": "توقيت نيوزيلندا الصيفي", "AEST": "توقيت شرق أستراليا الرسمي", "IST": "توقيت الهند", "NZST": "توقيت نيوزيلندا الرسمي", "WESZ": "توقيت غرب أوروبا الصيفي", "ChST": "توقيت تشامورو", "AST": "التوقيت الرسمي الأطلسي", "WAT": "توقيت غرب أفريقيا الرسمي", "AWST": "توقيت غرب أستراليا الرسمي", "MESZ": "توقيت وسط أوروبا الصيفي", "HADT": "توقيت هاواي ألوتيان الصيفي", "HAT": "توقيت نيوفاوندلاند الصيفي", "GFT": "توقيت غايانا الفرنسية", "SRT": "توقيت سورينام", "PDT": "توقيت المحيط الهادي الصيفي", "LHDT": "التوقيت الصيفي للورد هاو", "MYT": "توقيت ماليزيا", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "COST": "توقيت كولومبيا الصيفي", "∅∅∅": "توقيت الأمازون الصيفي", "AKST": "التوقيت الرسمي لألاسكا", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "HAST": "توقيت هاواي ألوتيان الرسمي", "WIB": "توقيت غرب إندونيسيا", "ACST": "توقيت وسط أستراليا الرسمي", "WEZ": "توقيت غرب أوروبا الرسمي", "CHAST": "توقيت تشاتام الرسمي", "OEZ": "توقيت شرق أوروبا الرسمي", "EAT": "توقيت شرق أفريقيا", "TMST": "توقيت تركمانستان الصيفي", "MEZ": "توقيت وسط أوروبا الرسمي", "AEDT": "توقيت شرق أستراليا الصيفي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "UYST": "توقيت أورغواي الصيفي", "CLT": "توقيت شيلي الرسمي", "CLST": "توقيت شيلي الصيفي", "CAT": "توقيت وسط أفريقيا", "COT": "توقيت كولومبيا الرسمي", "WAST": "توقيت غرب أفريقيا الصيفي", "WIT": "توقيت شرق إندونيسيا", "ADT": "التوقيت الصيفي الأطلسي", "HKT": "توقيت هونغ كونغ الرسمي", "WART": "توقيت غرب الأرجنتين الرسمي", "OESZ": "توقيت شرق أوروبا الصيفي", "JDT": "توقيت اليابان الصيفي", "LHST": "توقيت لورد هاو الرسمي", "GYT": "توقيت غيانا", "SGT": "توقيت سنغافورة", "ACDT": "توقيت وسط أستراليا الصيفي", "ARST": "توقيت الأرجنتين الصيفي", "UYT": "توقيت أورغواي الرسمي", "VET": "توقيت فنزويلا", "HKST": "توقيت هونغ كونغ الصيفي", "JST": "توقيت اليابان الرسمي", "BT": "توقيت بوتان", "WITA": "توقيت وسط إندونيسيا", "TMT": "توقيت تركمانستان الرسمي", "PST": "توقيت المحيط الهادي الرسمي", "AWDT": "توقيت غرب أستراليا الصيفي", "BOT": "توقيت بوليفيا", "CHADT": "توقيت تشاتام الصيفي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية"},
+ timezones: map[string]string{"AEST": "توقيت شرق أستراليا الرسمي", "ChST": "توقيت تشامورو", "CLT": "توقيت شيلي الرسمي", "VET": "توقيت فنزويلا", "SGT": "توقيت سنغافورة", "COST": "توقيت كولومبيا الصيفي", "TMT": "توقيت تركمانستان الرسمي", "HNT": "توقيت نيوفاوندلاند الرسمي", "ECT": "توقيت الإكوادور", "GYT": "توقيت غيانا", "MYT": "توقيت ماليزيا", "EAT": "توقيت شرق أفريقيا", "HKST": "توقيت هونغ كونغ الصيفي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "HAT": "توقيت نيوفاوندلاند الصيفي", "AEDT": "توقيت شرق أستراليا الصيفي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "HADT": "توقيت هاواي ألوتيان الصيفي", "WESZ": "توقيت غرب أوروبا الصيفي", "WAT": "توقيت غرب أفريقيا الرسمي", "MDT": "MDT", "PDT": "توقيت المحيط الهادي الصيفي", "MEZ": "توقيت وسط أوروبا الرسمي", "HAST": "توقيت هاواي ألوتيان الرسمي", "ADT": "التوقيت الصيفي الأطلسي", "BOT": "توقيت بوليفيا", "WEZ": "توقيت غرب أوروبا الرسمي", "CAT": "توقيت وسط أفريقيا", "CHADT": "توقيت تشاتام الصيفي", "AKDT": "توقيت ألاسكا الصيفي", "WART": "توقيت غرب الأرجنتين الرسمي", "SRT": "توقيت سورينام", "WAST": "توقيت غرب أفريقيا الصيفي", "UYT": "توقيت أورغواي الرسمي", "WARST": "توقيت غرب الأرجنتين الصيفي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "ARST": "توقيت الأرجنتين الصيفي", "JDT": "توقيت اليابان الصيفي", "NZST": "توقيت نيوزيلندا الرسمي", "ART": "توقيت الأرجنتين الرسمي", "NZDT": "توقيت نيوزيلندا الصيفي", "LHST": "توقيت لورد هاو الرسمي", "MST": "MST", "AST": "التوقيت الرسمي الأطلسي", "CLST": "توقيت شيلي الصيفي", "IST": "توقيت الهند", "∅∅∅": "∅∅∅", "COT": "توقيت كولومبيا الرسمي", "WIB": "توقيت غرب إندونيسيا", "AWST": "توقيت غرب أستراليا الرسمي", "AWDT": "توقيت غرب أستراليا الصيفي", "WITA": "توقيت وسط إندونيسيا", "PST": "توقيت المحيط الهادي الرسمي", "TMST": "توقيت تركمانستان الصيفي", "WIT": "توقيت شرق إندونيسيا", "ACST": "توقيت وسط أستراليا الرسمي", "GFT": "توقيت غايانا الفرنسية", "HKT": "توقيت هونغ كونغ الرسمي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "GMT": "توقيت غرينتش", "LHDT": "التوقيت الصيفي للورد هاو", "AKST": "التوقيت الرسمي لألاسكا", "MESZ": "توقيت وسط أوروبا الصيفي", "OEZ": "توقيت شرق أوروبا الرسمي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "SAST": "توقيت جنوب أفريقيا", "ACDT": "توقيت وسط أستراليا الصيفي", "UYST": "توقيت أورغواي الصيفي", "BT": "توقيت بوتان", "CHAST": "توقيت تشاتام الرسمي", "JST": "توقيت اليابان الرسمي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "OESZ": "توقيت شرق أوروبا الصيفي"},
}
}
diff --git a/ar_DJ/ar_DJ_test.go b/ar_DJ/ar_DJ_test.go
new file mode 100644
index 00000000..7a065296
--- /dev/null
+++ b/ar_DJ/ar_DJ_test.go
@@ -0,0 +1,1120 @@
+package ar_DJ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_DJ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ar_DZ/ar_DZ.go b/ar_DZ/ar_DZ.go
index fd8b3e73..e3fe29bc 100644
--- a/ar_DZ/ar_DZ.go
+++ b/ar_DZ/ar_DZ.go
@@ -47,7 +47,7 @@ func New() locales.Translator {
locale: "ar_DZ",
pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
pluralsOrdinal: []locales.PluralRule{6},
- pluralsRange: []locales.PluralRule{5, 6, 1, 4},
+ pluralsRange: []locales.PluralRule{1, 4, 5, 6},
decimal: ",",
group: ".",
minus: "‏-",
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"", ""},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"WESZ": "توقيت غرب أوروبا الصيفي", "WAT": "توقيت غرب أفريقيا الرسمي", "HKT": "توقيت هونغ كونغ الرسمي", "WART": "توقيت غرب الأرجنتين الرسمي", "OEZ": "توقيت شرق أوروبا الرسمي", "LHST": "توقيت لورد هاو الرسمي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "CAT": "توقيت وسط أفريقيا", "BOT": "توقيت بوليفيا", "COST": "توقيت كولومبيا الصيفي", "PST": "توقيت المحيط الهادي الرسمي", "GYT": "توقيت غيانا", "MYT": "توقيت ماليزيا", "JDT": "توقيت اليابان الصيفي", "AEST": "توقيت شرق أستراليا الرسمي", "AKDT": "توقيت ألاسكا الصيفي", "HNT": "توقيت نيوفاوندلاند الرسمي", "MST": "MST", "TMT": "توقيت تركمانستان الرسمي", "LHDT": "التوقيت الصيفي للورد هاو", "ADT": "التوقيت الصيفي الأطلسي", "EAT": "توقيت شرق أفريقيا", "ACDT": "توقيت وسط أستراليا الصيفي", "NZST": "توقيت نيوزيلندا الرسمي", "NZDT": "توقيت نيوزيلندا الصيفي", "ChST": "توقيت تشامورو", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "COT": "توقيت كولومبيا الرسمي", "WIT": "توقيت شرق إندونيسيا", "ART": "توقيت الأرجنتين الرسمي", "ARST": "توقيت الأرجنتين الصيفي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "CLST": "توقيت شيلي الصيفي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "MDT": "MDT", "TMST": "توقيت تركمانستان الصيفي", "UYT": "توقيت أورغواي الرسمي", "WITA": "توقيت وسط إندونيسيا", "SAST": "توقيت جنوب أفريقيا", "IST": "توقيت الهند", "VET": "توقيت فنزويلا", "SGT": "توقيت سنغافورة", "HADT": "توقيت هاواي ألوتيان الصيفي", "WAST": "توقيت غرب أفريقيا الصيفي", "SRT": "توقيت سورينام", "JST": "توقيت اليابان الرسمي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "AEDT": "توقيت شرق أستراليا الصيفي", "∅∅∅": "توقيت برازيليا الصيفي", "UYST": "توقيت أورغواي الصيفي", "BT": "توقيت بوتان", "OESZ": "توقيت شرق أوروبا الصيفي", "ACST": "توقيت وسط أستراليا الرسمي", "PDT": "توقيت المحيط الهادي الصيفي", "AWST": "توقيت غرب أستراليا الرسمي", "AWDT": "توقيت غرب أستراليا الصيفي", "WEZ": "توقيت غرب أوروبا الرسمي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "HAST": "توقيت هاواي ألوتيان الرسمي", "GMT": "توقيت غرينتش", "MEZ": "توقيت وسط أوروبا الرسمي", "WIB": "توقيت غرب إندونيسيا", "AKST": "التوقيت الرسمي لألاسكا", "CHAST": "توقيت تشاتام الرسمي", "CLT": "توقيت شيلي الرسمي", "GFT": "توقيت غايانا الفرنسية", "WARST": "توقيت غرب الأرجنتين الصيفي", "AST": "التوقيت الرسمي الأطلسي", "HKST": "توقيت هونغ كونغ الصيفي", "HAT": "توقيت نيوفاوندلاند الصيفي", "MESZ": "توقيت وسط أوروبا الصيفي", "CHADT": "توقيت تشاتام الصيفي", "ECT": "توقيت الإكوادور"},
+ timezones: map[string]string{"HKT": "توقيت هونغ كونغ الرسمي", "CHADT": "توقيت تشاتام الصيفي", "MESZ": "توقيت وسط أوروبا الصيفي", "OESZ": "توقيت شرق أوروبا الصيفي", "SRT": "توقيت سورينام", "AWST": "توقيت غرب أستراليا الرسمي", "ART": "توقيت الأرجنتين الرسمي", "MEZ": "توقيت وسط أوروبا الرسمي", "BOT": "توقيت بوليفيا", "WIB": "توقيت غرب إندونيسيا", "CHAST": "توقيت تشاتام الرسمي", "HADT": "توقيت هاواي ألوتيان الصيفي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "WEZ": "توقيت غرب أوروبا الرسمي", "∅∅∅": "توقيت الأمازون الصيفي", "OEZ": "توقيت شرق أوروبا الرسمي", "AST": "التوقيت الرسمي الأطلسي", "CLST": "توقيت شيلي الصيفي", "LHST": "توقيت لورد هاو الرسمي", "VET": "توقيت فنزويلا", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "SGT": "توقيت سنغافورة", "GMT": "توقيت غرينتش", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "PDT": "توقيت المحيط الهادي الصيفي", "WAST": "توقيت غرب أفريقيا الصيفي", "BT": "توقيت بوتان", "AKST": "التوقيت الرسمي لألاسكا", "HAST": "توقيت هاواي ألوتيان الرسمي", "COST": "توقيت كولومبيا الصيفي", "WIT": "توقيت شرق إندونيسيا", "GYT": "توقيت غيانا", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "HKST": "توقيت هونغ كونغ الصيفي", "AEDT": "توقيت شرق أستراليا الصيفي", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية", "EAT": "توقيت شرق أفريقيا", "ACST": "توقيت وسط أستراليا الرسمي", "AWDT": "توقيت غرب أستراليا الصيفي", "SAST": "توقيت جنوب أفريقيا", "TMT": "توقيت تركمانستان الرسمي", "TMST": "توقيت تركمانستان الصيفي", "AEST": "توقيت شرق أستراليا الرسمي", "UYT": "توقيت أورغواي الرسمي", "ACDT": "توقيت وسط أستراليا الصيفي", "ECT": "توقيت الإكوادور", "HNT": "توقيت نيوفاوندلاند الرسمي", "HAT": "توقيت نيوفاوندلاند الصيفي", "WESZ": "توقيت غرب أوروبا الصيفي", "JDT": "توقيت اليابان الصيفي", "CAT": "توقيت وسط أفريقيا", "MYT": "توقيت ماليزيا", "WITA": "توقيت وسط إندونيسيا", "CLT": "توقيت شيلي الرسمي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "WAT": "توقيت غرب أفريقيا الرسمي", "ChST": "توقيت تشامورو", "WART": "توقيت غرب الأرجنتين الرسمي", "ADT": "التوقيت الصيفي الأطلسي", "NZST": "توقيت نيوزيلندا الرسمي", "NZDT": "توقيت نيوزيلندا الصيفي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "AKDT": "توقيت ألاسكا الصيفي", "UYST": "توقيت أورغواي الصيفي", "GFT": "توقيت غايانا الفرنسية", "JST": "توقيت اليابان الرسمي", "LHDT": "التوقيت الصيفي للورد هاو", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "WARST": "توقيت غرب الأرجنتين الصيفي", "ARST": "توقيت الأرجنتين الصيفي", "PST": "توقيت المحيط الهادي الرسمي", "IST": "توقيت الهند", "COT": "توقيت كولومبيا الرسمي"},
}
}
diff --git a/ar_DZ/ar_DZ_test.go b/ar_DZ/ar_DZ_test.go
new file mode 100644
index 00000000..a14b6ce0
--- /dev/null
+++ b/ar_DZ/ar_DZ_test.go
@@ -0,0 +1,1120 @@
+package ar_DZ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_DZ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ar_EG/ar_EG.go b/ar_EG/ar_EG.go
index 13e43480..c121f128 100644
--- a/ar_EG/ar_EG.go
+++ b/ar_EG/ar_EG.go
@@ -47,7 +47,7 @@ func New() locales.Translator {
locale: "ar_EG",
pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
pluralsOrdinal: []locales.PluralRule{6},
- pluralsRange: []locales.PluralRule{6, 1, 4, 5},
+ pluralsRange: []locales.PluralRule{1, 4, 5, 6},
decimal: "٫",
group: "٬",
minus: "‏-",
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"", ""},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"ACST": "توقيت وسط أستراليا الرسمي", "PST": "توقيت المحيط الهادي الرسمي", "AKDT": "توقيت ألاسكا الصيفي", "WAT": "توقيت غرب أفريقيا الرسمي", "WAST": "توقيت غرب أفريقيا الصيفي", "ACDT": "توقيت وسط أستراليا الصيفي", "ChST": "توقيت تشامورو", "WEZ": "توقيت غرب أوروبا الرسمي", "ADT": "التوقيت الصيفي الأطلسي", "HKT": "توقيت هونغ كونغ الرسمي", "WART": "توقيت غرب الأرجنتين الرسمي", "∅∅∅": "توقيت الأمازون الصيفي", "AWDT": "توقيت غرب أستراليا الصيفي", "NZDT": "توقيت نيوزيلندا الصيفي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "CLT": "توقيت شيلي الرسمي", "CLST": "توقيت شيلي الصيفي", "VET": "توقيت فنزويلا", "HAT": "توقيت نيوفاوندلاند الصيفي", "TMST": "توقيت تركمانستان الصيفي", "EAT": "توقيت شرق أفريقيا", "AWST": "توقيت غرب أستراليا الرسمي", "AEDT": "توقيت شرق أستراليا الصيفي", "IST": "توقيت الهند", "TMT": "توقيت تركمانستان الرسمي", "PDT": "توقيت المحيط الهادي الصيفي", "MESZ": "توقيت وسط أوروبا الصيفي", "CHADT": "توقيت تشاتام الصيفي", "WESZ": "توقيت غرب أوروبا الصيفي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "GYT": "توقيت غيانا", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "WIB": "توقيت غرب إندونيسيا", "ECT": "توقيت الإكوادور", "WITA": "توقيت وسط إندونيسيا", "ART": "توقيت الأرجنتين الرسمي", "JDT": "توقيت اليابان الصيفي", "UYT": "توقيت أورغواي الرسمي", "AEST": "توقيت شرق أستراليا الرسمي", "CHAST": "توقيت تشاتام الرسمي", "SGT": "توقيت سنغافورة", "AST": "التوقيت الرسمي الأطلسي", "MST": "MST", "AKST": "التوقيت الرسمي لألاسكا", "BOT": "توقيت بوليفيا", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "ARST": "توقيت الأرجنتين الصيفي", "MEZ": "توقيت وسط أوروبا الرسمي", "NZST": "توقيت نيوزيلندا الرسمي", "CAT": "توقيت وسط أفريقيا", "HADT": "توقيت هاواي ألوتيان الصيفي", "UYST": "توقيت أورغواي الصيفي", "COT": "توقيت كولومبيا الرسمي", "SAST": "توقيت جنوب أفريقيا", "GFT": "توقيت غايانا الفرنسية", "LHDT": "التوقيت الصيفي للورد هاو", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "COST": "توقيت كولومبيا الصيفي", "HKST": "توقيت هونغ كونغ الصيفي", "OESZ": "توقيت شرق أوروبا الصيفي", "LHST": "توقيت لورد هاو الرسمي", "JST": "توقيت اليابان الرسمي", "HAST": "توقيت هاواي ألوتيان الرسمي", "BT": "توقيت بوتان", "WARST": "توقيت غرب الأرجنتين الصيفي", "GMT": "توقيت غرينتش", "SRT": "توقيت سورينام", "OEZ": "توقيت شرق أوروبا الرسمي", "HNT": "توقيت نيوفاوندلاند الرسمي", "WIT": "توقيت شرق إندونيسيا", "MDT": "MDT", "MYT": "توقيت ماليزيا"},
+ timezones: map[string]string{"GMT": "توقيت غرينتش", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية", "ACDT": "توقيت وسط أستراليا الصيفي", "GYT": "توقيت غيانا", "CLT": "توقيت شيلي الرسمي", "HKT": "توقيت هونغ كونغ الرسمي", "PDT": "توقيت المحيط الهادي الصيفي", "SAST": "توقيت جنوب أفريقيا", "COT": "توقيت كولومبيا الرسمي", "HKST": "توقيت هونغ كونغ الصيفي", "JDT": "توقيت اليابان الصيفي", "ADT": "التوقيت الصيفي الأطلسي", "PST": "توقيت المحيط الهادي الرسمي", "HNT": "توقيت نيوفاوندلاند الرسمي", "WAST": "توقيت غرب أفريقيا الصيفي", "OESZ": "توقيت شرق أوروبا الصيفي", "GFT": "توقيت غايانا الفرنسية", "CHADT": "توقيت تشاتام الصيفي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "ARST": "توقيت الأرجنتين الصيفي", "WEZ": "توقيت غرب أوروبا الرسمي", "WITA": "توقيت وسط إندونيسيا", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "COST": "توقيت كولومبيا الصيفي", "TMST": "توقيت تركمانستان الصيفي", "OEZ": "توقيت شرق أوروبا الرسمي", "WIT": "توقيت شرق إندونيسيا", "∅∅∅": "توقيت برازيليا الصيفي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "WAT": "توقيت غرب أفريقيا الرسمي", "AEDT": "توقيت شرق أستراليا الصيفي", "BT": "توقيت بوتان", "ACST": "توقيت وسط أستراليا الرسمي", "SGT": "توقيت سنغافورة", "MYT": "توقيت ماليزيا", "LHDT": "التوقيت الصيفي للورد هاو", "JST": "توقيت اليابان الرسمي", "HAST": "توقيت هاواي ألوتيان الرسمي", "HADT": "توقيت هاواي ألوتيان الصيفي", "CLST": "توقيت شيلي الصيفي", "AKDT": "توقيت ألاسكا الصيفي", "IST": "توقيت الهند", "TMT": "توقيت تركمانستان الرسمي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "CHAST": "توقيت تشاتام الرسمي", "ECT": "توقيت الإكوادور", "WESZ": "توقيت غرب أوروبا الصيفي", "AWST": "توقيت غرب أستراليا الرسمي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "MESZ": "توقيت وسط أوروبا الصيفي", "NZDT": "توقيت نيوزيلندا الصيفي", "EAT": "توقيت شرق أفريقيا", "WARST": "توقيت غرب الأرجنتين الصيفي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "VET": "توقيت فنزويلا", "CAT": "توقيت وسط أفريقيا", "AEST": "توقيت شرق أستراليا الرسمي", "WART": "توقيت غرب الأرجنتين الرسمي", "SRT": "توقيت سورينام", "AWDT": "توقيت غرب أستراليا الصيفي", "NZST": "توقيت نيوزيلندا الرسمي", "WIB": "توقيت غرب إندونيسيا", "UYT": "توقيت أورغواي الرسمي", "UYST": "توقيت أورغواي الصيفي", "AKST": "التوقيت الرسمي لألاسكا", "MEZ": "توقيت وسط أوروبا الرسمي", "LHST": "توقيت لورد هاو الرسمي", "ART": "توقيت الأرجنتين الرسمي", "HAT": "توقيت نيوفاوندلاند الصيفي", "ChST": "توقيت تشامورو", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "AST": "التوقيت الرسمي الأطلسي", "BOT": "توقيت بوليفيا"},
}
}
diff --git a/ar_EG/ar_EG_test.go b/ar_EG/ar_EG_test.go
new file mode 100644
index 00000000..9bc3a93d
--- /dev/null
+++ b/ar_EG/ar_EG_test.go
@@ -0,0 +1,1120 @@
+package ar_EG
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_EG"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ar_EH/ar_EH.go b/ar_EH/ar_EH.go
index f2ac57f2..291e6afb 100644
--- a/ar_EH/ar_EH.go
+++ b/ar_EH/ar_EH.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"", ""},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"BT": "توقيت بوتان", "AWST": "توقيت غرب أستراليا الرسمي", "MEZ": "توقيت وسط أوروبا الرسمي", "WESZ": "توقيت غرب أوروبا الصيفي", "HAST": "توقيت هاواي ألوتيان الرسمي", "ECT": "توقيت الإكوادور", "AST": "التوقيت الرسمي الأطلسي", "IST": "توقيت الهند", "HAT": "توقيت نيوفاوندلاند الصيفي", "AKST": "التوقيت الرسمي لألاسكا", "WEZ": "توقيت غرب أوروبا الرسمي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "NZDT": "توقيت نيوزيلندا الصيفي", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية", "SRT": "توقيت سورينام", "NZST": "توقيت نيوزيلندا الرسمي", "BOT": "توقيت بوليفيا", "HADT": "توقيت هاواي ألوتيان الصيفي", "GFT": "توقيت غايانا الفرنسية", "ACDT": "توقيت وسط أستراليا الصيفي", "CHADT": "توقيت تشاتام الصيفي", "AEDT": "توقيت شرق أستراليا الصيفي", "LHST": "توقيت لورد هاو الرسمي", "LHDT": "التوقيت الصيفي للورد هاو", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "SAST": "توقيت جنوب أفريقيا", "CAT": "توقيت وسط أفريقيا", "OEZ": "توقيت شرق أوروبا الرسمي", "HNT": "توقيت نيوفاوندلاند الرسمي", "CHAST": "توقيت تشاتام الرسمي", "AEST": "توقيت شرق أستراليا الرسمي", "WIB": "توقيت غرب إندونيسيا", "OESZ": "توقيت شرق أوروبا الصيفي", "MYT": "توقيت ماليزيا", "UYT": "توقيت أورغواي الرسمي", "∅∅∅": "توقيت برازيليا الصيفي", "SGT": "توقيت سنغافورة", "GYT": "توقيت غيانا", "JDT": "توقيت اليابان الصيفي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "WITA": "توقيت وسط إندونيسيا", "GMT": "توقيت غرينتش", "TMST": "توقيت تركمانستان الصيفي", "ACST": "توقيت وسط أستراليا الرسمي", "MESZ": "توقيت وسط أوروبا الصيفي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "WAT": "توقيت غرب أفريقيا الرسمي", "COT": "توقيت كولومبيا الرسمي", "TMT": "توقيت تركمانستان الرسمي", "JST": "توقيت اليابان الرسمي", "UYST": "توقيت أورغواي الصيفي", "VET": "توقيت فنزويلا", "ChST": "توقيت تشامورو", "WAST": "توقيت غرب أفريقيا الصيفي", "HKT": "توقيت هونغ كونغ الرسمي", "HKST": "توقيت هونغ كونغ الصيفي", "ART": "توقيت الأرجنتين الرسمي", "ADT": "التوقيت الصيفي الأطلسي", "WART": "توقيت غرب الأرجنتين الرسمي", "PST": "توقيت المحيط الهادي الرسمي", "PDT": "توقيت المحيط الهادي الصيفي", "AWDT": "توقيت غرب أستراليا الصيفي", "COST": "توقيت كولومبيا الصيفي", "WARST": "توقيت غرب الأرجنتين الصيفي", "ARST": "توقيت الأرجنتين الصيفي", "CLT": "توقيت شيلي الرسمي", "WIT": "توقيت شرق إندونيسيا", "EAT": "توقيت شرق أفريقيا", "AKDT": "توقيت ألاسكا الصيفي", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "CLST": "توقيت شيلي الصيفي"},
+ timezones: map[string]string{"AWST": "توقيت غرب أستراليا الرسمي", "BOT": "توقيت بوليفيا", "HADT": "توقيت هاواي ألوتيان الصيفي", "WIB": "توقيت غرب إندونيسيا", "GMT": "توقيت غرينتش", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "ACDT": "توقيت وسط أستراليا الصيفي", "ECT": "توقيت الإكوادور", "ARST": "توقيت الأرجنتين الصيفي", "SAST": "توقيت جنوب أفريقيا", "WAT": "توقيت غرب أفريقيا الرسمي", "COT": "توقيت كولومبيا الرسمي", "UYT": "توقيت أورغواي الرسمي", "CLST": "توقيت شيلي الصيفي", "ART": "توقيت الأرجنتين الرسمي", "WAST": "توقيت غرب أفريقيا الصيفي", "GYT": "توقيت غيانا", "WARST": "توقيت غرب الأرجنتين الصيفي", "WEZ": "توقيت غرب أوروبا الرسمي", "HNT": "توقيت نيوفاوندلاند الرسمي", "HKST": "توقيت هونغ كونغ الصيفي", "CHADT": "توقيت تشاتام الصيفي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "AEDT": "توقيت شرق أستراليا الصيفي", "CHAST": "توقيت تشاتام الرسمي", "JST": "توقيت اليابان الرسمي", "EAT": "توقيت شرق أفريقيا", "LHST": "توقيت لورد هاو الرسمي", "ACST": "توقيت وسط أستراليا الرسمي", "SRT": "توقيت سورينام", "GFT": "توقيت غايانا الفرنسية", "AST": "التوقيت الرسمي الأطلسي", "TMST": "توقيت تركمانستان الصيفي", "HAT": "توقيت نيوفاوندلاند الصيفي", "WITA": "توقيت وسط إندونيسيا", "MESZ": "توقيت وسط أوروبا الصيفي", "LHDT": "التوقيت الصيفي للورد هاو", "WART": "توقيت غرب الأرجنتين الرسمي", "∅∅∅": "توقيت أزورس الصيفي", "AWDT": "توقيت غرب أستراليا الصيفي", "PDT": "توقيت المحيط الهادي الصيفي", "COST": "توقيت كولومبيا الصيفي", "OEZ": "توقيت شرق أوروبا الرسمي", "OESZ": "توقيت شرق أوروبا الصيفي", "HKT": "توقيت هونغ كونغ الرسمي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "PST": "توقيت المحيط الهادي الرسمي", "ChST": "توقيت تشامورو", "BT": "توقيت بوتان", "MYT": "توقيت ماليزيا", "ADT": "التوقيت الصيفي الأطلسي", "IST": "توقيت الهند", "VET": "توقيت فنزويلا", "HAST": "توقيت هاواي ألوتيان الرسمي", "MDT": "MDT", "AKST": "التوقيت الرسمي لألاسكا", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "NZST": "توقيت نيوزيلندا الرسمي", "CAT": "توقيت وسط أفريقيا", "WIT": "توقيت شرق إندونيسيا", "JDT": "توقيت اليابان الصيفي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "TMT": "توقيت تركمانستان الرسمي", "WESZ": "توقيت غرب أوروبا الصيفي", "SGT": "توقيت سنغافورة", "AEST": "توقيت شرق أستراليا الرسمي", "UYST": "توقيت أورغواي الصيفي", "MST": "MST", "AKDT": "توقيت ألاسكا الصيفي", "NZDT": "توقيت نيوزيلندا الصيفي", "MEZ": "توقيت وسط أوروبا الرسمي", "CLT": "توقيت شيلي الرسمي"},
}
}
diff --git a/ar_EH/ar_EH_test.go b/ar_EH/ar_EH_test.go
new file mode 100644
index 00000000..db7c521f
--- /dev/null
+++ b/ar_EH/ar_EH_test.go
@@ -0,0 +1,1120 @@
+package ar_EH
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_EH"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ar_ER/ar_ER.go b/ar_ER/ar_ER.go
index 26da907b..827399ec 100644
--- a/ar_ER/ar_ER.go
+++ b/ar_ER/ar_ER.go
@@ -47,7 +47,7 @@ func New() locales.Translator {
locale: "ar_ER",
pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
pluralsOrdinal: []locales.PluralRule{6},
- pluralsRange: []locales.PluralRule{1, 4, 5, 6},
+ pluralsRange: []locales.PluralRule{5, 6, 1, 4},
decimal: "٫",
group: "٬",
minus: "‏-",
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"", ""},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"AST": "التوقيت الرسمي الأطلسي", "JST": "توقيت اليابان الرسمي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "ECT": "توقيت الإكوادور", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "∅∅∅": "توقيت برازيليا الصيفي", "HAT": "توقيت نيوفاوندلاند الصيفي", "WITA": "توقيت وسط إندونيسيا", "ACDT": "توقيت وسط أستراليا الصيفي", "UYT": "توقيت أورغواي الرسمي", "CHADT": "توقيت تشاتام الصيفي", "ART": "توقيت الأرجنتين الرسمي", "GFT": "توقيت غايانا الفرنسية", "COST": "توقيت كولومبيا الصيفي", "LHDT": "التوقيت الصيفي للورد هاو", "JDT": "توقيت اليابان الصيفي", "MESZ": "توقيت وسط أوروبا الصيفي", "UYST": "توقيت أورغواي الصيفي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "AWST": "توقيت غرب أستراليا الرسمي", "NZST": "توقيت نيوزيلندا الرسمي", "BT": "توقيت بوتان", "TMST": "توقيت تركمانستان الصيفي", "VET": "توقيت فنزويلا", "CHAST": "توقيت تشاتام الرسمي", "ACST": "توقيت وسط أستراليا الرسمي", "BOT": "توقيت بوليفيا", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية", "COT": "توقيت كولومبيا الرسمي", "HKT": "توقيت هونغ كونغ الرسمي", "ARST": "توقيت الأرجنتين الصيفي", "TMT": "توقيت تركمانستان الرسمي", "GYT": "توقيت غيانا", "ChST": "توقيت تشامورو", "WESZ": "توقيت غرب أوروبا الصيفي", "PST": "توقيت المحيط الهادي الرسمي", "PDT": "توقيت المحيط الهادي الصيفي", "CLST": "توقيت شيلي الصيفي", "HADT": "توقيت هاواي ألوتيان الصيفي", "SAST": "توقيت جنوب أفريقيا", "OEZ": "توقيت شرق أوروبا الرسمي", "WIB": "توقيت غرب إندونيسيا", "SRT": "توقيت سورينام", "HAST": "توقيت هاواي ألوتيان الرسمي", "WARST": "توقيت غرب الأرجنتين الصيفي", "EAT": "توقيت شرق أفريقيا", "LHST": "توقيت لورد هاو الرسمي", "WAT": "توقيت غرب أفريقيا الرسمي", "OESZ": "توقيت شرق أوروبا الصيفي", "AEDT": "توقيت شرق أستراليا الصيفي", "CLT": "توقيت شيلي الرسمي", "WAST": "توقيت غرب أفريقيا الصيفي", "MYT": "توقيت ماليزيا", "AKDT": "توقيت ألاسكا الصيفي", "MEZ": "توقيت وسط أوروبا الرسمي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "CAT": "توقيت وسط أفريقيا", "SGT": "توقيت سنغافورة", "HKST": "توقيت هونغ كونغ الصيفي", "WART": "توقيت غرب الأرجنتين الرسمي", "IST": "توقيت الهند", "AWDT": "توقيت غرب أستراليا الصيفي", "AKST": "التوقيت الرسمي لألاسكا", "WEZ": "توقيت غرب أوروبا الرسمي", "HNT": "توقيت نيوفاوندلاند الرسمي", "WIT": "توقيت شرق إندونيسيا", "ADT": "التوقيت الصيفي الأطلسي", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "GMT": "توقيت غرينتش", "NZDT": "توقيت نيوزيلندا الصيفي", "AEST": "توقيت شرق أستراليا الرسمي"},
+ timezones: map[string]string{"CHADT": "توقيت تشاتام الصيفي", "HAT": "توقيت نيوفاوندلاند الصيفي", "WARST": "توقيت غرب الأرجنتين الصيفي", "NZST": "توقيت نيوزيلندا الرسمي", "HNT": "توقيت نيوفاوندلاند الرسمي", "OEZ": "توقيت شرق أوروبا الرسمي", "EAT": "توقيت شرق أفريقيا", "HKST": "توقيت هونغ كونغ الصيفي", "AST": "التوقيت الرسمي الأطلسي", "WEZ": "توقيت غرب أوروبا الرسمي", "MYT": "توقيت ماليزيا", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "HAST": "توقيت هاواي ألوتيان الرسمي", "ACST": "توقيت وسط أستراليا الرسمي", "AKDT": "توقيت ألاسكا الصيفي", "BT": "توقيت بوتان", "WAST": "توقيت غرب أفريقيا الصيفي", "WESZ": "توقيت غرب أوروبا الصيفي", "UYST": "توقيت أورغواي الصيفي", "HKT": "توقيت هونغ كونغ الرسمي", "ART": "توقيت الأرجنتين الرسمي", "ARST": "توقيت الأرجنتين الصيفي", "SAST": "توقيت جنوب أفريقيا", "MESZ": "توقيت وسط أوروبا الصيفي", "BOT": "توقيت بوليفيا", "AEDT": "توقيت شرق أستراليا الصيفي", "LHDT": "التوقيت الصيفي للورد هاو", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "OESZ": "توقيت شرق أوروبا الصيفي", "SRT": "توقيت سورينام", "MST": "MST", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "COST": "توقيت كولومبيا الصيفي", "TMT": "توقيت تركمانستان الرسمي", "TMST": "توقيت تركمانستان الصيفي", "CLT": "توقيت شيلي الرسمي", "GFT": "توقيت غايانا الفرنسية", "HADT": "توقيت هاواي ألوتيان الصيفي", "SGT": "توقيت سنغافورة", "ChST": "توقيت تشامورو", "GYT": "توقيت غيانا", "ADT": "التوقيت الصيفي الأطلسي", "CAT": "توقيت وسط أفريقيا", "CLST": "توقيت شيلي الصيفي", "WART": "توقيت غرب الأرجنتين الرسمي", "ECT": "توقيت الإكوادور", "WIB": "توقيت غرب إندونيسيا", "GMT": "توقيت غرينتش", "ACDT": "توقيت وسط أستراليا الصيفي", "AEST": "توقيت شرق أستراليا الرسمي", "CHAST": "توقيت تشاتام الرسمي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "COT": "توقيت كولومبيا الرسمي", "WAT": "توقيت غرب أفريقيا الرسمي", "WIT": "توقيت شرق إندونيسيا", "LHST": "توقيت لورد هاو الرسمي", "WITA": "توقيت وسط إندونيسيا", "AKST": "التوقيت الرسمي لألاسكا", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "PST": "توقيت المحيط الهادي الرسمي", "MEZ": "توقيت وسط أوروبا الرسمي", "∅∅∅": "توقيت أزورس الصيفي", "MDT": "MDT", "VET": "توقيت فنزويلا", "JST": "توقيت اليابان الرسمي", "AWDT": "توقيت غرب أستراليا الصيفي", "NZDT": "توقيت نيوزيلندا الصيفي", "UYT": "توقيت أورغواي الرسمي", "JDT": "توقيت اليابان الصيفي", "AWST": "توقيت غرب أستراليا الرسمي", "IST": "توقيت الهند", "PDT": "توقيت المحيط الهادي الصيفي"},
}
}
diff --git a/ar_ER/ar_ER_test.go b/ar_ER/ar_ER_test.go
new file mode 100644
index 00000000..6f323811
--- /dev/null
+++ b/ar_ER/ar_ER_test.go
@@ -0,0 +1,1120 @@
+package ar_ER
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_ER"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ar_IL/ar_IL.go b/ar_IL/ar_IL.go
index 0017fa12..678c0364 100644
--- a/ar_IL/ar_IL.go
+++ b/ar_IL/ar_IL.go
@@ -47,7 +47,7 @@ func New() locales.Translator {
locale: "ar_IL",
pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
pluralsOrdinal: []locales.PluralRule{6},
- pluralsRange: []locales.PluralRule{4, 5, 6, 1},
+ pluralsRange: []locales.PluralRule{1, 4, 5, 6},
decimal: "٫",
group: "٬",
minus: "‏-",
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"", ""},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"∅∅∅": "توقيت أزورس الصيفي", "BOT": "توقيت بوليفيا", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "ADT": "التوقيت الصيفي الأطلسي", "HNT": "توقيت نيوفاوندلاند الرسمي", "GFT": "توقيت غايانا الفرنسية", "GYT": "توقيت غيانا", "EAT": "توقيت شرق أفريقيا", "OESZ": "توقيت شرق أوروبا الصيفي", "IST": "توقيت الهند", "JDT": "توقيت اليابان الصيفي", "CAT": "توقيت وسط أفريقيا", "WAT": "توقيت غرب أفريقيا الرسمي", "BT": "توقيت بوتان", "WART": "توقيت غرب الأرجنتين الرسمي", "OEZ": "توقيت شرق أوروبا الرسمي", "WIB": "توقيت غرب إندونيسيا", "ACST": "توقيت وسط أستراليا الرسمي", "MEZ": "توقيت وسط أوروبا الرسمي", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية", "VET": "توقيت فنزويلا", "WEZ": "توقيت غرب أوروبا الرسمي", "AST": "التوقيت الرسمي الأطلسي", "SAST": "توقيت جنوب أفريقيا", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "HADT": "توقيت هاواي ألوتيان الصيفي", "ChST": "توقيت تشامورو", "NZST": "توقيت نيوزيلندا الرسمي", "UYST": "توقيت أورغواي الصيفي", "CHAST": "توقيت تشاتام الرسمي", "WESZ": "توقيت غرب أوروبا الصيفي", "HKT": "توقيت هونغ كونغ الرسمي", "JST": "توقيت اليابان الرسمي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "CLT": "توقيت شيلي الرسمي", "CLST": "توقيت شيلي الصيفي", "WAST": "توقيت غرب أفريقيا الصيفي", "WIT": "توقيت شرق إندونيسيا", "UYT": "توقيت أورغواي الرسمي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "COT": "توقيت كولومبيا الرسمي", "COST": "توقيت كولومبيا الصيفي", "ECT": "توقيت الإكوادور", "WARST": "توقيت غرب الأرجنتين الصيفي", "GMT": "توقيت غرينتش", "HAT": "توقيت نيوفاوندلاند الصيفي", "SRT": "توقيت سورينام", "ART": "توقيت الأرجنتين الرسمي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "ACDT": "توقيت وسط أستراليا الصيفي", "AWST": "توقيت غرب أستراليا الرسمي", "MYT": "توقيت ماليزيا", "TMT": "توقيت تركمانستان الرسمي", "AWDT": "توقيت غرب أستراليا الصيفي", "LHDT": "التوقيت الصيفي للورد هاو", "NZDT": "توقيت نيوزيلندا الصيفي", "AEST": "توقيت شرق أستراليا الرسمي", "CHADT": "توقيت تشاتام الصيفي", "PDT": "توقيت المحيط الهادي الصيفي", "SGT": "توقيت سنغافورة", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "MESZ": "توقيت وسط أوروبا الصيفي", "AEDT": "توقيت شرق أستراليا الصيفي", "HAST": "توقيت هاواي ألوتيان الرسمي", "TMST": "توقيت تركمانستان الصيفي", "AKST": "التوقيت الرسمي لألاسكا", "WITA": "توقيت وسط إندونيسيا", "ARST": "توقيت الأرجنتين الصيفي", "HKST": "توقيت هونغ كونغ الصيفي", "LHST": "توقيت لورد هاو الرسمي", "AKDT": "توقيت ألاسكا الصيفي", "PST": "توقيت المحيط الهادي الرسمي"},
+ timezones: map[string]string{"ART": "توقيت الأرجنتين الرسمي", "IST": "توقيت الهند", "COT": "توقيت كولومبيا الرسمي", "GYT": "توقيت غيانا", "WITA": "توقيت وسط إندونيسيا", "AWDT": "توقيت غرب أستراليا الصيفي", "CHADT": "توقيت تشاتام الصيفي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "TMT": "توقيت تركمانستان الرسمي", "SGT": "توقيت سنغافورة", "AEST": "توقيت شرق أستراليا الرسمي", "UYT": "توقيت أورغواي الرسمي", "CHAST": "توقيت تشاتام الرسمي", "ChST": "توقيت تشامورو", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "MEZ": "توقيت وسط أوروبا الرسمي", "COST": "توقيت كولومبيا الصيفي", "HKT": "توقيت هونغ كونغ الرسمي", "CLST": "توقيت شيلي الصيفي", "WART": "توقيت غرب الأرجنتين الرسمي", "AKST": "التوقيت الرسمي لألاسكا", "ARST": "توقيت الأرجنتين الصيفي", "HAT": "توقيت نيوفاوندلاند الصيفي", "LHDT": "التوقيت الصيفي للورد هاو", "ACDT": "توقيت وسط أستراليا الصيفي", "AWST": "توقيت غرب أستراليا الرسمي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "HADT": "توقيت هاواي ألوتيان الصيفي", "WIB": "توقيت غرب إندونيسيا", "CAT": "توقيت وسط أفريقيا", "WAT": "توقيت غرب أفريقيا الرسمي", "OESZ": "توقيت شرق أوروبا الصيفي", "VET": "توقيت فنزويلا", "NZST": "توقيت نيوزيلندا الرسمي", "BOT": "توقيت بوليفيا", "SAST": "توقيت جنوب أفريقيا", "TMST": "توقيت تركمانستان الصيفي", "OEZ": "توقيت شرق أوروبا الرسمي", "∅∅∅": "توقيت الأمازون الصيفي", "WEZ": "توقيت غرب أوروبا الرسمي", "GMT": "توقيت غرينتش", "SRT": "توقيت سورينام", "JDT": "توقيت اليابان الصيفي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "HAST": "توقيت هاواي ألوتيان الرسمي", "NZDT": "توقيت نيوزيلندا الصيفي", "AEDT": "توقيت شرق أستراليا الصيفي", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "MYT": "توقيت ماليزيا", "GFT": "توقيت غايانا الفرنسية", "ADT": "التوقيت الصيفي الأطلسي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "PST": "توقيت المحيط الهادي الرسمي", "CLT": "توقيت شيلي الرسمي", "LHST": "توقيت لورد هاو الرسمي", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية", "PDT": "توقيت المحيط الهادي الصيفي", "WAST": "توقيت غرب أفريقيا الصيفي", "BT": "توقيت بوتان", "ACST": "توقيت وسط أستراليا الرسمي", "MESZ": "توقيت وسط أوروبا الصيفي", "HKST": "توقيت هونغ كونغ الصيفي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "UYST": "توقيت أورغواي الصيفي", "AST": "التوقيت الرسمي الأطلسي", "WESZ": "توقيت غرب أوروبا الصيفي", "HNT": "توقيت نيوفاوندلاند الرسمي", "EAT": "توقيت شرق أفريقيا", "ECT": "توقيت الإكوادور", "JST": "توقيت اليابان الرسمي", "WIT": "توقيت شرق إندونيسيا", "WARST": "توقيت غرب الأرجنتين الصيفي", "AKDT": "توقيت ألاسكا الصيفي"},
}
}
diff --git a/ar_IL/ar_IL_test.go b/ar_IL/ar_IL_test.go
new file mode 100644
index 00000000..78d37a1a
--- /dev/null
+++ b/ar_IL/ar_IL_test.go
@@ -0,0 +1,1120 @@
+package ar_IL
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_IL"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ar_IQ/ar_IQ.go b/ar_IQ/ar_IQ.go
index 5be3b859..e7b1a8b3 100644
--- a/ar_IQ/ar_IQ.go
+++ b/ar_IQ/ar_IQ.go
@@ -47,7 +47,7 @@ func New() locales.Translator {
locale: "ar_IQ",
pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
pluralsOrdinal: []locales.PluralRule{6},
- pluralsRange: []locales.PluralRule{1, 4, 5, 6},
+ pluralsRange: []locales.PluralRule{5, 6, 1, 4},
decimal: "٫",
group: "٬",
minus: "‏-",
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"", ""},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"LHDT": "التوقيت الصيفي للورد هاو", "VET": "توقيت فنزويلا", "WIT": "توقيت شرق إندونيسيا", "SRT": "توقيت سورينام", "PDT": "توقيت المحيط الهادي الصيفي", "GYT": "توقيت غيانا", "NZDT": "توقيت نيوزيلندا الصيفي", "UYST": "توقيت أورغواي الصيفي", "CHAST": "توقيت تشاتام الرسمي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "OESZ": "توقيت شرق أوروبا الصيفي", "COT": "توقيت كولومبيا الرسمي", "AEDT": "توقيت شرق أستراليا الصيفي", "ACST": "توقيت وسط أستراليا الرسمي", "CAT": "توقيت وسط أفريقيا", "HAST": "توقيت هاواي ألوتيان الرسمي", "WIB": "توقيت غرب إندونيسيا", "MST": "MST", "MDT": "MDT", "ACDT": "توقيت وسط أستراليا الصيفي", "ARST": "توقيت الأرجنتين الصيفي", "MEZ": "توقيت وسط أوروبا الرسمي", "SGT": "توقيت سنغافورة", "SAST": "توقيت جنوب أفريقيا", "EAT": "توقيت شرق أفريقيا", "HKT": "توقيت هونغ كونغ الرسمي", "MESZ": "توقيت وسط أوروبا الصيفي", "WEZ": "توقيت غرب أوروبا الرسمي", "COST": "توقيت كولومبيا الصيفي", "HKST": "توقيت هونغ كونغ الصيفي", "AKDT": "توقيت ألاسكا الصيفي", "HNT": "توقيت نيوفاوندلاند الرسمي", "HAT": "توقيت نيوفاوندلاند الصيفي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "BT": "توقيت بوتان", "GMT": "توقيت غرينتش", "ChST": "توقيت تشامورو", "AST": "التوقيت الرسمي الأطلسي", "TMST": "توقيت تركمانستان الصيفي", "LHST": "توقيت لورد هاو الرسمي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "HADT": "توقيت هاواي ألوتيان الصيفي", "WART": "توقيت غرب الأرجنتين الرسمي", "AWDT": "توقيت غرب أستراليا الصيفي", "GFT": "توقيت غايانا الفرنسية", "NZST": "توقيت نيوزيلندا الرسمي", "WARST": "توقيت غرب الأرجنتين الصيفي", "IST": "توقيت الهند", "JST": "توقيت اليابان الرسمي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "CLT": "توقيت شيلي الرسمي", "CLST": "توقيت شيلي الصيفي", "WAST": "توقيت غرب أفريقيا الصيفي", "PST": "توقيت المحيط الهادي الرسمي", "BOT": "توقيت بوليفيا", "WAT": "توقيت غرب أفريقيا الرسمي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "TMT": "توقيت تركمانستان الرسمي", "AWST": "توقيت غرب أستراليا الرسمي", "MYT": "توقيت ماليزيا", "JDT": "توقيت اليابان الصيفي", "WESZ": "توقيت غرب أوروبا الصيفي", "AKST": "التوقيت الرسمي لألاسكا", "WITA": "توقيت وسط إندونيسيا", "ART": "توقيت الأرجنتين الرسمي", "AEST": "توقيت شرق أستراليا الرسمي", "ECT": "توقيت الإكوادور", "OEZ": "توقيت شرق أوروبا الرسمي", "UYT": "توقيت أورغواي الرسمي", "CHADT": "توقيت تشاتام الصيفي", "ADT": "التوقيت الصيفي الأطلسي", "∅∅∅": "توقيت الأمازون الصيفي"},
+ timezones: map[string]string{"PST": "توقيت المحيط الهادي الرسمي", "AEDT": "توقيت شرق أستراليا الصيفي", "UYT": "توقيت أورغواي الرسمي", "GFT": "توقيت غايانا الفرنسية", "ACDT": "توقيت وسط أستراليا الصيفي", "CHADT": "توقيت تشاتام الصيفي", "AKST": "التوقيت الرسمي لألاسكا", "HADT": "توقيت هاواي ألوتيان الصيفي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "BT": "توقيت بوتان", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "ACST": "توقيت وسط أستراليا الرسمي", "CHAST": "توقيت تشاتام الرسمي", "JST": "توقيت اليابان الرسمي", "JDT": "توقيت اليابان الصيفي", "HAST": "توقيت هاواي ألوتيان الرسمي", "COT": "توقيت كولومبيا الرسمي", "ADT": "التوقيت الصيفي الأطلسي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "TMT": "توقيت تركمانستان الرسمي", "ECT": "توقيت الإكوادور", "HKST": "توقيت هونغ كونغ الصيفي", "NZDT": "توقيت نيوزيلندا الصيفي", "BOT": "توقيت بوليفيا", "SGT": "توقيت سنغافورة", "HAT": "توقيت نيوفاوندلاند الصيفي", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية", "COST": "توقيت كولومبيا الصيفي", "ChST": "توقيت تشامورو", "UYST": "توقيت أورغواي الصيفي", "NZST": "توقيت نيوزيلندا الرسمي", "WAT": "توقيت غرب أفريقيا الرسمي", "OEZ": "توقيت شرق أوروبا الرسمي", "MYT": "توقيت ماليزيا", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "AWST": "توقيت غرب أستراليا الرسمي", "AWDT": "توقيت غرب أستراليا الصيفي", "MESZ": "توقيت وسط أوروبا الصيفي", "CLST": "توقيت شيلي الصيفي", "LHDT": "التوقيت الصيفي للورد هاو", "SRT": "توقيت سورينام", "HKT": "توقيت هونغ كونغ الرسمي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "WEZ": "توقيت غرب أوروبا الرسمي", "OESZ": "توقيت شرق أوروبا الصيفي", "VET": "توقيت فنزويلا", "AST": "التوقيت الرسمي الأطلسي", "MEZ": "توقيت وسط أوروبا الرسمي", "HNT": "توقيت نيوفاوندلاند الرسمي", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "EAT": "توقيت شرق أفريقيا", "LHST": "توقيت لورد هاو الرسمي", "SAST": "توقيت جنوب أفريقيا", "CLT": "توقيت شيلي الرسمي", "ARST": "توقيت الأرجنتين الصيفي", "WESZ": "توقيت غرب أوروبا الصيفي", "GMT": "توقيت غرينتش", "WIT": "توقيت شرق إندونيسيا", "CAT": "توقيت وسط أفريقيا", "WAST": "توقيت غرب أفريقيا الصيفي", "ART": "توقيت الأرجنتين الرسمي", "WITA": "توقيت وسط إندونيسيا", "PDT": "توقيت المحيط الهادي الصيفي", "TMST": "توقيت تركمانستان الصيفي", "GYT": "توقيت غيانا", "AEST": "توقيت شرق أستراليا الرسمي", "WART": "توقيت غرب الأرجنتين الرسمي", "WARST": "توقيت غرب الأرجنتين الصيفي", "AKDT": "توقيت ألاسكا الصيفي", "IST": "توقيت الهند", "∅∅∅": "توقيت الأمازون الصيفي", "WIB": "توقيت غرب إندونيسيا"},
}
}
diff --git a/ar_IQ/ar_IQ_test.go b/ar_IQ/ar_IQ_test.go
new file mode 100644
index 00000000..223372a8
--- /dev/null
+++ b/ar_IQ/ar_IQ_test.go
@@ -0,0 +1,1120 @@
+package ar_IQ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_IQ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ar_JO/ar_JO.go b/ar_JO/ar_JO.go
index 4ae01375..cfad3224 100644
--- a/ar_JO/ar_JO.go
+++ b/ar_JO/ar_JO.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"", ""},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"JST": "توقيت اليابان الرسمي", "MEZ": "توقيت وسط أوروبا الرسمي", "ADT": "التوقيت الصيفي الأطلسي", "HADT": "توقيت هاواي ألوتيان الصيفي", "∅∅∅": "توقيت الأمازون الصيفي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "WARST": "توقيت غرب الأرجنتين الصيفي", "EAT": "توقيت شرق أفريقيا", "AWDT": "توقيت غرب أستراليا الصيفي", "NZDT": "توقيت نيوزيلندا الصيفي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "COST": "توقيت كولومبيا الصيفي", "SAST": "توقيت جنوب أفريقيا", "MDT": "MDT", "TMT": "توقيت تركمانستان الرسمي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "CLT": "توقيت شيلي الرسمي", "COT": "توقيت كولومبيا الرسمي", "AST": "التوقيت الرسمي الأطلسي", "WAST": "توقيت غرب أفريقيا الصيفي", "AEDT": "توقيت شرق أستراليا الصيفي", "HNT": "توقيت نيوفاوندلاند الرسمي", "GFT": "توقيت غايانا الفرنسية", "PST": "توقيت المحيط الهادي الرسمي", "JDT": "توقيت اليابان الصيفي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "MESZ": "توقيت وسط أوروبا الصيفي", "WEZ": "توقيت غرب أوروبا الرسمي", "CHADT": "توقيت تشاتام الصيفي", "SGT": "توقيت سنغافورة", "ACDT": "توقيت وسط أستراليا الصيفي", "LHDT": "التوقيت الصيفي للورد هاو", "GYT": "توقيت غيانا", "AEST": "توقيت شرق أستراليا الرسمي", "BT": "توقيت بوتان", "IST": "توقيت الهند", "OESZ": "توقيت شرق أوروبا الصيفي", "MST": "MST", "ChST": "توقيت تشامورو", "HAST": "توقيت هاواي ألوتيان الرسمي", "NZST": "توقيت نيوزيلندا الرسمي", "WESZ": "توقيت غرب أوروبا الصيفي", "CLST": "توقيت شيلي الصيفي", "WITA": "توقيت وسط إندونيسيا", "ARST": "توقيت الأرجنتين الصيفي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "WIB": "توقيت غرب إندونيسيا", "HAT": "توقيت نيوفاوندلاند الصيفي", "BOT": "توقيت بوليفيا", "UYT": "توقيت أورغواي الرسمي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "WAT": "توقيت غرب أفريقيا الرسمي", "ACST": "توقيت وسط أستراليا الرسمي", "TMST": "توقيت تركمانستان الصيفي", "AKST": "التوقيت الرسمي لألاسكا", "ECT": "توقيت الإكوادور", "WART": "توقيت غرب الأرجنتين الرسمي", "GMT": "توقيت غرينتش", "WIT": "توقيت شرق إندونيسيا", "AKDT": "توقيت ألاسكا الصيفي", "PDT": "توقيت المحيط الهادي الصيفي", "AWST": "توقيت غرب أستراليا الرسمي", "CHAST": "توقيت تشاتام الرسمي", "CAT": "توقيت وسط أفريقيا", "OEZ": "توقيت شرق أوروبا الرسمي", "ART": "توقيت الأرجنتين الرسمي", "SRT": "توقيت سورينام", "MYT": "توقيت ماليزيا", "HKST": "توقيت هونغ كونغ الصيفي", "LHST": "توقيت لورد هاو الرسمي", "VET": "توقيت فنزويلا", "UYST": "توقيت أورغواي الصيفي", "HKT": "توقيت هونغ كونغ الرسمي"},
+ timezones: map[string]string{"LHST": "توقيت لورد هاو الرسمي", "CLT": "توقيت شيلي الرسمي", "∅∅∅": "توقيت برازيليا الصيفي", "JDT": "توقيت اليابان الصيفي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "SGT": "توقيت سنغافورة", "BT": "توقيت بوتان", "UYST": "توقيت أورغواي الصيفي", "AKST": "التوقيت الرسمي لألاسكا", "ADT": "التوقيت الصيفي الأطلسي", "WITA": "توقيت وسط إندونيسيا", "SAST": "توقيت جنوب أفريقيا", "CAT": "توقيت وسط أفريقيا", "WESZ": "توقيت غرب أوروبا الصيفي", "ChST": "توقيت تشامورو", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "AKDT": "توقيت ألاسكا الصيفي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية", "WIT": "توقيت شرق إندونيسيا", "WARST": "توقيت غرب الأرجنتين الصيفي", "CHAST": "توقيت تشاتام الرسمي", "PST": "توقيت المحيط الهادي الرسمي", "HAST": "توقيت هاواي ألوتيان الرسمي", "BOT": "توقيت بوليفيا", "GYT": "توقيت غيانا", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "SRT": "توقيت سورينام", "ART": "توقيت الأرجنتين الرسمي", "IST": "توقيت الهند", "MEZ": "توقيت وسط أوروبا الرسمي", "UYT": "توقيت أورغواي الرسمي", "NZDT": "توقيت نيوزيلندا الصيفي", "OESZ": "توقيت شرق أوروبا الصيفي", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "HKST": "توقيت هونغ كونغ الصيفي", "AWST": "توقيت غرب أستراليا الرسمي", "AWDT": "توقيت غرب أستراليا الصيفي", "OEZ": "توقيت شرق أوروبا الرسمي", "CLST": "توقيت شيلي الصيفي", "PDT": "توقيت المحيط الهادي الصيفي", "WAST": "توقيت غرب أفريقيا الصيفي", "COST": "توقيت كولومبيا الصيفي", "AEST": "توقيت شرق أستراليا الرسمي", "ACST": "توقيت وسط أستراليا الرسمي", "HKT": "توقيت هونغ كونغ الرسمي", "HADT": "توقيت هاواي ألوتيان الصيفي", "COT": "توقيت كولومبيا الرسمي", "TMT": "توقيت تركمانستان الرسمي", "WART": "توقيت غرب الأرجنتين الرسمي", "AST": "التوقيت الرسمي الأطلسي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "EAT": "توقيت شرق أفريقيا", "MYT": "توقيت ماليزيا", "WAT": "توقيت غرب أفريقيا الرسمي", "GFT": "توقيت غايانا الفرنسية", "HAT": "توقيت نيوفاوندلاند الصيفي", "GMT": "توقيت غرينتش", "LHDT": "التوقيت الصيفي للورد هاو", "VET": "توقيت فنزويلا", "JST": "توقيت اليابان الرسمي", "MESZ": "توقيت وسط أوروبا الصيفي", "WEZ": "توقيت غرب أوروبا الرسمي", "HNT": "توقيت نيوفاوندلاند الرسمي", "ACDT": "توقيت وسط أستراليا الصيفي", "CHADT": "توقيت تشاتام الصيفي", "NZST": "توقيت نيوزيلندا الرسمي", "WIB": "توقيت غرب إندونيسيا", "TMST": "توقيت تركمانستان الصيفي", "AEDT": "توقيت شرق أستراليا الصيفي", "ECT": "توقيت الإكوادور", "ARST": "توقيت الأرجنتين الصيفي"},
}
}
diff --git a/ar_JO/ar_JO_test.go b/ar_JO/ar_JO_test.go
new file mode 100644
index 00000000..37295493
--- /dev/null
+++ b/ar_JO/ar_JO_test.go
@@ -0,0 +1,1120 @@
+package ar_JO
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_JO"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ar_KM/ar_KM.go b/ar_KM/ar_KM.go
index 17dedf54..c579c4f2 100644
--- a/ar_KM/ar_KM.go
+++ b/ar_KM/ar_KM.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"", ""},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"ACWST": "توقيت غرب وسط أستراليا الرسمي", "CLST": "توقيت شيلي الصيفي", "AST": "التوقيت الرسمي الأطلسي", "ADT": "التوقيت الصيفي الأطلسي", "WIT": "توقيت شرق إندونيسيا", "ARST": "توقيت الأرجنتين الصيفي", "PST": "توقيت المحيط الهادي الرسمي", "VET": "توقيت فنزويلا", "ECT": "توقيت الإكوادور", "SGT": "توقيت سنغافورة", "MYT": "توقيت ماليزيا", "AKST": "التوقيت الرسمي لألاسكا", "LHST": "توقيت لورد هاو الرسمي", "LHDT": "التوقيت الصيفي للورد هاو", "UYST": "توقيت أورغواي الصيفي", "AEDT": "توقيت شرق أستراليا الصيفي", "HAST": "توقيت هاواي ألوتيان الرسمي", "HNT": "توقيت نيوفاوندلاند الرسمي", "JDT": "توقيت اليابان الصيفي", "SRT": "توقيت سورينام", "WEZ": "توقيت غرب أوروبا الرسمي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "ART": "توقيت الأرجنتين الرسمي", "TMST": "توقيت تركمانستان الصيفي", "EAT": "توقيت شرق أفريقيا", "AWST": "توقيت غرب أستراليا الرسمي", "MESZ": "توقيت وسط أوروبا الصيفي", "NZDT": "توقيت نيوزيلندا الصيفي", "ACST": "توقيت وسط أستراليا الرسمي", "PDT": "توقيت المحيط الهادي الصيفي", "AWDT": "توقيت غرب أستراليا الصيفي", "OESZ": "توقيت شرق أوروبا الصيفي", "GYT": "توقيت غيانا", "JST": "توقيت اليابان الرسمي", "AEST": "توقيت شرق أستراليا الرسمي", "ChST": "توقيت تشامورو", "CLT": "توقيت شيلي الرسمي", "WESZ": "توقيت غرب أوروبا الصيفي", "COST": "توقيت كولومبيا الصيفي", "CAT": "توقيت وسط أفريقيا", "WAT": "توقيت غرب أفريقيا الرسمي", "ACDT": "توقيت وسط أستراليا الصيفي", "MEZ": "توقيت وسط أوروبا الرسمي", "UYT": "توقيت أورغواي الرسمي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "WAST": "توقيت غرب أفريقيا الصيفي", "HKST": "توقيت هونغ كونغ الصيفي", "OEZ": "توقيت شرق أوروبا الرسمي", "WITA": "توقيت وسط إندونيسيا", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "CHADT": "توقيت تشاتام الصيفي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "HADT": "توقيت هاواي ألوتيان الصيفي", "BT": "توقيت بوتان", "WARST": "توقيت غرب الأرجنتين الصيفي", "CHAST": "توقيت تشاتام الرسمي", "∅∅∅": "توقيت برازيليا الصيفي", "IST": "توقيت الهند", "HKT": "توقيت هونغ كونغ الرسمي", "GFT": "توقيت غايانا الفرنسية", "AKDT": "توقيت ألاسكا الصيفي", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية", "COT": "توقيت كولومبيا الرسمي", "SAST": "توقيت جنوب أفريقيا", "BOT": "توقيت بوليفيا", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "GMT": "توقيت غرينتش", "HAT": "توقيت نيوفاوندلاند الصيفي", "WIB": "توقيت غرب إندونيسيا", "NZST": "توقيت نيوزيلندا الرسمي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "WART": "توقيت غرب الأرجنتين الرسمي", "TMT": "توقيت تركمانستان الرسمي"},
+ timezones: map[string]string{"GFT": "توقيت غايانا الفرنسية", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "AWST": "توقيت غرب أستراليا الرسمي", "SAST": "توقيت جنوب أفريقيا", "COST": "توقيت كولومبيا الصيفي", "CAT": "توقيت وسط أفريقيا", "WIT": "توقيت شرق إندونيسيا", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "CLST": "توقيت شيلي الصيفي", "SGT": "توقيت سنغافورة", "ACDT": "توقيت وسط أستراليا الصيفي", "ECT": "توقيت الإكوادور", "WITA": "توقيت وسط إندونيسيا", "WESZ": "توقيت غرب أوروبا الصيفي", "OESZ": "توقيت شرق أوروبا الصيفي", "MYT": "توقيت ماليزيا", "ACST": "توقيت وسط أستراليا الرسمي", "BT": "توقيت بوتان", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "AST": "التوقيت الرسمي الأطلسي", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "UYST": "توقيت أورغواي الصيفي", "WEZ": "توقيت غرب أوروبا الرسمي", "AEST": "توقيت شرق أستراليا الرسمي", "AWDT": "توقيت غرب أستراليا الصيفي", "MEZ": "توقيت وسط أوروبا الرسمي", "TMT": "توقيت تركمانستان الرسمي", "ChST": "توقيت تشامورو", "∅∅∅": "توقيت برازيليا الصيفي", "HAT": "توقيت نيوفاوندلاند الصيفي", "NZDT": "توقيت نيوزيلندا الصيفي", "HKT": "توقيت هونغ كونغ الرسمي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "TMST": "توقيت تركمانستان الصيفي", "OEZ": "توقيت شرق أوروبا الرسمي", "PST": "توقيت المحيط الهادي الرسمي", "COT": "توقيت كولومبيا الرسمي", "HAST": "توقيت هاواي ألوتيان الرسمي", "HNT": "توقيت نيوفاوندلاند الرسمي", "LHDT": "التوقيت الصيفي للورد هاو", "CLT": "توقيت شيلي الرسمي", "JST": "توقيت اليابان الرسمي", "GMT": "توقيت غرينتش", "SRT": "توقيت سورينام", "ART": "توقيت الأرجنتين الرسمي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "MESZ": "توقيت وسط أوروبا الصيفي", "HADT": "توقيت هاواي ألوتيان الصيفي", "NZST": "توقيت نيوزيلندا الرسمي", "WART": "توقيت غرب الأرجنتين الرسمي", "WARST": "توقيت غرب الأرجنتين الصيفي", "JDT": "توقيت اليابان الصيفي", "WIB": "توقيت غرب إندونيسيا", "WAT": "توقيت غرب أفريقيا الرسمي", "AEDT": "توقيت شرق أستراليا الصيفي", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية", "CHAST": "توقيت تشاتام الرسمي", "AKST": "التوقيت الرسمي لألاسكا", "AKDT": "توقيت ألاسكا الصيفي", "IST": "توقيت الهند", "EAT": "توقيت شرق أفريقيا", "CHADT": "توقيت تشاتام الصيفي", "GYT": "توقيت غيانا", "LHST": "توقيت لورد هاو الرسمي", "BOT": "توقيت بوليفيا", "PDT": "توقيت المحيط الهادي الصيفي", "UYT": "توقيت أورغواي الرسمي", "HKST": "توقيت هونغ كونغ الصيفي", "ARST": "توقيت الأرجنتين الصيفي", "ADT": "التوقيت الصيفي الأطلسي", "WAST": "توقيت غرب أفريقيا الصيفي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "VET": "توقيت فنزويلا"},
}
}
diff --git a/ar_KM/ar_KM_test.go b/ar_KM/ar_KM_test.go
new file mode 100644
index 00000000..4fe9ad40
--- /dev/null
+++ b/ar_KM/ar_KM_test.go
@@ -0,0 +1,1120 @@
+package ar_KM
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_KM"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ar_KW/ar_KW.go b/ar_KW/ar_KW.go
index ed132985..9456dd9b 100644
--- a/ar_KW/ar_KW.go
+++ b/ar_KW/ar_KW.go
@@ -47,7 +47,7 @@ func New() locales.Translator {
locale: "ar_KW",
pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
pluralsOrdinal: []locales.PluralRule{6},
- pluralsRange: []locales.PluralRule{1, 4, 5, 6},
+ pluralsRange: []locales.PluralRule{6, 1, 4, 5},
decimal: "٫",
group: "٬",
minus: "‏-",
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"", ""},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"CAT": "توقيت وسط أفريقيا", "HAST": "توقيت هاواي ألوتيان الرسمي", "WIT": "توقيت شرق إندونيسيا", "VET": "توقيت فنزويلا", "HKST": "توقيت هونغ كونغ الصيفي", "OESZ": "توقيت شرق أوروبا الصيفي", "HNT": "توقيت نيوفاوندلاند الرسمي", "AWDT": "توقيت غرب أستراليا الصيفي", "AEST": "توقيت شرق أستراليا الرسمي", "CHAST": "توقيت تشاتام الرسمي", "CLT": "توقيت شيلي الرسمي", "TMT": "توقيت تركمانستان الرسمي", "UYST": "توقيت أورغواي الصيفي", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية", "WAST": "توقيت غرب أفريقيا الصيفي", "BT": "توقيت بوتان", "PST": "توقيت المحيط الهادي الرسمي", "PDT": "توقيت المحيط الهادي الصيفي", "GYT": "توقيت غيانا", "JST": "توقيت اليابان الرسمي", "GMT": "توقيت غرينتش", "LHST": "توقيت لورد هاو الرسمي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "AST": "التوقيت الرسمي الأطلسي", "IST": "توقيت الهند", "WARST": "توقيت غرب الأرجنتين الصيفي", "WITA": "توقيت وسط إندونيسيا", "ECT": "توقيت الإكوادور", "HADT": "توقيت هاواي ألوتيان الصيفي", "SGT": "توقيت سنغافورة", "HKT": "توقيت هونغ كونغ الرسمي", "AKST": "التوقيت الرسمي لألاسكا", "WIB": "توقيت غرب إندونيسيا", "LHDT": "التوقيت الصيفي للورد هاو", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "WART": "توقيت غرب الأرجنتين الرسمي", "CLST": "توقيت شيلي الصيفي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "SRT": "توقيت سورينام", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "WAT": "توقيت غرب أفريقيا الرسمي", "NZDT": "توقيت نيوزيلندا الصيفي", "BOT": "توقيت بوليفيا", "UYT": "توقيت أورغواي الرسمي", "COT": "توقيت كولومبيا الرسمي", "MYT": "توقيت ماليزيا", "JDT": "توقيت اليابان الصيفي", "MEZ": "توقيت وسط أوروبا الرسمي", "MESZ": "توقيت وسط أوروبا الصيفي", "HAT": "توقيت نيوفاوندلاند الصيفي", "EAT": "توقيت شرق أفريقيا", "∅∅∅": "توقيت أزورس الصيفي", "AEDT": "توقيت شرق أستراليا الصيفي", "TMST": "توقيت تركمانستان الصيفي", "COST": "توقيت كولومبيا الصيفي", "SAST": "توقيت جنوب أفريقيا", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "NZST": "توقيت نيوزيلندا الرسمي", "WEZ": "توقيت غرب أوروبا الرسمي", "WESZ": "توقيت غرب أوروبا الصيفي", "ACST": "توقيت وسط أستراليا الرسمي", "ACDT": "توقيت وسط أستراليا الصيفي", "ART": "توقيت الأرجنتين الرسمي", "ARST": "توقيت الأرجنتين الصيفي", "AWST": "توقيت غرب أستراليا الرسمي", "CHADT": "توقيت تشاتام الصيفي", "ADT": "التوقيت الصيفي الأطلسي", "GFT": "توقيت غايانا الفرنسية", "AKDT": "توقيت ألاسكا الصيفي", "ChST": "توقيت تشامورو", "OEZ": "توقيت شرق أوروبا الرسمي"},
+ timezones: map[string]string{"MYT": "توقيت ماليزيا", "CLST": "توقيت شيلي الصيفي", "EAT": "توقيت شرق أفريقيا", "PST": "توقيت المحيط الهادي الرسمي", "NZST": "توقيت نيوزيلندا الرسمي", "GMT": "توقيت غرينتش", "AEST": "توقيت شرق أستراليا الرسمي", "AST": "التوقيت الرسمي الأطلسي", "ADT": "التوقيت الصيفي الأطلسي", "JST": "توقيت اليابان الرسمي", "WESZ": "توقيت غرب أوروبا الصيفي", "OESZ": "توقيت شرق أوروبا الصيفي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "MEZ": "توقيت وسط أوروبا الرسمي", "MESZ": "توقيت وسط أوروبا الصيفي", "CAT": "توقيت وسط أفريقيا", "AEDT": "توقيت شرق أستراليا الصيفي", "GYT": "توقيت غيانا", "HKST": "توقيت هونغ كونغ الصيفي", "WITA": "توقيت وسط إندونيسيا", "WIT": "توقيت شرق إندونيسيا", "ACDT": "توقيت وسط أستراليا الصيفي", "HKT": "توقيت هونغ كونغ الرسمي", "ECT": "توقيت الإكوادور", "IST": "توقيت الهند", "WAST": "توقيت غرب أفريقيا الصيفي", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "JDT": "توقيت اليابان الصيفي", "AKST": "التوقيت الرسمي لألاسكا", "BOT": "توقيت بوليفيا", "TMT": "توقيت تركمانستان الرسمي", "UYT": "توقيت أورغواي الرسمي", "WIB": "توقيت غرب إندونيسيا", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "CHADT": "توقيت تشاتام الصيفي", "VET": "توقيت فنزويلا", "AWST": "توقيت غرب أستراليا الرسمي", "WEZ": "توقيت غرب أوروبا الرسمي", "HNT": "توقيت نيوفاوندلاند الرسمي", "ChST": "توقيت تشامورو", "UYST": "توقيت أورغواي الصيفي", "∅∅∅": "توقيت بيرو الصيفي", "WART": "توقيت غرب الأرجنتين الرسمي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "AWDT": "توقيت غرب أستراليا الصيفي", "HADT": "توقيت هاواي ألوتيان الصيفي", "WARST": "توقيت غرب الأرجنتين الصيفي", "ART": "توقيت الأرجنتين الرسمي", "BT": "توقيت بوتان", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "WAT": "توقيت غرب أفريقيا الرسمي", "COST": "توقيت كولومبيا الصيفي", "GFT": "توقيت غايانا الفرنسية", "SGT": "توقيت سنغافورة", "ARST": "توقيت الأرجنتين الصيفي", "NZDT": "توقيت نيوزيلندا الصيفي", "ACST": "توقيت وسط أستراليا الرسمي", "SRT": "توقيت سورينام", "PDT": "توقيت المحيط الهادي الصيفي", "HAST": "توقيت هاواي ألوتيان الرسمي", "HAT": "توقيت نيوفاوندلاند الصيفي", "COT": "توقيت كولومبيا الرسمي", "TMST": "توقيت تركمانستان الصيفي", "OEZ": "توقيت شرق أوروبا الرسمي", "LHST": "توقيت لورد هاو الرسمي", "LHDT": "التوقيت الصيفي للورد هاو", "CLT": "توقيت شيلي الرسمي", "CHAST": "توقيت تشاتام الرسمي", "AKDT": "توقيت ألاسكا الصيفي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "SAST": "توقيت جنوب أفريقيا"},
}
}
diff --git a/ar_KW/ar_KW_test.go b/ar_KW/ar_KW_test.go
new file mode 100644
index 00000000..5b07a3a7
--- /dev/null
+++ b/ar_KW/ar_KW_test.go
@@ -0,0 +1,1120 @@
+package ar_KW
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_KW"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ar_LB/ar_LB.go b/ar_LB/ar_LB.go
index 5c647c41..7b27c163 100644
--- a/ar_LB/ar_LB.go
+++ b/ar_LB/ar_LB.go
@@ -47,7 +47,7 @@ func New() locales.Translator {
locale: "ar_LB",
pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
pluralsOrdinal: []locales.PluralRule{6},
- pluralsRange: []locales.PluralRule{5, 6, 1, 4},
+ pluralsRange: []locales.PluralRule{1, 4, 5, 6},
decimal: ",",
group: ".",
minus: "‏-",
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"", ""},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"OESZ": "توقيت شرق أوروبا الصيفي", "PST": "توقيت المحيط الهادي الرسمي", "UYST": "توقيت أورغواي الصيفي", "WEZ": "توقيت غرب أوروبا الرسمي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "COST": "توقيت كولومبيا الصيفي", "WIT": "توقيت شرق إندونيسيا", "MDT": "MDT", "LHDT": "التوقيت الصيفي للورد هاو", "MYT": "توقيت ماليزيا", "OEZ": "توقيت شرق أوروبا الرسمي", "WITA": "توقيت وسط إندونيسيا", "EAT": "توقيت شرق أفريقيا", "VET": "توقيت فنزويلا", "HKT": "توقيت هونغ كونغ الرسمي", "AWDT": "توقيت غرب أستراليا الصيفي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "AEST": "توقيت شرق أستراليا الرسمي", "CHADT": "توقيت تشاتام الصيفي", "HAST": "توقيت هاواي ألوتيان الرسمي", "SAST": "توقيت جنوب أفريقيا", "IST": "توقيت الهند", "ART": "توقيت الأرجنتين الرسمي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "UYT": "توقيت أورغواي الرسمي", "AEDT": "توقيت شرق أستراليا الصيفي", "HAT": "توقيت نيوفاوندلاند الصيفي", "MEZ": "توقيت وسط أوروبا الرسمي", "MESZ": "توقيت وسط أوروبا الصيفي", "BOT": "توقيت بوليفيا", "WARST": "توقيت غرب الأرجنتين الصيفي", "ACDT": "توقيت وسط أستراليا الصيفي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "CLT": "توقيت شيلي الرسمي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "AST": "التوقيت الرسمي الأطلسي", "PDT": "توقيت المحيط الهادي الصيفي", "WAT": "توقيت غرب أفريقيا الرسمي", "BT": "توقيت بوتان", "HNT": "توقيت نيوفاوندلاند الرسمي", "MST": "MST", "CLST": "توقيت شيلي الصيفي", "ADT": "التوقيت الصيفي الأطلسي", "WART": "توقيت غرب الأرجنتين الرسمي", "ACST": "توقيت وسط أستراليا الرسمي", "ARST": "توقيت الأرجنتين الصيفي", "JST": "توقيت اليابان الرسمي", "CHAST": "توقيت تشاتام الرسمي", "CAT": "توقيت وسط أفريقيا", "COT": "توقيت كولومبيا الرسمي", "∅∅∅": "توقيت الأمازون الصيفي", "AKDT": "توقيت ألاسكا الصيفي", "LHST": "توقيت لورد هاو الرسمي", "NZDT": "توقيت نيوزيلندا الصيفي", "ECT": "توقيت الإكوادور", "NZST": "توقيت نيوزيلندا الرسمي", "SGT": "توقيت سنغافورة", "WIB": "توقيت غرب إندونيسيا", "GMT": "توقيت غرينتش", "GFT": "توقيت غايانا الفرنسية", "TMT": "توقيت تركمانستان الرسمي", "GYT": "توقيت غيانا", "JDT": "توقيت اليابان الصيفي", "WESZ": "توقيت غرب أوروبا الصيفي", "ChST": "توقيت تشامورو", "HKST": "توقيت هونغ كونغ الصيفي", "TMST": "توقيت تركمانستان الصيفي", "SRT": "توقيت سورينام", "AKST": "التوقيت الرسمي لألاسكا", "WAST": "توقيت غرب أفريقيا الصيفي", "HADT": "توقيت هاواي ألوتيان الصيفي", "AWST": "توقيت غرب أستراليا الرسمي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية"},
+ timezones: map[string]string{"LHDT": "التوقيت الصيفي للورد هاو", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "GFT": "توقيت غايانا الفرنسية", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "PST": "توقيت المحيط الهادي الرسمي", "MESZ": "توقيت وسط أوروبا الصيفي", "ACDT": "توقيت وسط أستراليا الصيفي", "WART": "توقيت غرب الأرجنتين الرسمي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "ART": "توقيت الأرجنتين الرسمي", "EAT": "توقيت شرق أفريقيا", "WARST": "توقيت غرب الأرجنتين الصيفي", "IST": "توقيت الهند", "UYST": "توقيت أورغواي الصيفي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "NZST": "توقيت نيوزيلندا الرسمي", "PDT": "توقيت المحيط الهادي الصيفي", "WESZ": "توقيت غرب أوروبا الصيفي", "BOT": "توقيت بوليفيا", "TMT": "توقيت تركمانستان الرسمي", "WIT": "توقيت شرق إندونيسيا", "∅∅∅": "توقيت برازيليا الصيفي", "HKST": "توقيت هونغ كونغ الصيفي", "CHAST": "توقيت تشاتام الرسمي", "JST": "توقيت اليابان الرسمي", "NZDT": "توقيت نيوزيلندا الصيفي", "WEZ": "توقيت غرب أوروبا الرسمي", "COT": "توقيت كولومبيا الرسمي", "AEST": "توقيت شرق أستراليا الرسمي", "WIB": "توقيت غرب إندونيسيا", "AWST": "توقيت غرب أستراليا الرسمي", "WITA": "توقيت وسط إندونيسيا", "SAST": "توقيت جنوب أفريقيا", "TMST": "توقيت تركمانستان الصيفي", "HNT": "توقيت نيوفاوندلاند الرسمي", "UYT": "توقيت أورغواي الرسمي", "MEZ": "توقيت وسط أوروبا الرسمي", "HADT": "توقيت هاواي ألوتيان الصيفي", "CLT": "توقيت شيلي الرسمي", "HAST": "توقيت هاواي ألوتيان الرسمي", "CAT": "توقيت وسط أفريقيا", "OESZ": "توقيت شرق أوروبا الصيفي", "LHST": "توقيت لورد هاو الرسمي", "ACST": "توقيت وسط أستراليا الرسمي", "AKST": "التوقيت الرسمي لألاسكا", "AKDT": "توقيت ألاسكا الصيفي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "AWDT": "توقيت غرب أستراليا الصيفي", "OEZ": "توقيت شرق أوروبا الرسمي", "VET": "توقيت فنزويلا", "HAT": "توقيت نيوفاوندلاند الصيفي", "COST": "توقيت كولومبيا الصيفي", "GMT": "توقيت غرينتش", "BT": "توقيت بوتان", "MYT": "توقيت ماليزيا", "ECT": "توقيت الإكوادور", "AST": "التوقيت الرسمي الأطلسي", "SGT": "توقيت سنغافورة", "GYT": "توقيت غيانا", "SRT": "توقيت سورينام", "CHADT": "توقيت تشاتام الصيفي", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "JDT": "توقيت اليابان الصيفي", "ADT": "التوقيت الصيفي الأطلسي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "WAST": "توقيت غرب أفريقيا الصيفي", "AEDT": "توقيت شرق أستراليا الصيفي", "ChST": "توقيت تشامورو", "CLST": "توقيت شيلي الصيفي", "HKT": "توقيت هونغ كونغ الرسمي", "ARST": "توقيت الأرجنتين الصيفي", "WAT": "توقيت غرب أفريقيا الرسمي"},
}
}
diff --git a/ar_LB/ar_LB_test.go b/ar_LB/ar_LB_test.go
new file mode 100644
index 00000000..694225c8
--- /dev/null
+++ b/ar_LB/ar_LB_test.go
@@ -0,0 +1,1120 @@
+package ar_LB
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_LB"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ar_LY/ar_LY.go b/ar_LY/ar_LY.go
index 9c69a956..70dc8c4d 100644
--- a/ar_LY/ar_LY.go
+++ b/ar_LY/ar_LY.go
@@ -47,7 +47,7 @@ func New() locales.Translator {
locale: "ar_LY",
pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
pluralsOrdinal: []locales.PluralRule{6},
- pluralsRange: []locales.PluralRule{4, 5, 6, 1},
+ pluralsRange: []locales.PluralRule{1, 4, 5, 6},
decimal: ",",
group: ".",
minus: "‏-",
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"", ""},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"MST": "MST", "ACDT": "توقيت وسط أستراليا الصيفي", "AWST": "توقيت غرب أستراليا الرسمي", "LHST": "توقيت لورد هاو الرسمي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "WAST": "توقيت غرب أفريقيا الصيفي", "HNT": "توقيت نيوفاوندلاند الرسمي", "CHAST": "توقيت تشاتام الرسمي", "CLST": "توقيت شيلي الصيفي", "WEZ": "توقيت غرب أوروبا الرسمي", "OEZ": "توقيت شرق أوروبا الرسمي", "PST": "توقيت المحيط الهادي الرسمي", "NZST": "توقيت نيوزيلندا الرسمي", "COT": "توقيت كولومبيا الرسمي", "BT": "توقيت بوتان", "AWDT": "توقيت غرب أستراليا الصيفي", "ACST": "توقيت وسط أستراليا الرسمي", "SRT": "توقيت سورينام", "AKST": "التوقيت الرسمي لألاسكا", "NZDT": "توقيت نيوزيلندا الصيفي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "ECT": "توقيت الإكوادور", "HADT": "توقيت هاواي ألوتيان الصيفي", "WIT": "توقيت شرق إندونيسيا", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "LHDT": "التوقيت الصيفي للورد هاو", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "WAT": "توقيت غرب أفريقيا الرسمي", "GMT": "توقيت غرينتش", "MYT": "توقيت ماليزيا", "BOT": "توقيت بوليفيا", "HAST": "توقيت هاواي ألوتيان الرسمي", "SAST": "توقيت جنوب أفريقيا", "UYT": "توقيت أورغواي الرسمي", "AEST": "توقيت شرق أستراليا الرسمي", "CAT": "توقيت وسط أفريقيا", "COST": "توقيت كولومبيا الصيفي", "HKST": "توقيت هونغ كونغ الصيفي", "PDT": "توقيت المحيط الهادي الصيفي", "AKDT": "توقيت ألاسكا الصيفي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "ARST": "توقيت الأرجنتين الصيفي", "UYST": "توقيت أورغواي الصيفي", "HKT": "توقيت هونغ كونغ الرسمي", "ART": "توقيت الأرجنتين الرسمي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "CHADT": "توقيت تشاتام الصيفي", "WITA": "توقيت وسط إندونيسيا", "HAT": "توقيت نيوفاوندلاند الصيفي", "ChST": "توقيت تشامورو", "TMT": "توقيت تركمانستان الرسمي", "JDT": "توقيت اليابان الصيفي", "JST": "توقيت اليابان الرسمي", "MEZ": "توقيت وسط أوروبا الرسمي", "VET": "توقيت فنزويلا", "WESZ": "توقيت غرب أوروبا الصيفي", "AST": "التوقيت الرسمي الأطلسي", "∅∅∅": "∅∅∅", "WIB": "توقيت غرب إندونيسيا", "IST": "توقيت الهند", "OESZ": "توقيت شرق أوروبا الصيفي", "MDT": "MDT", "AEDT": "توقيت شرق أستراليا الصيفي", "SGT": "توقيت سنغافورة", "WART": "توقيت غرب الأرجنتين الرسمي", "GYT": "توقيت غيانا", "MESZ": "توقيت وسط أوروبا الصيفي", "CLT": "توقيت شيلي الرسمي", "WARST": "توقيت غرب الأرجنتين الصيفي", "TMST": "توقيت تركمانستان الصيفي", "EAT": "توقيت شرق أفريقيا", "ADT": "التوقيت الصيفي الأطلسي", "GFT": "توقيت غايانا الفرنسية"},
+ timezones: map[string]string{"AKST": "التوقيت الرسمي لألاسكا", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "MESZ": "توقيت وسط أوروبا الصيفي", "CAT": "توقيت وسط أفريقيا", "CLST": "توقيت شيلي الصيفي", "CHAST": "توقيت تشاتام الرسمي", "WAST": "توقيت غرب أفريقيا الصيفي", "WESZ": "توقيت غرب أوروبا الصيفي", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية", "ECT": "توقيت الإكوادور", "HKT": "توقيت هونغ كونغ الرسمي", "WAT": "توقيت غرب أفريقيا الرسمي", "OEZ": "توقيت شرق أوروبا الرسمي", "AEST": "توقيت شرق أستراليا الرسمي", "GFT": "توقيت غايانا الفرنسية", "VET": "توقيت فنزويلا", "HADT": "توقيت هاواي ألوتيان الصيفي", "OESZ": "توقيت شرق أوروبا الصيفي", "MYT": "توقيت ماليزيا", "EAT": "توقيت شرق أفريقيا", "BT": "توقيت بوتان", "UYST": "توقيت أورغواي الصيفي", "ACDT": "توقيت وسط أستراليا الصيفي", "ARST": "توقيت الأرجنتين الصيفي", "PDT": "توقيت المحيط الهادي الصيفي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "COST": "توقيت كولومبيا الصيفي", "AEDT": "توقيت شرق أستراليا الصيفي", "WITA": "توقيت وسط إندونيسيا", "PST": "توقيت المحيط الهادي الرسمي", "HAT": "توقيت نيوفاوندلاند الصيفي", "UYT": "توقيت أورغواي الرسمي", "SRT": "توقيت سورينام", "NZDT": "توقيت نيوزيلندا الصيفي", "HNT": "توقيت نيوفاوندلاند الرسمي", "COT": "توقيت كولومبيا الرسمي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "WEZ": "توقيت غرب أوروبا الرسمي", "GYT": "توقيت غيانا", "CLT": "توقيت شيلي الرسمي", "LHDT": "التوقيت الصيفي للورد هاو", "AWDT": "توقيت غرب أستراليا الصيفي", "AST": "التوقيت الرسمي الأطلسي", "ADT": "التوقيت الصيفي الأطلسي", "BOT": "توقيت بوليفيا", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "CHADT": "توقيت تشاتام الصيفي", "IST": "توقيت الهند", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "∅∅∅": "توقيت الأمازون الصيفي", "LHST": "توقيت لورد هاو الرسمي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "TMST": "توقيت تركمانستان الصيفي", "ChST": "توقيت تشامورو", "ART": "توقيت الأرجنتين الرسمي", "TMT": "توقيت تركمانستان الرسمي", "WIT": "توقيت شرق إندونيسيا", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "HKST": "توقيت هونغ كونغ الصيفي", "JST": "توقيت اليابان الرسمي", "JDT": "توقيت اليابان الصيفي", "AKDT": "توقيت ألاسكا الصيفي", "SAST": "توقيت جنوب أفريقيا", "GMT": "توقيت غرينتش", "AWST": "توقيت غرب أستراليا الرسمي", "HAST": "توقيت هاواي ألوتيان الرسمي", "NZST": "توقيت نيوزيلندا الرسمي", "SGT": "توقيت سنغافورة", "WIB": "توقيت غرب إندونيسيا", "MEZ": "توقيت وسط أوروبا الرسمي", "ACST": "توقيت وسط أستراليا الرسمي", "WART": "توقيت غرب الأرجنتين الرسمي", "WARST": "توقيت غرب الأرجنتين الصيفي"},
}
}
diff --git a/ar_LY/ar_LY_test.go b/ar_LY/ar_LY_test.go
new file mode 100644
index 00000000..b5a125d6
--- /dev/null
+++ b/ar_LY/ar_LY_test.go
@@ -0,0 +1,1120 @@
+package ar_LY
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_LY"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ar_MA/ar_MA.go b/ar_MA/ar_MA.go
index 0fcada59..561fe204 100644
--- a/ar_MA/ar_MA.go
+++ b/ar_MA/ar_MA.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"", ""},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"HNT": "توقيت نيوفاوندلاند الرسمي", "MST": "MST", "AKST": "التوقيت الرسمي لألاسكا", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "AST": "التوقيت الرسمي الأطلسي", "HAST": "توقيت هاواي ألوتيان الرسمي", "HKST": "توقيت هونغ كونغ الصيفي", "WARST": "توقيت غرب الأرجنتين الصيفي", "WIT": "توقيت شرق إندونيسيا", "ART": "توقيت الأرجنتين الرسمي", "MESZ": "توقيت وسط أوروبا الصيفي", "ECT": "توقيت الإكوادور", "HKT": "توقيت هونغ كونغ الرسمي", "WART": "توقيت غرب الأرجنتين الرسمي", "JST": "توقيت اليابان الرسمي", "PDT": "توقيت المحيط الهادي الصيفي", "NZDT": "توقيت نيوزيلندا الصيفي", "UYT": "توقيت أورغواي الرسمي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "SRT": "توقيت سورينام", "AKDT": "توقيت ألاسكا الصيفي", "GYT": "توقيت غيانا", "HAT": "توقيت نيوفاوندلاند الصيفي", "GFT": "توقيت غايانا الفرنسية", "AWDT": "توقيت غرب أستراليا الصيفي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "WIB": "توقيت غرب إندونيسيا", "IST": "توقيت الهند", "EAT": "توقيت شرق أفريقيا", "JDT": "توقيت اليابان الصيفي", "WESZ": "توقيت غرب أوروبا الصيفي", "AEDT": "توقيت شرق أستراليا الصيفي", "CHAST": "توقيت تشاتام الرسمي", "WAST": "توقيت غرب أفريقيا الصيفي", "MDT": "MDT", "NZST": "توقيت نيوزيلندا الرسمي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "∅∅∅": "توقيت برازيليا الصيفي", "ADT": "التوقيت الصيفي الأطلسي", "HADT": "توقيت هاواي ألوتيان الصيفي", "WAT": "توقيت غرب أفريقيا الرسمي", "BT": "توقيت بوتان", "PST": "توقيت المحيط الهادي الرسمي", "CAT": "توقيت وسط أفريقيا", "TMST": "توقيت تركمانستان الصيفي", "MYT": "توقيت ماليزيا", "BOT": "توقيت بوليفيا", "CLT": "توقيت شيلي الرسمي", "WEZ": "توقيت غرب أوروبا الرسمي", "WITA": "توقيت وسط إندونيسيا", "UYST": "توقيت أورغواي الصيفي", "CHADT": "توقيت تشاتام الصيفي", "OEZ": "توقيت شرق أوروبا الرسمي", "GMT": "توقيت غرينتش", "ACDT": "توقيت وسط أستراليا الصيفي", "TMT": "توقيت تركمانستان الرسمي", "AEST": "توقيت شرق أستراليا الرسمي", "SGT": "توقيت سنغافورة", "ARST": "توقيت الأرجنتين الصيفي", "LHDT": "التوقيت الصيفي للورد هاو", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "MEZ": "توقيت وسط أوروبا الرسمي", "CLST": "توقيت شيلي الصيفي", "VET": "توقيت فنزويلا", "ChST": "توقيت تشامورو", "SAST": "توقيت جنوب أفريقيا", "ACST": "توقيت وسط أستراليا الرسمي", "COT": "توقيت كولومبيا الرسمي", "COST": "توقيت كولومبيا الصيفي", "OESZ": "توقيت شرق أوروبا الصيفي", "AWST": "توقيت غرب أستراليا الرسمي", "LHST": "توقيت لورد هاو الرسمي"},
+ timezones: map[string]string{"TMT": "توقيت تركمانستان الرسمي", "UYT": "توقيت أورغواي الرسمي", "AST": "التوقيت الرسمي الأطلسي", "COT": "توقيت كولومبيا الرسمي", "WAT": "توقيت غرب أفريقيا الرسمي", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية", "HKT": "توقيت هونغ كونغ الرسمي", "JST": "توقيت اليابان الرسمي", "BOT": "توقيت بوليفيا", "HAT": "توقيت نيوفاوندلاند الصيفي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "ACDT": "توقيت وسط أستراليا الصيفي", "WART": "توقيت غرب الأرجنتين الرسمي", "SRT": "توقيت سورينام", "ART": "توقيت الأرجنتين الرسمي", "SAST": "توقيت جنوب أفريقيا", "WAST": "توقيت غرب أفريقيا الصيفي", "HKST": "توقيت هونغ كونغ الصيفي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "NZDT": "توقيت نيوزيلندا الصيفي", "GYT": "توقيت غيانا", "NZST": "توقيت نيوزيلندا الرسمي", "CLST": "توقيت شيلي الصيفي", "ADT": "التوقيت الصيفي الأطلسي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "SGT": "توقيت سنغافورة", "WESZ": "توقيت غرب أوروبا الصيفي", "HNT": "توقيت نيوفاوندلاند الرسمي", "CLT": "توقيت شيلي الرسمي", "UYST": "توقيت أورغواي الصيفي", "EAT": "توقيت شرق أفريقيا", "ACST": "توقيت وسط أستراليا الرسمي", "WIB": "توقيت غرب إندونيسيا", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "AEDT": "توقيت شرق أستراليا الصيفي", "BT": "توقيت بوتان", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "GFT": "توقيت غايانا الفرنسية", "HADT": "توقيت هاواي ألوتيان الصيفي", "AKST": "التوقيت الرسمي لألاسكا", "LHDT": "التوقيت الصيفي للورد هاو", "ChST": "توقيت تشامورو", "LHST": "توقيت لورد هاو الرسمي", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "VET": "توقيت فنزويلا", "ARST": "توقيت الأرجنتين الصيفي", "MEZ": "توقيت وسط أوروبا الرسمي", "PDT": "توقيت المحيط الهادي الصيفي", "COST": "توقيت كولومبيا الصيفي", "HAST": "توقيت هاواي ألوتيان الرسمي", "CHAST": "توقيت تشاتام الرسمي", "CHADT": "توقيت تشاتام الصيفي", "TMST": "توقيت تركمانستان الصيفي", "OESZ": "توقيت شرق أوروبا الصيفي", "MYT": "توقيت ماليزيا", "WITA": "توقيت وسط إندونيسيا", "JDT": "توقيت اليابان الصيفي", "WEZ": "توقيت غرب أوروبا الرسمي", "AKDT": "توقيت ألاسكا الصيفي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "AWST": "توقيت غرب أستراليا الرسمي", "AWDT": "توقيت غرب أستراليا الصيفي", "AEST": "توقيت شرق أستراليا الرسمي", "∅∅∅": "توقيت الأمازون الصيفي", "OEZ": "توقيت شرق أوروبا الرسمي", "WARST": "توقيت غرب الأرجنتين الصيفي", "ECT": "توقيت الإكوادور", "IST": "توقيت الهند", "MESZ": "توقيت وسط أوروبا الصيفي", "CAT": "توقيت وسط أفريقيا", "GMT": "توقيت غرينتش", "WIT": "توقيت شرق إندونيسيا", "PST": "توقيت المحيط الهادي الرسمي"},
}
}
diff --git a/ar_MA/ar_MA_test.go b/ar_MA/ar_MA_test.go
new file mode 100644
index 00000000..11c68780
--- /dev/null
+++ b/ar_MA/ar_MA_test.go
@@ -0,0 +1,1120 @@
+package ar_MA
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_MA"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ar_MR/ar_MR.go b/ar_MR/ar_MR.go
index 43358ec9..582536bc 100644
--- a/ar_MR/ar_MR.go
+++ b/ar_MR/ar_MR.go
@@ -47,7 +47,7 @@ func New() locales.Translator {
locale: "ar_MR",
pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
pluralsOrdinal: []locales.PluralRule{6},
- pluralsRange: []locales.PluralRule{5, 6, 1, 4},
+ pluralsRange: []locales.PluralRule{1, 4, 5, 6},
decimal: ",",
group: ".",
minus: "‏-",
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"", ""},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"WESZ": "توقيت غرب أوروبا الصيفي", "AEDT": "توقيت شرق أستراليا الصيفي", "HKST": "توقيت هونغ كونغ الصيفي", "OESZ": "توقيت شرق أوروبا الصيفي", "ARST": "توقيت الأرجنتين الصيفي", "MEZ": "توقيت وسط أوروبا الرسمي", "VET": "توقيت فنزويلا", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "COST": "توقيت كولومبيا الصيفي", "GYT": "توقيت غيانا", "HAST": "توقيت هاواي ألوتيان الرسمي", "WAST": "توقيت غرب أفريقيا الصيفي", "HKT": "توقيت هونغ كونغ الرسمي", "HNT": "توقيت نيوفاوندلاند الرسمي", "NZDT": "توقيت نيوزيلندا الصيفي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "AKDT": "توقيت ألاسكا الصيفي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "BOT": "توقيت بوليفيا", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "AEST": "توقيت شرق أستراليا الرسمي", "CHADT": "توقيت تشاتام الصيفي", "ECT": "توقيت الإكوادور", "∅∅∅": "توقيت برازيليا الصيفي", "WAT": "توقيت غرب أفريقيا الرسمي", "WART": "توقيت غرب الأرجنتين الرسمي", "PDT": "توقيت المحيط الهادي الصيفي", "LHST": "توقيت لورد هاو الرسمي", "SGT": "توقيت سنغافورة", "SAST": "توقيت جنوب أفريقيا", "BT": "توقيت بوتان", "OEZ": "توقيت شرق أوروبا الرسمي", "WIT": "توقيت شرق إندونيسيا", "TMT": "توقيت تركمانستان الرسمي", "LHDT": "التوقيت الصيفي للورد هاو", "CLST": "توقيت شيلي الصيفي", "COT": "توقيت كولومبيا الرسمي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "MESZ": "توقيت وسط أوروبا الصيفي", "UYT": "توقيت أورغواي الرسمي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "ADT": "التوقيت الصيفي الأطلسي", "GFT": "توقيت غايانا الفرنسية", "MYT": "توقيت ماليزيا", "HADT": "توقيت هاواي ألوتيان الصيفي", "EAT": "توقيت شرق أفريقيا", "AWST": "توقيت غرب أستراليا الرسمي", "AWDT": "توقيت غرب أستراليا الصيفي", "JST": "توقيت اليابان الرسمي", "WEZ": "توقيت غرب أوروبا الرسمي", "TMST": "توقيت تركمانستان الصيفي", "CHAST": "توقيت تشاتام الرسمي", "ART": "توقيت الأرجنتين الرسمي", "PST": "توقيت المحيط الهادي الرسمي", "JDT": "توقيت اليابان الصيفي", "NZST": "توقيت نيوزيلندا الرسمي", "IST": "توقيت الهند", "GMT": "توقيت غرينتش", "HAT": "توقيت نيوفاوندلاند الصيفي", "ChST": "توقيت تشامورو", "CLT": "توقيت شيلي الرسمي", "WARST": "توقيت غرب الأرجنتين الصيفي", "WIB": "توقيت غرب إندونيسيا", "ACDT": "توقيت وسط أستراليا الصيفي", "UYST": "توقيت أورغواي الصيفي", "WITA": "توقيت وسط إندونيسيا", "ACST": "توقيت وسط أستراليا الرسمي", "AKST": "التوقيت الرسمي لألاسكا", "CAT": "توقيت وسط أفريقيا", "AST": "التوقيت الرسمي الأطلسي", "SRT": "توقيت سورينام"},
+ timezones: map[string]string{"CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "WITA": "توقيت وسط إندونيسيا", "CLST": "توقيت شيلي الصيفي", "UYST": "توقيت أورغواي الصيفي", "WIB": "توقيت غرب إندونيسيا", "AEDT": "توقيت شرق أستراليا الصيفي", "ART": "توقيت الأرجنتين الرسمي", "ARST": "توقيت الأرجنتين الصيفي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "HAT": "توقيت نيوفاوندلاند الصيفي", "OESZ": "توقيت شرق أوروبا الصيفي", "WARST": "توقيت غرب الأرجنتين الصيفي", "VET": "توقيت فنزويلا", "PST": "توقيت المحيط الهادي الرسمي", "ACST": "توقيت وسط أستراليا الرسمي", "ACDT": "توقيت وسط أستراليا الصيفي", "CHAST": "توقيت تشاتام الرسمي", "HNT": "توقيت نيوفاوندلاند الرسمي", "AEST": "توقيت شرق أستراليا الرسمي", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية", "∅∅∅": "توقيت الأمازون الصيفي", "WIT": "توقيت شرق إندونيسيا", "SRT": "توقيت سورينام", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "MEZ": "توقيت وسط أوروبا الرسمي", "HAST": "توقيت هاواي ألوتيان الرسمي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "WAT": "توقيت غرب أفريقيا الرسمي", "ChST": "توقيت تشامورو", "OEZ": "توقيت شرق أوروبا الرسمي", "GMT": "توقيت غرينتش", "AKST": "التوقيت الرسمي لألاسكا", "AKDT": "توقيت ألاسكا الصيفي", "AST": "التوقيت الرسمي الأطلسي", "LHDT": "التوقيت الصيفي للورد هاو", "ECT": "توقيت الإكوادور", "CHADT": "توقيت تشاتام الصيفي", "UYT": "توقيت أورغواي الرسمي", "NZDT": "توقيت نيوزيلندا الصيفي", "BOT": "توقيت بوليفيا", "TMT": "توقيت تركمانستان الرسمي", "TMST": "توقيت تركمانستان الصيفي", "EAT": "توقيت شرق أفريقيا", "ADT": "التوقيت الصيفي الأطلسي", "HADT": "توقيت هاواي ألوتيان الصيفي", "SAST": "توقيت جنوب أفريقيا", "JDT": "توقيت اليابان الصيفي", "PDT": "توقيت المحيط الهادي الصيفي", "SGT": "توقيت سنغافورة", "COST": "توقيت كولومبيا الصيفي", "WAST": "توقيت غرب أفريقيا الصيفي", "AWST": "توقيت غرب أستراليا الرسمي", "AWDT": "توقيت غرب أستراليا الصيفي", "JST": "توقيت اليابان الرسمي", "GYT": "توقيت غيانا", "HKST": "توقيت هونغ كونغ الصيفي", "LHST": "توقيت لورد هاو الرسمي", "WART": "توقيت غرب الأرجنتين الرسمي", "WESZ": "توقيت غرب أوروبا الصيفي", "MYT": "توقيت ماليزيا", "BT": "توقيت بوتان", "NZST": "توقيت نيوزيلندا الرسمي", "GFT": "توقيت غايانا الفرنسية", "HKT": "توقيت هونغ كونغ الرسمي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "CAT": "توقيت وسط أفريقيا", "CLT": "توقيت شيلي الرسمي", "WEZ": "توقيت غرب أوروبا الرسمي", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "MESZ": "توقيت وسط أوروبا الصيفي", "IST": "توقيت الهند", "COT": "توقيت كولومبيا الرسمي"},
}
}
diff --git a/ar_MR/ar_MR_test.go b/ar_MR/ar_MR_test.go
new file mode 100644
index 00000000..0c914349
--- /dev/null
+++ b/ar_MR/ar_MR_test.go
@@ -0,0 +1,1120 @@
+package ar_MR
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_MR"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ar_OM/ar_OM.go b/ar_OM/ar_OM.go
index c5ce3667..0e2232c3 100644
--- a/ar_OM/ar_OM.go
+++ b/ar_OM/ar_OM.go
@@ -47,7 +47,7 @@ func New() locales.Translator {
locale: "ar_OM",
pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
pluralsOrdinal: []locales.PluralRule{6},
- pluralsRange: []locales.PluralRule{1, 4, 5, 6},
+ pluralsRange: []locales.PluralRule{6, 1, 4, 5},
decimal: "٫",
group: "٬",
minus: "‏-",
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"", ""},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"WESZ": "توقيت غرب أوروبا الصيفي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "CHADT": "توقيت تشاتام الصيفي", "SAST": "توقيت جنوب أفريقيا", "ACDT": "توقيت وسط أستراليا الصيفي", "MESZ": "توقيت وسط أوروبا الصيفي", "WEZ": "توقيت غرب أوروبا الرسمي", "AWDT": "توقيت غرب أستراليا الصيفي", "BOT": "توقيت بوليفيا", "VET": "توقيت فنزويلا", "CAT": "توقيت وسط أفريقيا", "HNT": "توقيت نيوفاوندلاند الرسمي", "TMST": "توقيت تركمانستان الصيفي", "UYT": "توقيت أورغواي الرسمي", "HAST": "توقيت هاواي ألوتيان الرسمي", "ARST": "توقيت الأرجنتين الصيفي", "AWST": "توقيت غرب أستراليا الرسمي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "ECT": "توقيت الإكوادور", "WARST": "توقيت غرب الأرجنتين الصيفي", "ART": "توقيت الأرجنتين الرسمي", "UYST": "توقيت أورغواي الصيفي", "CLST": "توقيت شيلي الصيفي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "SGT": "توقيت سنغافورة", "WART": "توقيت غرب الأرجنتين الرسمي", "GMT": "توقيت غرينتش", "WITA": "توقيت وسط إندونيسيا", "∅∅∅": "توقيت برازيليا الصيفي", "BT": "توقيت بوتان", "GFT": "توقيت غايانا الفرنسية", "SRT": "توقيت سورينام", "OEZ": "توقيت شرق أوروبا الرسمي", "AKST": "التوقيت الرسمي لألاسكا", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "OESZ": "توقيت شرق أوروبا الصيفي", "MYT": "توقيت ماليزيا", "COT": "توقيت كولومبيا الرسمي", "ADT": "التوقيت الصيفي الأطلسي", "HKST": "توقيت هونغ كونغ الصيفي", "TMT": "توقيت تركمانستان الرسمي", "MEZ": "توقيت وسط أوروبا الرسمي", "NZST": "توقيت نيوزيلندا الرسمي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية", "COST": "توقيت كولومبيا الصيفي", "IST": "توقيت الهند", "HAT": "توقيت نيوفاوندلاند الصيفي", "LHST": "توقيت لورد هاو الرسمي", "JDT": "توقيت اليابان الصيفي", "AST": "التوقيت الرسمي الأطلسي", "HKT": "توقيت هونغ كونغ الرسمي", "WIT": "توقيت شرق إندونيسيا", "ACST": "توقيت وسط أستراليا الرسمي", "AEDT": "توقيت شرق أستراليا الصيفي", "HADT": "توقيت هاواي ألوتيان الصيفي", "WAT": "توقيت غرب أفريقيا الرسمي", "AKDT": "توقيت ألاسكا الصيفي", "LHDT": "التوقيت الصيفي للورد هاو", "GYT": "توقيت غيانا", "AEST": "توقيت شرق أستراليا الرسمي", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "WIB": "توقيت غرب إندونيسيا", "EAT": "توقيت شرق أفريقيا", "PST": "توقيت المحيط الهادي الرسمي", "WAST": "توقيت غرب أفريقيا الصيفي", "PDT": "توقيت المحيط الهادي الصيفي", "JST": "توقيت اليابان الرسمي", "NZDT": "توقيت نيوزيلندا الصيفي", "ChST": "توقيت تشامورو", "CHAST": "توقيت تشاتام الرسمي", "CLT": "توقيت شيلي الرسمي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية"},
+ timezones: map[string]string{"AKDT": "توقيت ألاسكا الصيفي", "JST": "توقيت اليابان الرسمي", "PDT": "توقيت المحيط الهادي الصيفي", "UYT": "توقيت أورغواي الرسمي", "WESZ": "توقيت غرب أوروبا الصيفي", "MST": "MST", "SAST": "توقيت جنوب أفريقيا", "GMT": "توقيت غرينتش", "AEDT": "توقيت شرق أستراليا الصيفي", "CLT": "توقيت شيلي الرسمي", "VET": "توقيت فنزويلا", "AWST": "توقيت غرب أستراليا الرسمي", "ART": "توقيت الأرجنتين الرسمي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "SGT": "توقيت سنغافورة", "WIT": "توقيت شرق إندونيسيا", "MYT": "توقيت ماليزيا", "∅∅∅": "توقيت الأمازون الصيفي", "WAST": "توقيت غرب أفريقيا الصيفي", "WEZ": "توقيت غرب أوروبا الرسمي", "LHDT": "التوقيت الصيفي للورد هاو", "BOT": "توقيت بوليفيا", "HAST": "توقيت هاواي ألوتيان الرسمي", "NZST": "توقيت نيوزيلندا الرسمي", "COT": "توقيت كولومبيا الرسمي", "COST": "توقيت كولومبيا الصيفي", "AEST": "توقيت شرق أستراليا الرسمي", "GYT": "توقيت غيانا", "UYST": "توقيت أورغواي الصيفي", "WARST": "توقيت غرب الأرجنتين الصيفي", "ECT": "توقيت الإكوادور", "AWDT": "توقيت غرب أستراليا الصيفي", "NZDT": "توقيت نيوزيلندا الصيفي", "CAT": "توقيت وسط أفريقيا", "OEZ": "توقيت شرق أوروبا الرسمي", "GFT": "توقيت غايانا الفرنسية", "AKST": "التوقيت الرسمي لألاسكا", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "MEZ": "توقيت وسط أوروبا الرسمي", "MESZ": "توقيت وسط أوروبا الصيفي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "WITA": "توقيت وسط إندونيسيا", "TMST": "توقيت تركمانستان الصيفي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "JDT": "توقيت اليابان الصيفي", "IST": "توقيت الهند", "TMT": "توقيت تركمانستان الرسمي", "HNT": "توقيت نيوفاوندلاند الرسمي", "ACST": "توقيت وسط أستراليا الرسمي", "SRT": "توقيت سورينام", "CHAST": "توقيت تشاتام الرسمي", "ARST": "توقيت الأرجنتين الصيفي", "OESZ": "توقيت شرق أوروبا الصيفي", "BT": "توقيت بوتان", "AST": "التوقيت الرسمي الأطلسي", "ADT": "التوقيت الصيفي الأطلسي", "EAT": "توقيت شرق أفريقيا", "CLST": "توقيت شيلي الصيفي", "ACDT": "توقيت وسط أستراليا الصيفي", "HKT": "توقيت هونغ كونغ الرسمي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "HADT": "توقيت هاواي ألوتيان الصيفي", "WAT": "توقيت غرب أفريقيا الرسمي", "WIB": "توقيت غرب إندونيسيا", "ChST": "توقيت تشامورو", "HAT": "توقيت نيوفاوندلاند الصيفي", "MDT": "MDT", "HKST": "توقيت هونغ كونغ الصيفي", "CHADT": "توقيت تشاتام الصيفي", "PST": "توقيت المحيط الهادي الرسمي", "LHST": "توقيت لورد هاو الرسمي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "WART": "توقيت غرب الأرجنتين الرسمي"},
}
}
diff --git a/ar_OM/ar_OM_test.go b/ar_OM/ar_OM_test.go
new file mode 100644
index 00000000..33a5c8c9
--- /dev/null
+++ b/ar_OM/ar_OM_test.go
@@ -0,0 +1,1120 @@
+package ar_OM
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_OM"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ar_PS/ar_PS.go b/ar_PS/ar_PS.go
index 79f22f58..a4947a01 100644
--- a/ar_PS/ar_PS.go
+++ b/ar_PS/ar_PS.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"", ""},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"TMT": "توقيت تركمانستان الرسمي", "AST": "التوقيت الرسمي الأطلسي", "WAT": "توقيت غرب أفريقيا الرسمي", "GFT": "توقيت غايانا الفرنسية", "UYT": "توقيت أورغواي الرسمي", "WESZ": "توقيت غرب أوروبا الصيفي", "ChST": "توقيت تشامورو", "ADT": "التوقيت الصيفي الأطلسي", "HADT": "توقيت هاواي ألوتيان الصيفي", "WITA": "توقيت وسط إندونيسيا", "TMST": "توقيت تركمانستان الصيفي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "AEST": "توقيت شرق أستراليا الرسمي", "LHDT": "التوقيت الصيفي للورد هاو", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "BT": "توقيت بوتان", "MST": "MST", "PDT": "توقيت المحيط الهادي الصيفي", "MEZ": "توقيت وسط أوروبا الرسمي", "BOT": "توقيت بوليفيا", "UYST": "توقيت أورغواي الصيفي", "WEZ": "توقيت غرب أوروبا الرسمي", "CAT": "توقيت وسط أفريقيا", "SAST": "توقيت جنوب أفريقيا", "IST": "توقيت الهند", "CLST": "توقيت شيلي الصيفي", "HKST": "توقيت هونغ كونغ الصيفي", "ART": "توقيت الأرجنتين الرسمي", "ARST": "توقيت الأرجنتين الصيفي", "LHST": "توقيت لورد هاو الرسمي", "NZDT": "توقيت نيوزيلندا الصيفي", "CHADT": "توقيت تشاتام الصيفي", "EAT": "توقيت شرق أفريقيا", "MDT": "MDT", "WART": "توقيت غرب الأرجنتين الرسمي", "HAT": "توقيت نيوفاوندلاند الصيفي", "JDT": "توقيت اليابان الصيفي", "MYT": "توقيت ماليزيا", "MESZ": "توقيت وسط أوروبا الصيفي", "CHAST": "توقيت تشاتام الرسمي", "COT": "توقيت كولومبيا الرسمي", "WIT": "توقيت شرق إندونيسيا", "WIB": "توقيت غرب إندونيسيا", "PST": "توقيت المحيط الهادي الرسمي", "SGT": "توقيت سنغافورة", "OESZ": "توقيت شرق أوروبا الصيفي", "ACST": "توقيت وسط أستراليا الرسمي", "AWDT": "توقيت غرب أستراليا الصيفي", "VET": "توقيت فنزويلا", "OEZ": "توقيت شرق أوروبا الرسمي", "CLT": "توقيت شيلي الرسمي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "ECT": "توقيت الإكوادور", "HAST": "توقيت هاواي ألوتيان الرسمي", "WAST": "توقيت غرب أفريقيا الصيفي", "SRT": "توقيت سورينام", "AEDT": "توقيت شرق أستراليا الصيفي", "HNT": "توقيت نيوفاوندلاند الرسمي", "JST": "توقيت اليابان الرسمي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "GMT": "توقيت غرينتش", "∅∅∅": "توقيت الأمازون الصيفي", "AWST": "توقيت غرب أستراليا الرسمي", "GYT": "توقيت غيانا", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "COST": "توقيت كولومبيا الصيفي", "HKT": "توقيت هونغ كونغ الرسمي", "ACDT": "توقيت وسط أستراليا الصيفي", "AKST": "التوقيت الرسمي لألاسكا", "AKDT": "توقيت ألاسكا الصيفي", "NZST": "توقيت نيوزيلندا الرسمي", "WARST": "توقيت غرب الأرجنتين الصيفي"},
+ timezones: map[string]string{"GFT": "توقيت غايانا الفرنسية", "HKT": "توقيت هونغ كونغ الرسمي", "AWDT": "توقيت غرب أستراليا الصيفي", "OEZ": "توقيت شرق أوروبا الرسمي", "PST": "توقيت المحيط الهادي الرسمي", "WAST": "توقيت غرب أفريقيا الصيفي", "CLST": "توقيت شيلي الصيفي", "JST": "توقيت اليابان الرسمي", "AST": "التوقيت الرسمي الأطلسي", "CAT": "توقيت وسط أفريقيا", "WESZ": "توقيت غرب أوروبا الصيفي", "AEST": "توقيت شرق أستراليا الرسمي", "CLT": "توقيت شيلي الرسمي", "LHST": "توقيت لورد هاو الرسمي", "ACST": "توقيت وسط أستراليا الرسمي", "ART": "توقيت الأرجنتين الرسمي", "HAST": "توقيت هاواي ألوتيان الرسمي", "OESZ": "توقيت شرق أوروبا الصيفي", "WART": "توقيت غرب الأرجنتين الرسمي", "ADT": "التوقيت الصيفي الأطلسي", "COST": "توقيت كولومبيا الصيفي", "COT": "توقيت كولومبيا الرسمي", "TMT": "توقيت تركمانستان الرسمي", "TMST": "توقيت تركمانستان الصيفي", "EAT": "توقيت شرق أفريقيا", "CHAST": "توقيت تشاتام الرسمي", "AKDT": "توقيت ألاسكا الصيفي", "SGT": "توقيت سنغافورة", "HAT": "توقيت نيوفاوندلاند الصيفي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "MESZ": "توقيت وسط أوروبا الصيفي", "AEDT": "توقيت شرق أستراليا الصيفي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "VET": "توقيت فنزويلا", "AKST": "التوقيت الرسمي لألاسكا", "HNT": "توقيت نيوفاوندلاند الرسمي", "WARST": "توقيت غرب الأرجنتين الصيفي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "PDT": "توقيت المحيط الهادي الصيفي", "UYST": "توقيت أورغواي الصيفي", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "NZDT": "توقيت نيوزيلندا الصيفي", "IST": "توقيت الهند", "WEZ": "توقيت غرب أوروبا الرسمي", "UYT": "توقيت أورغواي الرسمي", "LHDT": "التوقيت الصيفي للورد هاو", "CHADT": "توقيت تشاتام الصيفي", "ECT": "توقيت الإكوادور", "JDT": "توقيت اليابان الصيفي", "MEZ": "توقيت وسط أوروبا الرسمي", "NZST": "توقيت نيوزيلندا الرسمي", "SAST": "توقيت جنوب أفريقيا", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "WAT": "توقيت غرب أفريقيا الرسمي", "WIT": "توقيت شرق إندونيسيا", "ARST": "توقيت الأرجنتين الصيفي", "HADT": "توقيت هاواي ألوتيان الصيفي", "ACDT": "توقيت وسط أستراليا الصيفي", "SRT": "توقيت سورينام", "HKST": "توقيت هونغ كونغ الصيفي", "GMT": "توقيت غرينتش", "ChST": "توقيت تشامورو", "WITA": "توقيت وسط إندونيسيا", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "GYT": "توقيت غيانا", "∅∅∅": "توقيت الأمازون الصيفي", "WIB": "توقيت غرب إندونيسيا", "MYT": "توقيت ماليزيا", "BT": "توقيت بوتان", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية", "AWST": "توقيت غرب أستراليا الرسمي", "BOT": "توقيت بوليفيا"},
}
}
diff --git a/ar_PS/ar_PS_test.go b/ar_PS/ar_PS_test.go
new file mode 100644
index 00000000..8feba658
--- /dev/null
+++ b/ar_PS/ar_PS_test.go
@@ -0,0 +1,1120 @@
+package ar_PS
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_PS"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ar_QA/ar_QA.go b/ar_QA/ar_QA.go
index e585d229..53907a03 100644
--- a/ar_QA/ar_QA.go
+++ b/ar_QA/ar_QA.go
@@ -47,7 +47,7 @@ func New() locales.Translator {
locale: "ar_QA",
pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
pluralsOrdinal: []locales.PluralRule{6},
- pluralsRange: []locales.PluralRule{4, 5, 6, 1},
+ pluralsRange: []locales.PluralRule{1, 4, 5, 6},
decimal: "٫",
group: "٬",
minus: "‏-",
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"", ""},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"UYT": "توقيت أورغواي الرسمي", "WEZ": "توقيت غرب أوروبا الرسمي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "WAST": "توقيت غرب أفريقيا الصيفي", "HKST": "توقيت هونغ كونغ الصيفي", "OESZ": "توقيت شرق أوروبا الصيفي", "ART": "توقيت الأرجنتين الرسمي", "ARST": "توقيت الأرجنتين الصيفي", "AKST": "التوقيت الرسمي لألاسكا", "AKDT": "توقيت ألاسكا الصيفي", "PDT": "توقيت المحيط الهادي الصيفي", "NZDT": "توقيت نيوزيلندا الصيفي", "ADT": "التوقيت الصيفي الأطلسي", "HNT": "توقيت نيوفاوندلاند الرسمي", "JDT": "توقيت اليابان الصيفي", "SRT": "توقيت سورينام", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "COST": "توقيت كولومبيا الصيفي", "AST": "التوقيت الرسمي الأطلسي", "IST": "توقيت الهند", "GFT": "توقيت غايانا الفرنسية", "AWDT": "توقيت غرب أستراليا الصيفي", "VET": "توقيت فنزويلا", "WARST": "توقيت غرب الأرجنتين الصيفي", "WITA": "توقيت وسط إندونيسيا", "EAT": "توقيت شرق أفريقيا", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "BOT": "توقيت بوليفيا", "WAT": "توقيت غرب أفريقيا الرسمي", "COT": "توقيت كولومبيا الرسمي", "WIB": "توقيت غرب إندونيسيا", "AWST": "توقيت غرب أستراليا الرسمي", "LHST": "توقيت لورد هاو الرسمي", "HAT": "توقيت نيوفاوندلاند الصيفي", "ACST": "توقيت وسط أستراليا الرسمي", "SGT": "توقيت سنغافورة", "CHAST": "توقيت تشاتام الرسمي", "BT": "توقيت بوتان", "OEZ": "توقيت شرق أوروبا الرسمي", "ACDT": "توقيت وسط أستراليا الصيفي", "PST": "توقيت المحيط الهادي الرسمي", "AEDT": "توقيت شرق أستراليا الصيفي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "HAST": "توقيت هاواي ألوتيان الرسمي", "SAST": "توقيت جنوب أفريقيا", "∅∅∅": "توقيت الأمازون الصيفي", "JST": "توقيت اليابان الرسمي", "MEZ": "توقيت وسط أوروبا الرسمي", "HKT": "توقيت هونغ كونغ الرسمي", "TMST": "توقيت تركمانستان الصيفي", "AEST": "توقيت شرق أستراليا الرسمي", "HADT": "توقيت هاواي ألوتيان الصيفي", "GMT": "توقيت غرينتش", "WESZ": "توقيت غرب أوروبا الصيفي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "TMT": "توقيت تركمانستان الرسمي", "MDT": "MDT", "CHADT": "توقيت تشاتام الصيفي", "ChST": "توقيت تشامورو", "WIT": "توقيت شرق إندونيسيا", "MESZ": "توقيت وسط أوروبا الصيفي", "CLT": "توقيت شيلي الرسمي", "LHDT": "التوقيت الصيفي للورد هاو", "CAT": "توقيت وسط أفريقيا", "WART": "توقيت غرب الأرجنتين الرسمي", "MYT": "توقيت ماليزيا", "UYST": "توقيت أورغواي الصيفي", "CLST": "توقيت شيلي الصيفي", "ECT": "توقيت الإكوادور", "MST": "MST", "GYT": "توقيت غيانا", "NZST": "توقيت نيوزيلندا الرسمي"},
+ timezones: map[string]string{"GFT": "توقيت غايانا الفرنسية", "MESZ": "توقيت وسط أوروبا الصيفي", "HNT": "توقيت نيوفاوندلاند الرسمي", "GYT": "توقيت غيانا", "HKT": "توقيت هونغ كونغ الرسمي", "CHAST": "توقيت تشاتام الرسمي", "AWST": "توقيت غرب أستراليا الرسمي", "IST": "توقيت الهند", "HAT": "توقيت نيوفاوندلاند الصيفي", "CHADT": "توقيت تشاتام الصيفي", "ECT": "توقيت الإكوادور", "JST": "توقيت اليابان الرسمي", "JDT": "توقيت اليابان الصيفي", "BOT": "توقيت بوليفيا", "SRT": "توقيت سورينام", "MST": "MST", "VET": "توقيت فنزويلا", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "WESZ": "توقيت غرب أوروبا الصيفي", "WIT": "توقيت شرق إندونيسيا", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "CAT": "توقيت وسط أفريقيا", "SGT": "توقيت سنغافورة", "COT": "توقيت كولومبيا الرسمي", "AEST": "توقيت شرق أستراليا الرسمي", "CLT": "توقيت شيلي الرسمي", "UYT": "توقيت أورغواي الرسمي", "GMT": "توقيت غرينتش", "SAST": "توقيت جنوب أفريقيا", "MDT": "MDT", "HKST": "توقيت هونغ كونغ الصيفي", "ARST": "توقيت الأرجنتين الصيفي", "HADT": "توقيت هاواي ألوتيان الصيفي", "WAT": "توقيت غرب أفريقيا الرسمي", "LHST": "توقيت لورد هاو الرسمي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "TMST": "توقيت تركمانستان الصيفي", "BT": "توقيت بوتان", "LHDT": "التوقيت الصيفي للورد هاو", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "AKDT": "توقيت ألاسكا الصيفي", "ADT": "التوقيت الصيفي الأطلسي", "OEZ": "توقيت شرق أوروبا الرسمي", "MYT": "توقيت ماليزيا", "AKST": "التوقيت الرسمي لألاسكا", "AWDT": "توقيت غرب أستراليا الصيفي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "PST": "توقيت المحيط الهادي الرسمي", "MEZ": "توقيت وسط أوروبا الرسمي", "WIB": "توقيت غرب إندونيسيا", "AEDT": "توقيت شرق أستراليا الصيفي", "ACDT": "توقيت وسط أستراليا الصيفي", "WART": "توقيت غرب الأرجنتين الرسمي", "∅∅∅": "توقيت أزورس الصيفي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "HAST": "توقيت هاواي ألوتيان الرسمي", "UYST": "توقيت أورغواي الصيفي", "AST": "التوقيت الرسمي الأطلسي", "ART": "توقيت الأرجنتين الرسمي", "WITA": "توقيت وسط إندونيسيا", "WAST": "توقيت غرب أفريقيا الصيفي", "COST": "توقيت كولومبيا الصيفي", "OESZ": "توقيت شرق أوروبا الصيفي", "NZDT": "توقيت نيوزيلندا الصيفي", "WEZ": "توقيت غرب أوروبا الرسمي", "EAT": "توقيت شرق أفريقيا", "WARST": "توقيت غرب الأرجنتين الصيفي", "PDT": "توقيت المحيط الهادي الصيفي", "TMT": "توقيت تركمانستان الرسمي", "ACST": "توقيت وسط أستراليا الرسمي", "NZST": "توقيت نيوزيلندا الرسمي", "ChST": "توقيت تشامورو", "CLST": "توقيت شيلي الصيفي"},
}
}
diff --git a/ar_QA/ar_QA_test.go b/ar_QA/ar_QA_test.go
new file mode 100644
index 00000000..78aea2aa
--- /dev/null
+++ b/ar_QA/ar_QA_test.go
@@ -0,0 +1,1120 @@
+package ar_QA
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_QA"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ar_SA/ar_SA.go b/ar_SA/ar_SA.go
index 1cd3cb79..a1c6dfd6 100644
--- a/ar_SA/ar_SA.go
+++ b/ar_SA/ar_SA.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"", ""},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"CAT": "توقيت وسط أفريقيا", "WART": "توقيت غرب الأرجنتين الرسمي", "SAST": "توقيت جنوب أفريقيا", "WIT": "توقيت شرق إندونيسيا", "ACDT": "توقيت وسط أستراليا الصيفي", "AWDT": "توقيت غرب أستراليا الصيفي", "AEDT": "توقيت شرق أستراليا الصيفي", "∅∅∅": "توقيت برازيليا الصيفي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "HADT": "توقيت هاواي ألوتيان الصيفي", "UYT": "توقيت أورغواي الرسمي", "CHADT": "توقيت تشاتام الصيفي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "GFT": "توقيت غايانا الفرنسية", "ChST": "توقيت تشامورو", "HKT": "توقيت هونغ كونغ الرسمي", "WEZ": "توقيت غرب أوروبا الرسمي", "ART": "توقيت الأرجنتين الرسمي", "EAT": "توقيت شرق أفريقيا", "NZDT": "توقيت نيوزيلندا الصيفي", "BOT": "توقيت بوليفيا", "UYST": "توقيت أورغواي الصيفي", "MEZ": "توقيت وسط أوروبا الرسمي", "VET": "توقيت فنزويلا", "HNT": "توقيت نيوفاوندلاند الرسمي", "LHDT": "التوقيت الصيفي للورد هاو", "ADT": "التوقيت الصيفي الأطلسي", "WAST": "توقيت غرب أفريقيا الصيفي", "BT": "توقيت بوتان", "JDT": "توقيت اليابان الصيفي", "SRT": "توقيت سورينام", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "CLT": "توقيت شيلي الرسمي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "AKDT": "توقيت ألاسكا الصيفي", "HAST": "توقيت هاواي ألوتيان الرسمي", "IST": "توقيت الهند", "COT": "توقيت كولومبيا الرسمي", "COST": "توقيت كولومبيا الصيفي", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "CHAST": "توقيت تشاتام الرسمي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "HAT": "توقيت نيوفاوندلاند الصيفي", "ACST": "توقيت وسط أستراليا الرسمي", "TMT": "توقيت تركمانستان الرسمي", "AEST": "توقيت شرق أستراليا الرسمي", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية", "MESZ": "توقيت وسط أوروبا الصيفي", "AWST": "توقيت غرب أستراليا الرسمي", "MYT": "توقيت ماليزيا", "WARST": "توقيت غرب الأرجنتين الصيفي", "WITA": "توقيت وسط إندونيسيا", "ARST": "توقيت الأرجنتين الصيفي", "LHST": "توقيت لورد هاو الرسمي", "NZST": "توقيت نيوزيلندا الرسمي", "ECT": "توقيت الإكوادور", "SGT": "توقيت سنغافورة", "WIB": "توقيت غرب إندونيسيا", "GYT": "توقيت غيانا", "AKST": "التوقيت الرسمي لألاسكا", "PDT": "توقيت المحيط الهادي الصيفي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "GMT": "توقيت غرينتش", "TMST": "توقيت تركمانستان الصيفي", "HKST": "توقيت هونغ كونغ الصيفي", "WAT": "توقيت غرب أفريقيا الرسمي", "OEZ": "توقيت شرق أوروبا الرسمي", "PST": "توقيت المحيط الهادي الرسمي", "WESZ": "توقيت غرب أوروبا الصيفي", "AST": "التوقيت الرسمي الأطلسي", "JST": "توقيت اليابان الرسمي", "CLST": "توقيت شيلي الصيفي", "OESZ": "توقيت شرق أوروبا الصيفي"},
+ timezones: map[string]string{"∅∅∅": "توقيت أزورس الصيفي", "ADT": "التوقيت الصيفي الأطلسي", "HADT": "توقيت هاواي ألوتيان الصيفي", "WART": "توقيت غرب الأرجنتين الرسمي", "GFT": "توقيت غايانا الفرنسية", "JST": "توقيت اليابان الرسمي", "AKST": "التوقيت الرسمي لألاسكا", "NZDT": "توقيت نيوزيلندا الصيفي", "WESZ": "توقيت غرب أوروبا الصيفي", "WIT": "توقيت شرق إندونيسيا", "ACDT": "توقيت وسط أستراليا الصيفي", "MEZ": "توقيت وسط أوروبا الرسمي", "VET": "توقيت فنزويلا", "ART": "توقيت الأرجنتين الرسمي", "ARST": "توقيت الأرجنتين الصيفي", "IST": "توقيت الهند", "PST": "توقيت المحيط الهادي الرسمي", "TMST": "توقيت تركمانستان الصيفي", "WEZ": "توقيت غرب أوروبا الرسمي", "CLT": "توقيت شيلي الرسمي", "MDT": "MDT", "WITA": "توقيت وسط إندونيسيا", "HAT": "توقيت نيوفاوندلاند الصيفي", "GMT": "توقيت غرينتش", "GYT": "توقيت غيانا", "UYST": "توقيت أورغواي الصيفي", "BT": "توقيت بوتان", "CHAST": "توقيت تشاتام الرسمي", "CAT": "توقيت وسط أفريقيا", "ChST": "توقيت تشامورو", "LHDT": "التوقيت الصيفي للورد هاو", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "HAST": "توقيت هاواي ألوتيان الرسمي", "TMT": "توقيت تركمانستان الرسمي", "EAT": "توقيت شرق أفريقيا", "ECT": "توقيت الإكوادور", "AKDT": "توقيت ألاسكا الصيفي", "AST": "التوقيت الرسمي الأطلسي", "AWST": "توقيت غرب أستراليا الرسمي", "NZST": "توقيت نيوزيلندا الرسمي", "OEZ": "توقيت شرق أوروبا الرسمي", "MESZ": "توقيت وسط أوروبا الصيفي", "COST": "توقيت كولومبيا الصيفي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "MST": "MST", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "WAST": "توقيت غرب أفريقيا الصيفي", "HNT": "توقيت نيوفاوندلاند الرسمي", "HKST": "توقيت هونغ كونغ الصيفي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "AEST": "توقيت شرق أستراليا الرسمي", "MYT": "توقيت ماليزيا", "WARST": "توقيت غرب الأرجنتين الصيفي", "JDT": "توقيت اليابان الصيفي", "BOT": "توقيت بوليفيا", "COT": "توقيت كولومبيا الرسمي", "LHST": "توقيت لورد هاو الرسمي", "ACST": "توقيت وسط أستراليا الرسمي", "HKT": "توقيت هونغ كونغ الرسمي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "WIB": "توقيت غرب إندونيسيا", "WAT": "توقيت غرب أفريقيا الرسمي", "AEDT": "توقيت شرق أستراليا الصيفي", "UYT": "توقيت أورغواي الرسمي", "SRT": "توقيت سورينام", "CLST": "توقيت شيلي الصيفي", "CHADT": "توقيت تشاتام الصيفي", "AWDT": "توقيت غرب أستراليا الصيفي", "SGT": "توقيت سنغافورة", "SAST": "توقيت جنوب أفريقيا", "PDT": "توقيت المحيط الهادي الصيفي", "OESZ": "توقيت شرق أوروبا الصيفي"},
}
}
diff --git a/ar_SA/ar_SA_test.go b/ar_SA/ar_SA_test.go
new file mode 100644
index 00000000..798310e9
--- /dev/null
+++ b/ar_SA/ar_SA_test.go
@@ -0,0 +1,1120 @@
+package ar_SA
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_SA"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ar_SD/ar_SD.go b/ar_SD/ar_SD.go
index 6d6fb19f..117c705b 100644
--- a/ar_SD/ar_SD.go
+++ b/ar_SD/ar_SD.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"", ""},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"JST": "توقيت اليابان الرسمي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "CHADT": "توقيت تشاتام الصيفي", "HNT": "توقيت نيوفاوندلاند الرسمي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "AEST": "توقيت شرق أستراليا الرسمي", "CHAST": "توقيت تشاتام الرسمي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "WIB": "توقيت غرب إندونيسيا", "MDT": "MDT", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "AEDT": "توقيت شرق أستراليا الصيفي", "WARST": "توقيت غرب الأرجنتين الصيفي", "SGT": "توقيت سنغافورة", "WESZ": "توقيت غرب أوروبا الصيفي", "CLT": "توقيت شيلي الرسمي", "COST": "توقيت كولومبيا الصيفي", "WITA": "توقيت وسط إندونيسيا", "ACST": "توقيت وسط أستراليا الرسمي", "AKST": "التوقيت الرسمي لألاسكا", "LHDT": "التوقيت الصيفي للورد هاو", "MESZ": "توقيت وسط أوروبا الصيفي", "CLST": "توقيت شيلي الصيفي", "GMT": "توقيت غرينتش", "ADT": "التوقيت الصيفي الأطلسي", "SAST": "توقيت جنوب أفريقيا", "WAST": "توقيت غرب أفريقيا الصيفي", "BT": "توقيت بوتان", "HKST": "توقيت هونغ كونغ الصيفي", "OEZ": "توقيت شرق أوروبا الرسمي", "GFT": "توقيت غايانا الفرنسية", "COT": "توقيت كولومبيا الرسمي", "MYT": "توقيت ماليزيا", "SRT": "توقيت سورينام", "AWST": "توقيت غرب أستراليا الرسمي", "HAST": "توقيت هاواي ألوتيان الرسمي", "PST": "توقيت المحيط الهادي الرسمي", "UYT": "توقيت أورغواي الرسمي", "AKDT": "توقيت ألاسكا الصيفي", "AST": "التوقيت الرسمي الأطلسي", "AWDT": "توقيت غرب أستراليا الصيفي", "ChST": "توقيت تشامورو", "EAT": "توقيت شرق أفريقيا", "TMST": "توقيت تركمانستان الصيفي", "PDT": "توقيت المحيط الهادي الصيفي", "GYT": "توقيت غيانا", "JDT": "توقيت اليابان الصيفي", "MEZ": "توقيت وسط أوروبا الرسمي", "UYST": "توقيت أورغواي الصيفي", "WEZ": "توقيت غرب أوروبا الرسمي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "ART": "توقيت الأرجنتين الرسمي", "NZDT": "توقيت نيوزيلندا الصيفي", "WIT": "توقيت شرق إندونيسيا", "TMT": "توقيت تركمانستان الرسمي", "WAT": "توقيت غرب أفريقيا الرسمي", "HAT": "توقيت نيوفاوندلاند الصيفي", "ARST": "توقيت الأرجنتين الصيفي", "BOT": "توقيت بوليفيا", "VET": "توقيت فنزويلا", "WART": "توقيت غرب الأرجنتين الرسمي", "ACDT": "توقيت وسط أستراليا الصيفي", "LHST": "توقيت لورد هاو الرسمي", "NZST": "توقيت نيوزيلندا الرسمي", "MST": "MST", "ECT": "توقيت الإكوادور", "∅∅∅": "توقيت برازيليا الصيفي", "HADT": "توقيت هاواي ألوتيان الصيفي", "HKT": "توقيت هونغ كونغ الرسمي", "IST": "توقيت الهند", "OESZ": "توقيت شرق أوروبا الصيفي", "CAT": "توقيت وسط أفريقيا"},
+ timezones: map[string]string{"AKDT": "توقيت ألاسكا الصيفي", "PST": "توقيت المحيط الهادي الرسمي", "WEZ": "توقيت غرب أوروبا الرسمي", "MYT": "توقيت ماليزيا", "HKT": "توقيت هونغ كونغ الرسمي", "LHDT": "التوقيت الصيفي للورد هاو", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "HKST": "توقيت هونغ كونغ الصيفي", "SAST": "توقيت جنوب أفريقيا", "∅∅∅": "∅∅∅", "WAT": "توقيت غرب أفريقيا الرسمي", "GMT": "توقيت غرينتش", "GYT": "توقيت غيانا", "SRT": "توقيت سورينام", "WART": "توقيت غرب الأرجنتين الرسمي", "WARST": "توقيت غرب الأرجنتين الصيفي", "AWST": "توقيت غرب أستراليا الرسمي", "NZDT": "توقيت نيوزيلندا الصيفي", "HAT": "توقيت نيوفاوندلاند الصيفي", "UYST": "توقيت أورغواي الصيفي", "WIT": "توقيت شرق إندونيسيا", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "BOT": "توقيت بوليفيا", "ChST": "توقيت تشامورو", "AST": "التوقيت الرسمي الأطلسي", "ACDT": "توقيت وسط أستراليا الصيفي", "MEZ": "توقيت وسط أوروبا الرسمي", "TMT": "توقيت تركمانستان الرسمي", "CAT": "توقيت وسط أفريقيا", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "WITA": "توقيت وسط إندونيسيا", "HADT": "توقيت هاواي ألوتيان الصيفي", "NZST": "توقيت نيوزيلندا الرسمي", "COST": "توقيت كولومبيا الصيفي", "CLST": "توقيت شيلي الصيفي", "CHADT": "توقيت تشاتام الصيفي", "ART": "توقيت الأرجنتين الرسمي", "COT": "توقيت كولومبيا الرسمي", "UYT": "توقيت أورغواي الرسمي", "EAT": "توقيت شرق أفريقيا", "BT": "توقيت بوتان", "AKST": "التوقيت الرسمي لألاسكا", "GFT": "توقيت غايانا الفرنسية", "VET": "توقيت فنزويلا", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "JST": "توقيت اليابان الرسمي", "PDT": "توقيت المحيط الهادي الصيفي", "MESZ": "توقيت وسط أوروبا الصيفي", "ECT": "توقيت الإكوادور", "AWDT": "توقيت غرب أستراليا الصيفي", "IST": "توقيت الهند", "TMST": "توقيت تركمانستان الصيفي", "LHST": "توقيت لورد هاو الرسمي", "ADT": "التوقيت الصيفي الأطلسي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "AEST": "توقيت شرق أستراليا الرسمي", "AEDT": "توقيت شرق أستراليا الصيفي", "OESZ": "توقيت شرق أوروبا الصيفي", "HAST": "توقيت هاواي ألوتيان الرسمي", "HNT": "توقيت نيوفاوندلاند الرسمي", "CHAST": "توقيت تشاتام الرسمي", "WIB": "توقيت غرب إندونيسيا", "OEZ": "توقيت شرق أوروبا الرسمي", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "WESZ": "توقيت غرب أوروبا الصيفي", "SGT": "توقيت سنغافورة", "WAST": "توقيت غرب أفريقيا الصيفي", "ACST": "توقيت وسط أستراليا الرسمي", "CLT": "توقيت شيلي الرسمي", "ARST": "توقيت الأرجنتين الصيفي", "JDT": "توقيت اليابان الصيفي"},
}
}
diff --git a/ar_SD/ar_SD_test.go b/ar_SD/ar_SD_test.go
new file mode 100644
index 00000000..1288f27e
--- /dev/null
+++ b/ar_SD/ar_SD_test.go
@@ -0,0 +1,1120 @@
+package ar_SD
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_SD"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ar_SO/ar_SO.go b/ar_SO/ar_SO.go
index 6f5edf9a..b2fa3e64 100644
--- a/ar_SO/ar_SO.go
+++ b/ar_SO/ar_SO.go
@@ -47,7 +47,7 @@ func New() locales.Translator {
locale: "ar_SO",
pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
pluralsOrdinal: []locales.PluralRule{6},
- pluralsRange: []locales.PluralRule{5, 6, 1, 4},
+ pluralsRange: []locales.PluralRule{1, 4, 5, 6},
decimal: "٫",
group: "٬",
minus: "‏-",
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"", ""},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"HKST": "توقيت هونغ كونغ الصيفي", "WIB": "توقيت غرب إندونيسيا", "EAT": "توقيت شرق أفريقيا", "ACDT": "توقيت وسط أستراليا الصيفي", "JDT": "توقيت اليابان الصيفي", "LHST": "توقيت لورد هاو الرسمي", "AST": "التوقيت الرسمي الأطلسي", "HADT": "توقيت هاواي ألوتيان الصيفي", "NZST": "توقيت نيوزيلندا الرسمي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "HNT": "توقيت نيوفاوندلاند الرسمي", "WITA": "توقيت وسط إندونيسيا", "JST": "توقيت اليابان الرسمي", "UYST": "توقيت أورغواي الصيفي", "SAST": "توقيت جنوب أفريقيا", "WAST": "توقيت غرب أفريقيا الصيفي", "AKDT": "توقيت ألاسكا الصيفي", "MESZ": "توقيت وسط أوروبا الصيفي", "AEDT": "توقيت شرق أستراليا الصيفي", "PDT": "توقيت المحيط الهادي الصيفي", "MEZ": "توقيت وسط أوروبا الرسمي", "UYT": "توقيت أورغواي الرسمي", "VET": "توقيت فنزويلا", "WESZ": "توقيت غرب أوروبا الصيفي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "CHADT": "توقيت تشاتام الصيفي", "ECT": "توقيت الإكوادور", "CAT": "توقيت وسط أفريقيا", "WARST": "توقيت غرب الأرجنتين الصيفي", "ART": "توقيت الأرجنتين الرسمي", "SRT": "توقيت سورينام", "CLST": "توقيت شيلي الصيفي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "HKT": "توقيت هونغ كونغ الرسمي", "WART": "توقيت غرب الأرجنتين الرسمي", "ARST": "توقيت الأرجنتين الصيفي", "TMST": "توقيت تركمانستان الصيفي", "AKST": "التوقيت الرسمي لألاسكا", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "BOT": "توقيت بوليفيا", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية", "WIT": "توقيت شرق إندونيسيا", "IST": "توقيت الهند", "OEZ": "توقيت شرق أوروبا الرسمي", "OESZ": "توقيت شرق أوروبا الصيفي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "HAT": "توقيت نيوفاوندلاند الصيفي", "NZDT": "توقيت نيوزيلندا الصيفي", "CHAST": "توقيت تشاتام الرسمي", "COT": "توقيت كولومبيا الرسمي", "ADT": "التوقيت الصيفي الأطلسي", "WAT": "توقيت غرب أفريقيا الرسمي", "GMT": "توقيت غرينتش", "AWDT": "توقيت غرب أستراليا الصيفي", "∅∅∅": "توقيت أزورس الصيفي", "WEZ": "توقيت غرب أوروبا الرسمي", "COST": "توقيت كولومبيا الصيفي", "HAST": "توقيت هاواي ألوتيان الرسمي", "ACST": "توقيت وسط أستراليا الرسمي", "GYT": "توقيت غيانا", "CLT": "توقيت شيلي الرسمي", "AEST": "توقيت شرق أستراليا الرسمي", "AWST": "توقيت غرب أستراليا الرسمي", "LHDT": "التوقيت الصيفي للورد هاو", "SGT": "توقيت سنغافورة", "TMT": "توقيت تركمانستان الرسمي", "PST": "توقيت المحيط الهادي الرسمي", "MYT": "توقيت ماليزيا", "ChST": "توقيت تشامورو", "BT": "توقيت بوتان", "GFT": "توقيت غايانا الفرنسية"},
+ timezones: map[string]string{"WAT": "توقيت غرب أفريقيا الرسمي", "CLT": "توقيت شيلي الرسمي", "SRT": "توقيت سورينام", "HKST": "توقيت هونغ كونغ الصيفي", "COT": "توقيت كولومبيا الرسمي", "OESZ": "توقيت شرق أوروبا الصيفي", "AEST": "توقيت شرق أستراليا الرسمي", "ChST": "توقيت تشامورو", "MST": "MST", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "NZDT": "توقيت نيوزيلندا الصيفي", "COST": "توقيت كولومبيا الصيفي", "WESZ": "توقيت غرب أوروبا الصيفي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "ADT": "التوقيت الصيفي الأطلسي", "BOT": "توقيت بوليفيا", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "AWST": "توقيت غرب أستراليا الرسمي", "TMST": "توقيت تركمانستان الصيفي", "CLST": "توقيت شيلي الصيفي", "WIT": "توقيت شرق إندونيسيا", "EAT": "توقيت شرق أفريقيا", "LHST": "توقيت لورد هاو الرسمي", "MYT": "توقيت ماليزيا", "VET": "توقيت فنزويلا", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "MEZ": "توقيت وسط أوروبا الرسمي", "WITA": "توقيت وسط إندونيسيا", "SAST": "توقيت جنوب أفريقيا", "PDT": "توقيت المحيط الهادي الصيفي", "CHADT": "توقيت تشاتام الصيفي", "HAT": "توقيت نيوفاوندلاند الصيفي", "ECT": "توقيت الإكوادور", "AKDT": "توقيت ألاسكا الصيفي", "HAST": "توقيت هاواي ألوتيان الرسمي", "ACST": "توقيت وسط أستراليا الرسمي", "ARST": "توقيت الأرجنتين الصيفي", "LHDT": "التوقيت الصيفي للورد هاو", "WEZ": "توقيت غرب أوروبا الرسمي", "∅∅∅": "توقيت أزورس الصيفي", "JST": "توقيت اليابان الرسمي", "MESZ": "توقيت وسط أوروبا الصيفي", "IST": "توقيت الهند", "WAST": "توقيت غرب أفريقيا الصيفي", "OEZ": "توقيت شرق أوروبا الرسمي", "GMT": "توقيت غرينتش", "UYST": "توقيت أورغواي الصيفي", "HKT": "توقيت هونغ كونغ الرسمي", "CHAST": "توقيت تشاتام الرسمي", "JDT": "توقيت اليابان الصيفي", "ART": "توقيت الأرجنتين الرسمي", "TMT": "توقيت تركمانستان الرسمي", "NZST": "توقيت نيوزيلندا الرسمي", "PST": "توقيت المحيط الهادي الرسمي", "WIB": "توقيت غرب إندونيسيا", "CAT": "توقيت وسط أفريقيا", "ACDT": "توقيت وسط أستراليا الصيفي", "WART": "توقيت غرب الأرجنتين الرسمي", "WARST": "توقيت غرب الأرجنتين الصيفي", "BT": "توقيت بوتان", "GFT": "توقيت غايانا الفرنسية", "AEDT": "توقيت شرق أستراليا الصيفي", "UYT": "توقيت أورغواي الرسمي", "AST": "التوقيت الرسمي الأطلسي", "AWDT": "توقيت غرب أستراليا الصيفي", "SGT": "توقيت سنغافورة", "GYT": "توقيت غيانا", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "MDT": "MDT", "AKST": "التوقيت الرسمي لألاسكا", "HADT": "توقيت هاواي ألوتيان الصيفي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "HNT": "توقيت نيوفاوندلاند الرسمي"},
}
}
diff --git a/ar_SO/ar_SO_test.go b/ar_SO/ar_SO_test.go
new file mode 100644
index 00000000..6692fc05
--- /dev/null
+++ b/ar_SO/ar_SO_test.go
@@ -0,0 +1,1120 @@
+package ar_SO
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_SO"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ar_SS/ar_SS.go b/ar_SS/ar_SS.go
index ad0446ed..742f4e27 100644
--- a/ar_SS/ar_SS.go
+++ b/ar_SS/ar_SS.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"", ""},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"JST": "توقيت اليابان الرسمي", "UYST": "توقيت أورغواي الصيفي", "MESZ": "توقيت وسط أوروبا الصيفي", "HNT": "توقيت نيوفاوندلاند الرسمي", "NZDT": "توقيت نيوزيلندا الصيفي", "HAST": "توقيت هاواي ألوتيان الرسمي", "GFT": "توقيت غايانا الفرنسية", "WIB": "توقيت غرب إندونيسيا", "EAT": "توقيت شرق أفريقيا", "JDT": "توقيت اليابان الصيفي", "WEZ": "توقيت غرب أوروبا الرسمي", "COST": "توقيت كولومبيا الصيفي", "ECT": "توقيت الإكوادور", "LHST": "توقيت لورد هاو الرسمي", "WAT": "توقيت غرب أفريقيا الرسمي", "WIT": "توقيت شرق إندونيسيا", "OEZ": "توقيت شرق أوروبا الرسمي", "WITA": "توقيت وسط إندونيسيا", "IST": "توقيت الهند", "ACST": "توقيت وسط أستراليا الرسمي", "TMST": "توقيت تركمانستان الصيفي", "AWST": "توقيت غرب أستراليا الرسمي", "SRT": "توقيت سورينام", "CLST": "توقيت شيلي الصيفي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "WARST": "توقيت غرب الأرجنتين الصيفي", "MEZ": "توقيت وسط أوروبا الرسمي", "CHADT": "توقيت تشاتام الصيفي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "WAST": "توقيت غرب أفريقيا الصيفي", "AKST": "التوقيت الرسمي لألاسكا", "PST": "توقيت المحيط الهادي الرسمي", "AEDT": "توقيت شرق أستراليا الصيفي", "WESZ": "توقيت غرب أوروبا الصيفي", "HAT": "توقيت نيوفاوندلاند الصيفي", "MST": "MST", "AKDT": "توقيت ألاسكا الصيفي", "BOT": "توقيت بوليفيا", "SGT": "توقيت سنغافورة", "ART": "توقيت الأرجنتين الرسمي", "VET": "توقيت فنزويلا", "ARST": "توقيت الأرجنتين الصيفي", "LHDT": "التوقيت الصيفي للورد هاو", "TMT": "توقيت تركمانستان الرسمي", "UYT": "توقيت أورغواي الرسمي", "CLT": "توقيت شيلي الرسمي", "∅∅∅": "توقيت برازيليا الصيفي", "WART": "توقيت غرب الأرجنتين الرسمي", "ChST": "توقيت تشامورو", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "CAT": "توقيت وسط أفريقيا", "AST": "التوقيت الرسمي الأطلسي", "ACDT": "توقيت وسط أستراليا الصيفي", "AWDT": "توقيت غرب أستراليا الصيفي", "AEST": "توقيت شرق أستراليا الرسمي", "BT": "توقيت بوتان", "OESZ": "توقيت شرق أوروبا الصيفي", "HKT": "توقيت هونغ كونغ الرسمي", "GMT": "توقيت غرينتش", "PDT": "توقيت المحيط الهادي الصيفي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "SAST": "توقيت جنوب أفريقيا", "MYT": "توقيت ماليزيا", "HADT": "توقيت هاواي ألوتيان الصيفي", "HKST": "توقيت هونغ كونغ الصيفي", "MDT": "MDT", "GYT": "توقيت غيانا", "NZST": "توقيت نيوزيلندا الرسمي", "CHAST": "توقيت تشاتام الرسمي", "COT": "توقيت كولومبيا الرسمي", "ADT": "التوقيت الصيفي الأطلسي", "ACWST": "توقيت غرب وسط أستراليا الرسمي"},
+ timezones: map[string]string{"ACWST": "توقيت غرب وسط أستراليا الرسمي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "HAST": "توقيت هاواي ألوتيان الرسمي", "AEST": "توقيت شرق أستراليا الرسمي", "∅∅∅": "توقيت برازيليا الصيفي", "ACDT": "توقيت وسط أستراليا الصيفي", "CHAST": "توقيت تشاتام الرسمي", "CHADT": "توقيت تشاتام الصيفي", "HADT": "توقيت هاواي ألوتيان الصيفي", "WAST": "توقيت غرب أفريقيا الصيفي", "CLST": "توقيت شيلي الصيفي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "BOT": "توقيت بوليفيا", "AEDT": "توقيت شرق أستراليا الصيفي", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية", "UYST": "توقيت أورغواي الصيفي", "VET": "توقيت فنزويلا", "WEZ": "توقيت غرب أوروبا الرسمي", "CAT": "توقيت وسط أفريقيا", "WAT": "توقيت غرب أفريقيا الرسمي", "OESZ": "توقيت شرق أوروبا الصيفي", "PST": "توقيت المحيط الهادي الرسمي", "NZDT": "توقيت نيوزيلندا الصيفي", "IST": "توقيت الهند", "OEZ": "توقيت شرق أوروبا الرسمي", "EAT": "توقيت شرق أفريقيا", "WIT": "توقيت شرق إندونيسيا", "AST": "التوقيت الرسمي الأطلسي", "ARST": "توقيت الأرجنتين الصيفي", "JST": "توقيت اليابان الرسمي", "SAST": "توقيت جنوب أفريقيا", "HKT": "توقيت هونغ كونغ الرسمي", "COST": "توقيت كولومبيا الصيفي", "SRT": "توقيت سورينام", "HKST": "توقيت هونغ كونغ الصيفي", "AWST": "توقيت غرب أستراليا الرسمي", "AWDT": "توقيت غرب أستراليا الصيفي", "PDT": "توقيت المحيط الهادي الصيفي", "COT": "توقيت كولومبيا الرسمي", "BT": "توقيت بوتان", "GFT": "توقيت غايانا الفرنسية", "ADT": "التوقيت الصيفي الأطلسي", "ART": "توقيت الأرجنتين الرسمي", "AKST": "التوقيت الرسمي لألاسكا", "WITA": "توقيت وسط إندونيسيا", "SGT": "توقيت سنغافورة", "GYT": "توقيت غيانا", "WESZ": "توقيت غرب أوروبا الصيفي", "TMT": "توقيت تركمانستان الرسمي", "LHST": "توقيت لورد هاو الرسمي", "CLT": "توقيت شيلي الرسمي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "WARST": "توقيت غرب الأرجنتين الصيفي", "ECT": "توقيت الإكوادور", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "TMST": "توقيت تركمانستان الصيفي", "UYT": "توقيت أورغواي الرسمي", "MEZ": "توقيت وسط أوروبا الرسمي", "NZST": "توقيت نيوزيلندا الرسمي", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "MYT": "توقيت ماليزيا", "ACST": "توقيت وسط أستراليا الرسمي", "WART": "توقيت غرب الأرجنتين الرسمي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "JDT": "توقيت اليابان الصيفي", "HNT": "توقيت نيوفاوندلاند الرسمي", "ChST": "توقيت تشامورو", "LHDT": "التوقيت الصيفي للورد هاو", "MESZ": "توقيت وسط أوروبا الصيفي", "HAT": "توقيت نيوفاوندلاند الصيفي", "WIB": "توقيت غرب إندونيسيا", "AKDT": "توقيت ألاسكا الصيفي", "GMT": "توقيت غرينتش"},
}
}
diff --git a/ar_SS/ar_SS_test.go b/ar_SS/ar_SS_test.go
new file mode 100644
index 00000000..3bfd45b2
--- /dev/null
+++ b/ar_SS/ar_SS_test.go
@@ -0,0 +1,1120 @@
+package ar_SS
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_SS"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ar_SY/ar_SY.go b/ar_SY/ar_SY.go
index 1085a60a..42ac83f1 100644
--- a/ar_SY/ar_SY.go
+++ b/ar_SY/ar_SY.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"", ""},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"MEZ": "توقيت وسط أوروبا الرسمي", "PST": "توقيت المحيط الهادي الرسمي", "UYT": "توقيت أورغواي الرسمي", "CLST": "توقيت شيلي الصيفي", "COT": "توقيت كولومبيا الرسمي", "ECT": "توقيت الإكوادور", "WAST": "توقيت غرب أفريقيا الصيفي", "HKST": "توقيت هونغ كونغ الصيفي", "WITA": "توقيت وسط إندونيسيا", "ARST": "توقيت الأرجنتين الصيفي", "GYT": "توقيت غيانا", "CLT": "توقيت شيلي الرسمي", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية", "SGT": "توقيت سنغافورة", "GFT": "توقيت غايانا الفرنسية", "ACST": "توقيت وسط أستراليا الرسمي", "CAT": "توقيت وسط أفريقيا", "∅∅∅": "توقيت برازيليا الصيفي", "WART": "توقيت غرب الأرجنتين الرسمي", "OESZ": "توقيت شرق أوروبا الصيفي", "AWDT": "توقيت غرب أستراليا الصيفي", "UYST": "توقيت أورغواي الصيفي", "VET": "توقيت فنزويلا", "AEDT": "توقيت شرق أستراليا الصيفي", "HAST": "توقيت هاواي ألوتيان الرسمي", "WAT": "توقيت غرب أفريقيا الرسمي", "HAT": "توقيت نيوفاوندلاند الصيفي", "TMST": "توقيت تركمانستان الصيفي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "AEST": "توقيت شرق أستراليا الرسمي", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "AST": "التوقيت الرسمي الأطلسي", "ACDT": "توقيت وسط أستراليا الصيفي", "HADT": "توقيت هاواي ألوتيان الصيفي", "SAST": "توقيت جنوب أفريقيا", "WIT": "توقيت شرق إندونيسيا", "COST": "توقيت كولومبيا الصيفي", "ADT": "التوقيت الصيفي الأطلسي", "HKT": "توقيت هونغ كونغ الرسمي", "WIB": "توقيت غرب إندونيسيا", "EAT": "توقيت شرق أفريقيا", "AKST": "التوقيت الرسمي لألاسكا", "PDT": "توقيت المحيط الهادي الصيفي", "MYT": "توقيت ماليزيا", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "WESZ": "توقيت غرب أوروبا الصيفي", "CHAST": "توقيت تشاتام الرسمي", "CHADT": "توقيت تشاتام الصيفي", "HNT": "توقيت نيوفاوندلاند الرسمي", "AWST": "توقيت غرب أستراليا الرسمي", "LHST": "توقيت لورد هاو الرسمي", "LHDT": "التوقيت الصيفي للورد هاو", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "MESZ": "توقيت وسط أوروبا الصيفي", "NZST": "توقيت نيوزيلندا الرسمي", "WEZ": "توقيت غرب أوروبا الرسمي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "WARST": "توقيت غرب الأرجنتين الصيفي", "OEZ": "توقيت شرق أوروبا الرسمي", "NZDT": "توقيت نيوزيلندا الصيفي", "IST": "توقيت الهند", "SRT": "توقيت سورينام", "BT": "توقيت بوتان", "GMT": "توقيت غرينتش", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "ChST": "توقيت تشامورو", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "JDT": "توقيت اليابان الصيفي", "BOT": "توقيت بوليفيا", "ART": "توقيت الأرجنتين الرسمي", "TMT": "توقيت تركمانستان الرسمي", "JST": "توقيت اليابان الرسمي", "AKDT": "توقيت ألاسكا الصيفي"},
+ timezones: map[string]string{"TMST": "توقيت تركمانستان الصيفي", "ACDT": "توقيت وسط أستراليا الصيفي", "ARST": "توقيت الأرجنتين الصيفي", "IST": "توقيت الهند", "PST": "توقيت المحيط الهادي الرسمي", "COT": "توقيت كولومبيا الرسمي", "WIB": "توقيت غرب إندونيسيا", "BT": "توقيت بوتان", "CHAST": "توقيت تشاتام الرسمي", "HAST": "توقيت هاواي ألوتيان الرسمي", "AEST": "توقيت شرق أستراليا الرسمي", "WARST": "توقيت غرب الأرجنتين الصيفي", "HKT": "توقيت هونغ كونغ الرسمي", "WITA": "توقيت وسط إندونيسيا", "AWDT": "توقيت غرب أستراليا الصيفي", "TMT": "توقيت تركمانستان الرسمي", "∅∅∅": "توقيت برازيليا الصيفي", "AKDT": "توقيت ألاسكا الصيفي", "MESZ": "توقيت وسط أوروبا الصيفي", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "SGT": "توقيت سنغافورة", "CAT": "توقيت وسط أفريقيا", "GYT": "توقيت غيانا", "LHDT": "التوقيت الصيفي للورد هاو", "GFT": "توقيت غايانا الفرنسية", "JST": "توقيت اليابان الرسمي", "AKST": "التوقيت الرسمي لألاسكا", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "GMT": "توقيت غرينتش", "UYST": "توقيت أورغواي الصيفي", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "AWST": "توقيت غرب أستراليا الرسمي", "MEZ": "توقيت وسط أوروبا الرسمي", "NZST": "توقيت نيوزيلندا الرسمي", "CHADT": "توقيت تشاتام الصيفي", "AST": "التوقيت الرسمي الأطلسي", "WAST": "توقيت غرب أفريقيا الصيفي", "CLT": "توقيت شيلي الرسمي", "WART": "توقيت غرب الأرجنتين الرسمي", "HKST": "توقيت هونغ كونغ الصيفي", "SAST": "توقيت جنوب أفريقيا", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "WAT": "توقيت غرب أفريقيا الرسمي", "WEZ": "توقيت غرب أوروبا الرسمي", "HNT": "توقيت نيوفاوندلاند الرسمي", "WIT": "توقيت شرق إندونيسيا", "EAT": "توقيت شرق أفريقيا", "LHST": "توقيت لورد هاو الرسمي", "JDT": "توقيت اليابان الصيفي", "ADT": "التوقيت الصيفي الأطلسي", "COST": "توقيت كولومبيا الصيفي", "AEDT": "توقيت شرق أستراليا الصيفي", "MYT": "توقيت ماليزيا", "UYT": "توقيت أورغواي الرسمي", "OESZ": "توقيت شرق أوروبا الصيفي", "ChST": "توقيت تشامورو", "ART": "توقيت الأرجنتين الرسمي", "HADT": "توقيت هاواي ألوتيان الصيفي", "ACST": "توقيت وسط أستراليا الرسمي", "PDT": "توقيت المحيط الهادي الصيفي", "HAT": "توقيت نيوفاوندلاند الصيفي", "OEZ": "توقيت شرق أوروبا الرسمي", "CLST": "توقيت شيلي الصيفي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "SRT": "توقيت سورينام", "ECT": "توقيت الإكوادور", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "WESZ": "توقيت غرب أوروبا الصيفي", "VET": "توقيت فنزويلا", "NZDT": "توقيت نيوزيلندا الصيفي", "BOT": "توقيت بوليفيا", "ACWST": "توقيت غرب وسط أستراليا الرسمي"},
}
}
diff --git a/ar_SY/ar_SY_test.go b/ar_SY/ar_SY_test.go
new file mode 100644
index 00000000..210ce72b
--- /dev/null
+++ b/ar_SY/ar_SY_test.go
@@ -0,0 +1,1120 @@
+package ar_SY
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_SY"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ar_TD/ar_TD.go b/ar_TD/ar_TD.go
index 36d6a1fc..17ca1927 100644
--- a/ar_TD/ar_TD.go
+++ b/ar_TD/ar_TD.go
@@ -47,7 +47,7 @@ func New() locales.Translator {
locale: "ar_TD",
pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
pluralsOrdinal: []locales.PluralRule{6},
- pluralsRange: []locales.PluralRule{6, 1, 4, 5},
+ pluralsRange: []locales.PluralRule{1, 4, 5, 6},
decimal: "٫",
group: "٬",
minus: "‏-",
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"", ""},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"VET": "توقيت فنزويلا", "WART": "توقيت غرب الأرجنتين الرسمي", "PDT": "توقيت المحيط الهادي الصيفي", "COST": "توقيت كولومبيا الصيفي", "AST": "التوقيت الرسمي الأطلسي", "TMST": "توقيت تركمانستان الصيفي", "AKST": "التوقيت الرسمي لألاسكا", "CHAST": "توقيت تشاتام الرسمي", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "HAST": "توقيت هاواي ألوتيان الرسمي", "HKT": "توقيت هونغ كونغ الرسمي", "ART": "توقيت الأرجنتين الرسمي", "HNT": "توقيت نيوفاوندلاند الرسمي", "HAT": "توقيت نيوفاوندلاند الصيفي", "NZDT": "توقيت نيوزيلندا الصيفي", "ADT": "التوقيت الصيفي الأطلسي", "IST": "توقيت الهند", "WIB": "توقيت غرب إندونيسيا", "GMT": "توقيت غرينتش", "MYT": "توقيت ماليزيا", "JST": "توقيت اليابان الرسمي", "AWDT": "توقيت غرب أستراليا الصيفي", "NZST": "توقيت نيوزيلندا الرسمي", "WEZ": "توقيت غرب أوروبا الرسمي", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "AEDT": "توقيت شرق أستراليا الصيفي", "ChST": "توقيت تشامورو", "COT": "توقيت كولومبيا الرسمي", "SAST": "توقيت جنوب أفريقيا", "OESZ": "توقيت شرق أوروبا الصيفي", "UYST": "توقيت أورغواي الصيفي", "CLT": "توقيت شيلي الرسمي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "ARST": "توقيت الأرجنتين الصيفي", "BT": "توقيت بوتان", "PST": "توقيت المحيط الهادي الرسمي", "LHST": "توقيت لورد هاو الرسمي", "WARST": "توقيت غرب الأرجنتين الصيفي", "OEZ": "توقيت شرق أوروبا الرسمي", "LHDT": "التوقيت الصيفي للورد هاو", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "UYT": "توقيت أورغواي الرسمي", "WAST": "توقيت غرب أفريقيا الصيفي", "CLST": "توقيت شيلي الصيفي", "ECT": "توقيت الإكوادور", "AKDT": "توقيت ألاسكا الصيفي", "∅∅∅": "توقيت برازيليا الصيفي", "CAT": "توقيت وسط أفريقيا", "TMT": "توقيت تركمانستان الرسمي", "AWST": "توقيت غرب أستراليا الرسمي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "MESZ": "توقيت وسط أوروبا الصيفي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "WIT": "توقيت شرق إندونيسيا", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "HADT": "توقيت هاواي ألوتيان الصيفي", "WAT": "توقيت غرب أفريقيا الرسمي", "SGT": "توقيت سنغافورة", "GYT": "توقيت غيانا", "BOT": "توقيت بوليفيا", "WITA": "توقيت وسط إندونيسيا", "MEZ": "توقيت وسط أوروبا الرسمي", "EAT": "توقيت شرق أفريقيا", "HKST": "توقيت هونغ كونغ الصيفي", "GFT": "توقيت غايانا الفرنسية", "ACST": "توقيت وسط أستراليا الرسمي", "ACDT": "توقيت وسط أستراليا الصيفي", "JDT": "توقيت اليابان الصيفي", "CHADT": "توقيت تشاتام الصيفي", "WESZ": "توقيت غرب أوروبا الصيفي", "AEST": "توقيت شرق أستراليا الرسمي", "SRT": "توقيت سورينام"},
+ timezones: map[string]string{"WAT": "توقيت غرب أفريقيا الرسمي", "COST": "توقيت كولومبيا الصيفي", "OESZ": "توقيت شرق أوروبا الصيفي", "LHDT": "التوقيت الصيفي للورد هاو", "GFT": "توقيت غايانا الفرنسية", "ARST": "توقيت الأرجنتين الصيفي", "HADT": "توقيت هاواي ألوتيان الصيفي", "ART": "توقيت الأرجنتين الرسمي", "JST": "توقيت اليابان الرسمي", "CLT": "توقيت شيلي الرسمي", "TMT": "توقيت تركمانستان الرسمي", "UYST": "توقيت أورغواي الصيفي", "WARST": "توقيت غرب الأرجنتين الصيفي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "WITA": "توقيت وسط إندونيسيا", "JDT": "توقيت اليابان الصيفي", "COT": "توقيت كولومبيا الرسمي", "TMST": "توقيت تركمانستان الصيفي", "AEST": "توقيت شرق أستراليا الرسمي", "UYT": "توقيت أورغواي الرسمي", "CHADT": "توقيت تشاتام الصيفي", "HAT": "توقيت نيوفاوندلاند الصيفي", "PDT": "توقيت المحيط الهادي الصيفي", "WAST": "توقيت غرب أفريقيا الصيفي", "WIB": "توقيت غرب إندونيسيا", "HKT": "توقيت هونغ كونغ الرسمي", "PST": "توقيت المحيط الهادي الرسمي", "GYT": "توقيت غيانا", "ECT": "توقيت الإكوادور", "ADT": "التوقيت الصيفي الأطلسي", "AWDT": "توقيت غرب أستراليا الصيفي", "WEZ": "توقيت غرب أوروبا الرسمي", "MYT": "توقيت ماليزيا", "WIT": "توقيت شرق إندونيسيا", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "BOT": "توقيت بوليفيا", "HNT": "توقيت نيوفاوندلاند الرسمي", "SGT": "توقيت سنغافورة", "CAT": "توقيت وسط أفريقيا", "GMT": "توقيت غرينتش", "WESZ": "توقيت غرب أوروبا الصيفي", "NZST": "توقيت نيوزيلندا الرسمي", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية", "SRT": "توقيت سورينام", "AST": "التوقيت الرسمي الأطلسي", "AKDT": "توقيت ألاسكا الصيفي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "CHAST": "توقيت تشاتام الرسمي", "ACST": "توقيت وسط أستراليا الرسمي", "MESZ": "توقيت وسط أوروبا الصيفي", "LHST": "توقيت لورد هاو الرسمي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "AWST": "توقيت غرب أستراليا الرسمي", "MEZ": "توقيت وسط أوروبا الرسمي", "ACDT": "توقيت وسط أستراليا الصيفي", "VET": "توقيت فنزويلا", "AKST": "التوقيت الرسمي لألاسكا", "IST": "توقيت الهند", "OEZ": "توقيت شرق أوروبا الرسمي", "EAT": "توقيت شرق أفريقيا", "WART": "توقيت غرب الأرجنتين الرسمي", "ChST": "توقيت تشامورو", "NZDT": "توقيت نيوزيلندا الصيفي", "BT": "توقيت بوتان", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "CLST": "توقيت شيلي الصيفي", "HKST": "توقيت هونغ كونغ الصيفي", "HAST": "توقيت هاواي ألوتيان الرسمي", "∅∅∅": "توقيت الأمازون الصيفي", "AEDT": "توقيت شرق أستراليا الصيفي", "SAST": "توقيت جنوب أفريقيا", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية"},
}
}
diff --git a/ar_TD/ar_TD_test.go b/ar_TD/ar_TD_test.go
new file mode 100644
index 00000000..8067eb03
--- /dev/null
+++ b/ar_TD/ar_TD_test.go
@@ -0,0 +1,1120 @@
+package ar_TD
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_TD"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ar_TN/ar_TN.go b/ar_TN/ar_TN.go
index 51f3ffd6..d7490834 100644
--- a/ar_TN/ar_TN.go
+++ b/ar_TN/ar_TN.go
@@ -47,7 +47,7 @@ func New() locales.Translator {
locale: "ar_TN",
pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
pluralsOrdinal: []locales.PluralRule{6},
- pluralsRange: []locales.PluralRule{1, 4, 5, 6},
+ pluralsRange: []locales.PluralRule{5, 6, 1, 4},
decimal: ",",
group: ".",
minus: "‏-",
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"", ""},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"COT": "توقيت كولومبيا الرسمي", "CAT": "توقيت وسط أفريقيا", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "MYT": "توقيت ماليزيا", "UYST": "توقيت أورغواي الصيفي", "AWDT": "توقيت غرب أستراليا الصيفي", "WIT": "توقيت شرق إندونيسيا", "ARST": "توقيت الأرجنتين الصيفي", "MDT": "MDT", "ADT": "التوقيت الصيفي الأطلسي", "HADT": "توقيت هاواي ألوتيان الصيفي", "JST": "توقيت اليابان الرسمي", "WEZ": "توقيت غرب أوروبا الرسمي", "HKT": "توقيت هونغ كونغ الرسمي", "OESZ": "توقيت شرق أوروبا الصيفي", "AEDT": "توقيت شرق أستراليا الصيفي", "VET": "توقيت فنزويلا", "HAST": "توقيت هاواي ألوتيان الرسمي", "WART": "توقيت غرب الأرجنتين الرسمي", "WIB": "توقيت غرب إندونيسيا", "LHST": "توقيت لورد هاو الرسمي", "WESZ": "توقيت غرب أوروبا الصيفي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "COST": "توقيت كولومبيا الصيفي", "SGT": "توقيت سنغافورة", "AST": "التوقيت الرسمي الأطلسي", "WARST": "توقيت غرب الأرجنتين الصيفي", "EAT": "توقيت شرق أفريقيا", "MST": "MST", "PST": "توقيت المحيط الهادي الرسمي", "ACDT": "توقيت وسط أستراليا الصيفي", "ART": "توقيت الأرجنتين الرسمي", "AKDT": "توقيت ألاسكا الصيفي", "AEST": "توقيت شرق أستراليا الرسمي", "WAT": "توقيت غرب أفريقيا الرسمي", "ACST": "توقيت وسط أستراليا الرسمي", "GYT": "توقيت غيانا", "CHADT": "توقيت تشاتام الصيفي", "AWST": "توقيت غرب أستراليا الرسمي", "NZDT": "توقيت نيوزيلندا الصيفي", "CHAST": "توقيت تشاتام الرسمي", "CLST": "توقيت شيلي الصيفي", "SRT": "توقيت سورينام", "NZST": "توقيت نيوزيلندا الرسمي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "∅∅∅": "توقيت الأمازون الصيفي", "AKST": "التوقيت الرسمي لألاسكا", "WAST": "توقيت غرب أفريقيا الصيفي", "HAT": "توقيت نيوفاوندلاند الصيفي", "WITA": "توقيت وسط إندونيسيا", "OEZ": "توقيت شرق أوروبا الرسمي", "MESZ": "توقيت وسط أوروبا الصيفي", "SAST": "توقيت جنوب أفريقيا", "ChST": "توقيت تشامورو", "LHDT": "التوقيت الصيفي للورد هاو", "MEZ": "توقيت وسط أوروبا الرسمي", "CLT": "توقيت شيلي الرسمي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "HKST": "توقيت هونغ كونغ الصيفي", "GFT": "توقيت غايانا الفرنسية", "PDT": "توقيت المحيط الهادي الصيفي", "BOT": "توقيت بوليفيا", "UYT": "توقيت أورغواي الرسمي", "GMT": "توقيت غرينتش", "TMT": "توقيت تركمانستان الرسمي", "JDT": "توقيت اليابان الصيفي", "BT": "توقيت بوتان", "HNT": "توقيت نيوفاوندلاند الرسمي", "IST": "توقيت الهند", "TMST": "توقيت تركمانستان الصيفي", "ECT": "توقيت الإكوادور"},
+ timezones: map[string]string{"WART": "توقيت غرب الأرجنتين الرسمي", "TMST": "توقيت تركمانستان الصيفي", "OESZ": "توقيت شرق أوروبا الصيفي", "WIT": "توقيت شرق إندونيسيا", "HNT": "توقيت نيوفاوندلاند الرسمي", "BT": "توقيت بوتان", "CLT": "توقيت شيلي الرسمي", "ACDT": "توقيت وسط أستراليا الصيفي", "CHAST": "توقيت تشاتام الرسمي", "NZDT": "توقيت نيوزيلندا الصيفي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "WARST": "توقيت غرب الأرجنتين الصيفي", "SRT": "توقيت سورينام", "AWST": "توقيت غرب أستراليا الرسمي", "AWDT": "توقيت غرب أستراليا الصيفي", "WITA": "توقيت وسط إندونيسيا", "∅∅∅": "توقيت برازيليا الصيفي", "WAST": "توقيت غرب أفريقيا الصيفي", "GMT": "توقيت غرينتش", "HKT": "توقيت هونغ كونغ الرسمي", "ARST": "توقيت الأرجنتين الصيفي", "HAT": "توقيت نيوفاوندلاند الصيفي", "SGT": "توقيت سنغافورة", "LHST": "توقيت لورد هاو الرسمي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "HADT": "توقيت هاواي ألوتيان الصيفي", "MYT": "توقيت ماليزيا", "CLST": "توقيت شيلي الصيفي", "JST": "توقيت اليابان الرسمي", "COT": "توقيت كولومبيا الرسمي", "TMT": "توقيت تركمانستان الرسمي", "AEST": "توقيت شرق أستراليا الرسمي", "OEZ": "توقيت شرق أوروبا الرسمي", "EAT": "توقيت شرق أفريقيا", "UYT": "توقيت أورغواي الرسمي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "SAST": "توقيت جنوب أفريقيا", "HAST": "توقيت هاواي ألوتيان الرسمي", "BOT": "توقيت بوليفيا", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية", "PST": "توقيت المحيط الهادي الرسمي", "MESZ": "توقيت وسط أوروبا الصيفي", "WEZ": "توقيت غرب أوروبا الرسمي", "WESZ": "توقيت غرب أوروبا الصيفي", "ChST": "توقيت تشامورو", "AKST": "التوقيت الرسمي لألاسكا", "IST": "توقيت الهند", "AEDT": "توقيت شرق أستراليا الصيفي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "UYST": "توقيت أورغواي الصيفي", "CHADT": "توقيت تشاتام الصيفي", "ECT": "توقيت الإكوادور", "AST": "التوقيت الرسمي الأطلسي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "ART": "توقيت الأرجنتين الرسمي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "HKST": "توقيت هونغ كونغ الصيفي", "ADT": "التوقيت الصيفي الأطلسي", "PDT": "توقيت المحيط الهادي الصيفي", "MEZ": "توقيت وسط أوروبا الرسمي", "CAT": "توقيت وسط أفريقيا", "LHDT": "التوقيت الصيفي للورد هاو", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "GFT": "توقيت غايانا الفرنسية", "VET": "توقيت فنزويلا", "NZST": "توقيت نيوزيلندا الرسمي", "WIB": "توقيت غرب إندونيسيا", "ACST": "توقيت وسط أستراليا الرسمي", "AKDT": "توقيت ألاسكا الصيفي", "JDT": "توقيت اليابان الصيفي", "WAT": "توقيت غرب أفريقيا الرسمي", "COST": "توقيت كولومبيا الصيفي", "GYT": "توقيت غيانا"},
}
}
diff --git a/ar_TN/ar_TN_test.go b/ar_TN/ar_TN_test.go
new file mode 100644
index 00000000..46c221a2
--- /dev/null
+++ b/ar_TN/ar_TN_test.go
@@ -0,0 +1,1120 @@
+package ar_TN
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_TN"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ar_YE/ar_YE.go b/ar_YE/ar_YE.go
index de8bba96..8fcb8ca4 100644
--- a/ar_YE/ar_YE.go
+++ b/ar_YE/ar_YE.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"", ""},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"HAST": "توقيت هاواي ألوتيان الرسمي", "∅∅∅": "∅∅∅", "SAST": "توقيت جنوب أفريقيا", "TMT": "توقيت تركمانستان الرسمي", "MESZ": "توقيت وسط أوروبا الصيفي", "AEDT": "توقيت شرق أستراليا الصيفي", "CLST": "توقيت شيلي الصيفي", "NZST": "توقيت نيوزيلندا الرسمي", "WAT": "توقيت غرب أفريقيا الرسمي", "BT": "توقيت بوتان", "GMT": "توقيت غرينتش", "PST": "توقيت المحيط الهادي الرسمي", "AWDT": "توقيت غرب أستراليا الصيفي", "LHDT": "التوقيت الصيفي للورد هاو", "AKST": "التوقيت الرسمي لألاسكا", "NZDT": "توقيت نيوزيلندا الصيفي", "COST": "توقيت كولومبيا الصيفي", "CAT": "توقيت وسط أفريقيا", "HAT": "توقيت نيوفاوندلاند الصيفي", "WITA": "توقيت وسط إندونيسيا", "AST": "التوقيت الرسمي الأطلسي", "ADT": "التوقيت الصيفي الأطلسي", "IST": "توقيت الهند", "MYT": "توقيت ماليزيا", "SGT": "توقيت سنغافورة", "WART": "توقيت غرب الأرجنتين الرسمي", "HNT": "توقيت نيوفاوندلاند الرسمي", "MEZ": "توقيت وسط أوروبا الرسمي", "UYST": "توقيت أورغواي الصيفي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "CLT": "توقيت شيلي الرسمي", "WIT": "توقيت شرق إندونيسيا", "GYT": "توقيت غيانا", "BOT": "توقيت بوليفيا", "CHADT": "توقيت تشاتام الصيفي", "ACDT": "توقيت وسط أستراليا الصيفي", "TMST": "توقيت تركمانستان الصيفي", "AKDT": "توقيت ألاسكا الصيفي", "MST": "MST", "AEST": "توقيت شرق أستراليا الرسمي", "ECT": "توقيت الإكوادور", "ART": "توقيت الأرجنتين الرسمي", "VET": "توقيت فنزويلا", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "ChST": "توقيت تشامورو", "COT": "توقيت كولومبيا الرسمي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "HADT": "توقيت هاواي ألوتيان الصيفي", "HKT": "توقيت هونغ كونغ الرسمي", "EAT": "توقيت شرق أفريقيا", "JDT": "توقيت اليابان الصيفي", "UYT": "توقيت أورغواي الرسمي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "CHAST": "توقيت تشاتام الرسمي", "OESZ": "توقيت شرق أوروبا الصيفي", "MDT": "MDT", "AWST": "توقيت غرب أستراليا الرسمي", "ARST": "توقيت الأرجنتين الصيفي", "LHST": "توقيت لورد هاو الرسمي", "SRT": "توقيت سورينام", "WESZ": "توقيت غرب أوروبا الصيفي", "WAST": "توقيت غرب أفريقيا الصيفي", "HKST": "توقيت هونغ كونغ الصيفي", "WARST": "توقيت غرب الأرجنتين الصيفي", "WIB": "توقيت غرب إندونيسيا", "JST": "توقيت اليابان الرسمي", "GFT": "توقيت غايانا الفرنسية", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "OEZ": "توقيت شرق أوروبا الرسمي", "ACST": "توقيت وسط أستراليا الرسمي", "PDT": "توقيت المحيط الهادي الصيفي", "WEZ": "توقيت غرب أوروبا الرسمي"},
+ timezones: map[string]string{"ART": "توقيت الأرجنتين الرسمي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "PST": "توقيت المحيط الهادي الرسمي", "OESZ": "توقيت شرق أوروبا الصيفي", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية", "AEST": "توقيت شرق أستراليا الرسمي", "EAT": "توقيت شرق أفريقيا", "HKT": "توقيت هونغ كونغ الرسمي", "JDT": "توقيت اليابان الصيفي", "AKDT": "توقيت ألاسكا الصيفي", "AST": "التوقيت الرسمي الأطلسي", "COST": "توقيت كولومبيا الصيفي", "TMT": "توقيت تركمانستان الرسمي", "BT": "توقيت بوتان", "VET": "توقيت فنزويلا", "SGT": "توقيت سنغافورة", "ARST": "توقيت الأرجنتين الصيفي", "IST": "توقيت الهند", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "HADT": "توقيت هاواي ألوتيان الصيفي", "BOT": "توقيت بوليفيا", "WIB": "توقيت غرب إندونيسيا", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "SRT": "توقيت سورينام", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "HAT": "توقيت نيوفاوندلاند الصيفي", "GMT": "توقيت غرينتش", "ChST": "توقيت تشامورو", "∅∅∅": "توقيت برازيليا الصيفي", "WESZ": "توقيت غرب أوروبا الصيفي", "CHAST": "توقيت تشاتام الرسمي", "MEZ": "توقيت وسط أوروبا الرسمي", "SAST": "توقيت جنوب أفريقيا", "WAT": "توقيت غرب أفريقيا الرسمي", "LHST": "توقيت لورد هاو الرسمي", "WITA": "توقيت وسط إندونيسيا", "MESZ": "توقيت وسط أوروبا الصيفي", "TMST": "توقيت تركمانستان الصيفي", "AEDT": "توقيت شرق أستراليا الصيفي", "ACST": "توقيت وسط أستراليا الرسمي", "ECT": "توقيت الإكوادور", "HAST": "توقيت هاواي ألوتيان الرسمي", "WAST": "توقيت غرب أفريقيا الصيفي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "WART": "توقيت غرب الأرجنتين الرسمي", "JST": "توقيت اليابان الرسمي", "CHADT": "توقيت تشاتام الصيفي", "CAT": "توقيت وسط أفريقيا", "MYT": "توقيت ماليزيا", "CLST": "توقيت شيلي الصيفي", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "AKST": "التوقيت الرسمي لألاسكا", "AWST": "توقيت غرب أستراليا الرسمي", "AWDT": "توقيت غرب أستراليا الصيفي", "NZDT": "توقيت نيوزيلندا الصيفي", "OEZ": "توقيت شرق أوروبا الرسمي", "UYST": "توقيت أورغواي الصيفي", "WARST": "توقيت غرب الأرجنتين الصيفي", "HKST": "توقيت هونغ كونغ الصيفي", "PDT": "توقيت المحيط الهادي الصيفي", "GFT": "توقيت غايانا الفرنسية", "WEZ": "توقيت غرب أوروبا الرسمي", "GYT": "توقيت غيانا", "UYT": "توقيت أورغواي الرسمي", "ACDT": "توقيت وسط أستراليا الصيفي", "LHDT": "التوقيت الصيفي للورد هاو", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "ADT": "التوقيت الصيفي الأطلسي", "NZST": "توقيت نيوزيلندا الرسمي", "COT": "توقيت كولومبيا الرسمي", "HNT": "توقيت نيوفاوندلاند الرسمي", "CLT": "توقيت شيلي الرسمي", "WIT": "توقيت شرق إندونيسيا"},
}
}
diff --git a/ar_YE/ar_YE_test.go b/ar_YE/ar_YE_test.go
new file mode 100644
index 00000000..58451540
--- /dev/null
+++ b/ar_YE/ar_YE_test.go
@@ -0,0 +1,1120 @@
+package ar_YE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_YE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/as/as.go b/as/as.go
index 7dea2ef7..fdd914d5 100644
--- a/as/as.go
+++ b/as/as.go
@@ -58,7 +58,7 @@ func New() locales.Translator {
daysWide: []string{"দেওবাৰ", "সোমবাৰ", "মঙ্গলবাৰ", "বুধবাৰ", "বৃহষ্পতিবাৰ", "শুক্ৰবাৰ", "শনিবাৰ"},
periodsAbbreviated: []string{"পূৰ্বাহ্ণ", "অপৰাহ্ণ"},
periodsWide: []string{"পূৰ্বাহ্ণ", "অপৰাহ্ণ"},
- timezones: map[string]string{"COST": "COST", "HKST": "HKST", "OEZ": "OEZ", "HNT": "HNT", "ACDT": "ACDT", "JST": "JST", "BT": "BT", "GMT": "GMT", "AKDT": "AKDT", "CDT": "CDT", "ACWDT": "ACWDT", "EST": "EST", "HAST": "HAST", "HADT": "HADT", "MEZ": "MEZ", "UYT": "UYT", "WART": "WART", "EAT": "EAT", "TMT": "TMT", "AKST": "AKST", "JDT": "JDT", "SRT": "SRT", "PST": "PST", "GYT": "GYT", "CHADT": "CHADT", "WAT": "WAT", "GFT": "GFT", "MDT": "MDT", "NZST": "NZST", "VET": "VET", "AEDT": "AEDT", "EDT": "EDT", "COT": "COT", "OESZ": "OESZ", "TMST": "TMST", "AWDT": "AWDT", "LHDT": "LHDT", "∅∅∅": "∅∅∅", "ADT": "ADT", "IST": "ভাৰতীয় সময়", "MST": "MST", "ACST": "ACST", "PDT": "PDT", "WARST": "WARST", "HAT": "HAT", "WIB": "WIB", "NZDT": "NZDT", "SGT": "SGT", "CHAST": "CHAST", "UYST": "UYST", "ChST": "ChST", "CAT": "CAT", "ECT": "ECT", "SAST": "SAST", "HKT": "HKT", "ART": "ART", "AWST": "AWST", "AST": "AST", "BOT": "BOT", "WITA": "WITA", "LHST": "LHST", "ARST": "ARST", "CST": "CST", "MESZ": "MESZ", "ACWST": "ACWST", "CLST": "CLST", "WAST": "WAST", "WESZ": "WESZ", "AEST": "AEST", "WIT": "WIT", "MYT": "MYT", "WEZ": "WEZ", "CLT": "CLT"},
+ timezones: map[string]string{"TMST": "TMST", "BT": "BT", "HADT": "HADT", "WAT": "WAT", "LHST": "LHST", "ECT": "ECT", "AST": "AST", "ADT": "ADT", "AWST": "AWST", "WESZ": "WESZ", "OEZ": "OEZ", "GMT": "GMT", "AEDT": "AEDT", "CDT": "CDT", "JST": "JST", "SAST": "SAST", "NZST": "NZST", "OESZ": "OESZ", "GYT": "GYT", "UYT": "UYT", "UYST": "UYST", "ACDT": "ACDT", "CHADT": "CHADT", "ACST": "ACST", "TMT": "TMT", "MYT": "MYT", "WITA": "WITA", "PDT": "PDT", "MEZ": "MEZ", "CAT": "CAT", "EAT": "EAT", "LHDT": "LHDT", "SRT": "SRT", "AKST": "AKST", "ACWDT": "ACWDT", "VET": "VET", "ACWST": "ACWST", "AWDT": "AWDT", "ARST": "ARST", "BOT": "BOT", "WAST": "WAST", "∅∅∅": "∅∅∅", "CST": "CST", "COT": "COT", "MST": "MST", "GFT": "GFT", "HKT": "HKT", "NZDT": "NZDT", "PST": "PST", "SGT": "SGT", "MDT": "MDT", "CLT": "CLT", "WARST": "WARST", "CHAST": "CHAST", "IST": "ভাৰতীয় সময়", "COST": "COST", "ChST": "ChST", "WART": "WART", "HKST": "HKST", "JDT": "JDT", "EDT": "EDT", "WIT": "WIT", "EST": "EST", "WIB": "WIB", "WEZ": "WEZ", "HNT": "HNT", "CLST": "CLST", "ART": "ART", "AEST": "AEST", "AKDT": "AKDT", "MESZ": "MESZ", "HAT": "HAT", "HAST": "HAST"},
}
}
@@ -135,7 +135,7 @@ func (as *as) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (as *as) MonthsNarrow() []string {
- return as.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/as/as_test.go b/as/as_test.go
new file mode 100644
index 00000000..26c1d0b0
--- /dev/null
+++ b/as/as_test.go
@@ -0,0 +1,1120 @@
+package as
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "as"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/as_IN/as_IN.go b/as_IN/as_IN.go
index 7e8b3904..387ad7c7 100644
--- a/as_IN/as_IN.go
+++ b/as_IN/as_IN.go
@@ -58,7 +58,7 @@ func New() locales.Translator {
daysWide: []string{"দেওবাৰ", "সোমবাৰ", "মঙ্গলবাৰ", "বুধবাৰ", "বৃহষ্পতিবাৰ", "শুক্ৰবাৰ", "শনিবাৰ"},
periodsAbbreviated: []string{"পূৰ্বাহ্ণ", "অপৰাহ্ণ"},
periodsWide: []string{"পূৰ্বাহ্ণ", "অপৰাহ্ণ"},
- timezones: map[string]string{"ACST": "ACST", "CHAST": "CHAST", "EDT": "EDT", "COST": "COST", "IST": "ভাৰতীয় সময়", "AWDT": "AWDT", "LHDT": "LHDT", "EST": "EST", "WAT": "WAT", "ARST": "ARST", "JST": "JST", "VET": "VET", "HAT": "HAT", "AKST": "AKST", "CST": "CST", "WARST": "WARST", "CDT": "CDT", "CAT": "CAT", "ADT": "ADT", "SRT": "SRT", "AWST": "AWST", "ACWST": "ACWST", "AEST": "AEST", "TMT": "TMT", "EAT": "EAT", "WITA": "WITA", "OEZ": "OEZ", "MDT": "MDT", "CHADT": "CHADT", "ACWDT": "ACWDT", "AST": "AST", "HAST": "HAST", "HKST": "HKST", "MEZ": "MEZ", "OESZ": "OESZ", "HNT": "HNT", "ACDT": "ACDT", "PDT": "PDT", "GYT": "GYT", "CLT": "CLT", "ChST": "ChST", "WIT": "WIT", "GMT": "GMT", "NZST": "NZST", "WART": "WART", "HKT": "HKT", "UYST": "UYST", "COT": "COT", "ECT": "ECT", "HADT": "HADT", "SGT": "SGT", "JDT": "JDT", "PST": "PST", "LHST": "LHST", "UYT": "UYT", "CLST": "CLST", "BT": "BT", "WIB": "WIB", "TMST": "TMST", "SAST": "SAST", "AKDT": "AKDT", "MESZ": "MESZ", "NZDT": "NZDT", "ART": "ART", "MYT": "MYT", "MST": "MST", "WEZ": "WEZ", "AEDT": "AEDT", "WAST": "WAST", "WESZ": "WESZ", "∅∅∅": "∅∅∅", "GFT": "GFT", "BOT": "BOT"},
+ timezones: map[string]string{"LHDT": "LHDT", "VET": "VET", "AWDT": "AWDT", "IST": "ভাৰতীয় সময়", "TMST": "TMST", "WARST": "WARST", "AKST": "AKST", "PST": "PST", "COT": "COT", "WAST": "WAST", "OEZ": "OEZ", "AEDT": "AEDT", "WIT": "WIT", "SRT": "SRT", "JST": "JST", "MEZ": "MEZ", "HAT": "HAT", "UYST": "UYST", "BT": "BT", "EDT": "EDT", "CLT": "CLT", "UYT": "UYT", "CDT": "CDT", "CHADT": "CHADT", "ART": "ART", "ADT": "ADT", "AKDT": "AKDT", "TMT": "TMT", "SGT": "SGT", "OESZ": "OESZ", "NZST": "NZST", "BOT": "BOT", "EST": "EST", "GYT": "GYT", "AST": "AST", "NZDT": "NZDT", "WESZ": "WESZ", "ChST": "ChST", "CHAST": "CHAST", "ACWDT": "ACWDT", "MESZ": "MESZ", "AWST": "AWST", "WIB": "WIB", "CLST": "CLST", "WAT": "WAT", "LHST": "LHST", "ACST": "ACST", "SAST": "SAST", "HKT": "HKT", "JDT": "JDT", "HADT": "HADT", "AEST": "AEST", "WART": "WART", "WITA": "WITA", "CAT": "CAT", "GMT": "GMT", "COST": "COST", "MYT": "MYT", "CST": "CST", "GFT": "GFT", "∅∅∅": "∅∅∅", "PDT": "PDT", "ACWST": "ACWST", "HNT": "HNT", "MST": "MST", "HKST": "HKST", "ARST": "ARST", "WEZ": "WEZ", "EAT": "EAT", "ACDT": "ACDT", "ECT": "ECT", "MDT": "MDT", "HAST": "HAST"},
}
}
@@ -135,7 +135,7 @@ func (as *as_IN) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (as *as_IN) MonthsNarrow() []string {
- return as.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/as_IN/as_IN_test.go b/as_IN/as_IN_test.go
new file mode 100644
index 00000000..bf0b3978
--- /dev/null
+++ b/as_IN/as_IN_test.go
@@ -0,0 +1,1120 @@
+package as_IN
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "as_IN"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/asa/asa.go b/asa/asa.go
index 0a393a98..d3eab417 100644
--- a/asa/asa.go
+++ b/asa/asa.go
@@ -63,7 +63,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"KM", "BM"},
erasNarrow: []string{"", ""},
erasWide: []string{"Kabla yakwe Yethu", "Baada yakwe Yethu"},
- timezones: map[string]string{"MDT": "MDT", "AWDT": "AWDT", "AKST": "AKST", "CHADT": "CHADT", "HAST": "HAST", "∅∅∅": "∅∅∅", "TMT": "TMT", "PST": "PST", "MESZ": "MESZ", "AST": "AST", "BT": "BT", "ACDT": "ACDT", "TMST": "TMST", "LHST": "LHST", "MEZ": "MEZ", "CST": "CST", "OESZ": "OESZ", "GFT": "GFT", "JST": "JST", "SRT": "SRT", "NZST": "NZST", "HKST": "HKST", "LHDT": "LHDT", "MYT": "MYT", "ECT": "ECT", "ACST": "ACST", "UYT": "UYT", "HADT": "HADT", "WARST": "WARST", "CLST": "CLST", "EST": "EST", "ADT": "ADT", "WAT": "WAT", "HNT": "HNT", "PDT": "PDT", "AKDT": "AKDT", "NZDT": "NZDT", "AEST": "AEST", "AEDT": "AEDT", "SGT": "SGT", "ART": "ART", "ACWDT": "ACWDT", "WAST": "WAST", "WIB": "WIB", "ACWST": "ACWST", "HKT": "HKT", "WITA": "WITA", "IST": "IST", "EAT": "EAT", "WESZ": "WESZ", "WIT": "WIT", "JDT": "JDT", "WEZ": "WEZ", "EDT": "EDT", "OEZ": "OEZ", "ARST": "ARST", "SAST": "SAST", "GMT": "GMT", "MST": "MST", "BOT": "BOT", "ChST": "ChST", "CHAST": "CHAST", "VET": "VET", "COST": "COST", "HAT": "HAT", "GYT": "GYT", "CLT": "CLT", "AWST": "AWST", "UYST": "UYST", "CDT": "CDT", "COT": "COT", "CAT": "CAT", "WART": "WART"},
+ timezones: map[string]string{"AST": "AST", "SGT": "SGT", "SRT": "SRT", "GFT": "GFT", "ART": "ART", "JST": "JST", "AKST": "AKST", "AWDT": "AWDT", "NZST": "NZST", "CLT": "CLT", "CST": "CST", "HKT": "HKT", "NZDT": "NZDT", "ACDT": "ACDT", "∅∅∅": "∅∅∅", "CHAST": "CHAST", "ACWST": "ACWST", "JDT": "JDT", "EDT": "EDT", "HADT": "HADT", "GMT": "GMT", "WART": "WART", "EAT": "EAT", "WARST": "WARST", "MST": "MST", "MDT": "MDT", "WAT": "WAT", "AEDT": "AEDT", "GYT": "GYT", "CAT": "CAT", "AEST": "AEST", "LHDT": "LHDT", "CLST": "CLST", "ECT": "ECT", "BOT": "BOT", "SAST": "SAST", "TMT": "TMT", "UYST": "UYST", "WIT": "WIT", "OEZ": "OEZ", "LHST": "LHST", "MYT": "MYT", "HKST": "HKST", "PDT": "PDT", "WEZ": "WEZ", "HNT": "HNT", "HAT": "HAT", "VET": "VET", "ACWDT": "ACWDT", "IST": "IST", "WESZ": "WESZ", "CDT": "CDT", "HAST": "HAST", "TMST": "TMST", "WAST": "WAST", "UYT": "UYT", "BT": "BT", "WITA": "WITA", "ADT": "ADT", "PST": "PST", "MEZ": "MEZ", "COT": "COT", "WIB": "WIB", "ACST": "ACST", "OESZ": "OESZ", "CHADT": "CHADT", "AWST": "AWST", "ARST": "ARST", "AKDT": "AKDT", "EST": "EST", "MESZ": "MESZ", "COST": "COST", "ChST": "ChST"},
}
}
diff --git a/asa/asa_test.go b/asa/asa_test.go
new file mode 100644
index 00000000..80143c0b
--- /dev/null
+++ b/asa/asa_test.go
@@ -0,0 +1,1120 @@
+package asa
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "asa"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/asa_TZ/asa_TZ.go b/asa_TZ/asa_TZ.go
index 1605b5bd..92148f7e 100644
--- a/asa_TZ/asa_TZ.go
+++ b/asa_TZ/asa_TZ.go
@@ -63,7 +63,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"KM", "BM"},
erasNarrow: []string{"", ""},
erasWide: []string{"Kabla yakwe Yethu", "Baada yakwe Yethu"},
- timezones: map[string]string{"UYT": "UYT", "ACWST": "ACWST", "CAT": "CAT", "IST": "IST", "LHST": "LHST", "UYST": "UYST", "WESZ": "WESZ", "EDT": "EDT", "WAST": "WAST", "HKST": "HKST", "MST": "MST", "WIT": "WIT", "GFT": "GFT", "ACDT": "ACDT", "AWDT": "AWDT", "AKDT": "AKDT", "CDT": "CDT", "NZDT": "NZDT", "AEST": "AEST", "SAST": "SAST", "GMT": "GMT", "MDT": "MDT", "SGT": "SGT", "TMST": "TMST", "CLT": "CLT", "ACWDT": "ACWDT", "TMT": "TMT", "ACST": "ACST", "SRT": "SRT", "BOT": "BOT", "CHAST": "CHAST", "HKT": "HKT", "OESZ": "OESZ", "COT": "COT", "HAT": "HAT", "ARST": "ARST", "AKST": "AKST", "VET": "VET", "ChST": "ChST", "∅∅∅": "∅∅∅", "ADT": "ADT", "OEZ": "OEZ", "PST": "PST", "AWST": "AWST", "PDT": "PDT", "CHADT": "CHADT", "CLST": "CLST", "COST": "COST", "WARST": "WARST", "WITA": "WITA", "MESZ": "MESZ", "JST": "JST", "LHDT": "LHDT", "CST": "CST", "WEZ": "WEZ", "AEDT": "AEDT", "ART": "ART", "MYT": "MYT", "MEZ": "MEZ", "NZST": "NZST", "HAST": "HAST", "JDT": "JDT", "AST": "AST", "WAT": "WAT", "BT": "BT", "WIB": "WIB", "EAT": "EAT", "GYT": "GYT", "EST": "EST", "ECT": "ECT", "HADT": "HADT", "WART": "WART", "HNT": "HNT"},
+ timezones: map[string]string{"WIB": "WIB", "ACST": "ACST", "BOT": "BOT", "HNT": "HNT", "TMST": "TMST", "MDT": "MDT", "WART": "WART", "ARST": "ARST", "EST": "EST", "MEZ": "MEZ", "OESZ": "OESZ", "JDT": "JDT", "ACWST": "ACWST", "WAT": "WAT", "GMT": "GMT", "CLT": "CLT", "HADT": "HADT", "CAT": "CAT", "SRT": "SRT", "AST": "AST", "LHDT": "LHDT", "COT": "COT", "WEZ": "WEZ", "BT": "BT", "ChST": "ChST", "CLST": "CLST", "EAT": "EAT", "∅∅∅": "∅∅∅", "ECT": "ECT", "HAST": "HAST", "CDT": "CDT", "WARST": "WARST", "TMT": "TMT", "GYT": "GYT", "CST": "CST", "NZST": "NZST", "NZDT": "NZDT", "SAST": "SAST", "PST": "PST", "MESZ": "MESZ", "OEZ": "OEZ", "LHST": "LHST", "CHAST": "CHAST", "VET": "VET", "JST": "JST", "AKST": "AKST", "AKDT": "AKDT", "ADT": "ADT", "WAST": "WAST", "SGT": "SGT", "GFT": "GFT", "ART": "ART", "COST": "COST", "UYT": "UYT", "WIT": "WIT", "HKT": "HKT", "WITA": "WITA", "ACWDT": "ACWDT", "AWST": "AWST", "PDT": "PDT", "AEST": "AEST", "MST": "MST", "ACDT": "ACDT", "CHADT": "CHADT", "AWDT": "AWDT", "WESZ": "WESZ", "MYT": "MYT", "HKST": "HKST", "IST": "IST", "EDT": "EDT", "HAT": "HAT", "AEDT": "AEDT", "UYST": "UYST"},
}
}
diff --git a/asa_TZ/asa_TZ_test.go b/asa_TZ/asa_TZ_test.go
new file mode 100644
index 00000000..51ec9e4d
--- /dev/null
+++ b/asa_TZ/asa_TZ_test.go
@@ -0,0 +1,1120 @@
+package asa_TZ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "asa_TZ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ast/ast.go b/ast/ast.go
index 0b8fc593..b5c3b7f8 100644
--- a/ast/ast.go
+++ b/ast/ast.go
@@ -70,7 +70,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a.C.", "d.C."},
erasNarrow: []string{"aC", "dC"},
erasWide: []string{"a.C.", "después de Cristu"},
- timezones: map[string]string{"CHAST": "Hora estándar de Chatham", "VET": "Hora de Venezuela", "AEST": "Hora estándar d’Australia del este", "AST": "Hora estándar del Atlánticu", "BT": "Hora de Bután", "PDT": "Hora braniega del Pacíficu norteamericanu", "HAT": "Hora braniega de Newfoundland", "EAT": "Hora d’África del este", "JST": "Hora estándar de Xapón", "JDT": "Hora braniega de Xapón", "HADT": "Hora braniega de Hawaii-Aleutianes", "WIB": "Hora d’Indonesia del oeste", "HNT": "Hora estándar de Newfoundland", "ADT": "Hora braniega del Atlánticu", "WAT": "Hora estándar d’África del oeste", "ChST": "Hora estándar de Chamorro", "∅∅∅": "Hora braniega de Brasilia", "OEZ": "Hora estándar d’Europa del Este", "AEDT": "Hora braniega d’Australia del este", "SRT": "Hora del Surinam", "SGT": "Hora estándar de Singapur", "IST": "Hora estándar de la India", "GFT": "Hora de La Guyana Francesa", "WESZ": "Hora braniega d’Europa Occidental", "WIT": "Hora d’Indonesia del este", "OESZ": "Hora braniega d’Europa del Este", "BOT": "Hora de Bolivia", "SAST": "Hora de Sudáfrica", "LHDT": "Hora braniega de Lord Howe", "NZDT": "Hora braniega de Nueva Zelanda", "WARST": "Hora braniega occidental d’Arxentina", "MDT": "Hora braniega de Macáu", "ART": "Hora estándar d’Arxentina", "EST": "Hora estándar del este norteamericanu", "MESZ": "Hora braniega d’Europa Central", "CHADT": "Hora braniega de Chatham", "LHST": "Hora estándar de Lord Howe", "CDT": "Hora braniega central norteamericana", "MEZ": "Hora estándar d’Europa Central", "CLST": "Hora braniega de Chile", "COT": "Hora estándar de Colombia", "MST": "Hora estándar de Macáu", "AKST": "Hora estándar d’Alaska", "ACST": "Hora estándar d’Australia central", "UYT": "Hora estándar del Uruguái", "ECT": "Hora d’Ecuador", "HKST": "Hora braniega de Ḥong Kong", "WART": "Hora estándar occidental d’Arxentina", "UYST": "Hora braniega del Uruguái", "ACWDT": "Hora braniega d’Australia central del oeste", "ARST": "Hora braniega d’Arxentina", "MYT": "Hora de Malasia", "PST": "Hora estándar del Pacíficu norteamericanu", "COST": "Hora braniega de Colombia", "HAST": "Hora estándar de Hawaii-Aleutianes", "TMST": "Hora braniega del Turkmenistán", "TMT": "Hora estándar del Turkmenistán", "ACDT": "Hora braniega d’Australia central", "AKDT": "Hora braniega d’Alaska", "AWST": "Hora estándar d’Australia del oeste", "EDT": "Hora braniega del este norteamericanu", "WITA": "Hora d’Indonesia central", "GMT": "Hora media de Greenwich", "WAST": "Hora braniega d’África del oeste", "HKT": "Hora estándar de Ḥong Kong", "ACWST": "Hora estándar d’Australia central del oeste", "CST": "Hora estándar central norteamericana", "NZST": "Hora estándar de Nueva Zelanda", "CLT": "Hora estándar de Chile", "WEZ": "Hora estándar d’Europa Occidental", "CAT": "Hora d’África central", "AWDT": "Hora braniega d’Australia del oeste", "GYT": "Hora de La Guyana"},
+ timezones: map[string]string{"WART": "Hora estándar occidental d’Arxentina", "HADT": "Hora braniega de Hawaii-Aleutianes", "WIB": "Hora d’Indonesia del oeste", "TMST": "Hora braniega del Turkmenistán", "LHDT": "Hora braniega de Lord Howe", "HKT": "Hora estándar de Ḥong Kong", "ECT": "Hora d’Ecuador", "COT": "Hora estándar de Colombia", "SGT": "Hora estándar de Singapur", "AEST": "Hora estándar d’Australia del este", "NZST": "Hora estándar de Nueva Zelanda", "WAT": "Hora estándar d’África del oeste", "JST": "Hora estándar de Xapón", "CAT": "Hora d’África central", "UYT": "Hora estándar del Uruguái", "WITA": "Hora d’Indonesia central", "AWDT": "Hora braniega d’Australia del oeste", "PST": "Hora estándar del Pacíficu norteamericanu", "EAT": "Hora d’África del este", "CHAST": "Hora estándar de Chatham", "ACDT": "Hora braniega d’Australia central", "HKST": "Hora braniega de Ḥong Kong", "AWST": "Hora estándar d’Australia del oeste", "BOT": "Hora de Bolivia", "WEZ": "Hora estándar d’Europa Occidental", "AEDT": "Hora braniega d’Australia del este", "WESZ": "Hora braniega d’Europa Occidental", "VET": "Hora de Venezuela", "JDT": "Hora braniega de Xapón", "OESZ": "Hora braniega d’Europa del Este", "GMT": "Hora media de Greenwich", "ACWDT": "Hora braniega d’Australia central del oeste", "MYT": "Hora de Malasia", "GFT": "Hora de La Guyana Francesa", "CHADT": "Hora braniega de Chatham", "ADT": "Hora braniega del Atlánticu", "NZDT": "Hora braniega de Nueva Zelanda", "PDT": "Hora braniega del Pacíficu norteamericanu", "BT": "Hora de Bután", "LHST": "Hora estándar de Lord Howe", "AKST": "Hora estándar d’Alaska", "SAST": "Hora de Sudáfrica", "IST": "Hora estándar de la India", "OEZ": "Hora estándar d’Europa del Este", "MEZ": "Hora estándar d’Europa Central", "WARST": "Hora braniega occidental d’Arxentina", "AST": "Hora estándar del Atlánticu", "ACWST": "Hora estándar d’Australia central del oeste", "EST": "Hora estándar del este norteamericanu", "WIT": "Hora d’Indonesia del este", "CST": "Hora estándar central norteamericana", "CLST": "Hora braniega de Chile", "UYST": "Hora braniega del Uruguái", "AKDT": "Hora braniega d’Alaska", "EDT": "Hora braniega del este norteamericanu", "TMT": "Hora estándar del Turkmenistán", "CLT": "Hora estándar de Chile", "SRT": "Hora del Surinam", "HAST": "Hora estándar de Hawaii-Aleutianes", "HNT": "Hora estándar de Newfoundland", "ACST": "Hora estándar d’Australia central", "WAST": "Hora braniega d’África del oeste", "GYT": "Hora de La Guyana", "MDT": "Hora braniega de les montañes norteamericanes", "CDT": "Hora braniega central norteamericana", "ART": "Hora estándar d’Arxentina", "MESZ": "Hora braniega d’Europa Central", "∅∅∅": "Hora braniega del Amazonas", "COST": "Hora braniega de Colombia", "ARST": "Hora braniega d’Arxentina", "HAT": "Hora braniega de Newfoundland", "ChST": "Hora estándar de Chamorro", "MST": "Hora estándar de les montañes norteamericanes"},
}
}
diff --git a/ast/ast_test.go b/ast/ast_test.go
new file mode 100644
index 00000000..68adb2c7
--- /dev/null
+++ b/ast/ast_test.go
@@ -0,0 +1,1120 @@
+package ast
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ast"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ast_ES/ast_ES.go b/ast_ES/ast_ES.go
index 794e2f03..761a055d 100644
--- a/ast_ES/ast_ES.go
+++ b/ast_ES/ast_ES.go
@@ -70,7 +70,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a.C.", "d.C."},
erasNarrow: []string{"aC", "dC"},
erasWide: []string{"a.C.", "después de Cristu"},
- timezones: map[string]string{"CDT": "Hora braniega central norteamericana", "WEZ": "Hora estándar d’Europa Occidental", "∅∅∅": "hora braniega d’Acre", "WAT": "Hora estándar d’África del oeste", "HNT": "Hora estándar de Newfoundland", "TMST": "Hora braniega del Turkmenistán", "EST": "Hora estándar del este norteamericanu", "NZDT": "Hora braniega de Nueva Zelanda", "CST": "Hora estándar central norteamericana", "CHAST": "Hora estándar de Chatham", "COT": "Hora estándar de Colombia", "AST": "Hora estándar del Atlánticu", "MST": "Hora estándar de Macáu", "AEDT": "Hora braniega d’Australia del este", "MESZ": "Hora braniega d’Europa Central", "CHADT": "Hora braniega de Chatham", "ADT": "Hora braniega del Atlánticu", "HKT": "Hora estándar de Ḥong Kong", "WITA": "Hora d’Indonesia central", "IST": "Hora estándar de la India", "NZST": "Hora estándar de Nueva Zelanda", "BOT": "Hora de Bolivia", "UYST": "Hora braniega del Uruguái", "MEZ": "Hora estándar d’Europa Central", "HADT": "Hora braniega de Hawaii-Aleutianes", "GFT": "Hora de La Guyana Francesa", "ACST": "Hora estándar d’Australia central", "PST": "Hora estándar del Pacíficu norteamericanu", "ECT": "Hora d’Ecuador", "WIT": "Hora d’Indonesia del este", "AWDT": "Hora braniega d’Australia del oeste", "AKST": "Hora estándar d’Alaska", "BT": "Hora de Bután", "MYT": "Hora de Malasia", "CAT": "Hora d’África central", "SAST": "Hora de Sudáfrica", "JDT": "Hora braniega de Xapón", "SRT": "Hora del Surinam", "AEST": "Hora estándar d’Australia del este", "WIB": "Hora d’Indonesia del oeste", "UYT": "Hora estándar del Uruguái", "WESZ": "Hora braniega d’Europa Occidental", "GMT": "Hora media de Greenwich", "AKDT": "Hora braniega d’Alaska", "COST": "Hora braniega de Colombia", "EDT": "Hora braniega del este norteamericanu", "LHST": "Hora estándar de Lord Howe", "CLT": "Hora estándar de Chile", "SGT": "Hora estándar de Singapur", "HKST": "Hora braniega de Ḥong Kong", "OEZ": "Hora estándar d’Europa del Este", "EAT": "Hora d’África del este", "OESZ": "Hora braniega d’Europa del Este", "CLST": "Hora braniega de Chile", "HAT": "Hora braniega de Newfoundland", "AWST": "Hora estándar d’Australia del oeste", "LHDT": "Hora braniega de Lord Howe", "TMT": "Hora estándar del Turkmenistán", "ACWST": "Hora estándar d’Australia central del oeste", "HAST": "Hora estándar de Hawaii-Aleutianes", "WAST": "Hora braniega d’África del oeste", "ACDT": "Hora braniega d’Australia central", "ARST": "Hora braniega d’Arxentina", "ART": "Hora estándar d’Arxentina", "PDT": "Hora braniega del Pacíficu norteamericanu", "ChST": "Hora estándar de Chamorro", "VET": "Hora de Venezuela", "JST": "Hora estándar de Xapón", "ACWDT": "Hora braniega d’Australia central del oeste", "WART": "Hora estándar occidental d’Arxentina", "WARST": "Hora braniega occidental d’Arxentina", "MDT": "Hora braniega de Macáu", "GYT": "Hora de La Guyana"},
+ timezones: map[string]string{"ARST": "Hora braniega d’Arxentina", "JST": "Hora estándar de Xapón", "JDT": "Hora braniega de Xapón", "MEZ": "Hora estándar d’Europa Central", "MYT": "Hora de Malasia", "WART": "Hora estándar occidental d’Arxentina", "CHAST": "Hora estándar de Chatham", "HKST": "Hora braniega de Ḥong Kong", "WARST": "Hora braniega occidental d’Arxentina", "ACST": "Hora estándar d’Australia central", "WIB": "Hora d’Indonesia del oeste", "TMST": "Hora braniega del Turkmenistán", "AEDT": "Hora braniega d’Australia del este", "LHST": "Hora estándar de Lord Howe", "LHDT": "Hora braniega de Lord Howe", "GFT": "Hora de La Guyana Francesa", "AKDT": "Hora braniega d’Alaska", "HAST": "Hora estándar de Hawaii-Aleutianes", "ACDT": "Hora braniega d’Australia central", "EDT": "Hora braniega del este norteamericanu", "NZDT": "Hora braniega de Nueva Zelanda", "OESZ": "Hora braniega d’Europa del Este", "WIT": "Hora d’Indonesia del este", "CDT": "Hora braniega central norteamericana", "AKST": "Hora estándar d’Alaska", "SGT": "Hora estándar de Singapur", "UYST": "Hora braniega del Uruguái", "ACWST": "Hora estándar d’Australia central del oeste", "CLST": "Hora braniega de Chile", "HADT": "Hora braniega de Hawaii-Aleutianes", "HAT": "Hora braniega de Newfoundland", "MDT": "Hora braniega de Macáu", "SAST": "Hora de Sudáfrica", "WAT": "Hora estándar d’África del oeste", "UYT": "Hora estándar del Uruguái", "CHADT": "Hora braniega de Chatham", "COST": "Hora braniega de Colombia", "PDT": "Hora braniega del Pacíficu norteamericanu", "CAT": "Hora d’África central", "AST": "Hora estándar del Atlánticu", "ADT": "Hora braniega del Atlánticu", "EST": "Hora estándar del este norteamericanu", "PST": "Hora estándar del Pacíficu norteamericanu", "MESZ": "Hora braniega d’Europa Central", "∅∅∅": "hora braniega d’Acre", "ChST": "Hora estándar de Chamorro", "CLT": "Hora estándar de Chile", "ECT": "Hora d’Ecuador", "VET": "Hora de Venezuela", "CST": "Hora estándar central norteamericana", "MST": "Hora estándar de Macáu", "WESZ": "Hora braniega d’Europa Occidental", "AWDT": "Hora braniega d’Australia del oeste", "BOT": "Hora de Bolivia", "BT": "Hora de Bután", "ACWDT": "Hora braniega d’Australia central del oeste", "AWST": "Hora estándar d’Australia del oeste", "WEZ": "Hora estándar d’Europa Occidental", "COT": "Hora estándar de Colombia", "WAST": "Hora braniega d’África del oeste", "GMT": "Hora media de Greenwich", "NZST": "Hora estándar de Nueva Zelanda", "IST": "Hora estándar de la India", "TMT": "Hora estándar del Turkmenistán", "AEST": "Hora estándar d’Australia del este", "GYT": "Hora de La Guyana", "OEZ": "Hora estándar d’Europa del Este", "EAT": "Hora d’África del este", "SRT": "Hora del Surinam", "HKT": "Hora estándar de Ḥong Kong", "WITA": "Hora d’Indonesia central", "ART": "Hora estándar d’Arxentina", "HNT": "Hora estándar de Newfoundland"},
}
}
diff --git a/ast_ES/ast_ES_test.go b/ast_ES/ast_ES_test.go
new file mode 100644
index 00000000..284c8e17
--- /dev/null
+++ b/ast_ES/ast_ES_test.go
@@ -0,0 +1,1120 @@
+package ast_ES
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ast_ES"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/az/az.go b/az/az.go
index c10de42f..3d568c51 100644
--- a/az/az.go
+++ b/az/az.go
@@ -47,7 +47,7 @@ func New() locales.Translator {
locale: "az",
pluralsCardinal: []locales.PluralRule{2, 6},
pluralsOrdinal: []locales.PluralRule{2, 4, 5, 6},
- pluralsRange: []locales.PluralRule{2, 6},
+ pluralsRange: []locales.PluralRule{6, 2},
decimal: ",",
group: ".",
minus: "-",
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"e.ə.", "b.e."},
erasNarrow: []string{"", ""},
erasWide: []string{"eramızdan əvvəl", "eramız"},
- timezones: map[string]string{"ART": "Argentina Standart Vaxtı", "MYT": "Malayziya Vaxtı", "JDT": "Yaponiya Yay Vaxtı", "UYST": "Uruqvay Yay Vaxtı", "MST": "Şimali Dağlıq Amerika Standart Vaxtı", "WESZ": "Qərbi Avropa Yay Vaxtı", "HKT": "Honq Konq Standart Vaxtı", "UYT": "Uruqvay Standart Vaxtı", "ACWST": "Mərkəzi Qərbi Avstraliya Standart Vaxtı", "OESZ": "Şərqi Avropa Yay Vaxtı", "PDT": "Şimali Amerika Sakit Okean Yay Vaxtı", "AWST": "Qərbi Avstraliya Standart Vaxtı", "NZST": "Yeni Zelandiya Standart Vaxtı", "ACWDT": "Mərkəzi Qərbi Avstraliya Yay Vaxtı", "WIT": "Şərqi İndoneziya Vaxtı", "JST": "Yaponiya Standart Vaxtı", "BT": "Butan Vaxtı", "LHST": "Lord Hau Standart Vaxtı", "MESZ": "Mərkəzi Avropa Yay Vaxtı", "NZDT": "Yeni Zelandiya Yay Vaxtı", "BOT": "Boliviya Vaxtı", "HADT": "Havay-Aleut Yay Vaxtı", "WITA": "Mərkəzi İndoneziya Vaxtı", "HAT": "Nyufaundlend Yay Vaxtı", "MEZ": "Mərkəzi Avropa Standart Vaxtı", "ChST": "Çamorro Vaxtı", "ADT": "Atlantik Yay Vaxtı", "SAST": "Cənubi Afrika Vaxtı", "CDT": "Şimali Mərkəzi Amerika Yay Vaxtı", "AEST": "Şərqi Avstraliya Standart Vaxtı", "IST": "Hindistan Vaxtı", "EAT": "Şərqi Afrika Vaxtı", "AKDT": "Alyaska Yay Vaxtı", "PST": "Şimali Amerika Sakit Okean Standart Vaxtı", "CHADT": "Çatham Yay Vaxtı", "WEZ": "Qərbi Avropa Standart Vaxtı", "COT": "Kolumbiya Standart Vaxtı", "AKST": "Alyaska Standart Vaxtı", "CLST": "Çili Yay Vaxtı", "CST": "Şimali Mərkəzi Amerika Standart Vaxtı", "SGT": "Sinqapur Vaxtı", "HNT": "Nyufaundlend Standart Vaxtı", "SRT": "Surinam Vaxtı", "TMST": "Türkmənistan Yay Vaxtı", "GYT": "Qayana Vaxtı", "CHAST": "Çatham Standart Vaxtı", "COST": "Kolumbiya Yay Vaxtı", "WARST": "Qərbi Argentina Yay Vaxtı", "TMT": "Türkmənistan Standart Vaxtı", "VET": "Venesuela Vaxtı", "HAST": "Havay-Aleut Standart Vaxtı", "ACDT": "Mərkəzi Avstraliya Yay Vaxtı", "ARST": "Argentina Yay Vaxtı", "LHDT": "Lord Hau Yay vaxtı", "AST": "Atlantik Standart Vaxt", "OEZ": "Şərqi Avropa Standart Vaxtı", "GMT": "Qrinviç Orta Vaxtı", "AWDT": "Qərbi Avstraliya Yay Vaxtı", "ECT": "Ekvador Vaxtı", "WART": "Qərbi Argentina Standart Vaxtı", "GFT": "Fransız Qvianası Vaxtı", "ACST": "Mərkəzi Avstraliya Standart Vaxtı", "∅∅∅": "Braziliya Yay Vaxtı", "WAST": "Qərbi Afrika Yay Vaxtı", "HKST": "Honq Konq Yay Vaxtı", "WIB": "Qərbi İndoneziya Vaxtı", "EST": "Şimali Şərqi Amerika Standart Vaxtı", "EDT": "Şimali Şərqi Amerika Yay Vaxtı", "WAT": "Qərbi Afrika Standart Vaxtı", "MDT": "Şimali Dağlıq Amerika Yay Vaxtı", "CLT": "Çili Standart Vaxtı", "AEDT": "Şərqi Avstraliya Yay Vaxtı", "CAT": "Mərkəzi Afrika Vaxtı"},
+ timezones: map[string]string{"GMT": "Qrinviç Orta Vaxtı", "GFT": "Fransız Qvianası Vaxtı", "WIB": "Qərbi İndoneziya Vaxtı", "HNT": "Nyufaundlend Standart Vaxtı", "OEZ": "Şərqi Avropa Standart Vaxtı", "WARST": "Qərbi Argentina Yay Vaxtı", "AKST": "Alyaska Standart Vaxtı", "OESZ": "Şərqi Avropa Yay Vaxtı", "HAST": "Havay-Aleut Standart Vaxtı", "SAST": "Cənubi Afrika Vaxtı", "PDT": "Şimali Amerika Sakit Okean Yay Vaxtı", "UYST": "Uruqvay Yay Vaxtı", "LHDT": "Lord Hau Yay vaxtı", "MST": "Şimali Dağlıq Amerika Standart Vaxtı", "CST": "Şimali Mərkəzi Amerika Standart Vaxtı", "ACWDT": "Mərkəzi Qərbi Avstraliya Yay Vaxtı", "ARST": "Argentina Yay Vaxtı", "NZST": "Yeni Zelandiya Standart Vaxtı", "CLST": "Çili Yay Vaxtı", "BT": "Butan Vaxtı", "MDT": "Şimali Dağlıq Amerika Yay Vaxtı", "CHADT": "Çatham Yay Vaxtı", "JST": "Yaponiya Standart Vaxtı", "HKST": "Honq Konq Yay Vaxtı", "AKDT": "Alyaska Yay Vaxtı", "NZDT": "Yeni Zelandiya Yay Vaxtı", "COT": "Kolumbiya Standart Vaxtı", "CAT": "Mərkəzi Afrika Vaxtı", "VET": "Venesuela Vaxtı", "AST": "Atlantik Standart Vaxt", "ADT": "Atlantik Yay Vaxtı", "WAT": "Qərbi Afrika Standart Vaxtı", "HKT": "Honq Konq Standart Vaxtı", "AWDT": "Qərbi Avstraliya Yay Vaxtı", "HADT": "Havay-Aleut Yay Vaxtı", "GYT": "Qayana Vaxtı", "UYT": "Uruqvay Standart Vaxtı", "WIT": "Şərqi İndoneziya Vaxtı", "EAT": "Şərqi Afrika Vaxtı", "∅∅∅": "Braziliya Yay Vaxtı", "BOT": "Boliviya Vaxtı", "WAST": "Qərbi Afrika Yay Vaxtı", "WESZ": "Qərbi Avropa Yay Vaxtı", "HAT": "Nyufaundlend Yay Vaxtı", "ACWST": "Mərkəzi Qərbi Avstraliya Standart Vaxtı", "COST": "Kolumbiya Yay Vaxtı", "SGT": "Sinqapur Vaxtı", "EST": "Şimali Şərqi Amerika Standart Vaxtı", "ECT": "Ekvador Vaxtı", "JDT": "Yaponiya Yay Vaxtı", "AEDT": "Şərqi Avstraliya Yay Vaxtı", "LHST": "Lord Hau Standart Vaxtı", "AWST": "Qərbi Avstraliya Standart Vaxtı", "MESZ": "Mərkəzi Avropa Yay Vaxtı", "ACDT": "Mərkəzi Avstraliya Yay Vaxtı", "CHAST": "Çatham Standart Vaxtı", "MEZ": "Mərkəzi Avropa Standart Vaxtı", "TMT": "Türkmənistan Standart Vaxtı", "ChST": "Çamorro Vaxtı", "CLT": "Çili Standart Vaxtı", "PST": "Şimali Amerika Sakit Okean Standart Vaxtı", "TMST": "Türkmənistan Yay Vaxtı", "WART": "Qərbi Argentina Standart Vaxtı", "ART": "Argentina Standart Vaxtı", "IST": "Hindistan Vaxtı", "EDT": "Şimali Şərqi Amerika Yay Vaxtı", "WITA": "Mərkəzi İndoneziya Vaxtı", "WEZ": "Qərbi Avropa Standart Vaxtı", "AEST": "Şərqi Avstraliya Standart Vaxtı", "MYT": "Malayziya Vaxtı", "CDT": "Şimali Mərkəzi Amerika Yay Vaxtı", "ACST": "Mərkəzi Avstraliya Standart Vaxtı", "SRT": "Surinam Vaxtı"},
}
}
diff --git a/az/az_test.go b/az/az_test.go
new file mode 100644
index 00000000..3919018b
--- /dev/null
+++ b/az/az_test.go
@@ -0,0 +1,1120 @@
+package az
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "az"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/az_Cyrl/az_Cyrl.go b/az_Cyrl/az_Cyrl.go
index 2edbabc3..ac80edd7 100644
--- a/az_Cyrl/az_Cyrl.go
+++ b/az_Cyrl/az_Cyrl.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"e.ə.", "b.e."},
erasNarrow: []string{"", ""},
erasWide: []string{"eramızdan əvvəl", "eramız"},
- timezones: map[string]string{"TMT": "Türkmənistan Standart Vaxtı", "SGT": "Sinqapur Vaxtı", "ACDT": "Mərkəzi Avstraliya Yay Vaxtı", "HKST": "Honq Konq Yay Vaxtı", "WIT": "Şərqi İndoneziya Vaxtı", "EAT": "Şərqi Afrika Vaxtı", "JDT": "Yaponiya Yay Vaxtı", "HKT": "Honq Konq Standart Vaxtı", "MDT": "MDT", "MYT": "Malayziya Vaxtı", "LHDT": "Lord Hau Yay vaxtı", "AKST": "Alyaska Standart Vaxtı", "COST": "Kolumbiya Yay Vaxtı", "COT": "Kolumbiya Standart Vaxtı", "WART": "Qərbi Argentina Standart Vaxtı", "OEZ": "Şərqi Avropa Standart Vaxtı", "ART": "Argentina Standart Vaxtı", "ChST": "Çamorro Vaxtı", "ACWST": "Mərkəzi Qərbi Avstraliya Standart Vaxtı", "OESZ": "Şərqi Avropa Yay Vaxtı", "LHST": "Lord Hau Standart Vaxtı", "GYT": "Qayana Vaxtı", "EST": "Şimali Şərqi Amerika Standart Vaxtı", "ADT": "Atlantik Yay Vaxtı", "GMT": "Qrinviç Orta Vaxtı", "CDT": "Şimali Mərkəzi Amerika Yay Vaxtı", "MEZ": "Mərkəzi Avropa Standart Vaxtı", "NZST": "Yeni Zelandiya Standart Vaxtı", "CLT": "Çili Standart Vaxtı", "AST": "Atlantik Standart Vaxt", "BT": "Butan Vaxtı", "WEZ": "Qərbi Avropa Standart Vaxtı", "CAT": "Mərkəzi Afrika Vaxtı", "HADT": "Havay-Aleut Yay Vaxtı", "JST": "Yaponiya Standart Vaxtı", "AKDT": "Alyaska Yay Vaxtı", "AWDT": "Qərbi Avstraliya Yay Vaxtı", "WIB": "Qərbi İndoneziya Vaxtı", "PST": "Şimali Amerika Sakit Okean Standart Vaxtı", "CST": "Şimali Mərkəzi Amerika Standart Vaxtı", "MESZ": "Mərkəzi Avropa Yay Vaxtı", "NZDT": "Yeni Zelandiya Yay Vaxtı", "WAT": "Qərbi Afrika Standart Vaxtı", "WAST": "Qərbi Afrika Yay Vaxtı", "GFT": "Fransız Qvianası Vaxtı", "WESZ": "Qərbi Avropa Yay Vaxtı", "AEDT": "Şərqi Avstraliya Yay Vaxtı", "ECT": "Ekvador Vaxtı", "HAT": "Nyufaundlend Yay Vaxtı", "VET": "Venesuela Vaxtı", "HAST": "Havay-Aleut Standart Vaxtı", "SRT": "Surinam Vaxtı", "CHADT": "Çatham Yay Vaxtı", "AEST": "Şərqi Avstraliya Standart Vaxtı", "TMST": "Türkmənistan Yay Vaxtı", "ACST": "Mərkəzi Avstraliya Standart Vaxtı", "AWST": "Qərbi Avstraliya Standart Vaxtı", "BOT": "Boliviya Vaxtı", "UYT": "Uruqvay Standart Vaxtı", "WARST": "Qərbi Argentina Yay Vaxtı", "IST": "Hindistan Vaxtı", "∅∅∅": "Amazon Yay Vaxtı", "CHAST": "Çatham Standart Vaxtı", "CLST": "Çili Yay Vaxtı", "EDT": "Şimali Şərqi Amerika Yay Vaxtı", "UYST": "Uruqvay Yay Vaxtı", "HNT": "Nyufaundlend Standart Vaxtı", "WITA": "Mərkəzi İndoneziya Vaxtı", "ARST": "Argentina Yay Vaxtı", "ACWDT": "Mərkəzi Qərbi Avstraliya Yay Vaxtı", "SAST": "Cənubi Afrika Vaxtı", "MST": "MST", "PDT": "Şimali Amerika Sakit Okean Yay Vaxtı"},
+ timezones: map[string]string{"EAT": "Şərqi Afrika Vaxtı", "ACWST": "Mərkəzi Qərbi Avstraliya Standart Vaxtı", "EDT": "Şimali Şərqi Amerika Yay Vaxtı", "COST": "Kolumbiya Yay Vaxtı", "OEZ": "Şərqi Avropa Standart Vaxtı", "AEST": "Şərqi Avstraliya Standart Vaxtı", "LHST": "Lord Hau Standart Vaxtı", "ART": "Argentina Standart Vaxtı", "SGT": "Sinqapur Vaxtı", "WAST": "Qərbi Afrika Yay Vaxtı", "AEDT": "Şərqi Avstraliya Yay Vaxtı", "LHDT": "Lord Hau Yay vaxtı", "UYST": "Uruqvay Yay Vaxtı", "HKT": "Honq Konq Standart Vaxtı", "AKST": "Alyaska Standart Vaxtı", "AST": "Atlantik Standart Vaxt", "MEZ": "Mərkəzi Avropa Standart Vaxtı", "CLT": "Çili Standart Vaxtı", "ADT": "Atlantik Yay Vaxtı", "AWST": "Qərbi Avstraliya Standart Vaxtı", "PST": "Şimali Amerika Sakit Okean Standart Vaxtı", "OESZ": "Şərqi Avropa Yay Vaxtı", "GYT": "Qayana Vaxtı", "ECT": "Ekvador Vaxtı", "HNT": "Nyufaundlend Standart Vaxtı", "TMST": "Türkmənistan Yay Vaxtı", "HAT": "Nyufaundlend Yay Vaxtı", "WIB": "Qərbi İndoneziya Vaxtı", "WIT": "Şərqi İndoneziya Vaxtı", "ACST": "Mərkəzi Avstraliya Standart Vaxtı", "ARST": "Argentina Yay Vaxtı", "HADT": "Havay-Aleut Yay Vaxtı", "MESZ": "Mərkəzi Avropa Yay Vaxtı", "WAT": "Qərbi Afrika Standart Vaxtı", "WEZ": "Qərbi Avropa Standart Vaxtı", "GMT": "Qrinviç Orta Vaxtı", "AKDT": "Alyaska Yay Vaxtı", "WITA": "Mərkəzi İndoneziya Vaxtı", "PDT": "Şimali Amerika Sakit Okean Yay Vaxtı", "IST": "Hindistan Vaxtı", "CLST": "Çili Yay Vaxtı", "UYT": "Uruqvay Standart Vaxtı", "CHADT": "Çatham Yay Vaxtı", "BOT": "Boliviya Vaxtı", "MST": "Şimali Dağlıq Amerika Standart Vaxtı", "GFT": "Fransız Qvianası Vaxtı", "HKST": "Honq Konq Yay Vaxtı", "EST": "Şimali Şərqi Amerika Standart Vaxtı", "SRT": "Surinam Vaxtı", "ACWDT": "Mərkəzi Qərbi Avstraliya Yay Vaxtı", "CAT": "Mərkəzi Afrika Vaxtı", "COT": "Kolumbiya Standart Vaxtı", "ChST": "Çamorro Vaxtı", "VET": "Venesuela Vaxtı", "AWDT": "Qərbi Avstraliya Yay Vaxtı", "JST": "Yaponiya Standart Vaxtı", "NZST": "Yeni Zelandiya Standart Vaxtı", "MYT": "Malayziya Vaxtı", "CDT": "Şimali Mərkəzi Amerika Yay Vaxtı", "WARST": "Qərbi Argentina Yay Vaxtı", "SAST": "Cənubi Afrika Vaxtı", "CHAST": "Çatham Standart Vaxtı", "HAST": "Havay-Aleut Standart Vaxtı", "WESZ": "Qərbi Avropa Yay Vaxtı", "WART": "Qərbi Argentina Standart Vaxtı", "JDT": "Yaponiya Yay Vaxtı", "∅∅∅": "Amazon Yay Vaxtı", "TMT": "Türkmənistan Standart Vaxtı", "BT": "Butan Vaxtı", "MDT": "Şimali Dağlıq Amerika Yay Vaxtı", "CST": "Şimali Mərkəzi Amerika Standart Vaxtı", "ACDT": "Mərkəzi Avstraliya Yay Vaxtı", "NZDT": "Yeni Zelandiya Yay Vaxtı"},
}
}
diff --git a/az_Cyrl/az_Cyrl_test.go b/az_Cyrl/az_Cyrl_test.go
new file mode 100644
index 00000000..b2523c57
--- /dev/null
+++ b/az_Cyrl/az_Cyrl_test.go
@@ -0,0 +1,1120 @@
+package az_Cyrl
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "az_Cyrl"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/az_Cyrl_AZ/az_Cyrl_AZ.go b/az_Cyrl_AZ/az_Cyrl_AZ.go
index 59afc1ba..6b51b3d4 100644
--- a/az_Cyrl_AZ/az_Cyrl_AZ.go
+++ b/az_Cyrl_AZ/az_Cyrl_AZ.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"e.ə.", "b.e."},
erasNarrow: []string{"", ""},
erasWide: []string{"eramızdan əvvəl", "eramız"},
- timezones: map[string]string{"HAST": "Havay-Aleut Standart Vaxtı", "ACWDT": "Mərkəzi Qərbi Avstraliya Yay Vaxtı", "WESZ": "Qərbi Avropa Yay Vaxtı", "∅∅∅": "Braziliya Yay Vaxtı", "GFT": "Fransız Qvianası Vaxtı", "WIB": "Qərbi İndoneziya Vaxtı", "LHDT": "Lord Hau Yay vaxtı", "AEDT": "Şərqi Avstraliya Yay Vaxtı", "HAT": "Nyufaundlend Yay Vaxtı", "ACDT": "Mərkəzi Avstraliya Yay Vaxtı", "ART": "Argentina Standart Vaxtı", "VET": "Venesuela Vaxtı", "WAST": "Qərbi Afrika Yay Vaxtı", "MST": "MST", "AWST": "Qərbi Avstraliya Standart Vaxtı", "AKST": "Alyaska Standart Vaxtı", "CLST": "Çili Yay Vaxtı", "AST": "Atlantik Standart Vaxt", "EAT": "Şərqi Afrika Vaxtı", "LHST": "Lord Hau Standart Vaxtı", "JST": "Yaponiya Standart Vaxtı", "NZDT": "Yeni Zelandiya Yay Vaxtı", "WART": "Qərbi Argentina Standart Vaxtı", "BT": "Butan Vaxtı", "ACST": "Mərkəzi Avstraliya Standart Vaxtı", "PST": "Şimali Amerika Sakit Okean Standart Vaxtı", "CHAST": "Çatham Standart Vaxtı", "CLT": "Çili Standart Vaxtı", "SGT": "Sinqapur Vaxtı", "HKT": "Honq Konq Standart Vaxtı", "IST": "Hindistan Vaxtı", "ARST": "Argentina Yay Vaxtı", "TMT": "Türkmənistan Standart Vaxtı", "TMST": "Türkmənistan Yay Vaxtı", "PDT": "Şimali Amerika Sakit Okean Yay Vaxtı", "EST": "Şimali Şərqi Amerika Standart Vaxtı", "OEZ": "Şərqi Avropa Standart Vaxtı", "OESZ": "Şərqi Avropa Yay Vaxtı", "MDT": "MDT", "BOT": "Boliviya Vaxtı", "ADT": "Atlantik Yay Vaxtı", "SAST": "Cənubi Afrika Vaxtı", "GMT": "Qrinviç Orta Vaxtı", "HNT": "Nyufaundlend Standart Vaxtı", "AWDT": "Qərbi Avstraliya Yay Vaxtı", "GYT": "Qayana Vaxtı", "WEZ": "Qərbi Avropa Standart Vaxtı", "CAT": "Mərkəzi Afrika Vaxtı", "WAT": "Qərbi Afrika Standart Vaxtı", "HKST": "Honq Konq Yay Vaxtı", "WITA": "Mərkəzi İndoneziya Vaxtı", "AKDT": "Alyaska Yay Vaxtı", "CST": "Şimali Mərkəzi Amerika Standart Vaxtı", "ACWST": "Mərkəzi Qərbi Avstraliya Standart Vaxtı", "CHADT": "Çatham Yay Vaxtı", "COST": "Kolumbiya Yay Vaxtı", "UYST": "Uruqvay Yay Vaxtı", "MEZ": "Mərkəzi Avropa Standart Vaxtı", "HADT": "Havay-Aleut Yay Vaxtı", "AEST": "Şərqi Avstraliya Standart Vaxtı", "COT": "Kolumbiya Standart Vaxtı", "SRT": "Surinam Vaxtı", "NZST": "Yeni Zelandiya Standart Vaxtı", "WIT": "Şərqi İndoneziya Vaxtı", "CDT": "Şimali Mərkəzi Amerika Yay Vaxtı", "EDT": "Şimali Şərqi Amerika Yay Vaxtı", "WARST": "Qərbi Argentina Yay Vaxtı", "MYT": "Malayziya Vaxtı", "JDT": "Yaponiya Yay Vaxtı", "UYT": "Uruqvay Standart Vaxtı", "ECT": "Ekvador Vaxtı", "ChST": "Çamorro Vaxtı", "MESZ": "Mərkəzi Avropa Yay Vaxtı"},
+ timezones: map[string]string{"CST": "Şimali Mərkəzi Amerika Standart Vaxtı", "ACST": "Mərkəzi Avstraliya Standart Vaxtı", "NZST": "Yeni Zelandiya Standart Vaxtı", "HAST": "Havay-Aleut Standart Vaxtı", "OEZ": "Şərqi Avropa Standart Vaxtı", "CAT": "Mərkəzi Afrika Vaxtı", "UYST": "Uruqvay Yay Vaxtı", "MDT": "Şimali Dağlıq Amerika Yay Vaxtı", "WART": "Qərbi Argentina Standart Vaxtı", "AWDT": "Qərbi Avstraliya Yay Vaxtı", "PDT": "Şimali Amerika Sakit Okean Yay Vaxtı", "TMST": "Türkmənistan Yay Vaxtı", "WITA": "Mərkəzi İndoneziya Vaxtı", "JDT": "Yaponiya Yay Vaxtı", "ART": "Argentina Standart Vaxtı", "EST": "Şimali Şərqi Amerika Standart Vaxtı", "TMT": "Türkmənistan Standart Vaxtı", "ChST": "Çamorro Vaxtı", "GYT": "Qayana Vaxtı", "WIT": "Şərqi İndoneziya Vaxtı", "LHDT": "Lord Hau Yay vaxtı", "MST": "Şimali Dağlıq Amerika Standart Vaxtı", "SGT": "Sinqapur Vaxtı", "GMT": "Qrinviç Orta Vaxtı", "AEDT": "Şərqi Avstraliya Yay Vaxtı", "WIB": "Qərbi İndoneziya Vaxtı", "WAST": "Qərbi Afrika Yay Vaxtı", "CLT": "Çili Standart Vaxtı", "JST": "Yaponiya Standart Vaxtı", "AKDT": "Alyaska Yay Vaxtı", "ADT": "Atlantik Yay Vaxtı", "NZDT": "Yeni Zelandiya Yay Vaxtı", "SAST": "Cənubi Afrika Vaxtı", "HNT": "Nyufaundlend Standart Vaxtı", "CHAST": "Çatham Standart Vaxtı", "AST": "Atlantik Standart Vaxt", "ARST": "Argentina Yay Vaxtı", "HAT": "Nyufaundlend Yay Vaxtı", "CDT": "Şimali Mərkəzi Amerika Yay Vaxtı", "PST": "Şimali Amerika Sakit Okean Standart Vaxtı", "HADT": "Havay-Aleut Yay Vaxtı", "HKT": "Honq Konq Standart Vaxtı", "BOT": "Boliviya Vaxtı", "WAT": "Qərbi Afrika Standart Vaxtı", "ACDT": "Mərkəzi Avstraliya Yay Vaxtı", "SRT": "Surinam Vaxtı", "HKST": "Honq Konq Yay Vaxtı", "ACWDT": "Mərkəzi Qərbi Avstraliya Yay Vaxtı", "MEZ": "Mərkəzi Avropa Standart Vaxtı", "UYT": "Uruqvay Standart Vaxtı", "EAT": "Şərqi Afrika Vaxtı", "VET": "Venesuela Vaxtı", "COST": "Kolumbiya Yay Vaxtı", "AEST": "Şərqi Avstraliya Standart Vaxtı", "AKST": "Alyaska Standart Vaxtı", "EDT": "Şimali Şərqi Amerika Yay Vaxtı", "WEZ": "Qərbi Avropa Standart Vaxtı", "OESZ": "Şərqi Avropa Yay Vaxtı", "MYT": "Malayziya Vaxtı", "WARST": "Qərbi Argentina Yay Vaxtı", "CHADT": "Çatham Yay Vaxtı", "ACWST": "Mərkəzi Qərbi Avstraliya Standart Vaxtı", "AWST": "Qərbi Avstraliya Standart Vaxtı", "MESZ": "Mərkəzi Avropa Yay Vaxtı", "CLST": "Çili Yay Vaxtı", "GFT": "Fransız Qvianası Vaxtı", "WESZ": "Qərbi Avropa Yay Vaxtı", "BT": "Butan Vaxtı", "LHST": "Lord Hau Standart Vaxtı", "∅∅∅": "Braziliya Yay Vaxtı", "ECT": "Ekvador Vaxtı", "IST": "Hindistan Vaxtı", "COT": "Kolumbiya Standart Vaxtı"},
}
}
diff --git a/az_Cyrl_AZ/az_Cyrl_AZ_test.go b/az_Cyrl_AZ/az_Cyrl_AZ_test.go
new file mode 100644
index 00000000..0554ed62
--- /dev/null
+++ b/az_Cyrl_AZ/az_Cyrl_AZ_test.go
@@ -0,0 +1,1120 @@
+package az_Cyrl_AZ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "az_Cyrl_AZ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/az_Latn/az_Latn.go b/az_Latn/az_Latn.go
index f76104ce..33b12c2c 100644
--- a/az_Latn/az_Latn.go
+++ b/az_Latn/az_Latn.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"e.ə.", "b.e."},
erasNarrow: []string{"", ""},
erasWide: []string{"eramızdan əvvəl", "eramız"},
- timezones: map[string]string{"ADT": "Atlantik Yay Vaxtı", "ACWDT": "Mərkəzi Qərbi Avstraliya Yay Vaxtı", "COST": "Kolumbiya Yay Vaxtı", "HADT": "Havay-Aleut Yay Vaxtı", "EAT": "Şərqi Afrika Vaxtı", "MYT": "Malayziya Vaxtı", "MESZ": "Mərkəzi Avropa Yay Vaxtı", "EST": "Şimali Şərqi Amerika Standart Vaxtı", "HAST": "Havay-Aleut Standart Vaxtı", "UYT": "Uruqvay Standart Vaxtı", "WESZ": "Qərbi Avropa Yay Vaxtı", "PST": "Şimali Amerika Sakit Okean Standart Vaxtı", "HNT": "Nyufaundlend Standart Vaxtı", "AST": "Atlantik Standart Vaxt", "WAST": "Qərbi Afrika Yay Vaxtı", "WARST": "Qərbi Argentina Yay Vaxtı", "HKST": "Honq Konq Yay Vaxtı", "WITA": "Mərkəzi İndoneziya Vaxtı", "GMT": "Qrinviç Orta Vaxtı", "ART": "Argentina Standart Vaxtı", "ARST": "Argentina Yay Vaxtı", "CLT": "Çili Standart Vaxtı", "ACWST": "Mərkəzi Qərbi Avstraliya Standart Vaxtı", "BOT": "Boliviya Vaxtı", "JDT": "Yaponiya Yay Vaxtı", "CDT": "Şimali Mərkəzi Amerika Yay Vaxtı", "GFT": "Fransız Qvianası Vaxtı", "NZST": "Yeni Zelandiya Standart Vaxtı", "NZDT": "Yeni Zelandiya Yay Vaxtı", "EDT": "Şimali Şərqi Amerika Yay Vaxtı", "SGT": "Sinqapur Vaxtı", "UYST": "Uruqvay Yay Vaxtı", "LHST": "Lord Hau Standart Vaxtı", "LHDT": "Lord Hau Yay vaxtı", "AKDT": "Alyaska Yay Vaxtı", "MST": "Şimali Dağlıq Amerika Standart Vaxtı", "TMT": "Türkmənistan Standart Vaxtı", "∅∅∅": "Braziliya Yay Vaxtı", "CAT": "Mərkəzi Afrika Vaxtı", "WART": "Qərbi Argentina Standart Vaxtı", "MDT": "Şimali Dağlıq Amerika Yay Vaxtı", "VET": "Venesuela Vaxtı", "OEZ": "Şərqi Avropa Standart Vaxtı", "PDT": "Şimali Amerika Sakit Okean Yay Vaxtı", "AWST": "Qərbi Avstraliya Standart Vaxtı", "WAT": "Qərbi Afrika Standart Vaxtı", "WIB": "Qərbi İndoneziya Vaxtı", "SRT": "Surinam Vaxtı", "CHAST": "Çatham Standart Vaxtı", "TMST": "Türkmənistan Yay Vaxtı", "ACST": "Mərkəzi Avstraliya Standart Vaxtı", "AKST": "Alyaska Standart Vaxtı", "AWDT": "Qərbi Avstraliya Yay Vaxtı", "BT": "Butan Vaxtı", "HKT": "Honq Konq Standart Vaxtı", "HAT": "Nyufaundlend Yay Vaxtı", "CST": "Şimali Mərkəzi Amerika Standart Vaxtı", "IST": "Hindistan Vaxtı", "OESZ": "Şərqi Avropa Yay Vaxtı", "ACDT": "Mərkəzi Avstraliya Yay Vaxtı", "GYT": "Qayana Vaxtı", "JST": "Yaponiya Standart Vaxtı", "SAST": "Cənubi Afrika Vaxtı", "WIT": "Şərqi İndoneziya Vaxtı", "COT": "Kolumbiya Standart Vaxtı", "ECT": "Ekvador Vaxtı", "MEZ": "Mərkəzi Avropa Standart Vaxtı", "AEST": "Şərqi Avstraliya Standart Vaxtı", "ChST": "Çamorro Vaxtı", "WEZ": "Qərbi Avropa Standart Vaxtı", "AEDT": "Şərqi Avstraliya Yay Vaxtı", "CHADT": "Çatham Yay Vaxtı", "CLST": "Çili Yay Vaxtı"},
+ timezones: map[string]string{"BT": "Butan Vaxtı", "AKST": "Alyaska Standart Vaxtı", "ACWDT": "Mərkəzi Qərbi Avstraliya Yay Vaxtı", "MESZ": "Mərkəzi Avropa Yay Vaxtı", "UYT": "Uruqvay Standart Vaxtı", "AWDT": "Qərbi Avstraliya Yay Vaxtı", "IST": "Hindistan Vaxtı", "AEDT": "Şərqi Avstraliya Yay Vaxtı", "WIT": "Şərqi İndoneziya Vaxtı", "WAT": "Qərbi Afrika Standart Vaxtı", "WAST": "Qərbi Afrika Yay Vaxtı", "AEST": "Şərqi Avstraliya Standart Vaxtı", "SRT": "Surinam Vaxtı", "ADT": "Atlantik Yay Vaxtı", "HADT": "Havay-Aleut Yay Vaxtı", "GYT": "Qayana Vaxtı", "CLT": "Çili Standart Vaxtı", "HKST": "Honq Konq Yay Vaxtı", "HAST": "Havay-Aleut Standart Vaxtı", "TMT": "Türkmənistan Standart Vaxtı", "CAT": "Mərkəzi Afrika Vaxtı", "LHST": "Lord Hau Standart Vaxtı", "MDT": "Şimali Dağlıq Amerika Yay Vaxtı", "WARST": "Qərbi Argentina Yay Vaxtı", "VET": "Venesuela Vaxtı", "CHAST": "Çatham Standart Vaxtı", "COST": "Kolumbiya Yay Vaxtı", "GMT": "Qrinviç Orta Vaxtı", "EAT": "Şərqi Afrika Vaxtı", "LHDT": "Lord Hau Yay vaxtı", "AST": "Atlantik Standart Vaxt", "HNT": "Nyufaundlend Standart Vaxtı", "ECT": "Ekvador Vaxtı", "PST": "Şimali Amerika Sakit Okean Standart Vaxtı", "OEZ": "Şərqi Avropa Standart Vaxtı", "GFT": "Fransız Qvianası Vaxtı", "SAST": "Cənubi Afrika Vaxtı", "EDT": "Şimali Şərqi Amerika Yay Vaxtı", "MYT": "Malayziya Vaxtı", "JDT": "Yaponiya Yay Vaxtı", "AKDT": "Alyaska Yay Vaxtı", "SGT": "Sinqapur Vaxtı", "HKT": "Honq Konq Standart Vaxtı", "TMST": "Türkmənistan Yay Vaxtı", "ARST": "Argentina Yay Vaxtı", "JST": "Yaponiya Standart Vaxtı", "ChST": "Çamorro Vaxtı", "PDT": "Şimali Amerika Sakit Okean Yay Vaxtı", "CDT": "Şimali Mərkəzi Amerika Yay Vaxtı", "WIB": "Qərbi İndoneziya Vaxtı", "OESZ": "Şərqi Avropa Yay Vaxtı", "CLST": "Çili Yay Vaxtı", "MST": "Şimali Dağlıq Amerika Standart Vaxtı", "WITA": "Mərkəzi İndoneziya Vaxtı", "AWST": "Qərbi Avstraliya Standart Vaxtı", "EST": "Şimali Şərqi Amerika Standart Vaxtı", "COT": "Kolumbiya Standart Vaxtı", "ACDT": "Mərkəzi Avstraliya Yay Vaxtı", "CHADT": "Çatham Yay Vaxtı", "CST": "Şimali Mərkəzi Amerika Standart Vaxtı", "WART": "Qərbi Argentina Standart Vaxtı", "ACWST": "Mərkəzi Qərbi Avstraliya Standart Vaxtı", "NZDT": "Yeni Zelandiya Yay Vaxtı", "WEZ": "Qərbi Avropa Standart Vaxtı", "WESZ": "Qərbi Avropa Yay Vaxtı", "∅∅∅": "Amazon Yay Vaxtı", "HAT": "Nyufaundlend Yay Vaxtı", "UYST": "Uruqvay Yay Vaxtı", "ACST": "Mərkəzi Avstraliya Standart Vaxtı", "ART": "Argentina Standart Vaxtı", "MEZ": "Mərkəzi Avropa Standart Vaxtı", "NZST": "Yeni Zelandiya Standart Vaxtı", "BOT": "Boliviya Vaxtı"},
}
}
diff --git a/az_Latn/az_Latn_test.go b/az_Latn/az_Latn_test.go
new file mode 100644
index 00000000..e30fbdeb
--- /dev/null
+++ b/az_Latn/az_Latn_test.go
@@ -0,0 +1,1120 @@
+package az_Latn
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "az_Latn"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/az_Latn_AZ/az_Latn_AZ.go b/az_Latn_AZ/az_Latn_AZ.go
index 788456a0..e6f5bfee 100644
--- a/az_Latn_AZ/az_Latn_AZ.go
+++ b/az_Latn_AZ/az_Latn_AZ.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"e.ə.", "b.e."},
erasNarrow: []string{"", ""},
erasWide: []string{"eramızdan əvvəl", "eramız"},
- timezones: map[string]string{"BOT": "Boliviya Vaxtı", "WEZ": "Qərbi Avropa Standart Vaxtı", "WARST": "Qərbi Argentina Yay Vaxtı", "LHDT": "Lord Hau Yay vaxtı", "AEST": "Şərqi Avstraliya Standart Vaxtı", "COT": "Kolumbiya Standart Vaxtı", "COST": "Kolumbiya Yay Vaxtı", "ECT": "Ekvador Vaxtı", "WAST": "Qərbi Afrika Yay Vaxtı", "CST": "Şimali Mərkəzi Amerika Standart Vaxtı", "MST": "Şimali Dağlıq Amerika Standart Vaxtı", "HADT": "Havay-Aleut Yay Vaxtı", "WAT": "Qərbi Afrika Standart Vaxtı", "WITA": "Mərkəzi İndoneziya Vaxtı", "BT": "Butan Vaxtı", "GFT": "Fransız Qvianası Vaxtı", "GYT": "Qayana Vaxtı", "ARST": "Argentina Yay Vaxtı", "AKDT": "Alyaska Yay Vaxtı", "ACWDT": "Mərkəzi Qərbi Avstraliya Yay Vaxtı", "AST": "Atlantik Standart Vaxt", "HKST": "Honq Konq Yay Vaxtı", "HAT": "Nyufaundlend Yay Vaxtı", "EAT": "Şərqi Afrika Vaxtı", "MEZ": "Mərkəzi Avropa Standart Vaxtı", "MDT": "Şimali Dağlıq Amerika Yay Vaxtı", "WIT": "Şərqi İndoneziya Vaxtı", "OESZ": "Şərqi Avropa Yay Vaxtı", "HAST": "Havay-Aleut Standart Vaxtı", "PDT": "Şimali Amerika Sakit Okean Yay Vaxtı", "NZST": "Yeni Zelandiya Standart Vaxtı", "CHADT": "Çatham Yay Vaxtı", "CAT": "Mərkəzi Afrika Vaxtı", "TMST": "Türkmənistan Yay Vaxtı", "AKST": "Alyaska Standart Vaxtı", "NZDT": "Yeni Zelandiya Yay Vaxtı", "JDT": "Yaponiya Yay Vaxtı", "AWDT": "Qərbi Avstraliya Yay Vaxtı", "SGT": "Sinqapur Vaxtı", "PST": "Şimali Amerika Sakit Okean Standart Vaxtı", "CDT": "Şimali Mərkəzi Amerika Yay Vaxtı", "CLST": "Çili Yay Vaxtı", "∅∅∅": "Braziliya Yay Vaxtı", "EST": "Şimali Şərqi Amerika Standart Vaxtı", "ADT": "Atlantik Yay Vaxtı", "SAST": "Cənubi Afrika Vaxtı", "OEZ": "Şərqi Avropa Standart Vaxtı", "MYT": "Malayziya Vaxtı", "MESZ": "Mərkəzi Avropa Yay Vaxtı", "UYT": "Uruqvay Standart Vaxtı", "CHAST": "Çatham Standart Vaxtı", "VET": "Venesuela Vaxtı", "ChST": "Çamorro Vaxtı", "JST": "Yaponiya Standart Vaxtı", "GMT": "Qrinviç Orta Vaxtı", "ACST": "Mərkəzi Avstraliya Standart Vaxtı", "UYST": "Uruqvay Yay Vaxtı", "EDT": "Şimali Şərqi Amerika Yay Vaxtı", "ACDT": "Mərkəzi Avstraliya Yay Vaxtı", "ART": "Argentina Standart Vaxtı", "HNT": "Nyufaundlend Standart Vaxtı", "TMT": "Türkmənistan Standart Vaxtı", "SRT": "Surinam Vaxtı", "WESZ": "Qərbi Avropa Yay Vaxtı", "AEDT": "Şərqi Avstraliya Yay Vaxtı", "HKT": "Honq Konq Standart Vaxtı", "WIB": "Qərbi İndoneziya Vaxtı", "IST": "Hindistan Vaxtı", "AWST": "Qərbi Avstraliya Standart Vaxtı", "CLT": "Çili Standart Vaxtı", "ACWST": "Mərkəzi Qərbi Avstraliya Standart Vaxtı", "WART": "Qərbi Argentina Standart Vaxtı", "LHST": "Lord Hau Standart Vaxtı"},
+ timezones: map[string]string{"CHAST": "Çatham Standart Vaxtı", "WITA": "Mərkəzi İndoneziya Vaxtı", "WAST": "Qərbi Afrika Yay Vaxtı", "GYT": "Qayana Vaxtı", "MDT": "MDT", "JDT": "Yaponiya Yay Vaxtı", "GMT": "Qrinviç Orta Vaxtı", "BT": "Butan Vaxtı", "LHST": "Lord Hau Standart Vaxtı", "EAT": "Şərqi Afrika Vaxtı", "ACDT": "Mərkəzi Avstraliya Yay Vaxtı", "HKT": "Honq Konq Standart Vaxtı", "AWST": "Qərbi Avstraliya Standart Vaxtı", "PST": "Şimali Amerika Sakit Okean Standart Vaxtı", "CAT": "Mərkəzi Afrika Vaxtı", "WAT": "Qərbi Afrika Standart Vaxtı", "AEDT": "Şərqi Avstraliya Yay Vaxtı", "ACST": "Mərkəzi Avstraliya Standart Vaxtı", "SRT": "Surinam Vaxtı", "AST": "Atlantik Standart Vaxt", "OESZ": "Şərqi Avropa Yay Vaxtı", "ARST": "Argentina Yay Vaxtı", "PDT": "Şimali Amerika Sakit Okean Yay Vaxtı", "WARST": "Qərbi Argentina Yay Vaxtı", "ADT": "Atlantik Yay Vaxtı", "ART": "Argentina Standart Vaxtı", "ChST": "Çamorro Vaxtı", "ECT": "Ekvador Vaxtı", "ACWST": "Mərkəzi Qərbi Avstraliya Standart Vaxtı", "ACWDT": "Mərkəzi Qərbi Avstraliya Yay Vaxtı", "IST": "Hindistan Vaxtı", "EST": "Şimali Şərqi Amerika Standart Vaxtı", "MEZ": "Mərkəzi Avropa Standart Vaxtı", "HAT": "Nyufaundlend Yay Vaxtı", "CLT": "Çili Standart Vaxtı", "AKDT": "Alyaska Yay Vaxtı", "NZDT": "Yeni Zelandiya Yay Vaxtı", "WEZ": "Qərbi Avropa Standart Vaxtı", "CLST": "Çili Yay Vaxtı", "∅∅∅": "Azor Yay Vaxtı", "HKST": "Honq Konq Yay Vaxtı", "VET": "Venesuela Vaxtı", "AKST": "Alyaska Standart Vaxtı", "SAST": "Cənubi Afrika Vaxtı", "TMT": "Türkmənistan Standart Vaxtı", "WESZ": "Qərbi Avropa Yay Vaxtı", "EDT": "Şimali Şərqi Amerika Yay Vaxtı", "HAST": "Havay-Aleut Standart Vaxtı", "HADT": "Havay-Aleut Yay Vaxtı", "WART": "Qərbi Argentina Standart Vaxtı", "TMST": "Türkmənistan Yay Vaxtı", "HNT": "Nyufaundlend Standart Vaxtı", "UYST": "Uruqvay Yay Vaxtı", "CST": "Şimali Mərkəzi Amerika Standart Vaxtı", "CDT": "Şimali Mərkəzi Amerika Yay Vaxtı", "GFT": "Fransız Qvianası Vaxtı", "OEZ": "Şərqi Avropa Standart Vaxtı", "AWDT": "Qərbi Avstraliya Yay Vaxtı", "COST": "Kolumbiya Yay Vaxtı", "UYT": "Uruqvay Standart Vaxtı", "JST": "Yaponiya Standart Vaxtı", "BOT": "Boliviya Vaxtı", "COT": "Kolumbiya Standart Vaxtı", "WIB": "Qərbi İndoneziya Vaxtı", "AEST": "Şərqi Avstraliya Standart Vaxtı", "LHDT": "Lord Hau Yay vaxtı", "MST": "MST", "MESZ": "Mərkəzi Avropa Yay Vaxtı", "NZST": "Yeni Zelandiya Standart Vaxtı", "WIT": "Şərqi İndoneziya Vaxtı", "CHADT": "Çatham Yay Vaxtı", "SGT": "Sinqapur Vaxtı", "MYT": "Malayziya Vaxtı"},
}
}
@@ -112,9 +112,9 @@ func (az *az_Latn_AZ) OrdinalPluralRule(num float64, v uint64) locales.PluralRul
n := math.Abs(num)
i := int64(n)
- iMod10 := i % 10
iMod100 := i % 100
iMod1000 := i % 1000
+ iMod10 := i % 10
if (iMod10 == 1 || iMod10 == 2 || iMod10 == 5 || iMod10 == 7 || iMod10 == 8) || (iMod100 == 20 || iMod100 == 50 || iMod100 == 70 || iMod100 == 80) {
return locales.PluralRuleOne
diff --git a/az_Latn_AZ/az_Latn_AZ_test.go b/az_Latn_AZ/az_Latn_AZ_test.go
new file mode 100644
index 00000000..84bbb798
--- /dev/null
+++ b/az_Latn_AZ/az_Latn_AZ_test.go
@@ -0,0 +1,1120 @@
+package az_Latn_AZ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "az_Latn_AZ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/bas/bas.go b/bas/bas.go
index 89e03435..9b757859 100644
--- a/bas/bas.go
+++ b/bas/bas.go
@@ -67,7 +67,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"b.Y.K", "m.Y.K"},
erasNarrow: []string{"", ""},
erasWide: []string{"bisū bi Yesù Krǐstò", "i mbūs Yesù Krǐstò"},
- timezones: map[string]string{"JDT": "JDT", "UYT": "UYT", "HKST": "HKST", "OEZ": "OEZ", "MDT": "MDT", "ACST": "ACST", "∅∅∅": "∅∅∅", "JST": "JST", "SAST": "SAST", "ARST": "ARST", "VET": "VET", "CHADT": "CHADT", "HAST": "HAST", "MYT": "MYT", "AST": "AST", "WAST": "WAST", "TMT": "TMT", "EDT": "EDT", "WIB": "WIB", "OESZ": "OESZ", "HAT": "HAT", "SRT": "SRT", "CST": "CST", "CDT": "CDT", "AWDT": "AWDT", "NZDT": "NZDT", "WESZ": "WESZ", "HADT": "HADT", "IST": "IST", "AKST": "AKST", "AKDT": "AKDT", "MEZ": "MEZ", "AEST": "AEST", "COT": "COT", "WIT": "WIT", "HNT": "HNT", "ACDT": "ACDT", "AWST": "AWST", "CLT": "CLT", "ACWDT": "ACWDT", "WART": "WART", "LHST": "LHST", "BOT": "BOT", "BT": "BT", "LHDT": "LHDT", "UYST": "UYST", "EST": "EST", "COST": "COST", "GYT": "GYT", "CAT": "CAT", "WAT": "WAT", "TMST": "TMST", "WARST": "WARST", "GFT": "GFT", "ChST": "ChST", "ADT": "ADT", "SGT": "SGT", "WITA": "WITA", "MST": "MST", "PST": "PST", "NZST": "NZST", "ACWST": "ACWST", "CHAST": "CHAST", "AEDT": "AEDT", "HKT": "HKT", "GMT": "GMT", "EAT": "EAT", "ART": "ART", "MESZ": "MESZ", "WEZ": "WEZ", "PDT": "PDT", "CLST": "CLST", "ECT": "ECT"},
+ timezones: map[string]string{"IST": "IST", "WAT": "WAT", "WEZ": "WEZ", "GFT": "GFT", "CHADT": "CHADT", "AKDT": "AKDT", "ART": "ART", "BOT": "BOT", "SGT": "SGT", "AEDT": "AEDT", "MYT": "MYT", "JST": "JST", "WART": "WART", "VET": "VET", "AST": "AST", "WAST": "WAST", "NZST": "NZST", "GYT": "GYT", "BT": "BT", "CDT": "CDT", "CHAST": "CHAST", "COT": "COT", "HAT": "HAT", "ChST": "ChST", "WIT": "WIT", "EST": "EST", "MEZ": "MEZ", "CAT": "CAT", "CST": "CST", "WITA": "WITA", "AWDT": "AWDT", "COST": "COST", "WARST": "WARST", "SRT": "SRT", "MST": "MST", "HKT": "HKT", "OEZ": "OEZ", "GMT": "GMT", "AEST": "AEST", "UYT": "UYT", "ACST": "ACST", "ACDT": "ACDT", "CLT": "CLT", "TMST": "TMST", "CLST": "CLST", "UYST": "UYST", "MDT": "MDT", "HKST": "HKST", "ACWST": "ACWST", "AWST": "AWST", "HADT": "HADT", "EAT": "EAT", "ECT": "ECT", "SAST": "SAST", "TMT": "TMT", "WESZ": "WESZ", "OESZ": "OESZ", "JDT": "JDT", "AKST": "AKST", "WIB": "WIB", "HNT": "HNT", "ACWDT": "ACWDT", "HAST": "HAST", "NZDT": "NZDT", "PDT": "PDT", "MESZ": "MESZ", "LHST": "LHST", "∅∅∅": "∅∅∅", "ADT": "ADT", "ARST": "ARST", "EDT": "EDT", "PST": "PST", "LHDT": "LHDT"},
}
}
diff --git a/bas/bas_test.go b/bas/bas_test.go
new file mode 100644
index 00000000..1b9b2b87
--- /dev/null
+++ b/bas/bas_test.go
@@ -0,0 +1,1120 @@
+package bas
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "bas"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/bas_CM/bas_CM.go b/bas_CM/bas_CM.go
index 6302f902..8e33ac44 100644
--- a/bas_CM/bas_CM.go
+++ b/bas_CM/bas_CM.go
@@ -67,7 +67,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"b.Y.K", "m.Y.K"},
erasNarrow: []string{"", ""},
erasWide: []string{"bisū bi Yesù Krǐstò", "i mbūs Yesù Krǐstò"},
- timezones: map[string]string{"AKDT": "AKDT", "MESZ": "MESZ", "ACWDT": "ACWDT", "PST": "PST", "VET": "VET", "TMT": "TMT", "CST": "CST", "WIT": "WIT", "CHADT": "CHADT", "AEDT": "AEDT", "HNT": "HNT", "ARST": "ARST", "NZDT": "NZDT", "ChST": "ChST", "JDT": "JDT", "AWST": "AWST", "ACWST": "ACWST", "OEZ": "OEZ", "GMT": "GMT", "ACDT": "ACDT", "JST": "JST", "SGT": "SGT", "GYT": "GYT", "SRT": "SRT", "MEZ": "MEZ", "HADT": "HADT", "IST": "IST", "PDT": "PDT", "CLT": "CLT", "WAT": "WAT", "SAST": "SAST", "HKT": "HKT", "TMST": "TMST", "ART": "ART", "UYT": "UYT", "NZST": "NZST", "AST": "AST", "WARST": "WARST", "EAT": "EAT", "LHDT": "LHDT", "UYST": "UYST", "ECT": "ECT", "EST": "EST", "ADT": "ADT", "WART": "WART", "WIB": "WIB", "∅∅∅": "∅∅∅", "CLST": "CLST", "WEZ": "WEZ", "GFT": "GFT", "OESZ": "OESZ", "BOT": "BOT", "BT": "BT", "CAT": "CAT", "COT": "COT", "HAST": "HAST", "HKST": "HKST", "MYT": "MYT", "CDT": "CDT", "CHAST": "CHAST", "AEST": "AEST", "LHST": "LHST", "WESZ": "WESZ", "EDT": "EDT", "WITA": "WITA", "HAT": "HAT", "MDT": "MDT", "AKST": "AKST", "MST": "MST", "AWDT": "AWDT", "ACST": "ACST", "COST": "COST", "WAST": "WAST"},
+ timezones: map[string]string{"MDT": "MDT", "WESZ": "WESZ", "GYT": "GYT", "COT": "COT", "ADT": "ADT", "ART": "ART", "SGT": "SGT", "OEZ": "OEZ", "AEDT": "AEDT", "BT": "BT", "LHST": "LHST", "UYST": "UYST", "CST": "CST", "CDT": "CDT", "CHAST": "CHAST", "CHADT": "CHADT", "MST": "MST", "UYT": "UYT", "ACST": "ACST", "HNT": "HNT", "WART": "WART", "VET": "VET", "AWDT": "AWDT", "MEZ": "MEZ", "HAST": "HAST", "CAT": "CAT", "HAT": "HAT", "ARST": "ARST", "MESZ": "MESZ", "WARST": "WARST", "ACWDT": "ACWDT", "BOT": "BOT", "WIT": "WIT", "GFT": "GFT", "COST": "COST", "AEST": "AEST", "AKST": "AKST", "AKDT": "AKDT", "PDT": "PDT", "NZST": "NZST", "NZDT": "NZDT", "EAT": "EAT", "LHDT": "LHDT", "AWST": "AWST", "JST": "JST", "SAST": "SAST", "EST": "EST", "SRT": "SRT", "EDT": "EDT", "PST": "PST", "GMT": "GMT", "ChST": "ChST", "∅∅∅": "∅∅∅", "HKT": "HKT", "ACWST": "ACWST", "WITA": "WITA", "WIB": "WIB", "TMST": "TMST", "MYT": "MYT", "CLT": "CLT", "HKST": "HKST", "ECT": "ECT", "JDT": "JDT", "HADT": "HADT", "TMT": "TMT", "WAT": "WAT", "WEZ": "WEZ", "OESZ": "OESZ", "CLST": "CLST", "ACDT": "ACDT", "AST": "AST", "IST": "IST", "WAST": "WAST"},
}
}
diff --git a/bas_CM/bas_CM_test.go b/bas_CM/bas_CM_test.go
new file mode 100644
index 00000000..cda7c58a
--- /dev/null
+++ b/bas_CM/bas_CM_test.go
@@ -0,0 +1,1120 @@
+package bas_CM
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "bas_CM"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/be/be.go b/be/be.go
index 0c723cee..dfce70cd 100644
--- a/be/be.go
+++ b/be/be.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"да н.э.", "н.э."},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"VET": "Венесуэльскі час", "SGT": "Сінгапурскі час", "JST": "Стандартны час Японіі", "MEZ": "Цэнтральнаеўрапейскі стандартны час", "HAST": "Гавайска-Алеуцкі стандартны час", "ART": "Аргенцінскі стандартны час", "CHAST": "Стандартны час Чатэма", "CLT": "Чылійскі стандартны час", "WAT": "Заходнеафрыканскі стандартны час", "WAST": "Заходнеафрыканскі летні час", "NZST": "Стандартны час Новай Зеландыі", "NZDT": "Летні час Новай Зеландыі", "AEDT": "Летні час усходняй Аўстраліі", "AST": "Атлантычны стандартны час", "EDT": "Паўночнаамерыканскі ўсходні летні час", "HKT": "Стандартны час Ганконга", "JDT": "Летні час Японіі", "PST": "Ціхаакіянскі стандартны час", "WITA": "Цэнтральнаінданезійскі час", "IST": "Час Індыі", "TMT": "Стандартны час Туркменістана", "GYT": "Час Гаяны", "CDT": "Паўночнаамерыканскі цэнтральны летні час", "WESZ": "Заходнееўрапейскі летні час", "ACWDT": "Заходні летні час Цэнтральнай Аўстраліі", "WARST": "Летні час Заходняй Аргенціны", "AKDT": "Летні час Аляскі", "MESZ": "Цэнтральнаеўрапейскі летні час", "ChST": "Час Чамора", "CLST": "Чылійскі летні час", "OEZ": "Усходнееўрапейскі стандартны час", "MYT": "Час Малайзіі", "PDT": "Ціхаакіянскі летні час", "CAT": "Цэнтральнаафрыканскі час", "GMT": "Час па Грынвічы", "WIT": "Усходнеінданезійскі час", "EAT": "Усходнеафрыканскі час", "ARST": "Аргенцінскі летні час", "AEST": "Стандартны час усходняй Аўстраліі", "COT": "Калумбійскі стандартны час", "GFT": "Час Французскай Гвіяны", "ACDT": "Летні час цэнтральнай Аўстраліі", "ADT": "Атлантычны летні час", "SAST": "Паўднёваафрыканскі час", "TMST": "Летні час Туркменістана", "ECT": "Эквадорскі час", "BT": "Час Бутана", "OESZ": "Усходнееўрапейскі летні час", "AKST": "Стандартны час Аляскі", "UYT": "Уругвайскі стандартны час", "CST": "Паўночнаамерыканскі цэнтральны стандартны час", "WEZ": "Заходнееўрапейскі стандартны час", "ACWST": "Заходні стандартны час Цэнтральнай Аўстраліі", "HAT": "Ньюфаўндлендскі летні час", "ACST": "Стандартны час цэнтральнай Аўстраліі", "AWST": "Стандартны час заходняй Аўстраліі", "UYST": "Уругвайскі летні час", "MST": "Паўночнаамерыканскі горны стандартны час", "COST": "Калумбійскі летні час", "HADT": "Гавайска-Алеуцкі летні час", "MDT": "Паўночнаамерыканскі горны летні час", "∅∅∅": "Бразільскі летні час", "LHST": "Стандартны час Лорд-Хау", "SRT": "Час Сурынама", "HKST": "Летні час Ганконга", "WART": "Стандартны час Заходняй Аргенціны", "HNT": "Ньюфаўндлендскі стандартны час", "WIB": "Заходнеінданезійскі час", "LHDT": "Летні час Лорд-Хау", "BOT": "Балівійскі час", "CHADT": "Летні час Чатэма", "EST": "Паўночнаамерыканскі ўсходні стандартны час", "AWDT": "Летні час заходняй Аўстраліі"},
+ timezones: map[string]string{"WESZ": "Заходнееўрапейскі летні час", "HAT": "Ньюфаўндлендскі летні час", "COST": "Калумбійскі летні час", "WIB": "Заходнеінданезійскі час", "MYT": "Час Малайзіі", "ACWDT": "Заходні летні час Цэнтральнай Аўстраліі", "ARST": "Аргенцінскі летні час", "SGT": "Сінгапурскі час", "COT": "Калумбійскі стандартны час", "TMST": "Летні час Туркменістана", "AEDT": "Летні час усходняй Аўстраліі", "ECT": "Эквадорскі час", "HADT": "Гавайска-Алеуцкі летні час", "BT": "Час Бутана", "UYST": "Уругвайскі летні час", "HAST": "Гавайска-Алеуцкі стандартны час", "AEST": "Стандартны час усходняй Аўстраліі", "MST": "Паўночнаамерыканскі горны стандартны час", "ACWST": "Заходні стандартны час Цэнтральнай Аўстраліі", "AWDT": "Летні час заходняй Аўстраліі", "VET": "Венесуэльскі час", "NZDT": "Летні час Новай Зеландыі", "WAST": "Заходнеафрыканскі летні час", "CAT": "Цэнтральнаафрыканскі час", "ACST": "Стандартны час цэнтральнай Аўстраліі", "SRT": "Час Сурынама", "CST": "Паўночнаамерыканскі цэнтральны стандартны час", "GFT": "Час Французскай Гвіяны", "ART": "Аргенцінскі стандартны час", "WITA": "Цэнтральнаінданезійскі час", "JDT": "Летні час Японіі", "AKST": "Стандартны час Аляскі", "EDT": "Паўночнаамерыканскі ўсходні летні час", "MEZ": "Цэнтральнаеўрапейскі стандартны час", "LHDT": "Летні час Лорд-Хау", "WIT": "Усходнеінданезійскі час", "ADT": "Атлантычны летні час", "AWST": "Стандартны час заходняй Аўстраліі", "AKDT": "Летні час Аляскі", "WARST": "Летні час Заходняй Аргенціны", "PDT": "Ціхаакіянскі летні час", "SAST": "Паўднёваафрыканскі час", "WAT": "Заходнеафрыканскі стандартны час", "HNT": "Ньюфаўндлендскі стандартны час", "MDT": "Паўночнаамерыканскі горны летні час", "UYT": "Уругвайскі стандартны час", "ACDT": "Летні час цэнтральнай Аўстраліі", "AST": "Атлантычны стандартны час", "CLT": "Чылійскі стандартны час", "WART": "Стандартны час Заходняй Аргенціны", "CHAST": "Стандартны час Чатэма", "NZST": "Стандартны час Новай Зеландыі", "MESZ": "Цэнтральнаеўрапейскі летні час", "ChST": "Час Чамора", "IST": "Час Індыі", "GYT": "Час Гаяны", "OESZ": "Усходнееўрапейскі летні час", "CLST": "Чылійскі летні час", "BOT": "Балівійскі час", "∅∅∅": "Амазонскі летні час", "CDT": "Паўночнаамерыканскі цэнтральны летні час", "CHADT": "Летні час Чатэма", "EST": "Паўночнаамерыканскі ўсходні стандартны час", "OEZ": "Усходнееўрапейскі стандартны час", "LHST": "Стандартны час Лорд-Хау", "EAT": "Усходнеафрыканскі час", "HKT": "Стандартны час Ганконга", "PST": "Ціхаакіянскі стандартны час", "WEZ": "Заходнееўрапейскі стандартны час", "GMT": "Час па Грынвічы", "TMT": "Стандартны час Туркменістана", "HKST": "Летні час Ганконга", "JST": "Стандартны час Японіі"},
}
}
diff --git a/be/be_test.go b/be/be_test.go
new file mode 100644
index 00000000..d34710df
--- /dev/null
+++ b/be/be_test.go
@@ -0,0 +1,1120 @@
+package be
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "be"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/be_BY/be_BY.go b/be_BY/be_BY.go
index 9554a1de..e06d5df4 100644
--- a/be_BY/be_BY.go
+++ b/be_BY/be_BY.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"да н.э.", "н.э."},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"GFT": "Час Французскай Гвіяны", "MST": "MST", "ACST": "Стандартны час цэнтральнай Аўстраліі", "AWST": "Стандартны час заходняй Аўстраліі", "AWDT": "Летні час заходняй Аўстраліі", "NZST": "Стандартны час Новай Зеландыі", "BOT": "Балівійскі час", "ACWST": "Заходні стандартны час Цэнтральнай Аўстраліі", "GMT": "Час па Грынвічы", "ARST": "Аргенцінскі летні час", "CLST": "Чылійскі летні час", "WEZ": "Заходнееўрапейскі стандартны час", "WESZ": "Заходнееўрапейскі летні час", "CAT": "Цэнтральнаафрыканскі час", "HNT": "Ньюфаўндлендскі стандартны час", "WITA": "Цэнтральнаінданезійскі час", "TMT": "Стандартны час Туркменістана", "LHDT": "Летні час Лорд-Хау", "ChST": "Час Чамора", "ADT": "Атлантычны летні час", "HADT": "Гавайска-Алеуцкі летні час", "JDT": "Летні час Японіі", "MYT": "Час Малайзіі", "SAST": "Паўднёваафрыканскі час", "WAT": "Заходнеафрыканскі стандартны час", "WARST": "Летні час Заходняй Аргенціны", "CDT": "Паўночнаамерыканскі цэнтральны летні час", "SGT": "Сінгапурскі час", "WIT": "Усходнеінданезійскі час", "EAT": "Усходнеафрыканскі час", "PDT": "Ціхаакіянскі летні час", "CLT": "Чылійскі стандартны час", "CHAST": "Стандартны час Чатэма", "HKST": "Летні час Ганконга", "ACDT": "Летні час цэнтральнай Аўстраліі", "CST": "Паўночнаамерыканскі цэнтральны стандартны час", "ECT": "Эквадорскі час", "WART": "Стандартны час Заходняй Аргенціны", "AKDT": "Летні час Аляскі", "PST": "Ціхаакіянскі стандартны час", "GYT": "Час Гаяны", "AEDT": "Летні час усходняй Аўстраліі", "WAST": "Заходнеафрыканскі летні час", "BT": "Час Бутана", "WIB": "Заходнеінданезійскі час", "HAT": "Ньюфаўндлендскі летні час", "TMST": "Летні час Туркменістана", "AEST": "Стандартны час усходняй Аўстраліі", "EST": "Паўночнаамерыканскі ўсходні стандартны час", "HKT": "Стандартны час Ганконга", "∅∅∅": "Амазонскі летні час", "MEZ": "Цэнтральнаеўрапейскі стандартны час", "ACWDT": "Заходні летні час Цэнтральнай Аўстраліі", "COT": "Калумбійскі стандартны час", "IST": "Час Індыі", "UYT": "Уругвайскі стандартны час", "EDT": "Паўночнаамерыканскі ўсходні летні час", "HAST": "Гавайска-Алеуцкі стандартны час", "MDT": "MDT", "LHST": "Стандартны час Лорд-Хау", "MESZ": "Цэнтральнаеўрапейскі летні час", "NZDT": "Летні час Новай Зеландыі", "CHADT": "Летні час Чатэма", "COST": "Калумбійскі летні час", "OEZ": "Усходнееўрапейскі стандартны час", "OESZ": "Усходнееўрапейскі летні час", "ART": "Аргенцінскі стандартны час", "VET": "Венесуэльскі час", "AST": "Атлантычны стандартны час", "JST": "Стандартны час Японіі", "SRT": "Час Сурынама", "AKST": "Стандартны час Аляскі", "UYST": "Уругвайскі летні час"},
+ timezones: map[string]string{"HADT": "Гавайска-Алеуцкі летні час", "MDT": "Паўночнаамерыканскі горны летні час", "SRT": "Час Сурынама", "AKST": "Стандартны час Аляскі", "ADT": "Атлантычны летні час", "ACWDT": "Заходні летні час Цэнтральнай Аўстраліі", "PDT": "Ціхаакіянскі летні час", "WIT": "Усходнеінданезійскі час", "CDT": "Паўночнаамерыканскі цэнтральны летні час", "HKT": "Стандартны час Ганконга", "WITA": "Цэнтральнаінданезійскі час", "WIB": "Заходнеінданезійскі час", "UYT": "Уругвайскі стандартны час", "SAST": "Паўднёваафрыканскі час", "HNT": "Ньюфаўндлендскі стандартны час", "ChST": "Час Чамора", "AEST": "Стандартны час усходняй Аўстраліі", "ACDT": "Летні час цэнтральнай Аўстраліі", "AWDT": "Летні час заходняй Аўстраліі", "PST": "Ціхаакіянскі стандартны час", "HAST": "Гавайска-Алеуцкі стандартны час", "ART": "Аргенцінскі стандартны час", "SGT": "Сінгапурскі час", "CLT": "Чылійскі стандартны час", "CAT": "Цэнтральнаафрыканскі час", "WAT": "Заходнеафрыканскі стандартны час", "NZDT": "Летні час Новай Зеландыі", "IST": "Час Індыі", "HAT": "Ньюфаўндлендскі летні час", "AEDT": "Летні час усходняй Аўстраліі", "CLST": "Чылійскі летні час", "WART": "Стандартны час Заходняй Аргенціны", "ECT": "Эквадорскі час", "JST": "Стандартны час Японіі", "NZST": "Стандартны час Новай Зеландыі", "OEZ": "Усходнееўрапейскі стандартны час", "WAST": "Заходнеафрыканскі летні час", "OESZ": "Усходнееўрапейскі летні час", "UYST": "Уругвайскі летні час", "JDT": "Летні час Японіі", "AKDT": "Летні час Аляскі", "TMT": "Стандартны час Туркменістана", "CHAST": "Стандартны час Чатэма", "CHADT": "Летні час Чатэма", "∅∅∅": "Амазонскі летні час", "COST": "Калумбійскі летні час", "LHDT": "Летні час Лорд-Хау", "GYT": "Час Гаяны", "GFT": "Час Французскай Гвіяны", "ARST": "Аргенцінскі летні час", "ACWST": "Заходні стандартны час Цэнтральнай Аўстраліі", "EDT": "Паўночнаамерыканскі ўсходні летні час", "ACST": "Стандартны час цэнтральнай Аўстраліі", "VET": "Венесуэльскі час", "AST": "Атлантычны стандартны час", "COT": "Калумбійскі стандартны час", "LHST": "Стандартны час Лорд-Хау", "GMT": "Час па Грынвічы", "WARST": "Летні час Заходняй Аргенціны", "HKST": "Летні час Ганконга", "MYT": "Час Малайзіі", "BT": "Час Бутана", "CST": "Паўночнаамерыканскі цэнтральны стандартны час", "BOT": "Балівійскі час", "WESZ": "Заходнееўрапейскі летні час", "EAT": "Усходнеафрыканскі час", "AWST": "Стандартны час заходняй Аўстраліі", "MEZ": "Цэнтральнаеўрапейскі стандартны час", "MESZ": "Цэнтральнаеўрапейскі летні час", "MST": "Паўночнаамерыканскі горны стандартны час", "EST": "Паўночнаамерыканскі ўсходні стандартны час", "TMST": "Летні час Туркменістана", "WEZ": "Заходнееўрапейскі стандартны час"},
}
}
@@ -101,8 +101,8 @@ func (be *be_BY) PluralsRange() []locales.PluralRule {
func (be *be_BY) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
n := math.Abs(num)
- nMod10 := math.Mod(n, 10)
nMod100 := math.Mod(n, 100)
+ nMod10 := math.Mod(n, 10)
if nMod10 == 1 && nMod100 != 11 {
return locales.PluralRuleOne
diff --git a/be_BY/be_BY_test.go b/be_BY/be_BY_test.go
new file mode 100644
index 00000000..e93f11a2
--- /dev/null
+++ b/be_BY/be_BY_test.go
@@ -0,0 +1,1120 @@
+package be_BY
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "be_BY"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/bem/bem.go b/bem/bem.go
index 483166ee..43adb8ae 100644
--- a/bem/bem.go
+++ b/bem/bem.go
@@ -61,7 +61,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"", ""},
erasWide: []string{"Before Yesu", "After Yesu"},
- timezones: map[string]string{"WAST": "WAST", "TMT": "TMT", "MESZ": "MESZ", "ACWDT": "ACWDT", "AEST": "AEST", "PDT": "PDT", "GYT": "GYT", "SAST": "SAST", "WART": "WART", "HAT": "HAT", "EAT": "EAT", "MDT": "MDT", "ACST": "ACST", "JDT": "JDT", "WESZ": "WESZ", "ACDT": "ACDT", "TMST": "TMST", "CST": "CST", "NZDT": "NZDT", "BT": "BT", "OEZ": "OEZ", "GMT": "GMT", "AKDT": "AKDT", "LHDT": "LHDT", "SRT": "SRT", "ACWST": "ACWST", "EST": "EST", "HAST": "HAST", "WARST": "WARST", "ARST": "ARST", "CDT": "CDT", "UYST": "UYST", "CHAST": "CHAST", "SGT": "SGT", "WAT": "WAT", "HNT": "HNT", "WIB": "WIB", "OESZ": "OESZ", "∅∅∅": "∅∅∅", "MYT": "MYT", "MEZ": "MEZ", "EDT": "EDT", "WITA": "WITA", "WIT": "WIT", "PST": "PST", "AWDT": "AWDT", "CAT": "CAT", "HADT": "HADT", "MST": "MST", "CHADT": "CHADT", "CLT": "CLT", "AST": "AST", "LHST": "LHST", "ADT": "ADT", "GFT": "GFT", "WEZ": "WEZ", "COST": "COST", "AEDT": "AEDT", "ChST": "ChST", "CLST": "CLST", "VET": "VET", "ECT": "ECT", "IST": "IST", "AKST": "AKST", "NZST": "NZST", "BOT": "BOT", "HKT": "HKT", "HKST": "HKST", "ART": "ART", "UYT": "UYT", "AWST": "AWST", "JST": "JST", "COT": "COT"},
+ timezones: map[string]string{"PDT": "PDT", "WART": "WART", "AKST": "AKST", "WITA": "WITA", "JST": "JST", "WAT": "WAT", "WEZ": "WEZ", "GMT": "GMT", "AEST": "AEST", "AKDT": "AKDT", "NZST": "NZST", "LHDT": "LHDT", "GFT": "GFT", "ACWST": "ACWST", "HAST": "HAST", "MEZ": "MEZ", "EDT": "EDT", "TMT": "TMT", "OEZ": "OEZ", "EAT": "EAT", "BT": "BT", "CST": "CST", "CHADT": "CHADT", "BOT": "BOT", "ECT": "ECT", "WESZ": "WESZ", "CLT": "CLT", "UYST": "UYST", "SRT": "SRT", "SAST": "SAST", "HKT": "HKT", "JDT": "JDT", "IST": "IST", "NZDT": "NZDT", "HAT": "HAT", "COST": "COST", "LHST": "LHST", "MYT": "MYT", "AWST": "AWST", "TMST": "TMST", "CAT": "CAT", "WAST": "WAST", "MESZ": "MESZ", "VET": "VET", "ACWDT": "ACWDT", "PST": "PST", "COT": "COT", "WIB": "WIB", "WIT": "WIT", "MST": "MST", "ACDT": "ACDT", "AST": "AST", "OESZ": "OESZ", "GYT": "GYT", "WARST": "WARST", "ART": "ART", "AEDT": "AEDT", "CLST": "CLST", "CHAST": "CHAST", "ARST": "ARST", "EST": "EST", "SGT": "SGT", "ACST": "ACST", "AWDT": "AWDT", "HNT": "HNT", "CDT": "CDT", "ADT": "ADT", "∅∅∅": "∅∅∅", "ChST": "ChST", "MDT": "MDT", "UYT": "UYT", "HKST": "HKST", "HADT": "HADT"},
}
}
diff --git a/bem/bem_test.go b/bem/bem_test.go
new file mode 100644
index 00000000..12975002
--- /dev/null
+++ b/bem/bem_test.go
@@ -0,0 +1,1120 @@
+package bem
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "bem"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/bem_ZM/bem_ZM.go b/bem_ZM/bem_ZM.go
index 0fd8128f..559e3d23 100644
--- a/bem_ZM/bem_ZM.go
+++ b/bem_ZM/bem_ZM.go
@@ -61,7 +61,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"", ""},
erasWide: []string{"Before Yesu", "After Yesu"},
- timezones: map[string]string{"ACDT": "ACDT", "ARST": "ARST", "AWDT": "AWDT", "SRT": "SRT", "BOT": "BOT", "UYST": "UYST", "HAST": "HAST", "AWST": "AWST", "CAT": "CAT", "SGT": "SGT", "MEZ": "MEZ", "COST": "COST", "BT": "BT", "WARST": "WARST", "∅∅∅": "∅∅∅", "WESZ": "WESZ", "LHDT": "LHDT", "OEZ": "OEZ", "MDT": "MDT", "TMT": "TMT", "MESZ": "MESZ", "SAST": "SAST", "HKST": "HKST", "PDT": "PDT", "AEDT": "AEDT", "WAT": "WAT", "GFT": "GFT", "WITA": "WITA", "WIT": "WIT", "CDT": "CDT", "COT": "COT", "WIB": "WIB", "TMST": "TMST", "AKST": "AKST", "GYT": "GYT", "ACWDT": "ACWDT", "WAST": "WAST", "WART": "WART", "ART": "ART", "PST": "PST", "ACWST": "ACWST", "HADT": "HADT", "LHST": "LHST", "AEST": "AEST", "EST": "EST", "AST": "AST", "IST": "IST", "HAT": "HAT", "EAT": "EAT", "AKDT": "AKDT", "ChST": "ChST", "CLT": "CLT", "OESZ": "OESZ", "GMT": "GMT", "ACST": "ACST", "JDT": "JDT", "NZDT": "NZDT", "UYT": "UYT", "ECT": "ECT", "CST": "CST", "NZST": "NZST", "WEZ": "WEZ", "CHADT": "CHADT", "EDT": "EDT", "HKT": "HKT", "MST": "MST", "MYT": "MYT", "JST": "JST", "CHAST": "CHAST", "CLST": "CLST", "VET": "VET", "ADT": "ADT", "HNT": "HNT"},
+ timezones: map[string]string{"ACWDT": "ACWDT", "WIB": "WIB", "OESZ": "OESZ", "LHST": "LHST", "MEZ": "MEZ", "∅∅∅": "∅∅∅", "COT": "COT", "OEZ": "OEZ", "GMT": "GMT", "AEDT": "AEDT", "WAST": "WAST", "TMT": "TMT", "MESZ": "MESZ", "HAST": "HAST", "SRT": "SRT", "AKDT": "AKDT", "WAT": "WAT", "CST": "CST", "SAST": "SAST", "WEZ": "WEZ", "HAT": "HAT", "MYT": "MYT", "UYST": "UYST", "EDT": "EDT", "PDT": "PDT", "WESZ": "WESZ", "EAT": "EAT", "BT": "BT", "LHDT": "LHDT", "WARST": "WARST", "CHAST": "CHAST", "AKST": "AKST", "ART": "ART", "ARST": "ARST", "JDT": "JDT", "WIT": "WIT", "HKT": "HKT", "ECT": "ECT", "IST": "IST", "CAT": "CAT", "CLST": "CLST", "WART": "WART", "CHADT": "CHADT", "NZST": "NZST", "BOT": "BOT", "ACDT": "ACDT", "GFT": "GFT", "VET": "VET", "JST": "JST", "EST": "EST", "HNT": "HNT", "SGT": "SGT", "UYT": "UYT", "TMST": "TMST", "ChST": "ChST", "MST": "MST", "AST": "AST", "AWDT": "AWDT", "PST": "PST", "HADT": "HADT", "NZDT": "NZDT", "WITA": "WITA", "COST": "COST", "AEST": "AEST", "GYT": "GYT", "CLT": "CLT", "CDT": "CDT", "ACST": "ACST", "MDT": "MDT", "HKST": "HKST", "ADT": "ADT", "ACWST": "ACWST", "AWST": "AWST"},
}
}
diff --git a/bem_ZM/bem_ZM_test.go b/bem_ZM/bem_ZM_test.go
new file mode 100644
index 00000000..b8acf921
--- /dev/null
+++ b/bem_ZM/bem_ZM_test.go
@@ -0,0 +1,1120 @@
+package bem_ZM
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "bem_ZM"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/bez/bez.go b/bez/bez.go
index 08d8b58f..cd23f2a5 100644
--- a/bez/bez.go
+++ b/bez/bez.go
@@ -59,7 +59,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"KM", "BM"},
erasNarrow: []string{"", ""},
erasWide: []string{"Kabla ya Mtwaa", "Baada ya Mtwaa"},
- timezones: map[string]string{"ACWDT": "ACWDT", "HKT": "HKT", "IST": "IST", "OESZ": "OESZ", "HNT": "HNT", "PDT": "PDT", "AWDT": "AWDT", "MDT": "MDT", "CHAST": "CHAST", "COT": "COT", "HADT": "HADT", "WIT": "WIT", "ART": "ART", "LHDT": "LHDT", "VET": "VET", "ChST": "ChST", "HAST": "HAST", "GFT": "GFT", "EST": "EST", "SGT": "SGT", "SAST": "SAST", "ARST": "ARST", "GYT": "GYT", "CHADT": "CHADT", "WARST": "WARST", "TMT": "TMT", "AEDT": "AEDT", "ACDT": "ACDT", "SRT": "SRT", "JST": "JST", "JDT": "JDT", "CDT": "CDT", "NZDT": "NZDT", "AST": "AST", "BT": "BT", "ACST": "ACST", "AWST": "AWST", "CST": "CST", "UYT": "UYT", "ADT": "ADT", "HAT": "HAT", "PST": "PST", "BOT": "BOT", "EDT": "EDT", "MST": "MST", "MESZ": "MESZ", "∅∅∅": "∅∅∅", "GMT": "GMT", "AKDT": "AKDT", "MYT": "MYT", "WART": "WART", "WIB": "WIB", "AKST": "AKST", "LHST": "LHST", "WEZ": "WEZ", "WESZ": "WESZ", "AEST": "AEST", "CAT": "CAT", "TMST": "TMST", "COST": "COST", "WAST": "WAST", "HKST": "HKST", "MEZ": "MEZ", "ACWST": "ACWST", "ECT": "ECT", "OEZ": "OEZ", "EAT": "EAT", "NZST": "NZST", "UYST": "UYST", "CLT": "CLT", "CLST": "CLST", "WAT": "WAT", "WITA": "WITA"},
+ timezones: map[string]string{"ChST": "ChST", "UYT": "UYT", "HKST": "HKST", "AKST": "AKST", "AWST": "AWST", "BOT": "BOT", "MESZ": "MESZ", "HNT": "HNT", "CST": "CST", "∅∅∅": "∅∅∅", "HAST": "HAST", "GYT": "GYT", "BT": "BT", "ACWST": "ACWST", "ARST": "ARST", "NZST": "NZST", "PDT": "PDT", "WAT": "WAT", "WAST": "WAST", "AKDT": "AKDT", "TMST": "TMST", "OEZ": "OEZ", "MYT": "MYT", "ACST": "ACST", "SRT": "SRT", "MDT": "MDT", "VET": "VET", "EDT": "EDT", "ACWDT": "ACWDT", "GMT": "GMT", "WIT": "WIT", "WESZ": "WESZ", "JDT": "JDT", "SAST": "SAST", "COST": "COST", "AEST": "AEST", "CLST": "CLST", "ADT": "ADT", "WITA": "WITA", "EST": "EST", "MEZ": "MEZ", "UYST": "UYST", "OESZ": "OESZ", "ACDT": "ACDT", "GFT": "GFT", "MST": "MST", "HKT": "HKT", "AST": "AST", "ART": "ART", "IST": "IST", "ECT": "ECT", "TMT": "TMT", "HAT": "HAT", "PST": "PST", "WEZ": "WEZ", "COT": "COT", "EAT": "EAT", "HADT": "HADT", "SGT": "SGT", "AEDT": "AEDT", "LHDT": "LHDT", "CDT": "CDT", "CAT": "CAT", "CLT": "CLT", "WART": "WART", "LHST": "LHST", "WARST": "WARST", "CHAST": "CHAST", "CHADT": "CHADT", "JST": "JST", "AWDT": "AWDT", "NZDT": "NZDT", "WIB": "WIB"},
}
}
diff --git a/bez/bez_test.go b/bez/bez_test.go
new file mode 100644
index 00000000..c6a45ba8
--- /dev/null
+++ b/bez/bez_test.go
@@ -0,0 +1,1120 @@
+package bez
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "bez"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/bez_TZ/bez_TZ.go b/bez_TZ/bez_TZ.go
index cba21a55..4a352623 100644
--- a/bez_TZ/bez_TZ.go
+++ b/bez_TZ/bez_TZ.go
@@ -59,7 +59,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"KM", "BM"},
erasNarrow: []string{"", ""},
erasWide: []string{"Kabla ya Mtwaa", "Baada ya Mtwaa"},
- timezones: map[string]string{"MST": "MST", "WEZ": "WEZ", "EDT": "EDT", "HAST": "HAST", "OEZ": "OEZ", "COST": "COST", "PDT": "PDT", "UYT": "UYT", "AWDT": "AWDT", "GYT": "GYT", "BT": "BT", "IST": "IST", "ACWDT": "ACWDT", "EST": "EST", "LHDT": "LHDT", "ChST": "ChST", "ACDT": "ACDT", "CHAST": "CHAST", "WART": "WART", "SAST": "SAST", "HAT": "HAT", "WIT": "WIT", "JST": "JST", "CST": "CST", "MEZ": "MEZ", "CHADT": "CHADT", "HKT": "HKT", "GMT": "GMT", "VET": "VET", "ACWST": "ACWST", "CLST": "CLST", "WAT": "WAT", "SRT": "SRT", "MESZ": "MESZ", "NZDT": "NZDT", "AEDT": "AEDT", "CLT": "CLT", "CAT": "CAT", "AST": "AST", "HNT": "HNT", "MDT": "MDT", "LHST": "LHST", "NZST": "NZST", "WESZ": "WESZ", "WARST": "WARST", "WAST": "WAST", "EAT": "EAT", "AWST": "AWST", "HKST": "HKST", "TMST": "TMST", "AKDT": "AKDT", "PST": "PST", "BOT": "BOT", "WITA": "WITA", "ARST": "ARST", "GFT": "GFT", "ACST": "ACST", "TMT": "TMT", "UYST": "UYST", "AEST": "AEST", "SGT": "SGT", "HADT": "HADT", "CDT": "CDT", "ECT": "ECT", "WIB": "WIB", "ART": "ART", "OESZ": "OESZ", "MYT": "MYT", "JDT": "JDT", "AKST": "AKST", "COT": "COT", "∅∅∅": "∅∅∅", "ADT": "ADT"},
+ timezones: map[string]string{"AST": "AST", "WAST": "WAST", "GYT": "GYT", "WARST": "WARST", "ECT": "ECT", "AWDT": "AWDT", "ADT": "ADT", "HAT": "HAT", "CDT": "CDT", "VET": "VET", "ART": "ART", "AKST": "AKST", "BOT": "BOT", "AEDT": "AEDT", "SRT": "SRT", "HKT": "HKT", "TMT": "TMT", "AEST": "AEST", "WITA": "WITA", "SAST": "SAST", "HAST": "HAST", "EST": "EST", "WIT": "WIT", "MST": "MST", "WAT": "WAT", "UYT": "UYT", "COST": "COST", "MEZ": "MEZ", "EDT": "EDT", "WEZ": "WEZ", "CLT": "CLT", "UYST": "UYST", "MESZ": "MESZ", "ACST": "ACST", "WIB": "WIB", "WESZ": "WESZ", "CLST": "CLST", "CST": "CST", "PST": "PST", "LHST": "LHST", "IST": "IST", "CHADT": "CHADT", "OEZ": "OEZ", "EAT": "EAT", "GFT": "GFT", "JST": "JST", "AKDT": "AKDT", "NZST": "NZST", "OESZ": "OESZ", "WART": "WART", "CHAST": "CHAST", "ACWDT": "ACWDT", "HADT": "HADT", "NZDT": "NZDT", "PDT": "PDT", "SGT": "SGT", "LHDT": "LHDT", "ACDT": "ACDT", "JDT": "JDT", "COT": "COT", "TMST": "TMST", "HNT": "HNT", "GMT": "GMT", "BT": "BT", "MDT": "MDT", "HKST": "HKST", "ARST": "ARST", "ACWST": "ACWST", "AWST": "AWST", "CAT": "CAT", "ChST": "ChST", "MYT": "MYT", "∅∅∅": "∅∅∅"},
}
}
diff --git a/bez_TZ/bez_TZ_test.go b/bez_TZ/bez_TZ_test.go
new file mode 100644
index 00000000..d52c782b
--- /dev/null
+++ b/bez_TZ/bez_TZ_test.go
@@ -0,0 +1,1120 @@
+package bez_TZ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "bez_TZ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/bg/bg.go b/bg/bg.go
index b3d95d58..b3d771db 100644
--- a/bg/bg.go
+++ b/bg/bg.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"пр.Хр.", "сл.Хр."},
erasNarrow: []string{"", ""},
erasWide: []string{"преди Христа", "след Христа"},
- timezones: map[string]string{"UYT": "Уругвайско стандартно време", "ChST": "Чаморо – стандартно време", "HADT": "Хавайско-алеутско лятно часово време", "TMT": "Туркменистанско стандартно време", "JDT": "Японско лятно часово време", "LHST": "Лорд Хау – стандартно време", "GYT": "Гаяна", "NZDT": "Новозеландско лятно часово време", "GMT": "Средно гринуичко време", "JST": "Японско стандартно време", "PDT": "Северноамериканско тихоокеанско лятно часово време", "CST": "Северноамериканско централно стандартно време", "COST": "Колумбийско лятно часово време", "CDT": "Северноамериканско централно лятно часово време", "BOT": "Боливийско време", "UYST": "Уругвайско лятно часово време", "CHAST": "Чатъм – стандартно време", "ACST": "Австралия – централно стандартно време", "AWST": "Австралия – западно стандартно време", "NZST": "Новозеландско стандартно време", "BT": "Бутанско време", "CLT": "Чилийско стандартно време", "WESZ": "Западноевропейско лятно време", "LHDT": "Лорд Хау – лятно часово време", "CAT": "Централноафриканско време", "EST": "Северноамериканско източно стандартно време", "OESZ": "Източноевропейско лятно часово време", "GFT": "Френска Гвиана", "TMST": "Туркменистанско лятно часово време", "EAT": "Източноафриканско време", "ART": "Аржентинско стандартно време", "ACWST": "Австралия – западно централно стандартно време", "MYT": "Малайзийско време", "AKDT": "Аляска – лятно часово време", "WARST": "Западноаржентинско лятно часово време", "AEST": "Австралия – източно стандартно време", "AST": "Северноамериканско атлантическо стандартно време", "WITA": "Централноиндонезийско време", "HAT": "Нюфаундлендско лятно часово време", "MST": "MST", "∅∅∅": "Амазонско лятно часово време", "MESZ": "Централноевропейско лятно часово време", "CHADT": "Чатъм – лятно часово време", "CLST": "Чилийско лятно часово време", "COT": "Колумбийско стандартно време", "ADT": "Северноамериканско атлантическо лятно часово време", "WART": "Западноаржентинско стандартно време", "AKST": "Аляска – стандартно време", "MEZ": "Централноевропейско стандартно време", "WEZ": "Западноевропейско стандартно време", "WIB": "Западноиндонезийско време", "IST": "Индийско стандартно време", "HNT": "Нюфаундлендско стандартно време", "ACDT": "Австралия – централно лятно часово време", "SRT": "Суринамско време", "EDT": "Северноамериканско източно лятно часово време", "MDT": "MDT", "VET": "Венецуелско време", "WAT": "Западноафриканско стандартно време", "OEZ": "Източноевропейско стандартно време", "ARST": "Аржентинско лятно часово време", "AEDT": "Австралия – източно лятно часово време", "ECT": "Еквадорско време", "SAST": "Южноафриканско време", "WIT": "Източноиндонезийско време", "PST": "Северноамериканско тихоокеанско стандартно време", "WAST": "Западноафриканско лятно часово време", "ACWDT": "Австралия – западно централно лятно часово време", "SGT": "Сингапурско време", "AWDT": "Австралия – западно лятно часово време", "HAST": "Хавайско-алеутско стандартно време", "HKT": "Хонконгско стандартно време", "HKST": "Хонконгско лятно часово време"},
+ timezones: map[string]string{"VET": "Венецуелско време", "NZDT": "Новозеландско лятно часово време", "MESZ": "Централноевропейско лятно часово време", "AKDT": "Аляска – лятно часово време", "MEZ": "Централноевропейско стандартно време", "HNT": "Нюфаундлендско стандартно време", "OEZ": "Източноевропейско стандартно време", "MST": "Северноамериканско планинско стандартно време", "CST": "Северноамериканско централно стандартно време", "JST": "Японско стандартно време", "CDT": "Северноамериканско централно лятно часово време", "HKT": "Хонконгско стандартно време", "ECT": "Еквадорско време", "ACWST": "Австралия – западно централно стандартно време", "ARST": "Аржентинско лятно часово време", "SAST": "Южноафриканско време", "CLT": "Чилийско стандартно време", "WARST": "Западноаржентинско лятно часово време", "BOT": "Боливийско време", "UYT": "Уругвайско стандартно време", "HAST": "Хавайско-алеутско стандартно време", "COST": "Колумбийско лятно часово време", "ART": "Аржентинско стандартно време", "WIB": "Западноиндонезийско време", "UYST": "Уругвайско лятно часово време", "JDT": "Японско лятно часово време", "AWST": "Австралия – западно стандартно време", "AST": "Северноамериканско атлантическо стандартно време", "AWDT": "Австралия – западно лятно часово време", "CAT": "Централноафриканско време", "GYT": "Гаяна", "CLST": "Чилийско лятно часово време", "WART": "Западноаржентинско стандартно време", "AKST": "Аляска – стандартно време", "PST": "Северноамериканско тихоокеанско стандартно време", "TMT": "Туркменистанско стандартно време", "MDT": "Северноамериканско планинско лятно часово време", "∅∅∅": "Бразилско лятно часово време", "IST": "Индийско стандартно време", "PDT": "Северноамериканско тихоокеанско лятно часово време", "WAST": "Западноафриканско лятно часово време", "SRT": "Суринамско време", "HKST": "Хонконгско лятно часово време", "ACWDT": "Австралия – западно централно лятно часово време", "EDT": "Северноамериканско източно лятно часово време", "COT": "Колумбийско стандартно време", "GMT": "Средно гринуичко време", "AEST": "Австралия – източно стандартно време", "ACST": "Австралия – централно стандартно време", "ACDT": "Австралия – централно лятно часово време", "EST": "Северноамериканско източно стандартно време", "NZST": "Новозеландско стандартно време", "TMST": "Туркменистанско лятно часово време", "HAT": "Нюфаундлендско лятно часово време", "OESZ": "Източноевропейско лятно часово време", "LHDT": "Лорд Хау – лятно часово време", "MYT": "Малайзийско време", "CHAST": "Чатъм – стандартно време", "EAT": "Източноафриканско време", "CHADT": "Чатъм – лятно часово време", "WIT": "Източноиндонезийско време", "BT": "Бутанско време", "WESZ": "Западноевропейско лятно време", "WEZ": "Западноевропейско стандартно време", "LHST": "Лорд Хау – стандартно време", "WITA": "Централноиндонезийско време", "ADT": "Северноамериканско атлантическо лятно часово време", "SGT": "Сингапурско време", "AEDT": "Австралия – източно лятно часово време", "ChST": "Чаморо – стандартно време", "GFT": "Френска Гвиана", "HADT": "Хавайско-алеутско лятно часово време", "WAT": "Западноафриканско стандартно време"},
}
}
diff --git a/bg/bg_test.go b/bg/bg_test.go
new file mode 100644
index 00000000..4228b64b
--- /dev/null
+++ b/bg/bg_test.go
@@ -0,0 +1,1120 @@
+package bg
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "bg"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/bg_BG/bg_BG.go b/bg_BG/bg_BG.go
index f1c2a543..6e7ec12e 100644
--- a/bg_BG/bg_BG.go
+++ b/bg_BG/bg_BG.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"пр.Хр.", "сл.Хр."},
erasNarrow: []string{"", ""},
erasWide: []string{"преди Христа", "след Христа"},
- timezones: map[string]string{"BT": "Бутанско време", "WART": "Западноаржентинско стандартно време", "WIT": "Източноиндонезийско време", "ACST": "Австралия – централно стандартно време", "AWDT": "Австралия – западно лятно часово време", "CLT": "Чилийско стандартно време", "EDT": "Северноамериканско източно лятно часово време", "TMT": "Туркменистанско стандартно време", "SRT": "Суринамско време", "UYST": "Уругвайско лятно часово време", "COT": "Колумбийско стандартно време", "AST": "Северноамериканско атлантическо стандартно време", "EAT": "Източноафриканско време", "ART": "Аржентинско стандартно време", "JST": "Японско стандартно време", "CDT": "Северноамериканско централно лятно часово време", "MEZ": "Централноевропейско стандартно време", "IST": "Индийско стандартно време", "NZST": "Новозеландско стандартно време", "BOT": "Боливийско време", "HADT": "Хавайско-алеутско лятно часово време", "SAST": "Южноафриканско време", "∅∅∅": "Амазонско лятно часово време", "CST": "Северноамериканско централно стандартно време", "AEST": "Австралия – източно стандартно време", "AEDT": "Австралия – източно лятно часово време", "COST": "Колумбийско лятно часово време", "AKST": "Аляска – стандартно време", "NZDT": "Новозеландско лятно часово време", "CHADT": "Чатъм – лятно часово време", "CLST": "Чилийско лятно часово време", "WARST": "Западноаржентинско лятно часово време", "OESZ": "Източноевропейско лятно часово време", "AWST": "Австралия – западно стандартно време", "UYT": "Уругвайско стандартно време", "WEZ": "Западноевропейско стандартно време", "SGT": "Сингапурско време", "WAT": "Западноафриканско стандартно време", "MST": "MST", "PST": "Северноамериканско тихоокеанско стандартно време", "CAT": "Централноафриканско време", "EST": "Северноамериканско източно стандартно време", "HAST": "Хавайско-алеутско стандартно време", "GMT": "Средно гринуичко време", "JDT": "Японско лятно часово време", "GYT": "Гаяна", "ADT": "Северноамериканско атлантическо лятно часово време", "WIB": "Западноиндонезийско време", "ACWST": "Австралия – западно централно стандартно време", "GFT": "Френска Гвиана", "TMST": "Туркменистанско лятно часово време", "WAST": "Западноафриканско лятно часово време", "OEZ": "Източноевропейско стандартно време", "ACDT": "Австралия – централно лятно часово време", "AKDT": "Аляска – лятно часово време", "PDT": "Северноамериканско тихоокеанско лятно часово време", "LHST": "Лорд Хау – стандартно време", "WITA": "Централноиндонезийско време", "ACWDT": "Австралия – западно централно лятно часово време", "ChST": "Чаморо – стандартно време", "ECT": "Еквадорско време", "MESZ": "Централноевропейско лятно часово време", "VET": "Венецуелско време", "HKT": "Хонконгско стандартно време", "HNT": "Нюфаундлендско стандартно време", "MDT": "MDT", "ARST": "Аржентинско лятно часово време", "MYT": "Малайзийско време", "LHDT": "Лорд Хау – лятно часово време", "HAT": "Нюфаундлендско лятно часово време", "CHAST": "Чатъм – стандартно време", "WESZ": "Западноевропейско лятно време", "HKST": "Хонконгско лятно часово време"},
+ timezones: map[string]string{"HAT": "Нюфаундлендско лятно часово време", "COST": "Колумбийско лятно часово време", "WIB": "Западноиндонезийско време", "MDT": "Северноамериканско планинско лятно часово време", "VET": "Венецуелско време", "WAST": "Западноафриканско лятно часово време", "ECT": "Еквадорско време", "AKDT": "Аляска – лятно часово време", "ADT": "Северноамериканско атлантическо лятно часово време", "LHDT": "Лорд Хау – лятно часово време", "ACDT": "Австралия – централно лятно часово време", "TMST": "Туркменистанско лятно часово време", "WAT": "Западноафриканско стандартно време", "AEDT": "Австралия – източно лятно часово време", "ACST": "Австралия – централно стандартно време", "EST": "Северноамериканско източно стандартно време", "SAST": "Южноафриканско време", "AEST": "Австралия – източно стандартно време", "CDT": "Северноамериканско централно лятно часово време", "PDT": "Северноамериканско тихоокеанско лятно часово време", "WART": "Западноаржентинско стандартно време", "SRT": "Суринамско време", "CHAST": "Чатъм – стандартно време", "AKST": "Аляска – стандартно време", "MESZ": "Централноевропейско лятно часово време", "TMT": "Туркменистанско стандартно време", "MYT": "Малайзийско време", "BT": "Бутанско време", "OESZ": "Източноевропейско лятно часово време", "AWDT": "Австралия – западно лятно часово време", "JDT": "Японско лятно часово време", "WESZ": "Западноевропейско лятно време", "UYT": "Уругвайско стандартно време", "WARST": "Западноаржентинско лятно часово време", "WIT": "Източноиндонезийско време", "∅∅∅": "Бразилско лятно часово време", "ACWST": "Австралия – западно централно стандартно време", "ACWDT": "Австралия – западно централно лятно часово време", "MST": "Северноамериканско планинско стандартно време", "CLT": "Чилийско стандартно време", "ARST": "Аржентинско лятно часово време", "AST": "Северноамериканско атлантическо стандартно време", "AWST": "Австралия – западно стандартно време", "NZST": "Новозеландско стандартно време", "BOT": "Боливийско време", "IST": "Индийско стандартно време", "SGT": "Сингапурско време", "OEZ": "Източноевропейско стандартно време", "UYST": "Уругвайско лятно часово време", "CST": "Северноамериканско централно стандартно време", "WEZ": "Западноевропейско стандартно време", "HNT": "Нюфаундлендско стандартно време", "CHADT": "Чатъм – лятно часово време", "MEZ": "Централноевропейско стандартно време", "HKST": "Хонконгско лятно часово време", "ART": "Аржентинско стандартно време", "ChST": "Чаморо – стандартно време", "GMT": "Средно гринуичко време", "CLST": "Чилийско лятно часово време", "HKT": "Хонконгско стандартно време", "PST": "Северноамериканско тихоокеанско стандартно време", "HAST": "Хавайско-алеутско стандартно време", "NZDT": "Новозеландско лятно часово време", "COT": "Колумбийско стандартно време", "GYT": "Гаяна", "LHST": "Лорд Хау – стандартно време", "WITA": "Централноиндонезийско време", "CAT": "Централноафриканско време", "JST": "Японско стандартно време", "EDT": "Северноамериканско източно лятно часово време", "HADT": "Хавайско-алеутско лятно часово време", "EAT": "Източноафриканско време", "GFT": "Френска Гвиана"},
}
}
diff --git a/bg_BG/bg_BG_test.go b/bg_BG/bg_BG_test.go
new file mode 100644
index 00000000..d180eede
--- /dev/null
+++ b/bg_BG/bg_BG_test.go
@@ -0,0 +1,1120 @@
+package bg_BG
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "bg_BG"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/bm/bm.go b/bm/bm.go
index 448e7185..9b988407 100644
--- a/bm/bm.go
+++ b/bm/bm.go
@@ -61,7 +61,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"J.-C. ɲɛ", "ni J.-C."},
erasNarrow: []string{"", ""},
erasWide: []string{"jezu krisiti ɲɛ", "jezu krisiti minkɛ"},
- timezones: map[string]string{"AWST": "AWST", "BOT": "BOT", "MESZ": "MESZ", "WITA": "WITA", "WIT": "WIT", "OEZ": "OEZ", "OESZ": "OESZ", "JST": "JST", "GFT": "GFT", "CHADT": "CHADT", "CLST": "CLST", "WEZ": "WEZ", "EST": "EST", "HADT": "HADT", "LHDT": "LHDT", "PST": "PST", "UYST": "UYST", "ACWDT": "ACWDT", "EDT": "EDT", "COST": "COST", "HKST": "HKST", "TMT": "TMT", "EAT": "EAT", "HAST": "HAST", "AWDT": "AWDT", "ACST": "ACST", "AKDT": "AKDT", "PDT": "PDT", "VET": "VET", "ECT": "ECT", "AST": "AST", "HKT": "HKT", "SAST": "SAST", "WARST": "WARST", "BT": "BT", "SRT": "SRT", "TMST": "TMST", "LHST": "LHST", "MEZ": "MEZ", "CHAST": "CHAST", "COT": "COT", "SGT": "SGT", "GMT": "GMT", "ARST": "ARST", "GYT": "GYT", "UYT": "UYT", "CST": "CST", "NZST": "NZST", "MDT": "MDT", "WESZ": "WESZ", "HNT": "HNT", "ACDT": "ACDT", "AKST": "AKST", "CLT": "CLT", "AEST": "AEST", "HAT": "HAT", "NZDT": "NZDT", "ChST": "ChST", "WART": "WART", "WAT": "WAT", "ART": "ART", "JDT": "JDT", "MYT": "MYT", "CDT": "CDT", "MST": "MST", "AEDT": "AEDT", "∅∅∅": "∅∅∅", "WAST": "WAST", "IST": "IST", "ACWST": "ACWST", "CAT": "CAT", "ADT": "ADT", "WIB": "WIB"},
+ timezones: map[string]string{"AST": "AST", "SAST": "SAST", "GMT": "GMT", "MYT": "MYT", "COT": "COT", "ChST": "ChST", "WARST": "WARST", "HKST": "HKST", "PST": "PST", "HAST": "HAST", "HADT": "HADT", "VET": "VET", "HNT": "HNT", "LHDT": "LHDT", "CDT": "CDT", "GFT": "GFT", "NZST": "NZST", "NZDT": "NZDT", "∅∅∅": "∅∅∅", "CAT": "CAT", "ACST": "ACST", "CLST": "CLST", "ECT": "ECT", "ACWDT": "ACWDT", "WITA": "WITA", "PDT": "PDT", "HAT": "HAT", "OESZ": "OESZ", "AEST": "AEST", "ADT": "ADT", "WAT": "WAT", "ACDT": "ACDT", "HKT": "HKT", "IST": "IST", "MEZ": "MEZ", "WIB": "WIB", "MDT": "MDT", "CLT": "CLT", "UYT": "UYT", "CHAST": "CHAST", "EST": "EST", "BOT": "BOT", "SGT": "SGT", "TMST": "TMST", "CST": "CST", "CHADT": "CHADT", "UYST": "UYST", "WART": "WART", "AKDT": "AKDT", "AWDT": "AWDT", "JDT": "JDT", "COST": "COST", "GYT": "GYT", "MST": "MST", "ACWST": "ACWST", "AWST": "AWST", "AKST": "AKST", "JST": "JST", "EDT": "EDT", "OEZ": "OEZ", "ART": "ART", "ARST": "ARST", "AEDT": "AEDT", "BT": "BT", "LHST": "LHST", "SRT": "SRT", "MESZ": "MESZ", "WAST": "WAST", "WESZ": "WESZ", "EAT": "EAT", "WIT": "WIT", "WEZ": "WEZ", "TMT": "TMT"},
}
}
diff --git a/bm/bm_test.go b/bm/bm_test.go
new file mode 100644
index 00000000..fdd3f61d
--- /dev/null
+++ b/bm/bm_test.go
@@ -0,0 +1,1120 @@
+package bm
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "bm"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/bm_ML/bm_ML.go b/bm_ML/bm_ML.go
index fffdfe6c..6037486e 100644
--- a/bm_ML/bm_ML.go
+++ b/bm_ML/bm_ML.go
@@ -61,7 +61,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"J.-C. ɲɛ", "ni J.-C."},
erasNarrow: []string{"", ""},
erasWide: []string{"jezu krisiti ɲɛ", "jezu krisiti minkɛ"},
- timezones: map[string]string{"WAST": "WAST", "GMT": "GMT", "CHADT": "CHADT", "CAT": "CAT", "WARST": "WARST", "HNT": "HNT", "NZDT": "NZDT", "WEZ": "WEZ", "WESZ": "WESZ", "VET": "VET", "HADT": "HADT", "HAT": "HAT", "GFT": "GFT", "ARST": "ARST", "PDT": "PDT", "OESZ": "OESZ", "LHST": "LHST", "MYT": "MYT", "IST": "IST", "WIT": "WIT", "NZST": "NZST", "CHAST": "CHAST", "HKST": "HKST", "WIB": "WIB", "MDT": "MDT", "BOT": "BOT", "AKDT": "AKDT", "LHDT": "LHDT", "JST": "JST", "ACWST": "ACWST", "AEDT": "AEDT", "COT": "COT", "ECT": "ECT", "AST": "AST", "AWDT": "AWDT", "MESZ": "MESZ", "ChST": "ChST", "COST": "COST", "SAST": "SAST", "TMST": "TMST", "JDT": "JDT", "AEST": "AEST", "ART": "ART", "PST": "PST", "MEZ": "MEZ", "UYST": "UYST", "SGT": "SGT", "BT": "BT", "ACST": "ACST", "SRT": "SRT", "CST": "CST", "∅∅∅": "∅∅∅", "MST": "MST", "CDT": "CDT", "EST": "EST", "EAT": "EAT", "GYT": "GYT", "CLT": "CLT", "EDT": "EDT", "WART": "WART", "OEZ": "OEZ", "AKST": "AKST", "UYT": "UYT", "ADT": "ADT", "WITA": "WITA", "TMT": "TMT", "AWST": "AWST", "ACWDT": "ACWDT", "CLST": "CLST", "HAST": "HAST", "WAT": "WAT", "HKT": "HKT", "ACDT": "ACDT"},
+ timezones: map[string]string{"MDT": "MDT", "AWST": "AWST", "JST": "JST", "ACWST": "ACWST", "HAST": "HAST", "NZDT": "NZDT", "WAST": "WAST", "TMT": "TMT", "UYST": "UYST", "HKT": "HKT", "MEZ": "MEZ", "HADT": "HADT", "OESZ": "OESZ", "ChST": "ChST", "MYT": "MYT", "HKST": "HKST", "VET": "VET", "AKST": "AKST", "MST": "MST", "AWDT": "AWDT", "ART": "ART", "GFT": "GFT", "GYT": "GYT", "ACDT": "ACDT", "CHAST": "CHAST", "PDT": "PDT", "LHST": "LHST", "ACWDT": "ACWDT", "WITA": "WITA", "MESZ": "MESZ", "TMST": "TMST", "AEST": "AEST", "AEDT": "AEDT", "CLT": "CLT", "CLST": "CLST", "UYT": "UYT", "CDT": "CDT", "AKDT": "AKDT", "WIB": "WIB", "GMT": "GMT", "EAT": "EAT", "WIT": "WIT", "ECT": "ECT", "WAT": "WAT", "COST": "COST", "ACST": "ACST", "∅∅∅": "∅∅∅", "JDT": "JDT", "SAST": "SAST", "NZST": "NZST", "BOT": "BOT", "WEZ": "WEZ", "CST": "CST", "AST": "AST", "EDT": "EDT", "HNT": "HNT", "OEZ": "OEZ", "BT": "BT", "ADT": "ADT", "IST": "IST", "EST": "EST", "CAT": "CAT", "HAT": "HAT", "SGT": "SGT", "COT": "COT", "WARST": "WARST", "CHADT": "CHADT", "PST": "PST", "WESZ": "WESZ", "LHDT": "LHDT", "SRT": "SRT", "ARST": "ARST", "WART": "WART"},
}
}
diff --git a/bm_ML/bm_ML_test.go b/bm_ML/bm_ML_test.go
new file mode 100644
index 00000000..d43f678d
--- /dev/null
+++ b/bm_ML/bm_ML_test.go
@@ -0,0 +1,1120 @@
+package bm_ML
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "bm_ML"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/bn/bn.go b/bn/bn.go
index 8757f4fa..e3d2f7fe 100644
--- a/bn/bn.go
+++ b/bn/bn.go
@@ -65,7 +65,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"খ্রিস্টপূর্ব", "খৃষ্টাব্দ"},
erasNarrow: []string{"", ""},
erasWide: []string{"খ্রিস্টপূর্ব", "খৃষ্টাব্দ"},
- timezones: map[string]string{"ACST": "অস্ট্রেলীয় কেন্দ্রীয় মানক সময়", "MYT": "মালয়েশিয়া সময়", "AKST": "আলাস্কা মানক সময়", "NZST": "নিউজিল্যান্ড মানক সময়", "ACWDT": "অস্ট্রেলীয় কেন্দ্রীয় পশ্চিমি দিবালোক সময়", "SGT": "সিঙ্গাপুর মানক সময়", "ART": "আর্জেনটিনা মানক সময়", "TMT": "তুর্কমেনিস্তান মানক সময়", "WAT": "পশ্চিম আফ্রিকা মানক সময়", "HNT": "নিউফাউন্ডল্যান্ড মানক সময়", "GFT": "ফরাসি গায়ানা সময়", "UYST": "উরুগুয়ে গ্রীষ্মকালীন সময়", "MESZ": "মধ্য ইউরোপের গ্রীষ্মকালীন সময়", "AST": "অতলান্তিক মানক সময়", "HADT": "হাওয়াই-আলেউত দিবালোক সময়", "WARST": "পশ্চিমি আর্জেনটিনা গৃষ্মকালীন সময়", "WITA": "কেন্দ্রীয় ইন্দোনেশিয়া সময়", "IST": "ভারতীয় মানক সময়", "PST": "প্রশান্ত মহাসাগরীয় অঞ্চলের প্রমাণ সময়", "EDT": "পূর্বাঞ্চলের দিবালোক সময়", "HAST": "হাওয়াই-আলেউত মানক সময়", "SAST": "দক্ষিণ আফ্রিকা মানক সময়", "TMST": "তুর্কমেনিস্তান গ্রীষ্মকালীন সময়", "JST": "জাপান মানক সময়", "ECT": "ইকুয়েডর সময়", "HKST": "হং কং গ্রীষ্মকালীন সময়", "OESZ": "পূর্ব ইউরোপের গ্রীষ্মকালীন সময়", "LHDT": "লর্ড হাওয়ে দিবালোক মসয়", "LHST": "লর্ড হাওয়ে মানক মসয়", "GYT": "গুয়ানা সময়", "PDT": "প্রশান্ত মহাসাগরীয় অঞ্চলের দিনের সময়", "VET": "ভেনেজুয়েলা সময়", "ADT": "অতলান্তিক দিবালোক সময়", "ACDT": "অস্ট্রেলীয় কেন্দ্রীয় দিবালোক সময়", "SRT": "সুরিনাম সময়", "BOT": "বোলিভিয়া সময়", "AEST": "অস্ট্রেলীয় পূর্ব মানক সময়", "EST": "পূর্বাঞ্চলের প্রমাণ সময়", "BT": "ভুটান সময়", "WIB": "পশ্চিমী ইন্দোনেশিয়া সময়", "WESZ": "পশ্চিম ইউরোপের গ্রীষ্মকালীন সময়", "CAT": "মধ্য আফ্রিকা সময়", "HKT": "হং কং মানক সময়", "UYT": "উরুগুয়ে মানক সময়", "CHADT": "চ্যাথাম দিবালোক সময়", "CLT": "চিলি মানক সময়", "∅∅∅": "ব্রাসিলিয়া গৃষ্মকালীন সময়", "AWST": "অস্ট্রেলিয়ান পশ্চিমি মানক সময়", "CLST": "চিলি গ্রীষ্মকাল সময়", "COT": "কোলোম্বিয়া মানক সময়", "AKDT": "আলাস্কা দিবালোক সময়", "CDT": "কেন্দ্রীয় দিবালোক সময়", "MEZ": "মধ্য ইউরোপের প্রমাণ সময়", "NZDT": "নিউজিল্যান্ড দিবালোক সময়", "MST": "পার্বত্য অঞ্চলের প্রমাণ সময়", "MDT": "পার্বত্য অঞ্চলের দিনের সময়", "CST": "কেন্দ্রীয় মানক সময়", "OEZ": "পূর্ব ইউরোপের প্রমাণ সময়", "WIT": "পূর্ব ইন্দোনেশিয়া সময়", "ACWST": "অস্ট্রেলীয় কেন্দ্রীয় পশ্চিমি মানক সময়", "COST": "কোলোম্বিয়া গ্রীষ্মকালীন সময়", "WART": "পশ্চিমি আর্জেনটিনার প্রমাণ সময়", "WAST": "পশ্চিম আফ্রিকা গ্রীষ্মকালীন সময়", "EAT": "পূর্ব আফ্রিকা সময়", "AEDT": "অস্ট্রেলীয় পূর্ব দিবালোক সময়", "GMT": "গ্রীনিচ মিন টাইম", "JDT": "জাপান দিবালোক সময়", "AWDT": "অস্ট্রেলীয় পশ্চিমি দিবালোক সময়", "ChST": "চামেরো মানক সময়", "CHAST": "চ্যাথাম মানক সময়", "WEZ": "পশ্চিম ইউরোপের প্রমাণ সময়", "HAT": "নিউফাউন্ডল্যান্ড দিবালোক সময়", "ARST": "আর্জেনটিনা গৃষ্মকালীন সময়"},
+ timezones: map[string]string{"ADT": "অতলান্তিক দিবালোক সময়", "EST": "পূর্বাঞ্চলের প্রমাণ সময়", "EDT": "পূর্বাঞ্চলের দিবালোক সময়", "MEZ": "মধ্য ইউরোপের প্রমাণ সময়", "CAT": "মধ্য আফ্রিকা সময়", "CST": "কেন্দ্রীয় মানক সময়", "UYT": "উরুগুয়ে মানক সময়", "UYST": "উরুগুয়ে গ্রীষ্মকালীন সময়", "WARST": "পশ্চিমি আর্জেনটিনা গৃষ্মকালীন সময়", "GFT": "ফরাসি গায়ানা সময়", "ECT": "ইকুয়েডর সময়", "ACWDT": "অস্ট্রেলীয় কেন্দ্রীয় পশ্চিমি দিবালোক সময়", "WIB": "পশ্চিমী ইন্দোনেশিয়া সময়", "MDT": "পার্বত্য অঞ্চলের দিনের সময়", "JDT": "জাপান দিবালোক সময়", "COT": "কোলোম্বিয়া মানক সময়", "GYT": "গুয়ানা সময়", "WIT": "পূর্ব ইন্দোনেশিয়া সময়", "AEDT": "অস্ট্রেলীয় পূর্ব দিবালোক সময়", "SAST": "দক্ষিণ আফ্রিকা মানক সময়", "GMT": "গ্রীনিচ মিন টাইম", "AST": "অতলান্তিক মানক সময়", "CLST": "চিলি গ্রীষ্মকাল সময়", "CHADT": "চ্যাথাম দিবালোক সময়", "ARST": "আর্জেনটিনা গৃষ্মকালীন সময়", "AKST": "আলাস্কা মানক সময়", "WAST": "পশ্চিম আফ্রিকা গ্রীষ্মকালীন সময়", "HNT": "নিউফাউন্ডল্যান্ড মানক সময়", "LHST": "লর্ড হাওয়ে মানক মসয়", "AKDT": "আলাস্কা দিবালোক সময়", "OESZ": "পূর্ব ইউরোপের গ্রীষ্মকালীন সময়", "VET": "ভেনেজুয়েলা সময়", "MESZ": "মধ্য ইউরোপের গ্রীষ্মকালীন সময়", "BOT": "বোলিভিয়া সময়", "SGT": "সিঙ্গাপুর মানক সময়", "AWST": "অস্ট্রেলিয়ান পশ্চিমি মানক সময়", "EAT": "পূর্ব আফ্রিকা সময়", "HADT": "হাওয়াই-আলেউত দিবালোক সময়", "MYT": "মালয়েশিয়া সময়", "HKT": "হং কং মানক সময়", "AWDT": "অস্ট্রেলীয় পশ্চিমি দিবালোক সময়", "ART": "আর্জেনটিনা মানক সময়", "HAT": "নিউফাউন্ডল্যান্ড দিবালোক সময়", "∅∅∅": "পেরু গ্রীষ্মকালীন সময়", "HKST": "হং কং গ্রীষ্মকালীন সময়", "ACWST": "অস্ট্রেলীয় কেন্দ্রীয় পশ্চিমি মানক সময়", "WESZ": "পশ্চিম ইউরোপের গ্রীষ্মকালীন সময়", "ACDT": "অস্ট্রেলীয় কেন্দ্রীয় দিবালোক সময়", "CDT": "কেন্দ্রীয় দিবালোক সময়", "WAT": "পশ্চিম আফ্রিকা মানক সময়", "COST": "কোলোম্বিয়া গ্রীষ্মকালীন সময়", "AEST": "অস্ট্রেলীয় পূর্ব মানক সময়", "WART": "পশ্চিমি আর্জেনটিনার প্রমাণ সময়", "WITA": "কেন্দ্রীয় ইন্দোনেশিয়া সময়", "PDT": "প্রশান্ত মহাসাগরীয় অঞ্চলের দিনের সময়", "TMT": "তুর্কমেনিস্তান মানক সময়", "OEZ": "পূর্ব ইউরোপের প্রমাণ সময়", "LHDT": "লর্ড হাওয়ে দিবালোক মসয়", "IST": "ভারতীয় মানক সময়", "NZST": "নিউজিল্যান্ড মানক সময়", "WEZ": "পশ্চিম ইউরোপের প্রমাণ সময়", "TMST": "তুর্কমেনিস্তান গ্রীষ্মকালীন সময়", "ACST": "অস্ট্রেলীয় কেন্দ্রীয় মানক সময়", "NZDT": "নিউজিল্যান্ড দিবালোক সময়", "MST": "পার্বত্য অঞ্চলের প্রমাণ সময়", "CLT": "চিলি মানক সময়", "SRT": "সুরিনাম সময়", "CHAST": "চ্যাথাম মানক সময়", "JST": "জাপান মানক সময়", "PST": "প্রশান্ত মহাসাগরীয় অঞ্চলের প্রমাণ সময়", "HAST": "হাওয়াই-আলেউত মানক সময়", "BT": "ভুটান সময়", "ChST": "চামেরো মানক সময়"},
}
}
diff --git a/bn/bn_test.go b/bn/bn_test.go
new file mode 100644
index 00000000..d651cb3c
--- /dev/null
+++ b/bn/bn_test.go
@@ -0,0 +1,1120 @@
+package bn
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "bn"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/bn_BD/bn_BD.go b/bn_BD/bn_BD.go
index b2b41c18..af396b8a 100644
--- a/bn_BD/bn_BD.go
+++ b/bn_BD/bn_BD.go
@@ -65,7 +65,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"খ্রিস্টপূর্ব", "খৃষ্টাব্দ"},
erasNarrow: []string{"", ""},
erasWide: []string{"খ্রিস্টপূর্ব", "খৃষ্টাব্দ"},
- timezones: map[string]string{"ACST": "অস্ট্রেলীয় কেন্দ্রীয় মানক সময়", "ARST": "আর্জেনটিনা গৃষ্মকালীন সময়", "AEDT": "অস্ট্রেলীয় পূর্ব দিবালোক সময়", "ChST": "চামেরো মানক সময়", "HAST": "হাওয়াই-আলেউত মানক সময়", "HKST": "হং কং গ্রীষ্মকালীন সময়", "JDT": "জাপান দিবালোক সময়", "NZDT": "নিউজিল্যান্ড দিবালোক সময়", "VET": "ভেনেজুয়েলা সময়", "CHADT": "চ্যাথাম দিবালোক সময়", "EAT": "পূর্ব আফ্রিকা সময়", "MST": "মাকাও মান সময়", "PDT": "প্রশান্ত মহাসাগরীয় অঞ্চলের দিনের সময়", "AWDT": "অস্ট্রেলীয় পশ্চিমি দিবালোক সময়", "AST": "অতলান্তিক মানক সময়", "GMT": "গ্রীনিচ মিন টাইম", "TMT": "তুর্কমেনিস্তান মানক সময়", "PST": "প্রশান্ত মহাসাগরীয় অঞ্চলের প্রমাণ সময়", "AWST": "অস্ট্রেলিয়ান পশ্চিমি মানক সময়", "JST": "জাপান মানক সময়", "MESZ": "মধ্য ইউরোপের গ্রীষ্মকালীন সময়", "EST": "পূর্বাঞ্চলের প্রমাণ সময়", "SAST": "দক্ষিণ আফ্রিকা মানক সময়", "CLT": "চিলি মানক সময়", "CST": "কেন্দ্রীয় মানক সময়", "WART": "পশ্চিমি আর্জেনটিনার প্রমাণ সময়", "WARST": "পশ্চিমি আর্জেনটিনা গৃষ্মকালীন সময়", "WITA": "কেন্দ্রীয় ইন্দোনেশিয়া সময়", "TMST": "তুর্কমেনিস্তান গ্রীষ্মকালীন সময়", "SRT": "সুরিনাম সময়", "LHST": "লর্ড হাওয়ে মানক মসয়", "MEZ": "মধ্য ইউরোপের প্রমাণ সময়", "HKT": "হং কং মানক সময়", "ADT": "অতলান্তিক দিবালোক সময়", "ACWDT": "অস্ট্রেলীয় কেন্দ্রীয় পশ্চিমি দিবালোক সময়", "BOT": "বোলিভিয়া সময়", "COST": "কোলোম্বিয়া গ্রীষ্মকালীন সময়", "GFT": "ফরাসি গায়ানা সময়", "ACDT": "অস্ট্রেলীয় কেন্দ্রীয় দিবালোক সময়", "WESZ": "পশ্চিম ইউরোপের গ্রীষ্মকালীন সময়", "HADT": "হাওয়াই-আলেউত দিবালোক সময়", "SGT": "সিঙ্গাপুর মানক সময়", "MDT": "মাকাও গ্রীষ্মকাল সময়", "WAST": "পশ্চিম আফ্রিকা গ্রীষ্মকালীন সময়", "AKST": "আলাস্কা মানক সময়", "MYT": "মালয়েশিয়া সময়", "ACWST": "অস্ট্রেলীয় কেন্দ্রীয় পশ্চিমি মানক সময়", "WAT": "পশ্চিম আফ্রিকা মানক সময়", "GYT": "গুয়ানা সময়", "WEZ": "পশ্চিম ইউরোপের প্রমাণ সময়", "CAT": "মধ্য আফ্রিকা সময়", "ECT": "ইকুয়েডর সময়", "ART": "আর্জেনটিনা মানক সময়", "OEZ": "পূর্ব ইউরোপের প্রমাণ সময়", "OESZ": "পূর্ব ইউরোপের গ্রীষ্মকালীন সময়", "NZST": "নিউজিল্যান্ড মানক সময়", "EDT": "পূর্বাঞ্চলের দিবালোক সময়", "IST": "ভারতীয় মানক সময়", "CDT": "কেন্দ্রীয় দিবালোক সময়", "LHDT": "লর্ড হাওয়ে দিবালোক মসয়", "HAT": "নিউফাউন্ডল্যান্ড দিবালোক সময়", "CHAST": "চ্যাথাম মানক সময়", "CLST": "চিলি গ্রীষ্মকাল সময়", "HNT": "নিউফাউন্ডল্যান্ড মানক সময়", "WIB": "পশ্চিমী ইন্দোনেশিয়া সময়", "∅∅∅": "অ্যামাজন গ্রীষ্মকালীন সময়", "AKDT": "আলাস্কা দিবালোক সময়", "BT": "ভুটান সময়", "UYT": "উরুগুয়ে মানক সময়", "UYST": "উরুগুয়ে গ্রীষ্মকালীন সময়", "AEST": "অস্ট্রেলীয় পূর্ব মানক সময়", "COT": "কোলোম্বিয়া মানক সময়", "WIT": "পূর্ব ইন্দোনেশিয়া সময়"},
+ timezones: map[string]string{"WESZ": "পশ্চিম ইউরোপের গ্রীষ্মকালীন সময়", "BOT": "বোলিভিয়া সময়", "CLT": "চিলি মানক সময়", "ACWDT": "অস্ট্রেলীয় কেন্দ্রীয় পশ্চিমি দিবালোক সময়", "AWDT": "অস্ট্রেলীয় পশ্চিমি দিবালোক সময়", "ART": "আর্জেনটিনা মানক সময়", "MST": "পার্বত্য অঞ্চলের প্রমাণ সময়", "SRT": "সুরিনাম সময়", "HKT": "হং কং মানক সময়", "CHADT": "চ্যাথাম দিবালোক সময়", "ARST": "আর্জেনটিনা গৃষ্মকালীন সময়", "AKDT": "আলাস্কা দিবালোক সময়", "UYST": "উরুগুয়ে গ্রীষ্মকালীন সময়", "BT": "ভুটান সময়", "WIT": "পূর্ব ইন্দোনেশিয়া সময়", "CHAST": "চ্যাথাম মানক সময়", "HNT": "নিউফাউন্ডল্যান্ড মানক সময়", "COST": "কোলোম্বিয়া গ্রীষ্মকালীন সময়", "TMT": "তুর্কমেনিস্তান মানক সময়", "AEDT": "অস্ট্রেলীয় পূর্ব দিবালোক সময়", "MDT": "পার্বত্য অঞ্চলের দিনের সময়", "UYT": "উরুগুয়ে মানক সময়", "∅∅∅": "পেরু গ্রীষ্মকালীন সময়", "WART": "পশ্চিমি আর্জেনটিনার প্রমাণ সময়", "EDT": "পূর্বাঞ্চলের দিবালোক সময়", "PST": "প্রশান্ত মহাসাগরীয় অঞ্চলের প্রমাণ সময়", "MEZ": "মধ্য ইউরোপের প্রমাণ সময়", "OEZ": "পূর্ব ইউরোপের প্রমাণ সময়", "TMST": "তুর্কমেনিস্তান গ্রীষ্মকালীন সময়", "NZDT": "নিউজিল্যান্ড দিবালোক সময়", "SGT": "সিঙ্গাপুর মানক সময়", "GYT": "গুয়ানা সময়", "ACDT": "অস্ট্রেলীয় কেন্দ্রীয় দিবালোক সময়", "AWST": "অস্ট্রেলিয়ান পশ্চিমি মানক সময়", "JDT": "জাপান দিবালোক সময়", "HAST": "হাওয়াই-আলেউত মানক সময়", "HADT": "হাওয়াই-আলেউত দিবালোক সময়", "WAST": "পশ্চিম আফ্রিকা গ্রীষ্মকালীন সময়", "EAT": "পূর্ব আফ্রিকা সময়", "SAST": "দক্ষিণ আফ্রিকা মানক সময়", "MESZ": "মধ্য ইউরোপের গ্রীষ্মকালীন সময়", "EST": "পূর্বাঞ্চলের প্রমাণ সময়", "GMT": "গ্রীনিচ মিন টাইম", "WEZ": "পশ্চিম ইউরোপের প্রমাণ সময়", "WAT": "পশ্চিম আফ্রিকা মানক সময়", "ACWST": "অস্ট্রেলীয় কেন্দ্রীয় পশ্চিমি মানক সময়", "WITA": "কেন্দ্রীয় ইন্দোনেশিয়া সময়", "JST": "জাপান মানক সময়", "AEST": "অস্ট্রেলীয় পূর্ব মানক সময়", "CST": "কেন্দ্রীয় মানক সময়", "GFT": "ফরাসি গায়ানা সময়", "PDT": "প্রশান্ত মহাসাগরীয় অঞ্চলের দিনের সময়", "CAT": "মধ্য আফ্রিকা সময়", "LHST": "লর্ড হাওয়ে মানক মসয়", "ECT": "ইকুয়েডর সময়", "VET": "ভেনেজুয়েলা সময়", "IST": "ভারতীয় মানক সময়", "NZST": "নিউজিল্যান্ড মানক সময়", "HAT": "নিউফাউন্ডল্যান্ড দিবালোক সময়", "CLST": "চিলি গ্রীষ্মকাল সময়", "HKST": "হং কং গ্রীষ্মকালীন সময়", "CDT": "কেন্দ্রীয় দিবালোক সময়", "MYT": "মালয়েশিয়া সময়", "ACST": "অস্ট্রেলীয় কেন্দ্রীয় মানক সময়", "AKST": "আলাস্কা মানক সময়", "WIB": "পশ্চিমী ইন্দোনেশিয়া সময়", "OESZ": "পূর্ব ইউরোপের গ্রীষ্মকালীন সময়", "LHDT": "লর্ড হাওয়ে দিবালোক মসয়", "WARST": "পশ্চিমি আর্জেনটিনা গৃষ্মকালীন সময়", "AST": "অতলান্তিক মানক সময়", "ADT": "অতলান্তিক দিবালোক সময়", "COT": "কোলোম্বিয়া মানক সময়", "ChST": "চামেরো মানক সময়"},
}
}
diff --git a/bn_BD/bn_BD_test.go b/bn_BD/bn_BD_test.go
new file mode 100644
index 00000000..55bde34d
--- /dev/null
+++ b/bn_BD/bn_BD_test.go
@@ -0,0 +1,1120 @@
+package bn_BD
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "bn_BD"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/bn_IN/bn_IN.go b/bn_IN/bn_IN.go
index 213ef305..43b685cc 100644
--- a/bn_IN/bn_IN.go
+++ b/bn_IN/bn_IN.go
@@ -65,7 +65,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"খ্রিস্টপূর্ব", "খৃষ্টাব্দ"},
erasNarrow: []string{"", ""},
erasWide: []string{"খ্রিস্টপূর্ব", "খৃষ্টাব্দ"},
- timezones: map[string]string{"∅∅∅": "অ্যামাজন গ্রীষ্মকালীন সময়", "LHST": "লর্ড হাওয়ে মানক মসয়", "BOT": "বোলিভিয়া সময়", "EST": "পূর্বাঞ্চলের প্রমাণ সময়", "EDT": "পূর্বাঞ্চলের দিবালোক সময়", "WAT": "পশ্চিম আফ্রিকা মানক সময়", "OEZ": "পূর্ব ইউরোপের প্রমাণ সময়", "GMT": "গ্রীনিচ মিন টাইম", "AST": "অতলান্তিক মানক সময়", "ADT": "অতলান্তিক দিবালোক সময়", "PDT": "প্রশান্ত মহাসাগরীয় অঞ্চলের দিনের সময়", "ACWST": "অস্ট্রেলীয় কেন্দ্রীয় পশ্চিমি মানক সময়", "COST": "কোলোম্বিয়া গ্রীষ্মকালীন সময়", "GFT": "ফরাসি গায়ানা সময়", "EAT": "পূর্ব আফ্রিকা সময়", "JDT": "জাপান দিবালোক সময়", "ACWDT": "অস্ট্রেলীয় কেন্দ্রীয় পশ্চিমি দিবালোক সময়", "AEDT": "অস্ট্রেলীয় পূর্ব দিবালোক সময়", "ECT": "ইকুয়েডর সময়", "CAT": "মধ্য আফ্রিকা সময়", "HAST": "হাওয়াই-আলেউত মানক সময়", "TMT": "তুর্কমেনিস্তান মানক সময়", "NZDT": "নিউজিল্যান্ড দিবালোক সময়", "VET": "ভেনেজুয়েলা সময়", "UYT": "উরুগুয়ে মানক সময়", "HNT": "নিউফাউন্ডল্যান্ড মানক সময়", "MDT": "মাকাও গ্রীষ্মকাল সময়", "GYT": "গুয়ানা সময়", "ART": "আর্জেনটিনা মানক সময়", "ARST": "আর্জেনটিনা গৃষ্মকালীন সময়", "MYT": "মালয়েশিয়া সময়", "JST": "জাপান মানক সময়", "MESZ": "মধ্য ইউরোপের গ্রীষ্মকালীন সময়", "WARST": "পশ্চিমি আর্জেনটিনা গৃষ্মকালীন সময়", "BT": "ভুটান সময়", "WIT": "পূর্ব ইন্দোনেশিয়া সময়", "LHDT": "লর্ড হাওয়ে দিবালোক মসয়", "PST": "প্রশান্ত মহাসাগরীয় অঞ্চলের প্রমাণ সময়", "CDT": "কেন্দ্রীয় দিবালোক সময়", "CLT": "চিলি মানক সময়", "HKT": "হং কং মানক সময়", "HAT": "নিউফাউন্ডল্যান্ড দিবালোক সময়", "OESZ": "পূর্ব ইউরোপের গ্রীষ্মকালীন সময়", "ACDT": "অস্ট্রেলীয় কেন্দ্রীয় দিবালোক সময়", "AWDT": "অস্ট্রেলীয় পশ্চিমি দিবালোক সময়", "ChST": "চামেরো মানক সময়", "COT": "কোলোম্বিয়া মানক সময়", "HADT": "হাওয়াই-আলেউত দিবালোক সময়", "SGT": "সিঙ্গাপুর মানক সময়", "HKST": "হং কং গ্রীষ্মকালীন সময়", "CLST": "চিলি গ্রীষ্মকাল সময়", "WEZ": "পশ্চিম ইউরোপের প্রমাণ সময়", "AKST": "আলাস্কা মানক সময়", "AEST": "অস্ট্রেলীয় পূর্ব মানক সময়", "CHAST": "চ্যাথাম মানক সময়", "UYST": "উরুগুয়ে গ্রীষ্মকালীন সময়", "WART": "পশ্চিমি আর্জেনটিনার প্রমাণ সময়", "WITA": "কেন্দ্রীয় ইন্দোনেশিয়া সময়", "IST": "ভারতীয় মানক সময়", "SRT": "সুরিনাম সময়", "AWST": "অস্ট্রেলিয়ান পশ্চিমি মানক সময়", "WIB": "পশ্চিমী ইন্দোনেশিয়া সময়", "NZST": "নিউজিল্যান্ড মানক সময়", "CST": "কেন্দ্রীয় মানক সময়", "CHADT": "চ্যাথাম দিবালোক সময়", "WAST": "পশ্চিম আফ্রিকা গ্রীষ্মকালীন সময়", "TMST": "তুর্কমেনিস্তান গ্রীষ্মকালীন সময়", "ACST": "অস্ট্রেলীয় কেন্দ্রীয় মানক সময়", "MEZ": "মধ্য ইউরোপের প্রমাণ সময়", "WESZ": "পশ্চিম ইউরোপের গ্রীষ্মকালীন সময়", "SAST": "দক্ষিণ আফ্রিকা মানক সময়", "MST": "মাকাও মান সময়", "AKDT": "আলাস্কা দিবালোক সময়"},
+ timezones: map[string]string{"AKST": "আলাস্কা মানক সময়", "OESZ": "পূর্ব ইউরোপের গ্রীষ্মকালীন সময়", "ChST": "চামেরো মানক সময়", "UYT": "উরুগুয়ে মানক সময়", "WARST": "পশ্চিমি আর্জেনটিনা গৃষ্মকালীন সময়", "HKST": "হং কং গ্রীষ্মকালীন সময়", "ART": "আর্জেনটিনা মানক সময়", "IST": "ভারতীয় মানক সময়", "WAT": "পশ্চিম আফ্রিকা মানক সময়", "TMT": "তুর্কমেনিস্তান মানক সময়", "BT": "ভুটান সময়", "SRT": "সুরিনাম সময়", "ARST": "আর্জেনটিনা গৃষ্মকালীন সময়", "BOT": "বোলিভিয়া সময়", "MDT": "মাকাও গ্রীষ্মকাল সময়", "HKT": "হং কং মানক সময়", "ACWST": "অস্ট্রেলীয় কেন্দ্রীয় পশ্চিমি মানক সময়", "NZST": "নিউজিল্যান্ড মানক সময়", "WEZ": "পশ্চিম ইউরোপের প্রমাণ সময়", "PST": "প্রশান্ত মহাসাগরীয় অঞ্চলের প্রমাণ সময়", "NZDT": "নিউজিল্যান্ড দিবালোক সময়", "CAT": "মধ্য আফ্রিকা সময়", "WESZ": "পশ্চিম ইউরোপের গ্রীষ্মকালীন সময়", "CHAST": "চ্যাথাম মানক সময়", "VET": "ভেনেজুয়েলা সময়", "AST": "অতলান্তিক মানক সময়", "JST": "জাপান মানক সময়", "COST": "কোলোম্বিয়া গ্রীষ্মকালীন সময়", "EDT": "পূর্বাঞ্চলের দিবালোক সময়", "MESZ": "মধ্য ইউরোপের গ্রীষ্মকালীন সময়", "LHST": "লর্ড হাওয়ে মানক মসয়", "CLT": "চিলি মানক সময়", "WIB": "পশ্চিমী ইন্দোনেশিয়া সময়", "GYT": "গুয়ানা সময়", "CST": "কেন্দ্রীয় মানক সময়", "WART": "পশ্চিমি আর্জেনটিনার প্রমাণ সময়", "GFT": "ফরাসি গায়ানা সময়", "AWST": "অস্ট্রেলিয়ান পশ্চিমি মানক সময়", "AWDT": "অস্ট্রেলীয় পশ্চিমি দিবালোক সময়", "EST": "পূর্বাঞ্চলের প্রমাণ সময়", "COT": "কোলোম্বিয়া মানক সময়", "TMST": "তুর্কমেনিস্তান গ্রীষ্মকালীন সময়", "WITA": "কেন্দ্রীয় ইন্দোনেশিয়া সময়", "CLST": "চিলি গ্রীষ্মকাল সময়", "WIT": "পূর্ব ইন্দোনেশিয়া সময়", "ACST": "অস্ট্রেলীয় কেন্দ্রীয় মানক সময়", "∅∅∅": "এজোরেস গ্রীষ্মকালীন সময়", "HNT": "নিউফাউন্ডল্যান্ড মানক সময়", "LHDT": "লর্ড হাওয়ে দিবালোক মসয়", "MYT": "মালয়েশিয়া সময়", "CHADT": "চ্যাথাম দিবালোক সময়", "MEZ": "মধ্য ইউরোপের প্রমাণ সময়", "HAST": "হাওয়াই-আলেউত মানক সময়", "OEZ": "পূর্ব ইউরোপের প্রমাণ সময়", "GMT": "গ্রীনিচ মিন টাইম", "CDT": "কেন্দ্রীয় দিবালোক সময়", "ACWDT": "অস্ট্রেলীয় কেন্দ্রীয় পশ্চিমি দিবালোক সময়", "SAST": "দক্ষিণ আফ্রিকা মানক সময়", "PDT": "প্রশান্ত মহাসাগরীয় অঞ্চলের দিনের সময়", "WAST": "পশ্চিম আফ্রিকা গ্রীষ্মকালীন সময়", "AEST": "অস্ট্রেলীয় পূর্ব মানক সময়", "UYST": "উরুগুয়ে গ্রীষ্মকালীন সময়", "MST": "মাকাও মান সময়", "AKDT": "আলাস্কা দিবালোক সময়", "HADT": "হাওয়াই-আলেউত দিবালোক সময়", "HAT": "নিউফাউন্ডল্যান্ড দিবালোক সময়", "AEDT": "অস্ট্রেলীয় পূর্ব দিবালোক সময়", "EAT": "পূর্ব আফ্রিকা সময়", "ECT": "ইকুয়েডর সময়", "ADT": "অতলান্তিক দিবালোক সময়", "JDT": "জাপান দিবালোক সময়", "SGT": "সিঙ্গাপুর মানক সময়", "ACDT": "অস্ট্রেলীয় কেন্দ্রীয় দিবালোক সময়"},
}
}
diff --git a/bn_IN/bn_IN_test.go b/bn_IN/bn_IN_test.go
new file mode 100644
index 00000000..bdee61d9
--- /dev/null
+++ b/bn_IN/bn_IN_test.go
@@ -0,0 +1,1120 @@
+package bn_IN
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "bn_IN"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/bo/bo.go b/bo/bo.go
index 218c2aef..fcb68cf0 100644
--- a/bo/bo.go
+++ b/bo/bo.go
@@ -64,7 +64,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"སྤྱི་ལོ་སྔོན་", "སྤྱི་ལོ་"},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"HADT": "HADT", "WAT": "WAT", "ACST": "ACST", "SGT": "SGT", "CST": "CST", "MEZ": "MEZ", "ACWST": "ACWST", "HKST": "HKST", "IST": "IST", "OEZ": "OEZ", "CHAST": "CHAST", "∅∅∅": "∅∅∅", "JST": "JST", "NZST": "NZST", "CHADT": "CHADT", "GFT": "GFT", "MDT": "MDT", "AKST": "AKST", "AKDT": "AKDT", "PST": "PST", "PDT": "PDT", "CLT": "CLT", "EDT": "EDT", "COT": "COT", "SAST": "SAST", "HNT": "HNT", "EAT": "EAT", "TMT": "TMT", "TMST": "TMST", "BOT": "BOT", "WESZ": "WESZ", "ACWDT": "ACWDT", "BT": "BT", "HKT": "HKT", "UYST": "UYST", "MST": "MST", "AWDT": "AWDT", "GYT": "GYT", "WEZ": "WEZ", "CLST": "CLST", "COST": "COST", "AST": "AST", "ARST": "ARST", "AWST": "AWST", "WARST": "WARST", "HAT": "HAT", "NZDT": "NZDT", "UYT": "UYT", "GMT": "GMT", "WITA": "WITA", "MESZ": "MESZ", "ADT": "ADT", "OESZ": "OESZ", "LHST": "LHST", "MYT": "MYT", "CDT": "CDT", "ChST": "ChST", "HAST": "HAST", "LHDT": "LHDT", "SRT": "SRT", "AEST": "AEST", "AEDT": "AEDT", "VET": "VET", "CAT": "CAT", "ECT": "ECT", "WIT": "WIT", "JDT": "JDT", "WAST": "WAST", "WART": "WART", "WIB": "WIB", "ACDT": "ACDT", "ART": "ART", "EST": "EST"},
+ timezones: map[string]string{"HADT": "HADT", "HAT": "HAT", "AEST": "AEST", "EAT": "EAT", "WART": "WART", "∅∅∅": "∅∅∅", "MST": "MST", "CHADT": "CHADT", "BOT": "BOT", "UYST": "UYST", "SRT": "SRT", "WEZ": "WEZ", "GYT": "GYT", "ACDT": "ACDT", "VET": "VET", "JDT": "JDT", "AST": "AST", "MESZ": "MESZ", "EST": "EST", "SGT": "SGT", "OEZ": "OEZ", "UYT": "UYT", "HKT": "HKT", "OESZ": "OESZ", "CDT": "CDT", "ACST": "ACST", "EDT": "EDT", "ChST": "ChST", "ECT": "ECT", "AWDT": "AWDT", "ACWDT": "ACWDT", "CAT": "CAT", "WARST": "WARST", "MEZ": "MEZ", "SAST": "SAST", "TMT": "TMT", "WESZ": "WESZ", "GFT": "GFT", "WIT": "WIT", "CST": "CST", "JST": "JST", "IST": "IST", "TMST": "TMST", "GMT": "GMT", "CLT": "CLT", "LHDT": "LHDT", "HKST": "HKST", "HAST": "HAST", "COST": "COST", "WAT": "WAT", "WAST": "WAST", "AWST": "AWST", "ART": "ART", "PST": "PST", "NZDT": "NZDT", "BT": "BT", "CHAST": "CHAST", "ADT": "ADT", "AEDT": "AEDT", "MDT": "MDT", "AKDT": "AKDT", "NZST": "NZST", "HNT": "HNT", "COT": "COT", "WIB": "WIB", "MYT": "MYT", "CLST": "CLST", "ARST": "ARST", "WITA": "WITA", "AKST": "AKST", "ACWST": "ACWST", "PDT": "PDT", "LHST": "LHST"},
}
}
@@ -120,7 +120,7 @@ func (bo *bo) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (bo *bo) MonthsNarrow() []string {
- return bo.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/bo/bo_test.go b/bo/bo_test.go
new file mode 100644
index 00000000..33fcc1bb
--- /dev/null
+++ b/bo/bo_test.go
@@ -0,0 +1,1120 @@
+package bo
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "bo"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/bo_CN/bo_CN.go b/bo_CN/bo_CN.go
index 5fb58e03..9d7753e9 100644
--- a/bo_CN/bo_CN.go
+++ b/bo_CN/bo_CN.go
@@ -64,7 +64,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"སྤྱི་ལོ་སྔོན་", "སྤྱི་ལོ་"},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"MESZ": "MESZ", "ECT": "ECT", "HNT": "HNT", "IST": "IST", "MYT": "MYT", "PDT": "PDT", "JDT": "JDT", "HKST": "HKST", "GFT": "GFT", "WIT": "WIT", "TMST": "TMST", "ACST": "ACST", "ACDT": "ACDT", "WAST": "WAST", "WIB": "WIB", "COT": "COT", "HKT": "HKT", "ARST": "ARST", "AKDT": "AKDT", "NZDT": "NZDT", "WART": "WART", "WITA": "WITA", "EAT": "EAT", "GYT": "GYT", "OESZ": "OESZ", "CST": "CST", "NZST": "NZST", "∅∅∅": "∅∅∅", "COST": "COST", "WARST": "WARST", "GMT": "GMT", "UYST": "UYST", "CLT": "CLT", "HAT": "HAT", "MDT": "MDT", "LHST": "LHST", "AWDT": "AWDT", "ACWDT": "ACWDT", "ART": "ART", "SRT": "SRT", "AKST": "AKST", "MEZ": "MEZ", "WEZ": "WEZ", "ACWST": "ACWST", "EST": "EST", "HAST": "HAST", "WAT": "WAT", "AWST": "AWST", "UYT": "UYT", "AEST": "AEST", "EDT": "EDT", "OEZ": "OEZ", "TMT": "TMT", "PST": "PST", "AST": "AST", "BT": "BT", "MST": "MST", "BOT": "BOT", "CDT": "CDT", "ADT": "ADT", "SAST": "SAST", "CLST": "CLST", "ChST": "ChST", "CHAST": "CHAST", "CHADT": "CHADT", "CAT": "CAT", "HADT": "HADT", "SGT": "SGT", "LHDT": "LHDT", "JST": "JST", "VET": "VET", "WESZ": "WESZ", "AEDT": "AEDT"},
+ timezones: map[string]string{"EAT": "EAT", "LHST": "LHST", "PDT": "PDT", "MST": "MST", "HKT": "HKT", "CHADT": "CHADT", "ADT": "ADT", "ARST": "ARST", "TMST": "TMST", "BT": "BT", "WIT": "WIT", "ACWDT": "ACWDT", "COT": "COT", "ACDT": "ACDT", "EDT": "EDT", "OESZ": "OESZ", "HKST": "HKST", "EST": "EST", "PST": "PST", "HAST": "HAST", "NZDT": "NZDT", "BOT": "BOT", "GFT": "GFT", "WEZ": "WEZ", "OEZ": "OEZ", "GYT": "GYT", "CLST": "CLST", "CDT": "CDT", "AST": "AST", "MEZ": "MEZ", "NZST": "NZST", "COST": "COST", "MDT": "MDT", "MYT": "MYT", "CLT": "CLT", "AKST": "AKST", "AWST": "AWST", "ART": "ART", "JST": "JST", "SAST": "SAST", "CST": "CST", "ACST": "ACST", "ACWST": "ACWST", "AWDT": "AWDT", "HADT": "HADT", "GMT": "GMT", "JDT": "JDT", "WAT": "WAT", "HNT": "HNT", "UYST": "UYST", "CHAST": "CHAST", "MESZ": "MESZ", "WAST": "WAST", "WIB": "WIB", "∅∅∅": "∅∅∅", "WARST": "WARST", "AKDT": "AKDT", "CAT": "CAT", "AEDT": "AEDT", "LHDT": "LHDT", "TMT": "TMT", "ChST": "ChST", "UYT": "UYT", "ECT": "ECT", "IST": "IST", "HAT": "HAT", "SGT": "SGT", "WART": "WART", "SRT": "SRT", "VET": "VET", "WITA": "WITA", "WESZ": "WESZ", "AEST": "AEST"},
}
}
@@ -120,7 +120,7 @@ func (bo *bo_CN) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (bo *bo_CN) MonthsNarrow() []string {
- return bo.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/bo_CN/bo_CN_test.go b/bo_CN/bo_CN_test.go
new file mode 100644
index 00000000..f4e143a8
--- /dev/null
+++ b/bo_CN/bo_CN_test.go
@@ -0,0 +1,1120 @@
+package bo_CN
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "bo_CN"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/bo_IN/bo_IN.go b/bo_IN/bo_IN.go
index 443a7d07..bf4a2a38 100644
--- a/bo_IN/bo_IN.go
+++ b/bo_IN/bo_IN.go
@@ -64,7 +64,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"སྤྱི་ལོ་སྔོན་", "སྤྱི་ལོ་"},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"CLT": "CLT", "COT": "COT", "ADT": "ADT", "LHST": "LHST", "WEZ": "WEZ", "ChST": "ChST", "ARST": "ARST", "MEZ": "MEZ", "AST": "AST", "WITA": "WITA", "UYST": "UYST", "AEST": "AEST", "CHAST": "CHAST", "HAST": "HAST", "ACST": "ACST", "AKDT": "AKDT", "NZDT": "NZDT", "HADT": "HADT", "IST": "IST", "HAT": "HAT", "AKST": "AKST", "AWST": "AWST", "VET": "VET", "CST": "CST", "CHADT": "CHADT", "HKT": "HKT", "AEDT": "AEDT", "BT": "BT", "HKST": "HKST", "ART": "ART", "TMST": "TMST", "WESZ": "WESZ", "MYT": "MYT", "JST": "JST", "MESZ": "MESZ", "NZST": "NZST", "CAT": "CAT", "EAT": "EAT", "PST": "PST", "AWDT": "AWDT", "WIB": "WIB", "ACWDT": "ACWDT", "WAST": "WAST", "MST": "MST", "MDT": "MDT", "UYT": "UYT", "CDT": "CDT", "EST": "EST", "OESZ": "OESZ", "GMT": "GMT", "JDT": "JDT", "EDT": "EDT", "WART": "WART", "WARST": "WARST", "ACDT": "ACDT", "GYT": "GYT", "COST": "COST", "ECT": "ECT", "HNT": "HNT", "GFT": "GFT", "ACWST": "ACWST", "SAST": "SAST", "OEZ": "OEZ", "∅∅∅": "∅∅∅", "TMT": "TMT", "PDT": "PDT", "WIT": "WIT", "SRT": "SRT", "CLST": "CLST", "SGT": "SGT", "LHDT": "LHDT", "BOT": "BOT", "WAT": "WAT"},
+ timezones: map[string]string{"AKST": "AKST", "MYT": "MYT", "GFT": "GFT", "MST": "MST", "AST": "AST", "AEST": "AEST", "CDT": "CDT", "∅∅∅": "∅∅∅", "JDT": "JDT", "EST": "EST", "HAT": "HAT", "CHADT": "CHADT", "WITA": "WITA", "PST": "PST", "AWST": "AWST", "ACDT": "ACDT", "BT": "BT", "JST": "JST", "MEZ": "MEZ", "COT": "COT", "ChST": "ChST", "LHDT": "LHDT", "ARST": "ARST", "MESZ": "MESZ", "WIB": "WIB", "WAST": "WAST", "MDT": "MDT", "HKT": "HKT", "HAST": "HAST", "OESZ": "OESZ", "TMST": "TMST", "CAT": "CAT", "CLT": "CLT", "COST": "COST", "WAT": "WAT", "GMT": "GMT", "LHST": "LHST", "TMT": "TMT", "CLST": "CLST", "WARST": "WARST", "EDT": "EDT", "PDT": "PDT", "NZDT": "NZDT", "GYT": "GYT", "HNT": "HNT", "AEDT": "AEDT", "WIT": "WIT", "EAT": "EAT", "ECT": "ECT", "ACWST": "ACWST", "ACWDT": "ACWDT", "SAST": "SAST", "SRT": "SRT", "NZST": "NZST", "WEZ": "WEZ", "WESZ": "WESZ", "UYST": "UYST", "CHAST": "CHAST", "ART": "ART", "AKDT": "AKDT", "ADT": "ADT", "AWDT": "AWDT", "BOT": "BOT", "SGT": "SGT", "ACST": "ACST", "OEZ": "OEZ", "UYT": "UYT", "WART": "WART", "CST": "CST", "VET": "VET", "HKST": "HKST", "HADT": "HADT", "IST": "IST"},
}
}
@@ -120,7 +120,7 @@ func (bo *bo_IN) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (bo *bo_IN) MonthsNarrow() []string {
- return bo.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/bo_IN/bo_IN_test.go b/bo_IN/bo_IN_test.go
new file mode 100644
index 00000000..b1575406
--- /dev/null
+++ b/bo_IN/bo_IN_test.go
@@ -0,0 +1,1120 @@
+package bo_IN
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "bo_IN"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/br/br.go b/br/br.go
index 3ee07d0a..2fdaf98a 100644
--- a/br/br.go
+++ b/br/br.go
@@ -66,7 +66,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a-raok J.K.", "goude J.K."},
erasNarrow: []string{"a-raok J.K.", "goude J.K."},
erasWide: []string{"a-raok Jezuz-Krist", "goude Jezuz-Krist"},
- timezones: map[string]string{"CHAST": "eur cʼhoañv Chatham", "EDT": "eur hañv ar Reter", "HNT": "eur cʼhoañv Newfoundland", "AWST": "eur cʼhoañv Aostralia ar Cʼhornôg", "AKDT": "eur hañv Alaska", "NZST": "eur cʼhoañv Zeland-Nevez", "HKST": "eur hañv Hong Kong", "OEZ": "eur cʼhoañv Europa ar Reter", "TMST": "eur hañv Turkmenistan", "PST": "PST", "AWDT": "eur hañv Aostralia ar Cʼhornôg", "MESZ": "eur hañv Kreizeuropa", "WESZ": "eur hañv Europa ar Cʼhornôg", "CAT": "eur Kreizafrika", "ACDT": "eur hañv Kreizaostralia", "AEST": "eur cʼhoañv Aostralia ar Reter", "AEDT": "eur hañv Aostralia ar Reter", "WEZ": "eur cʼhoañv Europa ar Cʼhornôg", "HKT": "eur cʼhoañv Hong Kong", "WART": "eur cʼhoañv Arcʼhantina ar Cʼhornôg", "CST": "CST", "MST": "eur cʼhoañv ar Menezioù", "∅∅∅": "eur hañv Brasília", "GMT": "Amzer keitat Greenwich (AKG)", "JST": "eur cʼhoañv Japan", "WITA": "WITA", "ART": "eur cʼhoañv Arcʼhantina", "ARST": "eur hañv Arcʼhantina", "COST": "eur hañv Kolombia", "HADT": "HADT", "PDT": "PDT", "UYT": "eur cʼhoañv Uruguay", "ACWST": "eur cʼhoañv Kreizaostralia ar Cʼhornôg", "IST": "eur cʼhoañv India", "EAT": "eur Afrika ar Reter", "ACWDT": "eur hañv Kreizaostralia ar Cʼhornôg", "VET": "eur Venezuela", "AST": "AST", "SAST": "eur cʼhoañv Suafrika", "WIT": "eur Indonezia ar Reter", "ACST": "eur cʼhoañv Kreizaostralia", "CLST": "eur hañv Chile", "HAST": "HAST", "WAT": "eur cʼhoañv Afrika ar Cʼhornôg", "WAST": "eur hañv Afrika ar Cʼhornôg", "WARST": "eur hañv Arcʼhantina ar Cʼhornôg", "GFT": "eur Gwiana cʼhall", "GYT": "eur Guyana", "CDT": "CDT", "ChST": "ChST", "CLT": "eur cʼhoañv Chile", "EST": "eur cʼhoañv ar Reter", "OESZ": "eur hañv Europa ar Reter", "LHST": "LHST", "LHDT": "LHDT", "JDT": "eur hañv Japan", "WIB": "eur Indonezia ar Cʼhornôg", "TMT": "eur cʼhoañv Turkmenistan", "MYT": "eur Malaysia", "MEZ": "eur cʼhoañv Kreizeuropa", "NZDT": "eur hañv Zeland-Nevez", "ADT": "ADT", "HAT": "eur hañv Newfoundland", "UYST": "eur hañv Uruguay", "MDT": "eur hañv ar Menezioù", "COT": "eur cʼhoañv Kolombia", "SGT": "eur cʼhoañv Singapour", "BT": "eur Bhoutan", "AKST": "eur cʼhoañv Alaska", "BOT": "eur Bolivia", "CHADT": "eur hañv Chatham", "ECT": "eur Ecuador", "SRT": "eur Surinam"},
+ timezones: map[string]string{"GFT": "eur Gwiana cʼhall", "WAST": "eur hañv Afrika ar Cʼhornôg", "VET": "eur Venezuela", "ECT": "eur Ecuador", "UYT": "eur cʼhoañv Uruguay", "EAT": "eur Afrika ar Reter", "ADT": "ADT", "EDT": "eur hañv ar Reter", "PDT": "PDT", "MESZ": "eur hañv Kreizeuropa", "MST": "eur cʼhoañv ar Menezioù", "GMT": "Amzer keitat Greenwich (AKG)", "ChST": "ChST", "LHST": "LHST", "ACDT": "eur hañv Kreizaostralia", "JST": "eur cʼhoañv Japan", "AKST": "eur cʼhoañv Alaska", "HNT": "eur cʼhoañv Newfoundland", "BT": "eur Bhoutan", "MEZ": "eur cʼhoañv Kreizeuropa", "HAST": "HAST", "SGT": "eur cʼhoañv Singapour", "LHDT": "LHDT", "AKDT": "eur hañv Alaska", "OESZ": "eur hañv Europa ar Reter", "WIT": "eur Indonezia ar Reter", "SRT": "eur Surinam", "CLT": "eur cʼhoañv Chile", "AEDT": "eur hañv Aostralia ar Reter", "UYST": "eur hañv Uruguay", "AWST": "eur cʼhoañv Aostralia ar Cʼhornôg", "WEZ": "eur cʼhoañv Europa ar Cʼhornôg", "GYT": "eur Guyana", "ACST": "eur cʼhoañv Kreizaostralia", "HKST": "eur hañv Hong Kong", "HADT": "HADT", "TMT": "eur cʼhoañv Turkmenistan", "COT": "eur cʼhoañv Kolombia", "MDT": "eur hañv ar Menezioù", "BOT": "eur Bolivia", "HAT": "eur hañv Newfoundland", "CLST": "eur hañv Chile", "ACWST": "eur cʼhoañv Kreizaostralia ar Cʼhornôg", "WIB": "eur Indonezia ar Cʼhornôg", "∅∅∅": "eur hañv Perou", "WARST": "eur hañv Arcʼhantina ar Cʼhornôg", "CDT": "CDT", "IST": "eur cʼhoañv India", "EST": "eur cʼhoañv ar Reter", "OEZ": "eur cʼhoañv Europa ar Reter", "WESZ": "eur hañv Europa ar Cʼhornôg", "CAT": "eur Kreizafrika", "AEST": "eur cʼhoañv Aostralia ar Reter", "MYT": "eur Malaysia", "CST": "CST", "ACWDT": "eur hañv Kreizaostralia ar Cʼhornôg", "AWDT": "eur hañv Aostralia ar Cʼhornôg", "WAT": "eur cʼhoañv Afrika ar Cʼhornôg", "ARST": "eur hañv Arcʼhantina", "NZDT": "eur hañv Zeland-Nevez", "SAST": "eur cʼhoañv Suafrika", "ART": "eur cʼhoañv Arcʼhantina", "TMST": "eur hañv Turkmenistan", "WART": "eur cʼhoañv Arcʼhantina ar Cʼhornôg", "HKT": "eur cʼhoañv Hong Kong", "WITA": "WITA", "JDT": "eur hañv Japan", "PST": "PST", "COST": "eur hañv Kolombia", "CHADT": "eur hañv Chatham", "AST": "AST", "NZST": "eur cʼhoañv Zeland-Nevez", "CHAST": "eur cʼhoañv Chatham"},
}
}
diff --git a/br/br_test.go b/br/br_test.go
new file mode 100644
index 00000000..f19012b0
--- /dev/null
+++ b/br/br_test.go
@@ -0,0 +1,1120 @@
+package br
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "br"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/br_FR/br_FR.go b/br_FR/br_FR.go
index a76c7fc7..f4f5771c 100644
--- a/br_FR/br_FR.go
+++ b/br_FR/br_FR.go
@@ -66,7 +66,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a-raok J.K.", "goude J.K."},
erasNarrow: []string{"a-raok J.K.", "goude J.K."},
erasWide: []string{"a-raok Jezuz-Krist", "goude Jezuz-Krist"},
- timezones: map[string]string{"CST": "CST", "AEDT": "eur hañv Aostralia ar Reter", "MDT": "eur hañv ar Menezioù", "HADT": "HADT", "GMT": "Amzer keitat Greenwich (AKG)", "CLT": "eur cʼhoañv Chile", "EDT": "eur hañv ar Reter", "ECT": "eur Ecuador", "HNT": "eur cʼhoañv Newfoundland", "VET": "eur Venezuela", "CAT": "eur Kreizafrika", "OEZ": "eur cʼhoañv Europa ar Reter", "PST": "PST", "UYST": "eur hañv Uruguay", "WEZ": "eur cʼhoañv Europa ar Cʼhornôg", "BT": "eur Bhoutan", "IST": "eur cʼhoañv India", "SRT": "eur Surinam", "WART": "eur cʼhoañv Arcʼhantina ar Cʼhornôg", "TMT": "eur cʼhoañv Turkmenistan", "JDT": "eur hañv Japan", "CDT": "CDT", "ADT": "ADT", "WAT": "eur cʼhoañv Afrika ar Cʼhornôg", "HKT": "eur cʼhoañv Hong Kong", "GFT": "eur Gwiana cʼhall", "AWST": "eur cʼhoañv Aostralia ar Cʼhornôg", "GYT": "eur Guyana", "BOT": "eur Bolivia", "ACWDT": "eur hañv Kreizaostralia ar Cʼhornôg", "EST": "eur cʼhoañv ar Reter", "SGT": "eur cʼhoañv Singapour", "WIT": "eur Indonezia ar Reter", "WIB": "eur Indonezia ar Cʼhornôg", "UYT": "eur cʼhoañv Uruguay", "MST": "eur cʼhoañv ar Menezioù", "WARST": "eur hañv Arcʼhantina ar Cʼhornôg", "EAT": "eur Afrika ar Reter", "ACDT": "eur hañv Kreizaostralia", "AKDT": "eur hañv Alaska", "MESZ": "eur hañv Kreizeuropa", "CHAST": "eur cʼhoañv Chatham", "∅∅∅": "eur hañv Brasília", "HKST": "eur hañv Hong Kong", "HAT": "eur hañv Newfoundland", "MYT": "eur Malaysia", "MEZ": "eur cʼhoañv Kreizeuropa", "ACWST": "eur cʼhoañv Kreizaostralia ar Cʼhornôg", "HAST": "HAST", "ART": "eur cʼhoañv Arcʼhantina", "TMST": "eur hañv Turkmenistan", "JST": "eur cʼhoañv Japan", "AKST": "eur cʼhoañv Alaska", "ChST": "ChST", "COT": "eur cʼhoañv Kolombia", "ARST": "eur hañv Arcʼhantina", "LHST": "LHST", "LHDT": "LHDT", "PDT": "PDT", "COST": "eur hañv Kolombia", "AST": "AST", "SAST": "eur cʼhoañv Suafrika", "ACST": "eur cʼhoañv Kreizaostralia", "NZST": "eur cʼhoañv Zeland-Nevez", "NZDT": "eur hañv Zeland-Nevez", "AEST": "eur cʼhoañv Aostralia ar Reter", "CHADT": "eur hañv Chatham", "WAST": "eur hañv Afrika ar Cʼhornôg", "AWDT": "eur hañv Aostralia ar Cʼhornôg", "CLST": "eur hañv Chile", "WESZ": "eur hañv Europa ar Cʼhornôg", "OESZ": "eur hañv Europa ar Reter", "WITA": "WITA"},
+ timezones: map[string]string{"WAST": "eur hañv Afrika ar Cʼhornôg", "COT": "eur cʼhoañv Kolombia", "ECT": "eur Ecuador", "JDT": "eur hañv Japan", "IST": "eur cʼhoañv India", "WAT": "eur cʼhoañv Afrika ar Cʼhornôg", "WARST": "eur hañv Arcʼhantina ar Cʼhornôg", "CHAST": "eur cʼhoañv Chatham", "AWST": "eur cʼhoañv Aostralia ar Cʼhornôg", "EDT": "eur hañv ar Reter", "HNT": "eur cʼhoañv Newfoundland", "AEDT": "eur hañv Aostralia ar Reter", "WIT": "eur Indonezia ar Reter", "VET": "eur Venezuela", "ADT": "ADT", "WEZ": "eur cʼhoañv Europa ar Cʼhornôg", "ACST": "eur cʼhoañv Kreizaostralia", "ART": "eur cʼhoañv Arcʼhantina", "CAT": "eur Kreizafrika", "OESZ": "eur hañv Europa ar Reter", "WART": "eur cʼhoañv Arcʼhantina ar Cʼhornôg", "HKT": "eur cʼhoañv Hong Kong", "HKST": "eur hañv Hong Kong", "AKDT": "eur hañv Alaska", "MESZ": "eur hañv Kreizeuropa", "AEST": "eur cʼhoañv Aostralia ar Reter", "EAT": "eur Afrika ar Reter", "AST": "AST", "SAST": "eur cʼhoañv Suafrika", "WESZ": "eur hañv Europa ar Cʼhornôg", "WIB": "eur Indonezia ar Cʼhornôg", "CST": "CST", "GFT": "eur Gwiana cʼhall", "TMST": "eur hañv Turkmenistan", "MST": "eur cʼhoañv ar Menezioù", "CHADT": "eur hañv Chatham", "ACWST": "eur cʼhoañv Kreizaostralia ar Cʼhornôg", "PST": "PST", "HAT": "eur hañv Newfoundland", "LHST": "LHST", "EST": "eur cʼhoañv ar Reter", "CLT": "eur cʼhoañv Chile", "UYST": "eur hañv Uruguay", "ARST": "eur hañv Arcʼhantina", "WITA": "WITA", "JST": "eur cʼhoañv Japan", "PDT": "PDT", "HAST": "HAST", "GYT": "eur Guyana", "ACWDT": "eur hañv Kreizaostralia ar Cʼhornôg", "AKST": "eur cʼhoañv Alaska", "NZDT": "eur hañv Zeland-Nevez", "LHDT": "LHDT", "MEZ": "eur cʼhoañv Kreizeuropa", "GMT": "Amzer keitat Greenwich (AKG)", "ChST": "ChST", "CDT": "CDT", "AWDT": "eur hañv Aostralia ar Cʼhornôg", "SGT": "eur cʼhoañv Singapour", "OEZ": "eur cʼhoañv Europa ar Reter", "MYT": "eur Malaysia", "∅∅∅": "eur hañv Perou", "NZST": "eur cʼhoañv Zeland-Nevez", "COST": "eur hañv Kolombia", "BT": "eur Bhoutan", "MDT": "eur hañv ar Menezioù", "CLST": "eur hañv Chile", "SRT": "eur Surinam", "TMT": "eur cʼhoañv Turkmenistan", "UYT": "eur cʼhoañv Uruguay", "ACDT": "eur hañv Kreizaostralia", "HADT": "HADT", "BOT": "eur Bolivia"},
}
}
diff --git a/br_FR/br_FR_test.go b/br_FR/br_FR_test.go
new file mode 100644
index 00000000..ff805705
--- /dev/null
+++ b/br_FR/br_FR_test.go
@@ -0,0 +1,1120 @@
+package br_FR
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "br_FR"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/brx/brx.go b/brx/brx.go
index 5e52caa5..8aaca315 100644
--- a/brx/brx.go
+++ b/brx/brx.go
@@ -68,7 +68,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ईसा.पूर्व", "सन"},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"MESZ": "मध्य यूरोप समर टाईम", "HAST": "हवाई आलटन स्टैंडर्ड टाईम", "WAT": "पश्चीम अफ्रीका स्टैंडर्ड टाईम", "WIT": "ईस्टर्न ईंडोनीशिया स्टैंडर्ड टाईम", "CHAST": "चैथम स्टैंडर्ड टाईम", "CLST": "चीली समर टाईम", "WESZ": "वेस्टर्न यूरोप समर टाईम", "CHADT": "चैथम डेलाईट टाईम", "COST": "कोलंबिया समर टाईम", "SGT": "सींगापुर स्टैंडर्ड टाईम", "SAST": "दक्षिण अफ्रीका स्टैंडर्ड टाईम", "WARST": "पश्चीम अर्जण्टिना समर टाईम", "JST": "जपान स्टैंडर्ड टाईम", "COT": "कोलंबिया स्टैंडर्ड टाईम", "ECT": "एक्वाडौर स्टैंडर्ड टाईम", "WAST": "पश्चीम अफ्रीका समर टाईम", "MYT": "मलेशिया स्टैंडर्ड टाईम", "NZDT": "न्युज़ीलैण्ड डेलाईट टाईम", "HAT": "न्युफाऊंडलैण्ड डेलाईट टाईम", "ART": "अर्जनटिना स्टैंडर्ड टाईम", "PST": "पैसीफीक स्टैंडर्ड टाईम", "AWST": "दक्षिण ओस्ट्रेलिया स्टैंडर्ड टाईम", "GYT": "गुयाना स्टैंडर्ड टाईम", "CST": "सैंट्रल अमरिका स्टैंडर्ड टाईम", "CDT": "सैंट्रल अमरिका डेलाईट टाईम", "HKST": "हाँगकॉंग समर टाईम", "NZST": "न्युज़ीलैण्ड स्टैंडर्ड टाईम", "AEST": "पूर्वी ओस्ट्रेलिया स्टैंडर्ड टाईम", "CLT": "चीली स्टैंडर्ड टाईम", "EDT": "ईस्टर्न अमरिका डेलाईट टाईम", "GMT": "ग्रीनीच स्टैंडर्ड टाईम", "AKST": "अलास्का स्टैंडर्ड टाईम", "LHDT": "लार्ड़ होव डेलाईट टाईम", "IST": "भारतीय स्टैंडर्ड टाईम", "TMT": "तुर्कमेनीस्तान स्टैंडर्ड टाईम", "MST": "अमरिका माऊन्टन स्टैंडर्ड टाईम", "CAT": "मध्य अफ्रीका स्टैंडर्ड टाईम", "ACST": "मध्य ओस्ट्रेलिया स्टैंडर्ड टाईम", "ARST": "अर्जण्टिना समर टाईम", "TMST": "तुर्कमेनीस्तान समर टाईम", "PDT": "पैसीफीक डेलाईट टाईम", "OESZ": "ईस्टर्न यूरोप समर टाईम", "GFT": "फ्रान्सीसी गुयाना स्टैंडर्ड टाईम", "HKT": "हाँगकॉंग स्टैंडर्ड टाईम", "OEZ": "ईस्टर्न यूरोप स्टैंडर्ड टाईम", "LHST": "लार्ड़ होव स्टैंडर्ड टाईम", "∅∅∅": "आज़ोर समर टाईम", "WEZ": "वेस्टर्न यूरोप स्टैंडर्ड टाईम", "ACWST": "मध्य-पश्चीम ओस्ट्रेलिया स्टैंडर्ड टाईम", "MDT": "अमरिका माऊन्टन डेलाईट टाईम", "EST": "ईस्टर्न अमरिका स्टैंडर्ड टाईम", "AKDT": "अलास्का डेलाईट टाईम", "JDT": "जपान डेलाईट टाईम", "UYT": "ऊरुगुए स्टैंडर्ड टाईम", "UYST": "ऊरुगुए समर टाईम", "AEDT": "पूर्वी ओस्ट्रेलिया डेलाईट टाईम", "AWDT": "दक्षिण ओस्ट्रेलिया डेलाईट टाईम", "MEZ": "मध्य यूरोप स्टैंडर्ड टाईम", "ChST": "चामरो स्टैंडर्ड टाईम", "AST": "अटलांटीक स्टैंडर्ड टाईम", "ACDT": "मध्य ओस्ट्रेलिया डेलाईट टाईम", "BOT": "बोलिविया स्टैंडर्ड टाईम", "VET": "वेनेज़ुएला स्टैंडर्ड टाईम", "ADT": "अटलांटीक डेलाईट टाईम", "HADT": "हवाई आलटन डेलाईट टाईम", "WIB": "वेस्टर्न ईंडोनीशिया स्टैंडर्ड टाईम", "EAT": "पूर्वी अफ्रीका स्टैंडर्ड टाईम", "SRT": "सुरीनाम स्टैंडर्ड टाईम", "HNT": "न्युफाऊंडलैण्ड स्टैंडर्ड टाईम", "ACWDT": "मध्य-पश्चीम ओस्ट्रेलिया डेलाईट टाईम", "BT": "भुटान स्टैंडर्ड टाईम", "WART": "पश्चीम अर्जण्टिना स्टैंडर्ड टाईम", "WITA": "ईंडोनीशिया स्टैंडर्ड टाईम"},
+ timezones: map[string]string{"JDT": "जपान डेलाईट टाईम", "PST": "पैसीफीक स्टैंडर्ड टाईम", "MESZ": "मध्य यूरोप समर टाईम", "HAST": "हवाई आलटन स्टैंडर्ड टाईम", "BOT": "बोलिविया स्टैंडर्ड टाईम", "WAST": "पश्चीम अफ्रीका समर टाईम", "MYT": "मलेशिया स्टैंडर्ड टाईम", "JST": "जपान स्टैंडर्ड टाईम", "WIB": "वेस्टर्न ईंडोनीशिया स्टैंडर्ड टाईम", "ACDT": "मध्य ओस्ट्रेलिया डेलाईट टाईम", "ECT": "एक्वाडौर स्टैंडर्ड टाईम", "HADT": "हवाई आलटन डेलाईट टाईम", "OEZ": "ईस्टर्न यूरोप स्टैंडर्ड टाईम", "CLST": "चीली समर टाईम", "WEZ": "वेस्टर्न यूरोप स्टैंडर्ड टाईम", "WART": "पश्चीम अर्जण्टिना स्टैंडर्ड टाईम", "HKST": "हाँगकॉंग समर टाईम", "CHADT": "चैथम डेलाईट टाईम", "ACWDT": "मध्य-पश्चीम ओस्ट्रेलिया डेलाईट टाईम", "NZDT": "न्युज़ीलैण्ड डेलाईट टाईम", "SAST": "दक्षिण अफ्रीका स्टैंडर्ड टाईम", "WAT": "पश्चीम अफ्रीका स्टैंडर्ड टाईम", "WESZ": "वेस्टर्न यूरोप समर टाईम", "GYT": "गुयाना स्टैंडर्ड टाईम", "HKT": "हाँगकॉंग स्टैंडर्ड टाईम", "AWDT": "दक्षिण ओस्ट्रेलिया डेलाईट टाईम", "LHDT": "लार्ड़ होव डेलाईट टाईम", "EAT": "पूर्वी अफ्रीका स्टैंडर्ड टाईम", "ChST": "चामरो स्टैंडर्ड टाईम", "BT": "भुटान स्टैंडर्ड टाईम", "CLT": "चीली स्टैंडर्ड टाईम", "UYST": "ऊरुगुए समर टाईम", "VET": "वेनेज़ुएला स्टैंडर्ड टाईम", "AKST": "अलास्का स्टैंडर्ड टाईम", "MDT": "माकाऊ समर टाईम", "NZST": "न्युज़ीलैण्ड स्टैंडर्ड टाईम", "MEZ": "मध्य यूरोप स्टैंडर्ड टाईम", "ACST": "मध्य ओस्ट्रेलिया स्टैंडर्ड टाईम", "SRT": "सुरीनाम स्टैंडर्ड टाईम", "CHAST": "चैथम स्टैंडर्ड टाईम", "AST": "अटलांटीक स्टैंडर्ड टाईम", "ADT": "अटलांटीक डेलाईट टाईम", "ARST": "अर्जण्टिना समर टाईम", "IST": "भारतीय स्टैंडर्ड टाईम", "CDT": "सैंट्रल अमरिका डेलाईट टाईम", "GFT": "फ्रान्सीसी गुयाना स्टैंडर्ड टाईम", "TMT": "तुर्कमेनीस्तान स्टैंडर्ड टाईम", "∅∅∅": "आज़ोर समर टाईम", "ART": "अर्जनटिना स्टैंडर्ड टाईम", "EST": "ईस्टर्न अमरिका स्टैंडर्ड टाईम", "PDT": "पैसीफीक डेलाईट टाईम", "COT": "कोलंबिया स्टैंडर्ड टाईम", "OESZ": "ईस्टर्न यूरोप समर टाईम", "WIT": "ईस्टर्न ईंडोनीशिया स्टैंडर्ड टाईम", "WITA": "ईंडोनीशिया स्टैंडर्ड टाईम", "AKDT": "अलास्का डेलाईट टाईम", "HNT": "न्युफाऊंडलैण्ड स्टैंडर्ड टाईम", "SGT": "सींगापुर स्टैंडर्ड टाईम", "AEST": "पूर्वी ओस्ट्रेलिया स्टैंडर्ड टाईम", "ACWST": "मध्य-पश्चीम ओस्ट्रेलिया स्टैंडर्ड टाईम", "GMT": "ग्रीनीच स्टैंडर्ड टाईम", "AEDT": "पूर्वी ओस्ट्रेलिया डेलाईट टाईम", "WARST": "पश्चीम अर्जण्टिना समर टाईम", "MST": "माकाऊ स्टैंडर्ड टाईम", "AWST": "दक्षिण ओस्ट्रेलिया स्टैंडर्ड टाईम", "HAT": "न्युफाऊंडलैण्ड डेलाईट टाईम", "CAT": "मध्य अफ्रीका स्टैंडर्ड टाईम", "CST": "सैंट्रल अमरिका स्टैंडर्ड टाईम", "EDT": "ईस्टर्न अमरिका डेलाईट टाईम", "COST": "कोलंबिया समर टाईम", "TMST": "तुर्कमेनीस्तान समर टाईम", "LHST": "लार्ड़ होव स्टैंडर्ड टाईम", "UYT": "ऊरुगुए स्टैंडर्ड टाईम"},
}
}
@@ -121,7 +121,7 @@ func (brx *brx) MonthAbbreviated(month time.Month) string {
// MonthsAbbreviated returns the locales abbreviated months
func (brx *brx) MonthsAbbreviated() []string {
- return brx.monthsAbbreviated[1:]
+ return nil
}
// MonthNarrow returns the locales narrow month given the 'month' provided
diff --git a/brx/brx_test.go b/brx/brx_test.go
new file mode 100644
index 00000000..f6208f26
--- /dev/null
+++ b/brx/brx_test.go
@@ -0,0 +1,1120 @@
+package brx
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "brx"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/brx_IN/brx_IN.go b/brx_IN/brx_IN.go
index a1579cf7..074d2e49 100644
--- a/brx_IN/brx_IN.go
+++ b/brx_IN/brx_IN.go
@@ -68,7 +68,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ईसा.पूर्व", "सन"},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"ACWST": "मध्य-पश्चीम ओस्ट्रेलिया स्टैंडर्ड टाईम", "WIB": "वेस्टर्न ईंडोनीशिया स्टैंडर्ड टाईम", "HAT": "न्युफाऊंडलैण्ड डेलाईट टाईम", "AWST": "दक्षिण ओस्ट्रेलिया स्टैंडर्ड टाईम", "AWDT": "दक्षिण ओस्ट्रेलिया डेलाईट टाईम", "UYT": "ऊरुगुए स्टैंडर्ड टाईम", "UYST": "ऊरुगुए समर टाईम", "MEZ": "मध्य यूरोप स्टैंडर्ड टाईम", "SGT": "सींगापुर स्टैंडर्ड टाईम", "WITA": "ईंडोनीशिया स्टैंडर्ड टाईम", "CLT": "चीली स्टैंडर्ड टाईम", "EAT": "पूर्वी अफ्रीका स्टैंडर्ड टाईम", "ARST": "अर्जण्टिना समर टाईम", "AKDT": "अलास्का डेलाईट टाईम", "MESZ": "मध्य यूरोप समर टाईम", "LHDT": "लार्ड़ होव डेलाईट टाईम", "NZST": "न्युज़ीलैण्ड स्टैंडर्ड टाईम", "BOT": "बोलिविया स्टैंडर्ड टाईम", "AST": "अटलांटीक स्टैंडर्ड टाईम", "AKST": "अलास्का स्टैंडर्ड टाईम", "EST": "ईस्टर्न अमरिका स्टैंडर्ड टाईम", "HADT": "हवाई आलटन डेलाईट टाईम", "HKST": "हाँगकॉंग समर टाईम", "WART": "पश्चीम अर्जण्टिना स्टैंडर्ड टाईम", "SAST": "दक्षिण अफ्रीका स्टैंडर्ड टाईम", "IST": "भारतीय स्टैंडर्ड टाईम", "MYT": "मलेशिया स्टैंडर्ड टाईम", "JST": "जपान स्टैंडर्ड टाईम", "PDT": "पैसीफीक डेलाईट टाईम", "COST": "कोलंबिया समर टाईम", "CHADT": "चैथम डेलाईट टाईम", "CAT": "मध्य अफ्रीका स्टैंडर्ड टाईम", "EDT": "ईस्टर्न अमरिका डेलाईट टाईम", "HNT": "न्युफाऊंडलैण्ड स्टैंडर्ड टाईम", "VET": "वेनेज़ुएला स्टैंडर्ड टाईम", "ACWDT": "मध्य-पश्चीम ओस्ट्रेलिया डेलाईट टाईम", "OEZ": "ईस्टर्न यूरोप स्टैंडर्ड टाईम", "WESZ": "वेस्टर्न यूरोप समर टाईम", "WARST": "पश्चीम अर्जण्टिना समर टाईम", "BT": "भुटान स्टैंडर्ड टाईम", "MDT": "माकाऊ समर टाईम", "JDT": "जपान डेलाईट टाईम", "PST": "पैसीफीक स्टैंडर्ड टाईम", "WEZ": "वेस्टर्न यूरोप स्टैंडर्ड टाईम", "WAST": "पश्चीम अफ्रीका समर टाईम", "ACDT": "मध्य ओस्ट्रेलिया डेलाईट टाईम", "AEST": "पूर्वी ओस्ट्रेलिया स्टैंडर्ड टाईम", "HKT": "हाँगकॉंग स्टैंडर्ड टाईम", "GMT": "ग्रीनीच स्टैंडर्ड टाईम", "ADT": "अटलांटीक डेलाईट टाईम", "HAST": "हवाई आलटन स्टैंडर्ड टाईम", "GFT": "फ्रान्सीसी गुयाना स्टैंडर्ड टाईम", "∅∅∅": "अमाज़ोन समर टाईम", "TMT": "तुर्कमेनीस्तान स्टैंडर्ड टाईम", "ART": "अर्जनटिना स्टैंडर्ड टाईम", "SRT": "सुरीनाम स्टैंडर्ड टाईम", "COT": "कोलंबिया स्टैंडर्ड टाईम", "WAT": "पश्चीम अफ्रीका स्टैंडर्ड टाईम", "WIT": "ईस्टर्न ईंडोनीशिया स्टैंडर्ड टाईम", "OESZ": "ईस्टर्न यूरोप समर टाईम", "GYT": "गुयाना स्टैंडर्ड टाईम", "NZDT": "न्युज़ीलैण्ड डेलाईट टाईम", "AEDT": "पूर्वी ओस्ट्रेलिया डेलाईट टाईम", "ChST": "चामरो स्टैंडर्ड टाईम", "TMST": "तुर्कमेनीस्तान समर टाईम", "MST": "माकाऊ स्टैंडर्ड टाईम", "ACST": "मध्य ओस्ट्रेलिया स्टैंडर्ड टाईम", "CST": "सैंट्रल अमरिका स्टैंडर्ड टाईम", "ECT": "एक्वाडौर स्टैंडर्ड टाईम", "LHST": "लार्ड़ होव स्टैंडर्ड टाईम", "CDT": "सैंट्रल अमरिका डेलाईट टाईम", "CHAST": "चैथम स्टैंडर्ड टाईम", "CLST": "चीली समर टाईम"},
+ timezones: map[string]string{"EDT": "ईस्टर्न अमरिका डेलाईट टाईम", "WESZ": "वेस्टर्न यूरोप समर टाईम", "GYT": "गुयाना स्टैंडर्ड टाईम", "MYT": "मलेशिया स्टैंडर्ड टाईम", "UYT": "ऊरुगुए स्टैंडर्ड टाईम", "HKT": "हाँगकॉंग स्टैंडर्ड टाईम", "AKDT": "अलास्का डेलाईट टाईम", "TMST": "तुर्कमेनीस्तान समर टाईम", "CAT": "मध्य अफ्रीका स्टैंडर्ड टाईम", "ACDT": "मध्य ओस्ट्रेलिया डेलाईट टाईम", "WITA": "ईंडोनीशिया स्टैंडर्ड टाईम", "AEST": "पूर्वी ओस्ट्रेलिया स्टैंडर्ड टाईम", "EST": "ईस्टर्न अमरिका स्टैंडर्ड टाईम", "PST": "पैसीफीक स्टैंडर्ड टाईम", "TMT": "तुर्कमेनीस्तान स्टैंडर्ड टाईम", "OEZ": "ईस्टर्न यूरोप स्टैंडर्ड टाईम", "LHDT": "लार्ड़ होव डेलाईट टाईम", "SGT": "सींगापुर स्टैंडर्ड टाईम", "ACST": "मध्य ओस्ट्रेलिया स्टैंडर्ड टाईम", "SRT": "सुरीनाम स्टैंडर्ड टाईम", "AWST": "दक्षिण ओस्ट्रेलिया स्टैंडर्ड टाईम", "MESZ": "मध्य यूरोप समर टाईम", "HADT": "हवाई आलटन डेलाईट टाईम", "LHST": "लार्ड़ होव स्टैंडर्ड टाईम", "CHAST": "चैथम स्टैंडर्ड टाईम", "MEZ": "मध्य यूरोप स्टैंडर्ड टाईम", "COT": "कोलंबिया स्टैंडर्ड टाईम", "CLST": "चीली समर टाईम", "AST": "अटलांटीक स्टैंडर्ड टाईम", "ACWST": "मध्य-पश्चीम ओस्ट्रेलिया स्टैंडर्ड टाईम", "PDT": "पैसीफीक डेलाईट टाईम", "NZST": "न्युज़ीलैण्ड स्टैंडर्ड टाईम", "BOT": "बोलिविया स्टैंडर्ड टाईम", "WAT": "पश्चीम अफ्रीका स्टैंडर्ड टाईम", "WIB": "वेस्टर्न ईंडोनीशिया स्टैंडर्ड टाईम", "ARST": "अर्जण्टिना समर टाईम", "CHADT": "चैथम डेलाईट टाईम", "HAST": "हवाई आलटन स्टैंडर्ड टाईम", "WEZ": "वेस्टर्न यूरोप स्टैंडर्ड टाईम", "OESZ": "ईस्टर्न यूरोप समर टाईम", "BT": "भुटान स्टैंडर्ड टाईम", "MDT": "अमरिका माऊन्टन डेलाईट टाईम", "UYST": "ऊरुगुए समर टाईम", "WARST": "पश्चीम अर्जण्टिना समर टाईम", "COST": "कोलंबिया समर टाईम", "CLT": "चीली स्टैंडर्ड टाईम", "EAT": "पूर्वी अफ्रीका स्टैंडर्ड टाईम", "CST": "सैंट्रल अमरिका स्टैंडर्ड टाईम", "JST": "जपान स्टैंडर्ड टाईम", "MST": "अमरिका माऊन्टन स्टैंडर्ड टाईम", "CDT": "सैंट्रल अमरिका डेलाईट टाईम", "HKST": "हाँगकॉंग समर टाईम", "ECT": "एक्वाडौर स्टैंडर्ड टाईम", "WAST": "पश्चीम अफ्रीका समर टाईम", "ART": "अर्जनटिना स्टैंडर्ड टाईम", "ACWDT": "मध्य-पश्चीम ओस्ट्रेलिया डेलाईट टाईम", "IST": "भारतीय स्टैंडर्ड टाईम", "SAST": "दक्षिण अफ्रीका स्टैंडर्ड टाईम", "HAT": "न्युफाऊंडलैण्ड डेलाईट टाईम", "AEDT": "पूर्वी ओस्ट्रेलिया डेलाईट टाईम", "WART": "पश्चीम अर्जण्टिना स्टैंडर्ड टाईम", "VET": "वेनेज़ुएला स्टैंडर्ड टाईम", "ADT": "अटलांटीक डेलाईट टाईम", "∅∅∅": "अमाज़ोन समर टाईम", "GFT": "फ्रान्सीसी गुयाना स्टैंडर्ड टाईम", "AWDT": "दक्षिण ओस्ट्रेलिया डेलाईट टाईम", "JDT": "जपान डेलाईट टाईम", "AKST": "अलास्का स्टैंडर्ड टाईम", "NZDT": "न्युज़ीलैण्ड डेलाईट टाईम", "HNT": "न्युफाऊंडलैण्ड स्टैंडर्ड टाईम", "GMT": "ग्रीनीच स्टैंडर्ड टाईम", "ChST": "चामरो स्टैंडर्ड टाईम", "WIT": "ईस्टर्न ईंडोनीशिया स्टैंडर्ड टाईम"},
}
}
@@ -121,7 +121,7 @@ func (brx *brx_IN) MonthAbbreviated(month time.Month) string {
// MonthsAbbreviated returns the locales abbreviated months
func (brx *brx_IN) MonthsAbbreviated() []string {
- return brx.monthsAbbreviated[1:]
+ return nil
}
// MonthNarrow returns the locales narrow month given the 'month' provided
diff --git a/brx_IN/brx_IN_test.go b/brx_IN/brx_IN_test.go
new file mode 100644
index 00000000..a76b2e1e
--- /dev/null
+++ b/brx_IN/brx_IN_test.go
@@ -0,0 +1,1120 @@
+package brx_IN
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "brx_IN"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/bs/bs.go b/bs/bs.go
index 356a570f..d0417ce2 100644
--- a/bs/bs.go
+++ b/bs/bs.go
@@ -47,7 +47,7 @@ func New() locales.Translator {
locale: "bs",
pluralsCardinal: []locales.PluralRule{2, 4, 6},
pluralsOrdinal: []locales.PluralRule{6},
- pluralsRange: []locales.PluralRule{2, 4, 6},
+ pluralsRange: []locales.PluralRule{6, 2, 4},
decimal: ",",
group: ".",
minus: "-",
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"p. n. e.", "n. e."},
erasNarrow: []string{"pr.n.e.", "AD"},
erasWide: []string{"Prije nove ere", "Nove ere"},
- timezones: map[string]string{"WARST": "Zapadnoargentinsko ljetno računanje vremena", "GMT": "Vrijeme po Grinviču", "WIB": "Zapadnoindonezijsko vrijeme", "AWDT": "Zapadnoaustralijsko ljetno računanje vremena", "MEZ": "Standardno centralnoevropsko vrijeme", "UYT": "Standardno urugvajsko vrijeme", "CLST": "Čileansko ljetno računanje vremena", "COT": "Standardno kolumbijsko vrijeme", "VET": "Venecuelansko vrijeme", "EAT": "Istočnoafričko vrijeme", "AEST": "Standardno istočnoaustralijsko vrijeme", "IST": "Standardno indijsko vrijeme", "WAST": "Zapadnoafričko ljetno računanje vremena", "SAST": "Standardno južnoafričko vrijeme", "AWST": "Standardno zapadnoaustralijsko vrijeme", "ACWST": "Standardno australijsko centralno zapadno vrijeme", "CHAST": "Standardno čatamsko vrijeme", "WEZ": "Standardno zapadnoevropsko vrijeme", "HAST": "Standardno havajsko-aleućansko vrijeme", "GFT": "Vrijeme Francuske Gvajane", "AKST": "Standardno aljaskansko vrijeme", "OEZ": "Standardno istočnoevropsko vrijeme", "ART": "Standardno argentinsko vrijeme", "JST": "Standardno japansko vrijeme", "NZDT": "Novozelandsko ljetno računanje vremena", "CST": "Standardno centralno vrijeme (SAD)", "AST": "Standardno atlantsko vrijeme", "OESZ": "Istočnoevropsko ljetno računanje vremena", "TMST": "Turkmenistansko ljetno računanje vremena", "COST": "Kolumbijsko ljetno računanje vremena", "WART": "Standardno zapadnoargentinsko vrijeme", "UYST": "Urugvajsko ljetno računanje vremena", "WESZ": "Zapadnoevropsko ljetno računanje vremena", "ECT": "Ekvadorsko vrijeme", "HNT": "Standardno njufaundlendsko vrijeme", "ACDT": "Centralnoaustralijsko ljetno računanje vremena", "LHST": "Standardno vrijeme na Ostrvu Lord Hau", "JDT": "Japansko ljetno računanje vremena", "BOT": "Bolivijsko vrijeme", "AEDT": "Istočnoaustralijsko ljetno računanje vremena", "ADT": "Ljetno računanje atlantskog vremena", "AKDT": "Aljaskansko ljetno računanje vremena", "CHADT": "Čatamsko ljetno računanje vremena", "CLT": "Standardno čileansko vrijeme", "HKST": "Hongkonško ljetno računanje vremena", "ChST": "Standardno čamorsko vrijeme", "WITA": "Centralnoindonezijsko vrijeme", "ARST": "Argentinsko ljetno računanje vremena", "ACWDT": "Australijsko centralno zapadno ljetno računanje vremena", "HADT": "Havajsko-aleućansko ljetno rečunanje vremena", "EDT": "Ljetno računanje istočnog vremena (SAD)", "CAT": "Centralnoafričko vrijeme", "HKT": "Standardno hongkonško vrijeme", "HAT": "Njufaundlendsko ljetno računanje vremena", "EST": "Standardno istočno vrijeme (SAD)", "WIT": "Istočnoindonezijsko vrijeme", "SGT": "Standardno singapursko vrijeme", "MDT": "Makao letnje računanje vremena", "PST": "Standardno pacifičko vrijeme (SAD)", "PDT": "Ljetno računanje pacifičkog vremena (SAD)", "NZST": "Standardno novozelandsko vrijeme", "CDT": "Ljetno računanje centralnog vremena (SAD)", "∅∅∅": "Brazilijsko ljetno računanje vremena", "GYT": "Gvajansko vrijeme", "SRT": "Surinamsko vrijeme", "ACST": "Standardno centralnoaustralijsko vrijeme", "BT": "Butansko vrijeme", "MST": "Makao standardno vreme", "TMT": "Standardno turkmenistansko vrijeme", "LHDT": "Ljetno računanje vremena na Ostrvu Lord Hau", "MYT": "Malezijsko vrijeme", "MESZ": "Centralnoevropsko ljetno računanje vremena", "WAT": "Standardno zapadnoafričko vrijeme"},
+ timezones: map[string]string{"JST": "Standardno japansko vrijeme", "AEST": "Standardno istočnoaustralijsko vrijeme", "GYT": "Gvajansko vrijeme", "WARST": "Zapadnoargentinsko ljetno računanje vremena", "HAST": "Standardno havajsko-aleućansko vrijeme", "MYT": "Malezijsko vrijeme", "GFT": "Vrijeme Francuske Gvajane", "HKST": "Hongkonško ljetno računanje vremena", "SGT": "Standardno singapursko vrijeme", "AEDT": "Istočnoaustralijsko ljetno računanje vremena", "BT": "Butansko vrijeme", "UYT": "Standardno urugvajsko vrijeme", "CHADT": "Čatamsko ljetno računanje vremena", "EDT": "Ljetno računanje istočnog vremena (SAD)", "OEZ": "Standardno istočnoevropsko vrijeme", "ECT": "Ekvadorsko vrijeme", "ACWDT": "Australijsko centralno zapadno ljetno računanje vremena", "PST": "Standardno pacifičko vrijeme (SAD)", "TMT": "Standardno turkmenistansko vrijeme", "LHST": "Standardno vrijeme na Ostrvu Lord Hau", "MDT": "Makao letnje računanje vremena", "WITA": "Centralnoindonezijsko vrijeme", "IST": "Standardno indijsko vrijeme", "AKDT": "Aljaskansko ljetno računanje vremena", "WAST": "Zapadnoafričko ljetno računanje vremena", "WIT": "Istočnoindonezijsko vrijeme", "LHDT": "Ljetno računanje vremena na Ostrvu Lord Hau", "WART": "Standardno zapadnoargentinsko vrijeme", "AKST": "Standardno aljaskansko vrijeme", "ADT": "Ljetno računanje atlantskog vremena", "ACWST": "Standardno australijsko centralno zapadno vrijeme", "AWDT": "Zapadnoaustralijsko ljetno računanje vremena", "COT": "Standardno kolumbijsko vrijeme", "WIB": "Zapadnoindonezijsko vrijeme", "ChST": "Standardno čamorsko vrijeme", "MST": "Makao standardno vreme", "CHAST": "Standardno čatamsko vrijeme", "TMST": "Turkmenistansko ljetno računanje vremena", "CLT": "Standardno čileansko vrijeme", "ACST": "Standardno centralnoaustralijsko vrijeme", "HKT": "Standardno hongkonško vrijeme", "ARST": "Argentinsko ljetno računanje vremena", "SAST": "Standardno južnoafričko vrijeme", "∅∅∅": "Amazonsko ljetno računanje vremena", "WESZ": "Zapadnoevropsko ljetno računanje vremena", "COST": "Kolumbijsko ljetno računanje vremena", "VET": "Venecuelansko vrijeme", "AST": "Standardno atlantsko vrijeme", "HADT": "Havajsko-aleućansko ljetno rečunanje vremena", "CAT": "Centralnoafričko vrijeme", "CLST": "Čileansko ljetno računanje vremena", "UYST": "Urugvajsko ljetno računanje vremena", "MEZ": "Standardno centralnoevropsko vrijeme", "WAT": "Standardno zapadnoafričko vrijeme", "HAT": "Njufaundlendsko ljetno računanje vremena", "GMT": "Vrijeme po Grinviču", "NZST": "Standardno novozelandsko vrijeme", "ACDT": "Centralnoaustralijsko ljetno računanje vremena", "NZDT": "Novozelandsko ljetno računanje vremena", "WEZ": "Standardno zapadnoevropsko vrijeme", "OESZ": "Istočnoevropsko ljetno računanje vremena", "ART": "Standardno argentinsko vrijeme", "EST": "Standardno istočno vrijeme (SAD)", "MESZ": "Centralnoevropsko ljetno računanje vremena", "SRT": "Surinamsko vrijeme", "CDT": "Ljetno računanje centralnog vremena (SAD)", "AWST": "Standardno zapadnoaustralijsko vrijeme", "JDT": "Japansko ljetno računanje vremena", "BOT": "Bolivijsko vrijeme", "PDT": "Ljetno računanje pacifičkog vremena (SAD)", "HNT": "Standardno njufaundlendsko vrijeme", "EAT": "Istočnoafričko vrijeme", "CST": "Standardno centralno vrijeme (SAD)"},
}
}
diff --git a/bs/bs_test.go b/bs/bs_test.go
new file mode 100644
index 00000000..91c7d67c
--- /dev/null
+++ b/bs/bs_test.go
@@ -0,0 +1,1120 @@
+package bs
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "bs"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/bs_Cyrl/bs_Cyrl.go b/bs_Cyrl/bs_Cyrl.go
index 47383ceb..fcb3312b 100644
--- a/bs_Cyrl/bs_Cyrl.go
+++ b/bs_Cyrl/bs_Cyrl.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"п. н. е.", "н. е."},
erasNarrow: []string{"п.н.е.", "н.е."},
erasWide: []string{"Пре нове ере", "Нове ере"},
- timezones: map[string]string{"HAST": "Хавајско-алеутско стандардно време", "SGT": "Сингапур стандардно време", "AWDT": "Аустралијско западно летње рачунање времена", "GYT": "Гвајана време", "MYT": "Малезија време", "ACWDT": "Аустралијско централно западно летње рачунање времена", "EDT": "Источно летње рачунање времена", "ADT": "Атланско лтње рачунање времена", "HKT": "Хонг Конг стандардно време", "LHST": "Лорд Хов стандардно време", "WART": "Западна Аргентина стандардно време", "NZST": "Нови Зеланд стандардно време", "CLT": "Чиле стандардно време", "CHADT": "Чатам летње рачунање времена", "WIT": "Источно-индонезијско време", "AWST": "Аустралијско западно стандардно време", "CLST": "Чиле летње рачунање времена", "PST": "Пацифичко стандардно време", "LHDT": "Лорд Хов летње рачунање времена", "AEST": "Аустралијско источно стандардно време", "MST": "Планинско стандардно време", "HAT": "Њуфаундленд летње рачунање времена", "ACST": "Аустралијско централно стандардно време", "AKST": "Аљашко стандардно време", "∅∅∅": "Азори летње рачунање времена", "BOT": "Боливија време", "EST": "Источно стандардно време", "WARST": "Западна Аргентина летње рачунање времена", "NZDT": "Нови Зеланд летње рачунање времена", "WAT": "Западно-афричко стандардно време", "BT": "Бутан време", "WIB": "Западно-индонезијско време", "OEZ": "Источноевропско стандардно време", "ART": "Аргентина стандардно време", "JST": "Јапанско стандардно време", "CDT": "Централно летње рачунање времена", "WESZ": "Западноевропско летње рачунање времена", "COT": "Колумбија стандардно време", "HADT": "Хавајско-алеутско летње рачунање времена", "IST": "Индијско стандардно време", "WEZ": "Западноевропско стандардно време", "AST": "Атланско стандардно време", "ACDT": "Аустралијско централно летње рачунање времена", "AKDT": "Аљашко летње време", "CHAST": "Чатам стандардно време", "WAST": "Западно-афричко летње рачунање времена", "OESZ": "Источноевропско летње рачунање времена", "HNT": "Њуфаундленд стандардно време", "ARST": "Аргентина летње рачунање времена", "JDT": "Јапанско летње рачунање времена", "MEZ": "Средњеевропско стандардно време", "UYT": "Уругвај стандардно време", "UYST": "Уругвај летње рачунање времена", "AEDT": "Аустралијско источно летње рачунање времена", "CAT": "Централно-афричко време", "TMT": "Туркменистан стандардно време", "SRT": "Суринам време", "ACWST": "Аустралијско централно западно стандардно време", "HKST": "Хонгконшко летње рачунање времена", "GMT": "Гринвич средње време", "EAT": "Источно-афричко време", "VET": "Венецуела време", "GFT": "Француска Гвајана време", "ChST": "Чаморо време", "MDT": "Планинско летње рачунање времена", "COST": "Колумбија летње рачунање времена", "TMST": "Туркменистан летње рачунање времена", "PDT": "Пацифичко летње рачунање времена", "CST": "Централно стандардно време", "MESZ": "Средњеевропско летње рачунање времена", "ECT": "Еквадор време", "SAST": "Јужно-афричко време", "WITA": "Централно-индонезијско време"},
+ timezones: map[string]string{"MEZ": "Средњеевропско стандардно време", "HAT": "Њуфаундленд летње рачунање времена", "OESZ": "Источноевропско летње рачунање времена", "UYT": "Уругвај стандардно време", "WARST": "Западна Аргентина летње рачунање времена", "ECT": "Еквадор време", "ACWDT": "Аустралијско централно западно летње рачунање времена", "TMT": "Туркменистан стандардно време", "WAT": "Западно-афричко стандардно време", "AEST": "Аустралијско источно стандардно време", "CLST": "Чиле летње рачунање времена", "MESZ": "Средњеевропско летње рачунање времена", "PDT": "Пацифичко летње рачунање времена", "JDT": "Јапанско летње рачунање времена", "PST": "Пацифичко стандардно време", "LHST": "Лорд Хов стандардно време", "GFT": "Француска Гвајана време", "CHAST": "Чатам стандардно време", "SAST": "Јужно-афричко време", "IST": "Индијско стандардно време", "ACST": "Аустралијско централно стандардно време", "SRT": "Суринам време", "HKT": "Хонг Конг стандардно време", "WITA": "Централно-индонезијско време", "SGT": "Сингапур стандардно време", "LHDT": "Лорд Хов летње рачунање времена", "AWST": "Аустралијско западно стандардно време", "HAST": "Хавајско-алеутско стандардно време", "ChST": "Чаморо време", "ACDT": "Аустралијско централно летње рачунање времена", "AKDT": "Аљашко летње време", "EDT": "Источно летње рачунање времена", "WIB": "Западно-индонезијско време", "WESZ": "Западноевропско летње рачунање времена", "ART": "Аргентина стандардно време", "ACWST": "Аустралијско централно западно стандардно време", "ADT": "Атланско лтње рачунање времена", "WAST": "Западно-афричко летње рачунање времена", "∅∅∅": "Азори летње рачунање времена", "MDT": "Макао летње рачунање вемена", "MYT": "Малезија време", "CDT": "Централно летње рачунање времена", "AKST": "Аљашко стандардно време", "OEZ": "Источноевропско стандардно време", "NZDT": "Нови Зеланд летње рачунање времена", "EST": "Источно стандардно време", "HKST": "Хонгконшко летње рачунање времена", "HADT": "Хавајско-алеутско летње рачунање времена", "BOT": "Боливија време", "WEZ": "Западноевропско стандардно време", "MST": "Макао стандардно време", "AST": "Атланско стандардно време", "BT": "Бутан време", "AWDT": "Аустралијско западно летње рачунање времена", "NZST": "Нови Зеланд стандардно време", "COT": "Колумбија стандардно време", "CST": "Централно стандардно време", "VET": "Венецуела време", "ARST": "Аргентина летње рачунање времена", "WART": "Западна Аргентина стандардно време", "JST": "Јапанско стандардно време", "GMT": "Гринвич средње време", "TMST": "Туркменистан летње рачунање времена", "HNT": "Њуфаундленд стандардно време", "UYST": "Уругвај летње рачунање времена", "CHADT": "Чатам летње рачунање времена", "COST": "Колумбија летње рачунање времена", "AEDT": "Аустралијско источно летње рачунање времена", "CLT": "Чиле стандардно време", "WIT": "Источно-индонезијско време", "EAT": "Источно-афричко време", "CAT": "Централно-афричко време", "GYT": "Гвајана време"},
}
}
@@ -103,8 +103,8 @@ func (bs *bs_Cyrl) CardinalPluralRule(num float64, v uint64) locales.PluralRule
f := locales.F(n, v)
iMod10 := i % 10
iMod100 := i % 100
- fMod10 := f % 10
fMod100 := f % 100
+ fMod10 := f % 10
if (v == 0 && iMod10 == 1 && iMod100 != 11) || (fMod10 == 1 && fMod100 != 11) {
return locales.PluralRuleOne
diff --git a/bs_Cyrl/bs_Cyrl_test.go b/bs_Cyrl/bs_Cyrl_test.go
new file mode 100644
index 00000000..b4132d53
--- /dev/null
+++ b/bs_Cyrl/bs_Cyrl_test.go
@@ -0,0 +1,1120 @@
+package bs_Cyrl
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "bs_Cyrl"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/bs_Cyrl_BA/bs_Cyrl_BA.go b/bs_Cyrl_BA/bs_Cyrl_BA.go
index 5f379123..72dc8f12 100644
--- a/bs_Cyrl_BA/bs_Cyrl_BA.go
+++ b/bs_Cyrl_BA/bs_Cyrl_BA.go
@@ -47,7 +47,7 @@ func New() locales.Translator {
locale: "bs_Cyrl_BA",
pluralsCardinal: []locales.PluralRule{2, 4, 6},
pluralsOrdinal: []locales.PluralRule{6},
- pluralsRange: []locales.PluralRule{2, 4, 6},
+ pluralsRange: []locales.PluralRule{4, 6, 2},
decimal: ",",
group: ".",
minus: "-",
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"p. n. e.", "n. e."},
erasNarrow: []string{"pr.n.e.", "AD"},
erasWide: []string{"Prije nove ere", "Nove ere"},
- timezones: map[string]string{"GYT": "Gvajansko vrijeme", "AKDT": "Aljaskansko ljetno računanje vremena", "VET": "Venecuelansko vrijeme", "AWST": "Standardno zapadnoaustralijsko vrijeme", "SAST": "Standardno južnoafričko vrijeme", "WAT": "Standardno zapadnoafričko vrijeme", "SRT": "Surinamsko vrijeme", "UYST": "Urugvajsko ljetno računanje vremena", "CLST": "Čileansko ljetno računanje vremena", "HADT": "Havajsko-aleućansko ljetno rečunanje vremena", "ECT": "Ekvadorsko vrijeme", "WITA": "Centralnoindonezijsko vrijeme", "TMST": "Turkmenistansko ljetno računanje vremena", "LHDT": "Ljetno računanje vremena na Ostrvu Lord Hau", "AEDT": "Istočnoaustralijsko ljetno računanje vremena", "MST": "Standardno planinsko vrijeme (SAD)", "CLT": "Standardno čileansko vrijeme", "WESZ": "Zapadnoevropsko ljetno računanje vremena", "COT": "Standardno kolumbijsko vrijeme", "WIT": "Istočnoindonezijsko vrijeme", "JST": "Standardno japansko vrijeme", "AST": "Standardno atlantsko vrijeme", "BT": "Butansko vrijeme", "WIB": "Zapadnoindonezijsko vrijeme", "ACST": "Standardno centralnoaustralijsko vrijeme", "PST": "Standardno pacifičko vrijeme (SAD)", "CST": "Standardno centralno vrijeme (SAD)", "∅∅∅": "Brazilijsko ljetno računanje vremena", "EST": "Standardno istočno vrijeme (SAD)", "NZDT": "Novozelandsko ljetno računanje vremena", "CDT": "Ljetno računanje centralnog vremena (SAD)", "EDT": "Ljetno računanje istočnog vremena (SAD)", "OEZ": "Standardno istočnoevropsko vrijeme", "HAT": "Njufaundlendsko ljetno računanje vremena", "GFT": "Vrijeme Francuske Gvajane", "AEST": "Standardno istočnoaustralijsko vrijeme", "HKST": "Hongkonško ljetno računanje vremena", "AWDT": "Zapadnoaustralijsko ljetno računanje vremena", "ADT": "Ljetno računanje atlantskog vremena", "HNT": "Standardno njufaundlendsko vrijeme", "ACDT": "Centralnoaustralijsko ljetno računanje vremena", "PDT": "Ljetno računanje pacifičkog vremena (SAD)", "BOT": "Bolivijsko vrijeme", "MDT": "Ljetno računanje planinskog vremena (SAD)", "HAST": "Standardno havajsko-aleućansko vrijeme", "MYT": "Malezijsko vrijeme", "CAT": "Centralnoafričko vrijeme", "WART": "Standardno zapadnoargentinsko vrijeme", "ACWST": "Standardno australijsko centralno zapadno vrijeme", "WARST": "Zapadnoargentinsko ljetno računanje vremena", "IST": "Standardno indijsko vrijeme", "OESZ": "Istočnoevropsko ljetno računanje vremena", "ART": "Standardno argentinsko vrijeme", "EAT": "Istočnoafričko vrijeme", "ChST": "Standardno čamorsko vrijeme", "CHAST": "Standardno čatamsko vrijeme", "NZST": "Standardno novozelandsko vrijeme", "MESZ": "Centralnoevropsko ljetno računanje vremena", "HKT": "Standardno hongkonško vrijeme", "WAST": "Zapadnoafričko ljetno računanje vremena", "GMT": "Vrijeme po Grinviču", "ARST": "Argentinsko ljetno računanje vremena", "LHST": "Standardno vrijeme na Ostrvu Lord Hau", "UYT": "Standardno urugvajsko vrijeme", "CHADT": "Čatamsko ljetno računanje vremena", "WEZ": "Standardno zapadnoevropsko vrijeme", "TMT": "Standardno turkmenistansko vrijeme", "MEZ": "Standardno centralnoevropsko vrijeme", "COST": "Kolumbijsko ljetno računanje vremena", "SGT": "Standardno singapursko vrijeme", "AKST": "Standardno aljaskansko vrijeme", "ACWDT": "Australijsko centralno zapadno ljetno računanje vremena", "JDT": "Japansko ljetno računanje vremena"},
+ timezones: map[string]string{"GMT": "Vrijeme po Grinviču", "UYT": "Standardno urugvajsko vrijeme", "AWDT": "Zapadnoaustralijsko ljetno računanje vremena", "PDT": "Ljetno računanje pacifičkog vremena (SAD)", "EST": "Standardno istočno vrijeme (SAD)", "TMT": "Standardno turkmenistansko vrijeme", "OESZ": "Istočnoevropsko ljetno računanje vremena", "PST": "Standardno pacifičko vrijeme (SAD)", "COT": "Standardno kolumbijsko vrijeme", "MDT": "Makao letnje računanje vremena", "CHAST": "Standardno čatamsko vrijeme", "AWST": "Standardno zapadnoaustralijsko vrijeme", "LHDT": "Ljetno računanje vremena na Ostrvu Lord Hau", "WART": "Standardno zapadnoargentinsko vrijeme", "AKST": "Standardno aljaskansko vrijeme", "TMST": "Turkmenistansko ljetno računanje vremena", "UYST": "Urugvajsko ljetno računanje vremena", "WIT": "Istočnoindonezijsko vrijeme", "LHST": "Standardno vrijeme na Ostrvu Lord Hau", "SRT": "Surinamsko vrijeme", "CST": "Standardno centralno vrijeme (SAD)", "ACDT": "Centralnoaustralijsko ljetno računanje vremena", "ECT": "Ekvadorsko vrijeme", "AKDT": "Aljaskansko ljetno računanje vremena", "ACWDT": "Australijsko centralno zapadno ljetno računanje vremena", "NZDT": "Novozelandsko ljetno računanje vremena", "SGT": "Standardno singapursko vrijeme", "HKT": "Standardno hongkonško vrijeme", "HNT": "Standardno njufaundlendsko vrijeme", "CLT": "Standardno čileansko vrijeme", "WARST": "Zapadnoargentinsko ljetno računanje vremena", "CHADT": "Čatamsko ljetno računanje vremena", "ACWST": "Standardno australijsko centralno zapadno vrijeme", "CDT": "Ljetno računanje centralnog vremena (SAD)", "ART": "Standardno argentinsko vrijeme", "WITA": "Centralnoindonezijsko vrijeme", "MESZ": "Centralnoevropsko ljetno računanje vremena", "SAST": "Standardno južnoafričko vrijeme", "ACST": "Standardno centralnoaustralijsko vrijeme", "VET": "Venecuelansko vrijeme", "MEZ": "Standardno centralnoevropsko vrijeme", "WAST": "Zapadnoafričko ljetno računanje vremena", "BOT": "Bolivijsko vrijeme", "EDT": "Ljetno računanje istočnog vremena (SAD)", "WESZ": "Zapadnoevropsko ljetno računanje vremena", "GYT": "Gvajansko vrijeme", "EAT": "Istočnoafričko vrijeme", "MST": "Makao standardno vreme", "HKST": "Hongkonško ljetno računanje vremena", "JDT": "Japansko ljetno računanje vremena", "HAT": "Njufaundlendsko ljetno računanje vremena", "WIB": "Zapadnoindonezijsko vrijeme", "WEZ": "Standardno zapadnoevropsko vrijeme", "ChST": "Standardno čamorsko vrijeme", "AEDT": "Istočnoaustralijsko ljetno računanje vremena", "OEZ": "Standardno istočnoevropsko vrijeme", "AEST": "Standardno istočnoaustralijsko vrijeme", "GFT": "Vrijeme Francuske Gvajane", "AST": "Standardno atlantsko vrijeme", "HAST": "Standardno havajsko-aleućansko vrijeme", "∅∅∅": "Amazonsko ljetno računanje vremena", "COST": "Kolumbijsko ljetno računanje vremena", "CAT": "Centralnoafričko vrijeme", "ARST": "Argentinsko ljetno računanje vremena", "JST": "Standardno japansko vrijeme", "ADT": "Ljetno računanje atlantskog vremena", "HADT": "Havajsko-aleućansko ljetno rečunanje vremena", "BT": "Butansko vrijeme", "WAT": "Standardno zapadnoafričko vrijeme", "CLST": "Čileansko ljetno računanje vremena", "NZST": "Standardno novozelandsko vrijeme", "IST": "Standardno indijsko vrijeme", "MYT": "Malezijsko vrijeme"},
}
}
diff --git a/bs_Cyrl_BA/bs_Cyrl_BA_test.go b/bs_Cyrl_BA/bs_Cyrl_BA_test.go
new file mode 100644
index 00000000..42efd373
--- /dev/null
+++ b/bs_Cyrl_BA/bs_Cyrl_BA_test.go
@@ -0,0 +1,1120 @@
+package bs_Cyrl_BA
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "bs_Cyrl_BA"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/bs_Latn/bs_Latn.go b/bs_Latn/bs_Latn.go
index a5c3a77d..c60f1549 100644
--- a/bs_Latn/bs_Latn.go
+++ b/bs_Latn/bs_Latn.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"p. n. e.", "n. e."},
erasNarrow: []string{"pr.n.e.", "AD"},
erasWide: []string{"Prije nove ere", "Nove ere"},
- timezones: map[string]string{"BT": "Butansko vrijeme", "OEZ": "Standardno istočnoevropsko vrijeme", "TMST": "Turkmenistansko ljetno računanje vremena", "LHDT": "Ljetno računanje vremena na Ostrvu Lord Hau", "AWST": "Standardno zapadnoaustralijsko vrijeme", "VET": "Venecuelansko vrijeme", "SGT": "Standardno singapursko vrijeme", "WAT": "Standardno zapadnoafričko vrijeme", "AWDT": "Zapadnoaustralijsko ljetno računanje vremena", "UYT": "Standardno urugvajsko vrijeme", "CDT": "Ljetno računanje centralnog vremena (SAD)", "SAST": "Standardno južnoafričko vrijeme", "ACST": "Standardno centralnoaustralijsko vrijeme", "AKST": "Standardno aljaskansko vrijeme", "HADT": "Havajsko-aleućansko ljetno rečunanje vremena", "HKST": "Hongkonško ljetno računanje vremena", "HNT": "Standardno njufaundlendsko vrijeme", "UYST": "Urugvajsko ljetno računanje vremena", "ACWDT": "Australijsko centralno zapadno ljetno računanje vremena", "EDT": "Ljetno računanje istočnog vremena (SAD)", "COST": "Kolumbijsko ljetno računanje vremena", "NZDT": "Novozelandsko ljetno računanje vremena", "AEST": "Standardno istočnoaustralijsko vrijeme", "COT": "Standardno kolumbijsko vrijeme", "EAT": "Istočnoafričko vrijeme", "JST": "Standardno japansko vrijeme", "MESZ": "Centralnoevropsko ljetno računanje vremena", "CAT": "Centralnoafričko vrijeme", "WAST": "Zapadnoafričko ljetno računanje vremena", "IST": "Standardno indijsko vrijeme", "PDT": "Ljetno računanje pacifičkog vremena (SAD)", "CHAST": "Standardno čatamsko vrijeme", "WESZ": "Zapadnoevropsko ljetno računanje vremena", "HAT": "Njufaundlendsko ljetno računanje vremena", "NZST": "Standardno novozelandsko vrijeme", "∅∅∅": "Brazilijsko ljetno računanje vremena", "AST": "Standardno atlantsko vrijeme", "OESZ": "Istočnoevropsko ljetno računanje vremena", "WARST": "Zapadnoargentinsko ljetno računanje vremena", "GFT": "Vrijeme Francuske Gvajane", "ACDT": "Centralnoaustralijsko ljetno računanje vremena", "LHST": "Standardno vrijeme na Ostrvu Lord Hau", "WEZ": "Standardno zapadnoevropsko vrijeme", "ADT": "Ljetno računanje atlantskog vremena", "WART": "Standardno zapadnoargentinsko vrijeme", "ART": "Standardno argentinsko vrijeme", "MDT": "Ljetno računanje planinskog vremena (SAD)", "EST": "Standardno istočno vrijeme (SAD)", "HAST": "Standardno havajsko-aleućansko vrijeme", "ARST": "Argentinsko ljetno računanje vremena", "BOT": "Bolivijsko vrijeme", "GYT": "Gvajansko vrijeme", "SRT": "Surinamsko vrijeme", "ChST": "Standardno čamorsko vrijeme", "WITA": "Centralnoindonezijsko vrijeme", "GMT": "Vrijeme po Grinviču", "WIT": "Istočnoindonezijsko vrijeme", "MYT": "Malezijsko vrijeme", "AEDT": "Istočnoaustralijsko ljetno računanje vremena", "TMT": "Standardno turkmenistansko vrijeme", "ECT": "Ekvadorsko vrijeme", "HKT": "Standardno hongkonško vrijeme", "WIB": "Zapadnoindonezijsko vrijeme", "CST": "Standardno centralno vrijeme (SAD)", "MEZ": "Standardno centralnoevropsko vrijeme", "CHADT": "Čatamsko ljetno računanje vremena", "CLST": "Čileansko ljetno računanje vremena", "ACWST": "Standardno australijsko centralno zapadno vrijeme", "JDT": "Japansko ljetno računanje vremena", "PST": "Standardno pacifičko vrijeme (SAD)", "MST": "Standardno planinsko vrijeme (SAD)", "CLT": "Standardno čileansko vrijeme", "AKDT": "Aljaskansko ljetno računanje vremena"},
+ timezones: map[string]string{"ADT": "Ljetno računanje atlantskog vremena", "EAT": "Istočnoafričko vrijeme", "HKT": "Standardno hongkonško vrijeme", "SAST": "Standardno južnoafričko vrijeme", "GMT": "Vrijeme po Grinviču", "ACWST": "Standardno australijsko centralno zapadno vrijeme", "AWST": "Standardno zapadnoaustralijsko vrijeme", "WAT": "Standardno zapadnoafričko vrijeme", "COT": "Standardno kolumbijsko vrijeme", "ACDT": "Centralnoaustralijsko ljetno računanje vremena", "HADT": "Havajsko-aleućansko ljetno rečunanje vremena", "TMST": "Turkmenistansko ljetno računanje vremena", "BT": "Butansko vrijeme", "CDT": "Ljetno računanje centralnog vremena (SAD)", "ChST": "Standardno čamorsko vrijeme", "MYT": "Malezijsko vrijeme", "AKDT": "Aljaskansko ljetno računanje vremena", "JST": "Standardno japansko vrijeme", "HAST": "Standardno havajsko-aleućansko vrijeme", "WEZ": "Standardno zapadnoevropsko vrijeme", "HNT": "Standardno njufaundlendsko vrijeme", "AEST": "Standardno istočnoaustralijsko vrijeme", "CLST": "Čileansko ljetno računanje vremena", "VET": "Venecuelansko vrijeme", "NZST": "Standardno novozelandsko vrijeme", "WESZ": "Zapadnoevropsko ljetno računanje vremena", "SGT": "Standardno singapursko vrijeme", "OEZ": "Standardno istočnoevropsko vrijeme", "SRT": "Surinamsko vrijeme", "AKST": "Standardno aljaskansko vrijeme", "MST": "Standardno planinsko vrijeme (SAD)", "GFT": "Vrijeme Francuske Gvajane", "CHAST": "Standardno čatamsko vrijeme", "ARST": "Argentinsko ljetno računanje vremena", "IST": "Standardno indijsko vrijeme", "TMT": "Standardno turkmenistansko vrijeme", "LHST": "Standardno vrijeme na Ostrvu Lord Hau", "AWDT": "Zapadnoaustralijsko ljetno računanje vremena", "PST": "Standardno pacifičko vrijeme (SAD)", "PDT": "Ljetno računanje pacifičkog vremena (SAD)", "AEDT": "Istočnoaustralijsko ljetno računanje vremena", "CST": "Standardno centralno vrijeme (SAD)", "ACST": "Standardno centralnoaustralijsko vrijeme", "CHADT": "Čatamsko ljetno računanje vremena", "EST": "Standardno istočno vrijeme (SAD)", "EDT": "Ljetno računanje istočnog vremena (SAD)", "MESZ": "Centralnoevropsko ljetno računanje vremena", "WAST": "Zapadnoafričko ljetno računanje vremena", "WIB": "Zapadnoindonezijsko vrijeme", "MDT": "Ljetno računanje planinskog vremena (SAD)", "ART": "Standardno argentinsko vrijeme", "CAT": "Centralnoafričko vrijeme", "UYST": "Urugvajsko ljetno računanje vremena", "WIT": "Istočnoindonezijsko vrijeme", "HKST": "Hongkonško ljetno računanje vremena", "ECT": "Ekvadorsko vrijeme", "WITA": "Centralnoindonezijsko vrijeme", "WART": "Standardno zapadnoargentinsko vrijeme", "WARST": "Zapadnoargentinsko ljetno računanje vremena", "MEZ": "Standardno centralnoevropsko vrijeme", "NZDT": "Novozelandsko ljetno računanje vremena", "LHDT": "Ljetno računanje vremena na Ostrvu Lord Hau", "UYT": "Standardno urugvajsko vrijeme", "JDT": "Japansko ljetno računanje vremena", "BOT": "Bolivijsko vrijeme", "HAT": "Njufaundlendsko ljetno računanje vremena", "COST": "Kolumbijsko ljetno računanje vremena", "OESZ": "Istočnoevropsko ljetno računanje vremena", "AST": "Standardno atlantsko vrijeme", "ACWDT": "Australijsko centralno zapadno ljetno računanje vremena", "∅∅∅": "Amazonsko ljetno računanje vremena", "GYT": "Gvajansko vrijeme", "CLT": "Standardno čileansko vrijeme"},
}
}
diff --git a/bs_Latn/bs_Latn_test.go b/bs_Latn/bs_Latn_test.go
new file mode 100644
index 00000000..fde1ce88
--- /dev/null
+++ b/bs_Latn/bs_Latn_test.go
@@ -0,0 +1,1120 @@
+package bs_Latn
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "bs_Latn"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/bs_Latn_BA/bs_Latn_BA.go b/bs_Latn_BA/bs_Latn_BA.go
index ae503fe5..853d10ea 100644
--- a/bs_Latn_BA/bs_Latn_BA.go
+++ b/bs_Latn_BA/bs_Latn_BA.go
@@ -47,7 +47,7 @@ func New() locales.Translator {
locale: "bs_Latn_BA",
pluralsCardinal: []locales.PluralRule{2, 4, 6},
pluralsOrdinal: []locales.PluralRule{6},
- pluralsRange: []locales.PluralRule{6, 2, 4},
+ pluralsRange: []locales.PluralRule{2, 4, 6},
decimal: ",",
group: ".",
minus: "-",
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"p. n. e.", "n. e."},
erasNarrow: []string{"pr.n.e.", "AD"},
erasWide: []string{"Prije nove ere", "Nove ere"},
- timezones: map[string]string{"CHAST": "Standardno čatamsko vrijeme", "CLST": "Čileansko ljetno računanje vremena", "WESZ": "Zapadnoevropsko ljetno računanje vremena", "AEDT": "Istočnoaustralijsko ljetno računanje vremena", "COT": "Standardno kolumbijsko vrijeme", "CDT": "Ljetno računanje centralnog vremena (SAD)", "HAT": "Njufaundlendsko ljetno računanje vremena", "WIB": "Zapadnoindonezijsko vrijeme", "EST": "Standardno istočno vrijeme (SAD)", "WARST": "Zapadnoargentinsko ljetno računanje vremena", "EAT": "Istočnoafričko vrijeme", "PST": "Standardno pacifičko vrijeme (SAD)", "JST": "Standardno japansko vrijeme", "CAT": "Centralnoafričko vrijeme", "WART": "Standardno zapadnoargentinsko vrijeme", "∅∅∅": "Amazonsko ljetno računanje vremena", "TMT": "Standardno turkmenistansko vrijeme", "ChST": "Standardno čamorsko vrijeme", "IST": "Standardno indijsko vrijeme", "JDT": "Japansko ljetno računanje vremena", "AKDT": "Aljaskansko ljetno računanje vremena", "ACWST": "Standardno australijsko centralno zapadno vrijeme", "COST": "Kolumbijsko ljetno računanje vremena", "AST": "Standardno atlantsko vrijeme", "ACDT": "Centralnoaustralijsko ljetno računanje vremena", "WIT": "Istočnoindonezijsko vrijeme", "SRT": "Surinamsko vrijeme", "MEZ": "Standardno centralnoevropsko vrijeme", "CST": "Standardno centralno vrijeme (SAD)", "EDT": "Ljetno računanje istočnog vremena (SAD)", "GFT": "Vrijeme Francuske Gvajane", "AWST": "Standardno zapadnoaustralijsko vrijeme", "ACST": "Standardno centralnoaustralijsko vrijeme", "AWDT": "Zapadnoaustralijsko ljetno računanje vremena", "LHST": "Standardno vrijeme na Ostrvu Lord Hau", "AEST": "Standardno istočnoaustralijsko vrijeme", "WITA": "Centralnoindonezijsko vrijeme", "HKT": "Standardno hongkonško vrijeme", "SAST": "Standardno južnoafričko vrijeme", "PDT": "Ljetno računanje pacifičkog vremena (SAD)", "VET": "Venecuelansko vrijeme", "WAT": "Standardno zapadnoafričko vrijeme", "ARST": "Argentinsko ljetno računanje vremena", "HKST": "Hongkonško ljetno računanje vremena", "MST": "Makao standardno vreme", "MESZ": "Centralnoevropsko ljetno računanje vremena", "BOT": "Bolivijsko vrijeme", "ACWDT": "Australijsko centralno zapadno ljetno računanje vremena", "WEZ": "Standardno zapadnoevropsko vrijeme", "ADT": "Ljetno računanje atlantskog vremena", "HNT": "Standardno njufaundlendsko vrijeme", "GMT": "Vrijeme po Grinviču", "NZDT": "Novozelandsko ljetno računanje vremena", "ECT": "Ekvadorsko vrijeme", "HAST": "Standardno havajsko-aleućansko vrijeme", "SGT": "Standardno singapursko vrijeme", "WAST": "Zapadnoafričko ljetno računanje vremena", "HADT": "Havajsko-aleućansko ljetno rečunanje vremena", "BT": "Butansko vrijeme", "MDT": "Makao letnje računanje vremena", "TMST": "Turkmenistansko ljetno računanje vremena", "LHDT": "Ljetno računanje vremena na Ostrvu Lord Hau", "GYT": "Gvajansko vrijeme", "AKST": "Standardno aljaskansko vrijeme", "OESZ": "Istočnoevropsko ljetno računanje vremena", "ART": "Standardno argentinsko vrijeme", "MYT": "Malezijsko vrijeme", "NZST": "Standardno novozelandsko vrijeme", "UYT": "Standardno urugvajsko vrijeme", "UYST": "Urugvajsko ljetno računanje vremena", "CHADT": "Čatamsko ljetno računanje vremena", "CLT": "Standardno čileansko vrijeme", "OEZ": "Standardno istočnoevropsko vrijeme"},
+ timezones: map[string]string{"ECT": "Ekvadorsko vrijeme", "JST": "Standardno japansko vrijeme", "AKDT": "Aljaskansko ljetno računanje vremena", "SAST": "Standardno južnoafričko vrijeme", "MYT": "Malezijsko vrijeme", "ACDT": "Centralnoaustralijsko ljetno računanje vremena", "SRT": "Surinamsko vrijeme", "MST": "Standardno planinsko vrijeme (SAD)", "PDT": "Ljetno računanje pacifičkog vremena (SAD)", "AEST": "Standardno istočnoaustralijsko vrijeme", "HNT": "Standardno njufaundlendsko vrijeme", "GMT": "Vrijeme po Grinviču", "BOT": "Bolivijsko vrijeme", "COST": "Kolumbijsko ljetno računanje vremena", "WESZ": "Zapadnoevropsko ljetno računanje vremena", "AST": "Standardno atlantsko vrijeme", "PST": "Standardno pacifičko vrijeme (SAD)", "SGT": "Standardno singapursko vrijeme", "OEZ": "Standardno istočnoevropsko vrijeme", "AEDT": "Istočnoaustralijsko ljetno računanje vremena", "ChST": "Standardno čamorsko vrijeme", "HKST": "Hongkonško ljetno računanje vremena", "JDT": "Japansko ljetno računanje vremena", "HAST": "Standardno havajsko-aleućansko vrijeme", "HADT": "Havajsko-aleućansko ljetno rečunanje vremena", "HAT": "Njufaundlendsko ljetno računanje vremena", "LHST": "Standardno vrijeme na Ostrvu Lord Hau", "LHDT": "Ljetno računanje vremena na Ostrvu Lord Hau", "∅∅∅": "Brazilijsko ljetno računanje vremena", "MESZ": "Centralnoevropsko ljetno računanje vremena", "TMT": "Standardno turkmenistansko vrijeme", "WART": "Standardno zapadnoargentinsko vrijeme", "ACWST": "Standardno australijsko centralno zapadno vrijeme", "IST": "Standardno indijsko vrijeme", "CST": "Standardno centralno vrijeme (SAD)", "ARST": "Argentinsko ljetno računanje vremena", "WAT": "Standardno zapadnoafričko vrijeme", "WITA": "Centralnoindonezijsko vrijeme", "ADT": "Ljetno računanje atlantskog vremena", "CAT": "Centralnoafričko vrijeme", "WEZ": "Standardno zapadnoevropsko vrijeme", "OESZ": "Istočnoevropsko ljetno računanje vremena", "CLT": "Standardno čileansko vrijeme", "CLST": "Čileansko ljetno računanje vremena", "HKT": "Standardno hongkonško vrijeme", "WARST": "Zapadnoargentinsko ljetno računanje vremena", "AKST": "Standardno aljaskansko vrijeme", "AWST": "Standardno zapadnoaustralijsko vrijeme", "AWDT": "Zapadnoaustralijsko ljetno računanje vremena", "EDT": "Ljetno računanje istočnog vremena (SAD)", "UYST": "Urugvajsko ljetno računanje vremena", "WIT": "Istočnoindonezijsko vrijeme", "MDT": "Ljetno računanje planinskog vremena (SAD)", "WIB": "Zapadnoindonezijsko vrijeme", "COT": "Standardno kolumbijsko vrijeme", "TMST": "Turkmenistansko ljetno računanje vremena", "UYT": "Standardno urugvajsko vrijeme", "ACST": "Standardno centralnoaustralijsko vrijeme", "NZST": "Standardno novozelandsko vrijeme", "WAST": "Zapadnoafričko ljetno računanje vremena", "ACWDT": "Australijsko centralno zapadno ljetno računanje vremena", "ART": "Standardno argentinsko vrijeme", "EST": "Standardno istočno vrijeme (SAD)", "EAT": "Istočnoafričko vrijeme", "CHAST": "Standardno čatamsko vrijeme", "GYT": "Gvajansko vrijeme", "CHADT": "Čatamsko ljetno računanje vremena", "VET": "Venecuelansko vrijeme", "BT": "Butansko vrijeme", "CDT": "Ljetno računanje centralnog vremena (SAD)", "GFT": "Vrijeme Francuske Gvajane", "NZDT": "Novozelandsko ljetno računanje vremena", "MEZ": "Standardno centralnoevropsko vrijeme"},
}
}
@@ -101,8 +101,8 @@ func (bs *bs_Latn_BA) CardinalPluralRule(num float64, v uint64) locales.PluralRu
n := math.Abs(num)
i := int64(n)
f := locales.F(n, v)
- iMod10 := i % 10
iMod100 := i % 100
+ iMod10 := i % 10
fMod10 := f % 10
fMod100 := f % 100
diff --git a/bs_Latn_BA/bs_Latn_BA_test.go b/bs_Latn_BA/bs_Latn_BA_test.go
new file mode 100644
index 00000000..ee4346d8
--- /dev/null
+++ b/bs_Latn_BA/bs_Latn_BA_test.go
@@ -0,0 +1,1120 @@
+package bs_Latn_BA
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "bs_Latn_BA"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ca/ca.go b/ca/ca.go
index 935dc984..6ecf249a 100644
--- a/ca/ca.go
+++ b/ca/ca.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"aC", "dC"},
erasNarrow: []string{"aC", "dC"},
erasWide: []string{"abans de Crist", "després de Crist"},
- timezones: map[string]string{"MDT": "Hora d’estiu de muntanya d’Amèrica del Nord", "EST": "Hora estàndard oriental d’Amèrica del Nord", "EDT": "Hora d’estiu oriental d’Amèrica del Nord", "AEST": "Hora estàndard d’Austràlia Oriental", "HAST": "Hora estàndard de Hawaii-Aleutianes", "PST": "Hora estàndard del Pacífic", "MEZ": "Hora estàndard del Centre d’Europa", "CAT": "Hora de l’Àfrica Central", "SAST": "Hora estàndard del sud de l’Àfrica", "WARST": "Hora d’estiu de l’oest de l’Argentina", "ADT": "Hora d’estiu de l’Atlàntic", "SGT": "Hora de Singapur", "OEZ": "Hora estàndard de l’Est d’Europa", "HNT": "Hora estàndard de Terranova", "SRT": "Hora de Surinam", "LHDT": "Horari d’estiu de Lord Howe", "ChST": "Hora de Chamorro", "HADT": "Hora d’estiu de Hawaii-Aleutianes", "WAT": "Hora estàndard de l’Àfrica Occidental", "HKT": "Hora estàndard de Hong Kong", "AWST": "Hora estàndard d’Austràlia Occidental", "UYST": "Hora d’estiu de l’Uruguai", "AST": "Hora estàndard de l’Atlàntic", "TMST": "Hora d’estiu del Turkmenistan", "JST": "Hora estàndard del Japó", "GFT": "Hora de la Guaiana Francesa", "ARST": "Hora d’estiu de l’Argentina", "UYT": "Hora estàndard de l’Uruguai", "AEDT": "Hora d’estiu d’Austràlia Oriental", "COST": "Hora d’estiu de Colòmbia", "IST": "Hora estàndard de l’Índia", "ACST": "Hora estàndard d’Austràlia Central", "TMT": "Hora estàndard del Turkmenistan", "AKST": "Hora estàndard d’Alaska", "WAST": "Hora d’estiu de l’Àfrica Occidental", "HKST": "Hora d’estiu de Hong Kong", "ACDT": "Hora d’estiu d’Austràlia Central", "HAT": "Hora d’estiu de Terranova", "PDT": "Hora d’estiu del Pacífic", "MESZ": "Hora d’estiu del Centre d’Europa", "NZST": "Hora estàndard de Nova Zelanda", "ACWST": "Hora estàndard d’Austràlia centre-occidental", "ACWDT": "Hora d’estiu d’Austràlia centre-occidental", "ECT": "Hora de l’Equador", "WART": "Hora estàndard de l’oest de l’Argentina", "AWDT": "Hora d’estiu d’Austràlia Occidental", "VET": "Hora de Veneçuela", "WESZ": "Hora d’estiu de l’Oest d’Europa", "CHADT": "Hora d’estiu de Chatham", "∅∅∅": "Hora d’estiu de Brasília", "ART": "Hora estàndard de l’Argentina", "JDT": "Hora d’estiu del Japó", "CLT": "Hora estàndard de Xile", "CLST": "Hora d’estiu de Xile", "MST": "Hora estàndard de muntanya d’Amèrica del Nord", "CHAST": "Hora estàndard de Chatham", "BT": "Hora de Bhutan", "GMT": "Hora del Meridià de Greenwich", "WITA": "Hora central d’Indonèsia", "NZDT": "Hora d’estiu de Nova Zelanda", "WIT": "Hora de l’est d’Indonèsia", "OESZ": "Hora d’estiu de l’Est d’Europa", "AKDT": "Hora d’estiu d’Alaska", "LHST": "Hora estàndard de Lord Howe", "MYT": "Hora de Malàisia", "CST": "Hora estàndard central d’Amèrica del Nord", "BOT": "Hora de Bolívia", "WEZ": "Hora estàndard de l’Oest d’Europa", "COT": "Hora estàndard de Colòmbia", "CDT": "Hora d’estiu central d’Amèrica del Nord", "WIB": "Hora de l’oest d’Indonèsia", "EAT": "Hora de l’Àfrica Oriental", "GYT": "Hora de Guyana"},
+ timezones: map[string]string{"WEZ": "Hora estàndard de l’Oest d’Europa", "HKT": "Hora estàndard de Hong Kong", "TMT": "Hora estàndard del Turkmenistan", "BOT": "Hora de Bolívia", "MESZ": "Hora d’estiu del Centre d’Europa", "COST": "Hora d’estiu de Colòmbia", "WARST": "Hora d’estiu de l’oest de l’Argentina", "CHAST": "Hora estàndard de Chatham", "VET": "Hora de Veneçuela", "MST": "Hora estàndard de Macau", "AST": "Hora estàndard de l’Atlàntic", "PST": "Hora estàndard del Pacífic", "HAST": "Hora estàndard de Hawaii-Aleutianes", "CAT": "Hora de l’Àfrica Central", "ECT": "Hora de l’Equador", "OEZ": "Hora estàndard de l’Est d’Europa", "WART": "Hora estàndard de l’oest de l’Argentina", "GYT": "Hora de Guyana", "AKST": "Hora estàndard d’Alaska", "PDT": "Hora d’estiu del Pacífic", "SAST": "Hora estàndard del sud de l’Àfrica", "∅∅∅": "Hora d’estiu de l’Amazones", "WAT": "Hora estàndard de l’Àfrica Occidental", "AEDT": "Hora d’estiu d’Austràlia Oriental", "CST": "Hora estàndard central d’Amèrica del Nord", "ACWDT": "Hora d’estiu d’Austràlia centre-occidental", "NZDT": "Hora d’estiu de Nova Zelanda", "TMST": "Hora d’estiu del Turkmenistan", "UYST": "Hora d’estiu de l’Uruguai", "CDT": "Hora d’estiu central d’Amèrica del Nord", "ARST": "Hora d’estiu de l’Argentina", "MDT": "Hora d’estiu de Macau", "BT": "Hora de Bhutan", "LHST": "Hora estàndard de Lord Howe", "HKST": "Hora d’estiu de Hong Kong", "MYT": "Hora de Malàisia", "CLST": "Hora d’estiu de Xile", "WIT": "Hora de l’est d’Indonèsia", "ACST": "Hora estàndard d’Austràlia Central", "ART": "Hora estàndard de l’Argentina", "AWDT": "Hora d’estiu d’Austràlia Occidental", "HNT": "Hora estàndard de Terranova", "HAT": "Hora d’estiu de Terranova", "ChST": "Hora de Chamorro", "AWST": "Hora estàndard d’Austràlia Occidental", "EST": "Hora estàndard oriental d’Amèrica del Nord", "UYT": "Hora estàndard de l’Uruguai", "IST": "Hora estàndard de l’Índia", "JST": "Hora estàndard del Japó", "NZST": "Hora estàndard de Nova Zelanda", "AEST": "Hora estàndard d’Austràlia Oriental", "CLT": "Hora estàndard de Xile", "WITA": "Hora central d’Indonèsia", "MEZ": "Hora estàndard del Centre d’Europa", "WAST": "Hora d’estiu de l’Àfrica Occidental", "WIB": "Hora de l’oest d’Indonèsia", "GMT": "Hora del Meridià de Greenwich", "SRT": "Hora de Surinam", "GFT": "Hora de la Guaiana Francesa", "CHADT": "Hora d’estiu de Chatham", "OESZ": "Hora d’estiu de l’Est d’Europa", "ACWST": "Hora estàndard d’Austràlia centre-occidental", "AKDT": "Hora d’estiu d’Alaska", "WESZ": "Hora d’estiu de l’Oest d’Europa", "SGT": "Hora de Singapur", "LHDT": "Horari d’estiu de Lord Howe", "JDT": "Hora d’estiu del Japó", "EDT": "Hora d’estiu oriental d’Amèrica del Nord", "HADT": "Hora d’estiu de Hawaii-Aleutianes", "COT": "Hora estàndard de Colòmbia", "EAT": "Hora de l’Àfrica Oriental", "ACDT": "Hora d’estiu d’Austràlia Central", "ADT": "Hora d’estiu de l’Atlàntic"},
}
}
diff --git a/ca/ca_test.go b/ca/ca_test.go
new file mode 100644
index 00000000..b465e400
--- /dev/null
+++ b/ca/ca_test.go
@@ -0,0 +1,1120 @@
+package ca
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ca"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ca_AD/ca_AD.go b/ca_AD/ca_AD.go
index ad681a8c..49ae7d37 100644
--- a/ca_AD/ca_AD.go
+++ b/ca_AD/ca_AD.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"aC", "dC"},
erasNarrow: []string{"aC", "dC"},
erasWide: []string{"abans de Crist", "després de Crist"},
- timezones: map[string]string{"CDT": "Hora d’estiu central d’Amèrica del Nord", "MEZ": "Hora estàndard del Centre d’Europa", "VET": "Hora de Veneçuela", "PDT": "Hora d’estiu del Pacífic", "AWDT": "Hora d’estiu d’Austràlia Occidental", "SRT": "Hora de Surinam", "WIT": "Hora de l’est d’Indonèsia", "ART": "Hora estàndard de l’Argentina", "CLST": "Hora d’estiu de Xile", "ACWDT": "Hora d’estiu d’Austràlia centre-occidental", "GFT": "Hora de la Guaiana Francesa", "CLT": "Hora estàndard de Xile", "ChST": "Hora de Chamorro", "AEST": "Hora estàndard d’Austràlia Oriental", "HKST": "Hora d’estiu de Hong Kong", "WEZ": "Hora estàndard de l’Oest d’Europa", "SAST": "Hora estàndard del sud de l’Àfrica", "IST": "Hora estàndard de l’Índia", "ACST": "Hora estàndard d’Austràlia Central", "∅∅∅": "Hora d’estiu de les Açores", "MESZ": "Hora d’estiu del Centre d’Europa", "UYST": "Hora d’estiu de l’Uruguai", "CST": "Hora estàndard central d’Amèrica del Nord", "NZST": "Hora estàndard de Nova Zelanda", "NZDT": "Hora d’estiu de Nova Zelanda", "BOT": "Hora de Bolívia", "ECT": "Hora de l’Equador", "PST": "Hora estàndard del Pacífic", "LHST": "Hora estàndard de Lord Howe", "SGT": "Hora de Singapur", "GMT": "Hora del Meridià de Greenwich", "CAT": "Hora de l’Àfrica Central", "TMT": "Hora estàndard del Turkmenistan", "LHDT": "Horari d’estiu de Lord Howe", "AEDT": "Hora d’estiu d’Austràlia Oriental", "EDT": "Hora d’estiu oriental d’Amèrica del Nord", "HADT": "Hora d’estiu de Hawaii-Aleutianes", "WART": "Hora estàndard de l’oest de l’Argentina", "WITA": "Hora central d’Indonèsia", "OEZ": "Hora estàndard de l’Est d’Europa", "TMST": "Hora d’estiu del Turkmenistan", "MYT": "Hora de Malàisia", "WESZ": "Hora d’estiu de l’Oest d’Europa", "ADT": "Hora d’estiu de l’Atlàntic", "BT": "Hora de Bhutan", "HKT": "Hora estàndard de Hong Kong", "OESZ": "Hora d’estiu de l’Est d’Europa", "HAT": "Hora d’estiu de Terranova", "COT": "Hora estàndard de Colòmbia", "AST": "Hora estàndard de l’Atlàntic", "EST": "Hora estàndard oriental d’Amèrica del Nord", "WAST": "Hora d’estiu de l’Àfrica Occidental", "GYT": "Hora de Guyana", "CHAST": "Hora estàndard de Chatham", "UYT": "Hora estàndard de l’Uruguai", "WAT": "Hora estàndard de l’Àfrica Occidental", "JDT": "Hora d’estiu del Japó", "AWST": "Hora estàndard d’Austràlia Occidental", "CHADT": "Hora d’estiu de Chatham", "MST": "Hora estàndard de muntanya d’Amèrica del Nord", "WARST": "Hora d’estiu de l’oest de l’Argentina", "AKDT": "Hora d’estiu d’Alaska", "COST": "Hora d’estiu de Colòmbia", "WIB": "Hora de l’oest d’Indonèsia", "HNT": "Hora estàndard de Terranova", "EAT": "Hora de l’Àfrica Oriental", "ACDT": "Hora d’estiu d’Austràlia Central", "JST": "Hora estàndard del Japó", "AKST": "Hora estàndard d’Alaska", "ARST": "Hora d’estiu de l’Argentina", "HAST": "Hora estàndard de Hawaii-Aleutianes", "MDT": "Hora d’estiu de muntanya d’Amèrica del Nord", "ACWST": "Hora estàndard d’Austràlia centre-occidental"},
+ timezones: map[string]string{"VET": "Hora de Veneçuela", "PST": "Hora estàndard del Pacífic", "PDT": "Hora d’estiu del Pacífic", "NZDT": "Hora d’estiu de Nova Zelanda", "CLT": "Hora estàndard de Xile", "HKT": "Hora estàndard de Hong Kong", "IST": "Hora estàndard de l’Índia", "COT": "Hora estàndard de Colòmbia", "GMT": "Hora del Meridià de Greenwich", "UYST": "Hora d’estiu de l’Uruguai", "CDT": "Hora d’estiu central d’Amèrica del Nord", "ACWDT": "Hora d’estiu d’Austràlia centre-occidental", "GYT": "Hora de Guyana", "ACDT": "Hora d’estiu d’Austràlia Central", "WAST": "Hora d’estiu de l’Àfrica Occidental", "SAST": "Hora estàndard del sud de l’Àfrica", "MESZ": "Hora d’estiu del Centre d’Europa", "AST": "Hora estàndard de l’Atlàntic", "AEDT": "Hora d’estiu d’Austràlia Oriental", "WARST": "Hora d’estiu de l’oest de l’Argentina", "AEST": "Hora estàndard d’Austràlia Oriental", "HAT": "Hora d’estiu de Terranova", "HAST": "Hora estàndard de Hawaii-Aleutianes", "EST": "Hora estàndard oriental d’Amèrica del Nord", "ChST": "Hora de Chamorro", "UYT": "Hora estàndard de l’Uruguai", "SRT": "Hora de Surinam", "BOT": "Hora de Bolívia", "ECT": "Hora de l’Equador", "AKDT": "Hora d’estiu d’Alaska", "ARST": "Hora d’estiu de l’Argentina", "JDT": "Hora d’estiu del Japó", "HNT": "Hora estàndard de Terranova", "OESZ": "Hora d’estiu de l’Est d’Europa", "∅∅∅": "Hora d’estiu de les Açores", "TMT": "Hora estàndard del Turkmenistan", "WEZ": "Hora estàndard de l’Oest d’Europa", "WIT": "Hora de l’est d’Indonèsia", "BT": "Hora de Bhutan", "CLST": "Hora d’estiu de Xile", "WART": "Hora estàndard de l’oest de l’Argentina", "WITA": "Hora central d’Indonèsia", "EDT": "Hora d’estiu oriental d’Amèrica del Nord", "COST": "Hora d’estiu de Colòmbia", "ACST": "Hora estàndard d’Austràlia Central", "AWDT": "Hora d’estiu d’Austràlia Occidental", "AWST": "Hora estàndard d’Austràlia Occidental", "TMST": "Hora d’estiu del Turkmenistan", "WESZ": "Hora d’estiu de l’Oest d’Europa", "OEZ": "Hora estàndard de l’Est d’Europa", "GFT": "Hora de la Guaiana Francesa", "WAT": "Hora estàndard de l’Àfrica Occidental", "EAT": "Hora de l’Àfrica Oriental", "LHDT": "Horari d’estiu de Lord Howe", "MYT": "Hora de Malàisia", "HKST": "Hora d’estiu de Hong Kong", "CHADT": "Hora d’estiu de Chatham", "MEZ": "Hora estàndard del Centre d’Europa", "HADT": "Hora d’estiu de Hawaii-Aleutianes", "MDT": "Hora d’estiu de Macau", "ACWST": "Hora estàndard d’Austràlia centre-occidental", "AKST": "Hora estàndard d’Alaska", "ART": "Hora estàndard de l’Argentina", "SGT": "Hora de Singapur", "LHST": "Hora estàndard de Lord Howe", "CHAST": "Hora estàndard de Chatham", "ADT": "Hora d’estiu de l’Atlàntic", "JST": "Hora estàndard del Japó", "NZST": "Hora estàndard de Nova Zelanda", "CAT": "Hora de l’Àfrica Central", "WIB": "Hora de l’oest d’Indonèsia", "CST": "Hora estàndard central d’Amèrica del Nord", "MST": "Hora estàndard de Macau"},
}
}
diff --git a/ca_AD/ca_AD_test.go b/ca_AD/ca_AD_test.go
new file mode 100644
index 00000000..4056866e
--- /dev/null
+++ b/ca_AD/ca_AD_test.go
@@ -0,0 +1,1120 @@
+package ca_AD
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ca_AD"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ca_ES/ca_ES.go b/ca_ES/ca_ES.go
index 3875d792..df6c2709 100644
--- a/ca_ES/ca_ES.go
+++ b/ca_ES/ca_ES.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"aC", "dC"},
erasNarrow: []string{"aC", "dC"},
erasWide: []string{"abans de Crist", "després de Crist"},
- timezones: map[string]string{"WITA": "Hora central d’Indonèsia", "JST": "Hora estàndard del Japó", "CST": "Hora estàndard central d’Amèrica del Nord", "CDT": "Hora d’estiu central d’Amèrica del Nord", "WARST": "Hora d’estiu de l’oest de l’Argentina", "OEZ": "Hora estàndard de l’Est d’Europa", "PST": "Hora estàndard del Pacífic", "AWST": "Hora estàndard d’Austràlia Occidental", "MYT": "Hora de Malàisia", "JDT": "Hora d’estiu del Japó", "AEDT": "Hora d’estiu d’Austràlia Oriental", "ACDT": "Hora d’estiu d’Austràlia Central", "NZDT": "Hora d’estiu de Nova Zelanda", "CLT": "Hora estàndard de Xile", "CAT": "Hora de l’Àfrica Central", "HKT": "Hora estàndard de Hong Kong", "AEST": "Hora estàndard d’Austràlia Oriental", "ADT": "Hora d’estiu de l’Atlàntic", "HKST": "Hora d’estiu de Hong Kong", "WIT": "Hora de l’est d’Indonèsia", "TMST": "Hora d’estiu del Turkmenistan", "UYT": "Hora estàndard de l’Uruguai", "ECT": "Hora de l’Equador", "HAST": "Hora estàndard de Hawaii-Aleutianes", "OESZ": "Hora d’estiu de l’Est d’Europa", "ART": "Hora estàndard de l’Argentina", "∅∅∅": "Hora d’estiu de l’Amazones", "PDT": "Hora d’estiu del Pacífic", "MESZ": "Hora d’estiu del Centre d’Europa", "SAST": "Hora estàndard del sud de l’Àfrica", "BT": "Hora de Bhutan", "IST": "Hora estàndard de l’Índia", "MDT": "Hora d’estiu de Macau", "LHDT": "Horari d’estiu de Lord Howe", "WESZ": "Hora d’estiu de l’Oest d’Europa", "CHAST": "Hora estàndard de Chatham", "CHADT": "Hora d’estiu de Chatham", "VET": "Hora de Veneçuela", "EDT": "Hora d’estiu oriental d’Amèrica del Nord", "SGT": "Hora de Singapur", "ACWST": "Hora estàndard d’Austràlia centre-occidental", "WAST": "Hora d’estiu de l’Àfrica Occidental", "TMT": "Hora estàndard del Turkmenistan", "LHST": "Hora estàndard de Lord Howe", "SRT": "Hora de Surinam", "COT": "Hora estàndard de Colòmbia", "GMT": "Hora del Meridià de Greenwich", "AKDT": "Hora d’estiu d’Alaska", "NZST": "Hora estàndard de Nova Zelanda", "UYST": "Hora d’estiu de l’Uruguai", "HAT": "Hora d’estiu de Terranova", "WIB": "Hora de l’oest d’Indonèsia", "AKST": "Hora estàndard d’Alaska", "AWDT": "Hora d’estiu d’Austràlia Occidental", "ChST": "Hora de Chamorro", "WAT": "Hora estàndard de l’Àfrica Occidental", "WEZ": "Hora estàndard de l’Oest d’Europa", "COST": "Hora d’estiu de Colòmbia", "MST": "Hora estàndard de Macau", "ARST": "Hora d’estiu de l’Argentina", "ACWDT": "Hora d’estiu d’Austràlia centre-occidental", "HNT": "Hora estàndard de Terranova", "EAT": "Hora de l’Àfrica Oriental", "GYT": "Hora de Guyana", "EST": "Hora estàndard oriental d’Amèrica del Nord", "WART": "Hora estàndard de l’oest de l’Argentina", "GFT": "Hora de la Guaiana Francesa", "ACST": "Hora estàndard d’Austràlia Central", "MEZ": "Hora estàndard del Centre d’Europa", "BOT": "Hora de Bolívia", "CLST": "Hora d’estiu de Xile", "AST": "Hora estàndard de l’Atlàntic", "HADT": "Hora d’estiu de Hawaii-Aleutianes"},
+ timezones: map[string]string{"COT": "Hora estàndard de Colòmbia", "WESZ": "Hora d’estiu de l’Oest d’Europa", "LHDT": "Horari d’estiu de Lord Howe", "WIB": "Hora de l’oest d’Indonèsia", "BT": "Hora de Bhutan", "AKDT": "Hora d’estiu d’Alaska", "AST": "Hora estàndard de l’Atlàntic", "HAST": "Hora estàndard de Hawaii-Aleutianes", "NZDT": "Hora d’estiu de Nova Zelanda", "SGT": "Hora de Singapur", "ACWST": "Hora estàndard d’Austràlia centre-occidental", "OEZ": "Hora estàndard de l’Est d’Europa", "WITA": "Hora central d’Indonèsia", "PDT": "Hora d’estiu del Pacífic", "OESZ": "Hora d’estiu de l’Est d’Europa", "UYST": "Hora d’estiu de l’Uruguai", "EDT": "Hora d’estiu oriental d’Amèrica del Nord", "JST": "Hora estàndard del Japó", "HNT": "Hora estàndard de Terranova", "HAT": "Hora d’estiu de Terranova", "CST": "Hora estàndard central d’Amèrica del Nord", "ACDT": "Hora d’estiu d’Austràlia Central", "HKST": "Hora d’estiu de Hong Kong", "AWDT": "Hora d’estiu d’Austràlia Occidental", "AKST": "Hora estàndard d’Alaska", "AEDT": "Hora d’estiu d’Austràlia Oriental", "MDT": "Hora d’estiu de muntanya d’Amèrica del Nord", "WART": "Hora estàndard de l’oest de l’Argentina", "JDT": "Hora d’estiu del Japó", "TMT": "Hora estàndard del Turkmenistan", "AEST": "Hora estàndard d’Austràlia Oriental", "MESZ": "Hora d’estiu del Centre d’Europa", "COST": "Hora d’estiu de Colòmbia", "ChST": "Hora de Chamorro", "WIT": "Hora de l’est d’Indonèsia", "ECT": "Hora de l’Equador", "MYT": "Hora de Malàisia", "ACWDT": "Hora d’estiu d’Austràlia centre-occidental", "PST": "Hora estàndard del Pacífic", "SAST": "Hora estàndard del sud de l’Àfrica", "CAT": "Hora de l’Àfrica Central", "GYT": "Hora de Guyana", "WAT": "Hora estàndard de l’Àfrica Occidental", "CLST": "Hora d’estiu de Xile", "LHST": "Hora estàndard de Lord Howe", "ARST": "Hora d’estiu de l’Argentina", "NZST": "Hora estàndard de Nova Zelanda", "BOT": "Hora de Bolívia", "IST": "Hora estàndard de l’Índia", "∅∅∅": "Hora d’estiu de l’Amazones", "WARST": "Hora d’estiu de l’oest de l’Argentina", "TMST": "Hora d’estiu del Turkmenistan", "WAST": "Hora d’estiu de l’Àfrica Occidental", "MST": "Hora estàndard de muntanya d’Amèrica del Nord", "GFT": "Hora de la Guaiana Francesa", "ART": "Hora estàndard de l’Argentina", "MEZ": "Hora estàndard del Centre d’Europa", "EST": "Hora estàndard oriental d’Amèrica del Nord", "SRT": "Hora de Surinam", "CDT": "Hora d’estiu central d’Amèrica del Nord", "ACST": "Hora estàndard d’Austràlia Central", "HADT": "Hora d’estiu de Hawaii-Aleutianes", "WEZ": "Hora estàndard de l’Oest d’Europa", "GMT": "Hora del Meridià de Greenwich", "UYT": "Hora estàndard de l’Uruguai", "EAT": "Hora de l’Àfrica Oriental", "VET": "Hora de Veneçuela", "CHADT": "Hora d’estiu de Chatham", "ADT": "Hora d’estiu de l’Atlàntic", "HKT": "Hora estàndard de Hong Kong", "AWST": "Hora estàndard d’Austràlia Occidental", "CLT": "Hora estàndard de Xile", "CHAST": "Hora estàndard de Chatham"},
}
}
diff --git a/ca_ES/ca_ES_test.go b/ca_ES/ca_ES_test.go
new file mode 100644
index 00000000..6162c247
--- /dev/null
+++ b/ca_ES/ca_ES_test.go
@@ -0,0 +1,1120 @@
+package ca_ES
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ca_ES"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ca_ES_VALENCIA/ca_ES_VALENCIA.go b/ca_ES_VALENCIA/ca_ES_VALENCIA.go
index 21b56883..cac0611c 100644
--- a/ca_ES_VALENCIA/ca_ES_VALENCIA.go
+++ b/ca_ES_VALENCIA/ca_ES_VALENCIA.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"aC", "dC"},
erasNarrow: []string{"aC", "dC"},
erasWide: []string{"abans de Crist", "després de Crist"},
- timezones: map[string]string{"AKDT": "Hora d’estiu d’Alaska", "CDT": "Hora d’estiu central d’Amèrica del Nord", "SRT": "Hora de Surinam", "CST": "Hora estàndard central d’Amèrica del Nord", "NZDT": "Hora d’estiu de Nova Zelanda", "CAT": "Hora de l’Àfrica Central", "HKT": "Hora estàndard de Hong Kong", "WIB": "Hora de l’oest d’Indonèsia", "CHAST": "Hora estàndard de Chatham", "CLT": "Hora estàndard de Xile", "CLST": "Hora d’estiu de Xile", "AST": "Hora estàndard de l’Atlàntic", "GFT": "Hora de la Guaiana Francesa", "JDT": "Hora d’estiu del Japó", "AWST": "Hora estàndard d’Austràlia Occidental", "UYST": "Hora d’estiu de l’Uruguai", "AEST": "Hora estàndard d’Austràlia Oriental", "WEZ": "Hora estàndard de l’Oest d’Europa", "ECT": "Hora de l’Equador", "WAST": "Hora d’estiu de l’Àfrica Occidental", "WITA": "Hora central d’Indonèsia", "BOT": "Hora de Bolívia", "ChST": "Hora de Chamorro", "ACST": "Hora estàndard d’Austràlia Central", "LHST": "Hora estàndard de Lord Howe", "OESZ": "Hora d’estiu de l’Est d’Europa", "∅∅∅": "Hora d’estiu de l’Amazones", "MDT": "Hora d’estiu de Macau", "NZST": "Hora estàndard de Nova Zelanda", "WESZ": "Hora d’estiu de l’Oest d’Europa", "ACWDT": "Hora d’estiu d’Austràlia centre-occidental", "SAST": "Hora estàndard del sud de l’Àfrica", "HNT": "Hora estàndard de Terranova", "COT": "Hora estàndard de Colòmbia", "EDT": "Hora d’estiu oriental d’Amèrica del Nord", "HAT": "Hora d’estiu de Terranova", "TMST": "Hora d’estiu del Turkmenistan", "WARST": "Hora d’estiu de l’oest de l’Argentina", "GMT": "Hora del Meridià de Greenwich", "MST": "Hora estàndard de Macau", "BT": "Hora de Bhutan", "WART": "Hora estàndard de l’oest de l’Argentina", "PST": "Hora estàndard del Pacífic", "MEZ": "Hora estàndard del Centre d’Europa", "ACDT": "Hora d’estiu d’Austràlia Central", "ART": "Hora estàndard de l’Argentina", "ADT": "Hora d’estiu de l’Atlàntic", "HKST": "Hora d’estiu de Hong Kong", "MYT": "Hora de Malàisia", "PDT": "Hora d’estiu del Pacífic", "LHDT": "Horari d’estiu de Lord Howe", "GYT": "Hora de Guyana", "AKST": "Hora estàndard d’Alaska", "VET": "Hora de Veneçuela", "COST": "Hora d’estiu de Colòmbia", "EST": "Hora estàndard oriental d’Amèrica del Nord", "WIT": "Hora de l’est d’Indonèsia", "EAT": "Hora de l’Àfrica Oriental", "HAST": "Hora estàndard de Hawaii-Aleutianes", "HADT": "Hora d’estiu de Hawaii-Aleutianes", "AWDT": "Hora d’estiu d’Austràlia Occidental", "CHADT": "Hora d’estiu de Chatham", "IST": "Hora estàndard de l’Índia", "TMT": "Hora estàndard del Turkmenistan", "JST": "Hora estàndard del Japó", "UYT": "Hora estàndard de l’Uruguai", "MESZ": "Hora d’estiu del Centre d’Europa", "AEDT": "Hora d’estiu d’Austràlia Oriental", "WAT": "Hora estàndard de l’Àfrica Occidental", "OEZ": "Hora estàndard de l’Est d’Europa", "SGT": "Hora de Singapur", "ARST": "Hora d’estiu de l’Argentina", "ACWST": "Hora estàndard d’Austràlia centre-occidental"},
+ timezones: map[string]string{"WIT": "Hora de l’est d’Indonèsia", "HKT": "Hora estàndard de Hong Kong", "HKST": "Hora d’estiu de Hong Kong", "BOT": "Hora de Bolívia", "MYT": "Hora de Malàisia", "AKST": "Hora estàndard d’Alaska", "MESZ": "Hora d’estiu del Centre d’Europa", "SGT": "Hora de Singapur", "BT": "Hora de Bhutan", "VET": "Hora de Veneçuela", "HAST": "Hora estàndard de Hawaii-Aleutianes", "NZDT": "Hora d’estiu de Nova Zelanda", "MDT": "Hora d’estiu de muntanya d’Amèrica del Nord", "UYT": "Hora estàndard de l’Uruguai", "OESZ": "Hora d’estiu de l’Est d’Europa", "WAST": "Hora d’estiu de l’Àfrica Occidental", "HNT": "Hora estàndard de Terranova", "∅∅∅": "Hora d’estiu de Brasília", "ACDT": "Hora d’estiu d’Austràlia Central", "WARST": "Hora d’estiu de l’oest de l’Argentina", "WITA": "Hora central d’Indonèsia", "JDT": "Hora d’estiu del Japó", "EDT": "Hora d’estiu oriental d’Amèrica del Nord", "TMT": "Hora estàndard del Turkmenistan", "ChST": "Hora de Chamorro", "ACST": "Hora estàndard d’Austràlia Central", "JST": "Hora estàndard del Japó", "PDT": "Hora d’estiu del Pacífic", "NZST": "Hora estàndard de Nova Zelanda", "WIB": "Hora de l’oest d’Indonèsia", "TMST": "Hora d’estiu del Turkmenistan", "MST": "Hora estàndard de muntanya d’Amèrica del Nord", "GFT": "Hora de la Guaiana Francesa", "CHAST": "Hora estàndard de Chatham", "AEST": "Hora estàndard d’Austràlia Oriental", "LHDT": "Horari d’estiu de Lord Howe", "AWST": "Hora estàndard d’Austràlia Occidental", "ART": "Hora estàndard de l’Argentina", "HADT": "Hora d’estiu de Hawaii-Aleutianes", "WAT": "Hora estàndard de l’Àfrica Occidental", "HAT": "Hora d’estiu de Terranova", "LHST": "Hora estàndard de Lord Howe", "UYST": "Hora d’estiu de l’Uruguai", "CST": "Hora estàndard central d’Amèrica del Nord", "SAST": "Hora estàndard del sud de l’Àfrica", "AST": "Hora estàndard de l’Atlàntic", "ACWDT": "Hora d’estiu d’Austràlia centre-occidental", "COST": "Hora d’estiu de Colòmbia", "OEZ": "Hora estàndard de l’Est d’Europa", "ACWST": "Hora estàndard d’Austràlia centre-occidental", "MEZ": "Hora estàndard del Centre d’Europa", "GYT": "Hora de Guyana", "CDT": "Hora d’estiu central d’Amèrica del Nord", "WART": "Hora estàndard de l’oest de l’Argentina", "AWDT": "Hora d’estiu d’Austràlia Occidental", "IST": "Hora estàndard de l’Índia", "AEDT": "Hora d’estiu d’Austràlia Oriental", "CHADT": "Hora d’estiu de Chatham", "ARST": "Hora d’estiu de l’Argentina", "CAT": "Hora de l’Àfrica Central", "GMT": "Hora del Meridià de Greenwich", "CLT": "Hora estàndard de Xile", "CLST": "Hora d’estiu de Xile", "AKDT": "Hora d’estiu d’Alaska", "ADT": "Hora d’estiu de l’Atlàntic", "EST": "Hora estàndard oriental d’Amèrica del Nord", "WEZ": "Hora estàndard de l’Oest d’Europa", "ECT": "Hora de l’Equador", "PST": "Hora estàndard del Pacífic", "COT": "Hora estàndard de Colòmbia", "EAT": "Hora de l’Àfrica Oriental", "SRT": "Hora de Surinam", "WESZ": "Hora d’estiu de l’Oest d’Europa"},
}
}
diff --git a/ca_ES_VALENCIA/ca_ES_VALENCIA_test.go b/ca_ES_VALENCIA/ca_ES_VALENCIA_test.go
new file mode 100644
index 00000000..390cffb4
--- /dev/null
+++ b/ca_ES_VALENCIA/ca_ES_VALENCIA_test.go
@@ -0,0 +1,1120 @@
+package ca_ES_VALENCIA
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ca_ES_VALENCIA"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ca_FR/ca_FR.go b/ca_FR/ca_FR.go
index cc55411a..214e4842 100644
--- a/ca_FR/ca_FR.go
+++ b/ca_FR/ca_FR.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"aC", "dC"},
erasNarrow: []string{"aC", "dC"},
erasWide: []string{"abans de Crist", "després de Crist"},
- timezones: map[string]string{"ART": "Hora estàndard de l’Argentina", "CHAST": "Hora estàndard de Chatham", "ACWDT": "Hora d’estiu d’Austràlia centre-occidental", "ADT": "Hora d’estiu de l’Atlàntic", "WART": "Hora estàndard de l’oest de l’Argentina", "WAST": "Hora d’estiu de l’Àfrica Occidental", "AST": "Hora estàndard de l’Atlàntic", "HKST": "Hora d’estiu de Hong Kong", "ACST": "Hora estàndard d’Austràlia Central", "WESZ": "Hora d’estiu de l’Oest d’Europa", "AKDT": "Hora d’estiu d’Alaska", "ChST": "Hora de Chamorro", "PST": "Hora estàndard del Pacífic", "AEDT": "Hora d’estiu d’Austràlia Oriental", "WEZ": "Hora estàndard de l’Oest d’Europa", "HADT": "Hora d’estiu de Hawaii-Aleutianes", "GFT": "Hora de la Guaiana Francesa", "TMST": "Hora d’estiu del Turkmenistan", "EDT": "Hora d’estiu oriental d’Amèrica del Nord", "WAT": "Hora estàndard de l’Àfrica Occidental", "SRT": "Hora de Surinam", "UYST": "Hora d’estiu de l’Uruguai", "SGT": "Hora de Singapur", "WITA": "Hora central d’Indonèsia", "BOT": "Hora de Bolívia", "MEZ": "Hora estàndard del Centre d’Europa", "∅∅∅": "Hora d’estiu de l’Amazones", "NZST": "Hora estàndard de Nova Zelanda", "CAT": "Hora de l’Àfrica Central", "HNT": "Hora estàndard de Terranova", "IST": "Hora estàndard de l’Índia", "JST": "Hora estàndard del Japó", "MESZ": "Hora d’estiu del Centre d’Europa", "WARST": "Hora d’estiu de l’oest de l’Argentina", "WIT": "Hora de l’est d’Indonèsia", "TMT": "Hora estàndard del Turkmenistan", "MYT": "Hora de Malàisia", "AKST": "Hora estàndard d’Alaska", "CDT": "Hora d’estiu central d’Amèrica del Nord", "ACWST": "Hora estàndard d’Austràlia centre-occidental", "ECT": "Hora de l’Equador", "OEZ": "Hora estàndard de l’Est d’Europa", "ACDT": "Hora d’estiu d’Austràlia Central", "BT": "Hora de Bhutan", "CHADT": "Hora d’estiu de Chatham", "PDT": "Hora d’estiu del Pacífic", "NZDT": "Hora d’estiu de Nova Zelanda", "EST": "Hora estàndard oriental d’Amèrica del Nord", "WIB": "Hora de l’oest d’Indonèsia", "LHDT": "Horari d’estiu de Lord Howe", "AWDT": "Hora d’estiu d’Austràlia Occidental", "UYT": "Hora estàndard de l’Uruguai", "HKT": "Hora estàndard de Hong Kong", "OESZ": "Hora d’estiu de l’Est d’Europa", "HAT": "Hora d’estiu de Terranova", "LHST": "Hora estàndard de Lord Howe", "GYT": "Hora de Guyana", "AEST": "Hora estàndard d’Austràlia Oriental", "COT": "Hora estàndard de Colòmbia", "HAST": "Hora estàndard de Hawaii-Aleutianes", "SAST": "Hora estàndard del sud de l’Àfrica", "GMT": "Hora del Meridià de Greenwich", "CLT": "Hora estàndard de Xile", "CLST": "Hora d’estiu de Xile", "VET": "Hora de Veneçuela", "MDT": "Hora d’estiu de Macau", "JDT": "Hora d’estiu del Japó", "MST": "Hora estàndard de Macau", "AWST": "Hora estàndard d’Austràlia Occidental", "CST": "Hora estàndard central d’Amèrica del Nord", "COST": "Hora d’estiu de Colòmbia", "ARST": "Hora d’estiu de l’Argentina", "EAT": "Hora de l’Àfrica Oriental"},
+ timezones: map[string]string{"AEST": "Hora estàndard d’Austràlia Oriental", "LHST": "Hora estàndard de Lord Howe", "WARST": "Hora d’estiu de l’oest de l’Argentina", "CHAST": "Hora estàndard de Chatham", "AKDT": "Hora d’estiu d’Alaska", "TMST": "Hora d’estiu del Turkmenistan", "WAT": "Hora estàndard de l’Àfrica Occidental", "WAST": "Hora d’estiu de l’Àfrica Occidental", "SAST": "Hora estàndard del sud de l’Àfrica", "TMT": "Hora estàndard del Turkmenistan", "HADT": "Hora d’estiu de Hawaii-Aleutianes", "WIT": "Hora de l’est d’Indonèsia", "HNT": "Hora estàndard de Terranova", "COT": "Hora estàndard de Colòmbia", "MYT": "Hora de Malàisia", "LHDT": "Horari d’estiu de Lord Howe", "ACST": "Hora estàndard d’Austràlia Central", "ARST": "Hora d’estiu de l’Argentina", "NZDT": "Hora d’estiu de Nova Zelanda", "∅∅∅": "Hora d’estiu de l’Amazones", "CLT": "Hora estàndard de Xile", "ACWDT": "Hora d’estiu d’Austràlia centre-occidental", "MEZ": "Hora estàndard del Centre d’Europa", "AWDT": "Hora d’estiu d’Austràlia Occidental", "AST": "Hora estàndard de l’Atlàntic", "EST": "Hora estàndard oriental d’Amèrica del Nord", "UYST": "Hora d’estiu de l’Uruguai", "ECT": "Hora de l’Equador", "VET": "Hora de Veneçuela", "ACWST": "Hora estàndard d’Austràlia centre-occidental", "EDT": "Hora d’estiu oriental d’Amèrica del Nord", "WEZ": "Hora estàndard de l’Oest d’Europa", "WESZ": "Hora d’estiu de l’Oest d’Europa", "JST": "Hora estàndard del Japó", "JDT": "Hora d’estiu del Japó", "IST": "Hora estàndard de l’Índia", "WIB": "Hora de l’oest d’Indonèsia", "BT": "Hora de Bhutan", "PST": "Hora estàndard del Pacífic", "NZST": "Hora estàndard de Nova Zelanda", "PDT": "Hora d’estiu del Pacífic", "COST": "Hora d’estiu de Colòmbia", "OEZ": "Hora estàndard de l’Est d’Europa", "CLST": "Hora d’estiu de Xile", "UYT": "Hora estàndard de l’Uruguai", "HKT": "Hora estàndard de Hong Kong", "AKST": "Hora estàndard d’Alaska", "SRT": "Hora de Surinam", "GFT": "Hora de la Guaiana Francesa", "AWST": "Hora estàndard d’Austràlia Occidental", "ADT": "Hora d’estiu de l’Atlàntic", "GYT": "Hora de Guyana", "OESZ": "Hora d’estiu de l’Est d’Europa", "ACDT": "Hora d’estiu d’Austràlia Central", "WART": "Hora estàndard de l’oest de l’Argentina", "MESZ": "Hora d’estiu del Centre d’Europa", "SGT": "Hora de Singapur", "CST": "Hora estàndard central d’Amèrica del Nord", "HAT": "Hora d’estiu de Terranova", "CAT": "Hora de l’Àfrica Central", "CDT": "Hora d’estiu central d’Amèrica del Nord", "HKST": "Hora d’estiu de Hong Kong", "BOT": "Hora de Bolívia", "EAT": "Hora de l’Àfrica Oriental", "WITA": "Hora central d’Indonèsia", "HAST": "Hora estàndard de Hawaii-Aleutianes", "CHADT": "Hora d’estiu de Chatham", "ChST": "Hora de Chamorro", "MST": "Hora estàndard de Macau", "MDT": "Hora d’estiu de Macau", "AEDT": "Hora d’estiu d’Austràlia Oriental", "ART": "Hora estàndard de l’Argentina", "GMT": "Hora del Meridià de Greenwich"},
}
}
diff --git a/ca_FR/ca_FR_test.go b/ca_FR/ca_FR_test.go
new file mode 100644
index 00000000..5cdbcf16
--- /dev/null
+++ b/ca_FR/ca_FR_test.go
@@ -0,0 +1,1120 @@
+package ca_FR
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ca_FR"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ca_IT/ca_IT.go b/ca_IT/ca_IT.go
index 0b1c4720..75b51d56 100644
--- a/ca_IT/ca_IT.go
+++ b/ca_IT/ca_IT.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"aC", "dC"},
erasNarrow: []string{"aC", "dC"},
erasWide: []string{"abans de Crist", "després de Crist"},
- timezones: map[string]string{"MST": "Hora estàndard de muntanya d’Amèrica del Nord", "COST": "Hora d’estiu de Colòmbia", "WAT": "Hora estàndard de l’Àfrica Occidental", "HKST": "Hora d’estiu de Hong Kong", "CDT": "Hora d’estiu central d’Amèrica del Nord", "NZDT": "Hora d’estiu de Nova Zelanda", "ARST": "Hora d’estiu de l’Argentina", "AKDT": "Hora d’estiu d’Alaska", "WEZ": "Hora estàndard de l’Oest d’Europa", "AST": "Hora estàndard de l’Atlàntic", "LHDT": "Horari d’estiu de Lord Howe", "VET": "Hora de Veneçuela", "ACWST": "Hora estàndard d’Austràlia centre-occidental", "AEST": "Hora estàndard d’Austràlia Oriental", "PDT": "Hora d’estiu del Pacífic", "ECT": "Hora de l’Equador", "ADT": "Hora d’estiu de l’Atlàntic", "SAST": "Hora estàndard del sud de l’Àfrica", "BT": "Hora de Bhutan", "UYT": "Hora estàndard de l’Uruguai", "MEZ": "Hora estàndard del Centre d’Europa", "CLST": "Hora d’estiu de Xile", "COT": "Hora estàndard de Colòmbia", "OESZ": "Hora d’estiu de l’Est d’Europa", "AWST": "Hora estàndard d’Austràlia Occidental", "HAT": "Hora d’estiu de Terranova", "ART": "Hora estàndard de l’Argentina", "UYST": "Hora d’estiu de l’Uruguai", "WITA": "Hora central d’Indonèsia", "WIB": "Hora de l’oest d’Indonèsia", "IST": "Hora estàndard de l’Índia", "EDT": "Hora d’estiu oriental d’Amèrica del Nord", "WARST": "Hora d’estiu de l’oest de l’Argentina", "GMT": "Hora del Meridià de Greenwich", "SRT": "Hora de Surinam", "WAST": "Hora d’estiu de l’Àfrica Occidental", "GFT": "Hora de la Guaiana Francesa", "PST": "Hora estàndard del Pacífic", "CST": "Hora estàndard central d’Amèrica del Nord", "AEDT": "Hora d’estiu d’Austràlia Oriental", "GYT": "Hora de Guyana", "MYT": "Hora de Malàisia", "TMT": "Hora estàndard del Turkmenistan", "ACST": "Hora estàndard d’Austràlia Central", "BOT": "Hora de Bolívia", "MDT": "Hora d’estiu de muntanya d’Amèrica del Nord", "CHADT": "Hora d’estiu de Chatham", "CAT": "Hora de l’Àfrica Central", "MESZ": "Hora d’estiu del Centre d’Europa", "HADT": "Hora d’estiu de Hawaii-Aleutianes", "LHST": "Hora estàndard de Lord Howe", "∅∅∅": "Hora d’estiu de Brasília", "EST": "Hora estàndard oriental d’Amèrica del Nord", "WIT": "Hora de l’est d’Indonèsia", "JST": "Hora estàndard del Japó", "HKT": "Hora estàndard de Hong Kong", "OEZ": "Hora estàndard de l’Est d’Europa", "HNT": "Hora estàndard de Terranova", "TMST": "Hora d’estiu del Turkmenistan", "CHAST": "Hora estàndard de Chatham", "CLT": "Hora estàndard de Xile", "HAST": "Hora estàndard de Hawaii-Aleutianes", "WART": "Hora estàndard de l’oest de l’Argentina", "NZST": "Hora estàndard de Nova Zelanda", "WESZ": "Hora d’estiu de l’Oest d’Europa", "ChST": "Hora de Chamorro", "SGT": "Hora de Singapur", "AKST": "Hora estàndard d’Alaska", "AWDT": "Hora d’estiu d’Austràlia Occidental", "ACWDT": "Hora d’estiu d’Austràlia centre-occidental", "EAT": "Hora de l’Àfrica Oriental", "ACDT": "Hora d’estiu d’Austràlia Central", "JDT": "Hora d’estiu del Japó"},
+ timezones: map[string]string{"TMT": "Hora estàndard del Turkmenistan", "CAT": "Hora de l’Àfrica Central", "UYST": "Hora d’estiu de l’Uruguai", "CST": "Hora estàndard central d’Amèrica del Nord", "ADT": "Hora d’estiu de l’Atlàntic", "ACWST": "Hora estàndard d’Austràlia centre-occidental", "ACWDT": "Hora d’estiu d’Austràlia centre-occidental", "WESZ": "Hora d’estiu de l’Oest d’Europa", "WITA": "Hora central d’Indonèsia", "MDT": "Hora d’estiu de muntanya d’Amèrica del Nord", "∅∅∅": "Hora d’estiu del Perú", "JDT": "Hora d’estiu del Japó", "NZST": "Hora estàndard de Nova Zelanda", "WAST": "Hora d’estiu de l’Àfrica Occidental", "ECT": "Hora de l’Equador", "VET": "Hora de Veneçuela", "AWDT": "Hora d’estiu d’Austràlia Occidental", "AKST": "Hora estàndard d’Alaska", "HADT": "Hora d’estiu de Hawaii-Aleutianes", "COT": "Hora estàndard de Colòmbia", "CLT": "Hora estàndard de Xile", "AST": "Hora estàndard de l’Atlàntic", "WAT": "Hora estàndard de l’Àfrica Occidental", "LHDT": "Horari d’estiu de Lord Howe", "MYT": "Hora de Malàisia", "BOT": "Hora de Bolívia", "HNT": "Hora estàndard de Terranova", "ChST": "Hora de Chamorro", "OEZ": "Hora estàndard de l’Est d’Europa", "EAT": "Hora de l’Àfrica Oriental", "EST": "Hora estàndard oriental d’Amèrica del Nord", "TMST": "Hora d’estiu del Turkmenistan", "LHST": "Hora estàndard de Lord Howe", "GFT": "Hora de la Guaiana Francesa", "SGT": "Hora de Singapur", "HKST": "Hora d’estiu de Hong Kong", "PST": "Hora estàndard del Pacífic", "WART": "Hora estàndard de l’oest de l’Argentina", "ART": "Hora estàndard de l’Argentina", "EDT": "Hora d’estiu oriental d’Amèrica del Nord", "SAST": "Hora estàndard del sud de l’Àfrica", "ACST": "Hora estàndard d’Austràlia Central", "JST": "Hora estàndard del Japó", "GMT": "Hora del Meridià de Greenwich", "SRT": "Hora de Surinam", "CDT": "Hora d’estiu central d’Amèrica del Nord", "AWST": "Hora estàndard d’Austràlia Occidental", "UYT": "Hora estàndard de l’Uruguai", "ARST": "Hora d’estiu de l’Argentina", "PDT": "Hora d’estiu del Pacífic", "MESZ": "Hora d’estiu del Centre d’Europa", "NZDT": "Hora d’estiu de Nova Zelanda", "BT": "Hora de Bhutan", "OESZ": "Hora d’estiu de l’Est d’Europa", "WIT": "Hora de l’est d’Indonèsia", "WARST": "Hora d’estiu de l’oest de l’Argentina", "CHAST": "Hora estàndard de Chatham", "GYT": "Hora de Guyana", "MST": "Hora estàndard de muntanya d’Amèrica del Nord", "CLST": "Hora d’estiu de Xile", "HKT": "Hora estàndard de Hong Kong", "CHADT": "Hora d’estiu de Chatham", "AEST": "Hora estàndard d’Austràlia Oriental", "HAT": "Hora d’estiu de Terranova", "AKDT": "Hora d’estiu d’Alaska", "MEZ": "Hora estàndard del Centre d’Europa", "WEZ": "Hora estàndard de l’Oest d’Europa", "WIB": "Hora de l’oest d’Indonèsia", "AEDT": "Hora d’estiu d’Austràlia Oriental", "ACDT": "Hora d’estiu d’Austràlia Central", "IST": "Hora estàndard de l’Índia", "HAST": "Hora estàndard de Hawaii-Aleutianes", "COST": "Hora d’estiu de Colòmbia"},
}
}
diff --git a/ca_IT/ca_IT_test.go b/ca_IT/ca_IT_test.go
new file mode 100644
index 00000000..2a1a3b33
--- /dev/null
+++ b/ca_IT/ca_IT_test.go
@@ -0,0 +1,1120 @@
+package ca_IT
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ca_IT"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ce/ce.go b/ce/ce.go
index 7a84a59f..8b5fe661 100644
--- a/ce/ce.go
+++ b/ce/ce.go
@@ -62,7 +62,7 @@ func New() locales.Translator {
monthsAbbreviated: []string{"", "янв", "фев", "мар", "апр", "май", "июн", "июл", "авг", "сен", "окт", "ноя", "дек"},
monthsWide: []string{"", "январь", "февраль", "март", "апрель", "май", "июнь", "июль", "август", "сентябрь", "октябрь", "ноябрь", "декабрь"},
daysWide: []string{"кӀиранан де", "оршотан де", "шинарин де", "кхаарин де", "еарин де", "пӀераскан де", "шот де"},
- timezones: map[string]string{"AKDT": "Аляска, аьхкенан хан", "EST": "Малхбален Америка, стандартан хан", "HAST": "Гавайн-алеутийн стандартан хан", "HADT": "Гавайн-алеутийн аьхкенан хан", "BT": "Бутан", "HKT": "Гонконг, стандартан хан", "OEZ": "Малхбален Европа, стандартан хан", "GFT": "Французийн Гвиана", "MEZ": "Юккъера Европа, стандартан хан", "MESZ": "Юккъера Европа, аьхкенан хан", "AEDT": "Малхбален Австрали, аьхкенан хан", "EDT": "Малхбален Америка, аьхкенан хан", "ACST": "Юккъера Австрали, стандартан хан", "UYST": "Уругвай, аьхкенан хан", "COT": "Колумби, стандартан хан", "∅∅∅": "Бразили, аьхкенан хан", "MST": "MST", "LHST": "Лорд-Хау, стандартан хан", "LHDT": "Лорд-Хау, аьхкенан хан", "UYT": "Уругвай, стандартан хан", "CST": "Юккъера Америка, стандартан хан", "WITA": "Юккъера Индонези", "ACWDT": "Юккъера Австрали, малхбузен аьхкенан хан", "PDT": "Тийна океанан аьхкенан хан", "GYT": "Гайана", "CDT": "Юккъера Америка, аьхкенан хан", "CAT": "Юккъера Африка", "PST": "Тийна океанан стандартан хан", "AKST": "Аляска, стандартан хан", "WART": "Малхбузен Аргентина, стандартан хан", "SRT": "Суринам", "CHAST": "Чатем, стандартан хан", "CHADT": "Чатем, аьхкенан хан", "IST": "Инди", "MDT": "MDT", "ARST": "Аргентина, аьхкенан хан", "WARST": "Малхбузен Аргентина, аьхкенан хан", "WIT": "Малхбален Индонези", "NZST": "Керла Зеланди, стандартан хан", "BOT": "Боливи", "SAST": "Къилба Африка", "HAT": "Ньюфаундленд, аьхкенан хан", "ACDT": "Юккъера Австрали, аьхкенан хан", "MYT": "Малайзи", "NZDT": "Керла Зеланди, аьхкенан хан", "ACWST": "Юккъера Австрали, малхбузен стандартан хан", "WESZ": "Малхбузен Европа, аьхкенан хан", "COST": "Колумби, аьхкенан хан", "ECT": "Эквадор", "ADT": "Атлантикан аьхкенан хан", "WAT": "Малхбузен Африка, стандартан хан", "WAST": "Малхбузен Африка, аьхкенан хан", "OESZ": "Малхбален Европа, аьхкенан хан", "AEST": "Малхбален Австрали, стандартан хан", "GMT": "Гринвичица юкъара хан", "AWST": "Малхбузен Австрали, стандартан хан", "JDT": "Япони, аьхкенан хан", "HKST": "Гонконг, аьхкенан хан", "WIB": "Малхбузен Индонези", "ART": "Аргентина, стандартан хан", "ChST": "Чаморро", "TMT": "Туркменин стандартан хан", "WEZ": "Малхбузен Европа, стандартан хан", "AST": "Атлантикан стандартан хан", "HNT": "Ньюфаундленд, стандартан хан", "TMST": "Туркменин аьхкенан хан", "EAT": "Малхбален Африка", "SGT": "Сингапур", "AWDT": "Малхбузен Австрали, аьхкенан хан", "JST": "Япони, стандартан хан", "CLT": "Чили, стандартан хан", "CLST": "Чили, аьхкенан хан", "VET": "Венесуэла"},
+ timezones: map[string]string{"NZDT": "Керла Зеланди, аьхкенан хан", "CAT": "Юккъера Африка", "GYT": "Гайана", "MST": "Лаьмнийн стандартан хан (АЦШ)", "CLST": "Чили, аьхкенан хан", "CDT": "Юккъера Америка, аьхкенан хан", "HKT": "Гонконг, стандартан хан", "ACWST": "Юккъера Австрали, малхбузен стандартан хан", "WAT": "Малхбузен Африка, стандартан хан", "LHDT": "Лорд-Хау, аьхкенан хан", "ACDT": "Юккъера Австрали, аьхкенан хан", "PST": "Тийна океанан стандартан хан", "TMT": "Туркменин стандартан хан", "TMST": "Туркменин аьхкенан хан", "JST": "Япони, стандартан хан", "AST": "Атлантикан стандартан хан", "SAST": "Къилба Африка", "EDT": "Малхбален Америка, аьхкенан хан", "ChST": "Чаморро", "UYST": "Уругвай, аьхкенан хан", "PDT": "Тийна океанан аьхкенан хан", "HAT": "Ньюфаундленд, аьхкенан хан", "WEZ": "Малхбузен Европа, стандартан хан", "MDT": "Лаьмнийн аьхкенан хан (АЦШ)", "WIT": "Малхбален Индонези", "WAST": "Малхбузен Африка, аьхкенан хан", "CLT": "Чили, стандартан хан", "CST": "Юккъера Америка, стандартан хан", "ART": "Аргентина, стандартан хан", "MEZ": "Юккъера Европа, стандартан хан", "LHST": "Лорд-Хау, стандартан хан", "ACST": "Юккъера Австрали, стандартан хан", "SGT": "Сингапур", "VET": "Венесуэла", "ACWDT": "Юккъера Австрали, малхбузен аьхкенан хан", "COT": "Колумби, стандартан хан", "BT": "Бутан", "AWST": "Малхбузен Австрали, стандартан хан", "GMT": "Гринвичица юкъара хан", "AEDT": "Малхбален Австрали, аьхкенан хан", "AWDT": "Малхбузен Австрали, аьхкенан хан", "WITA": "Юккъера Индонези", "AKST": "Аляска, стандартан хан", "NZST": "Керла Зеланди, стандартан хан", "HNT": "Ньюфаундленд, стандартан хан", "MYT": "Малайзи", "UYT": "Уругвай, стандартан хан", "SRT": "Суринам", "MESZ": "Юккъера Европа, аьхкенан хан", "OESZ": "Малхбален Европа, аьхкенан хан", "ARST": "Аргентина, аьхкенан хан", "AKDT": "Аляска, аьхкенан хан", "IST": "Инди", "WART": "Малхбузен Аргентина, стандартан хан", "WARST": "Малхбузен Аргентина, аьхкенан хан", "ECT": "Эквадор", "CHAST": "Чатем, стандартан хан", "CHADT": "Чатем, аьхкенан хан", "WESZ": "Малхбузен Европа, аьхкенан хан", "OEZ": "Малхбален Европа, стандартан хан", "AEST": "Малхбален Австрали, стандартан хан", "∅∅∅": "Бразили, аьхкенан хан", "GFT": "Французийн Гвиана", "HAST": "Гавайн-алеутийн стандартан хан", "BOT": "Боливи", "EST": "Малхбален Америка, стандартан хан", "HKST": "Гонконг, аьхкенан хан", "HADT": "Гавайн-алеутийн аьхкенан хан", "COST": "Колумби, аьхкенан хан", "JDT": "Япони, аьхкенан хан", "EAT": "Малхбален Африка", "ADT": "Атлантикан аьхкенан хан", "WIB": "Малхбузен Индонези"},
}
}
@@ -125,7 +125,7 @@ func (ce *ce) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (ce *ce) MonthsNarrow() []string {
- return ce.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/ce/ce_test.go b/ce/ce_test.go
new file mode 100644
index 00000000..32181dcf
--- /dev/null
+++ b/ce/ce_test.go
@@ -0,0 +1,1120 @@
+package ce
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ce"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ce_RU/ce_RU.go b/ce_RU/ce_RU.go
index d647185b..0fc1bb35 100644
--- a/ce_RU/ce_RU.go
+++ b/ce_RU/ce_RU.go
@@ -62,7 +62,7 @@ func New() locales.Translator {
monthsAbbreviated: []string{"", "янв", "фев", "мар", "апр", "май", "июн", "июл", "авг", "сен", "окт", "ноя", "дек"},
monthsWide: []string{"", "январь", "февраль", "март", "апрель", "май", "июнь", "июль", "август", "сентябрь", "октябрь", "ноябрь", "декабрь"},
daysWide: []string{"кӀиранан де", "оршотан де", "шинарин де", "кхаарин де", "еарин де", "пӀераскан де", "шот де"},
- timezones: map[string]string{"CHAST": "Чатем, стандартан хан", "CLT": "Чили, стандартан хан", "WITA": "Юккъера Индонези", "AKST": "Аляска, стандартан хан", "ChST": "Чаморро", "WESZ": "Малхбузен Европа, аьхкенан хан", "HKST": "Гонконг, аьхкенан хан", "SRT": "Суринам", "NZST": "Керла Зеланди, стандартан хан", "CLST": "Чили, аьхкенан хан", "OESZ": "Малхбален Европа, аьхкенан хан", "ACST": "Юккъера Австрали, стандартан хан", "LHST": "Лорд-Хау, стандартан хан", "COT": "Колумби, стандартан хан", "SAST": "Къилба Африка", "MST": "MST", "AEDT": "Малхбален Австрали, аьхкенан хан", "AST": "Атлантикан стандартан хан", "WAST": "Малхбузен Африка, аьхкенан хан", "PDT": "Тийна океанан аьхкенан хан", "EAT": "Малхбален Африка", "NZDT": "Керла Зеланди, аьхкенан хан", "CST": "Юккъера Америка, стандартан хан", "CHADT": "Чатем, аьхкенан хан", "VET": "Венесуэла", "SGT": "Сингапур", "GMT": "Гринвичица юкъара хан", "ARST": "Аргентина, аьхкенан хан", "HAT": "Ньюфаундленд, аьхкенан хан", "HNT": "Ньюфаундленд, стандартан хан", "AKDT": "Аляска, аьхкенан хан", "EDT": "Малхбален Америка, аьхкенан хан", "COST": "Колумби, аьхкенан хан", "ECT": "Эквадор", "HADT": "Гавайн-алеутийн аьхкенан хан", "ADT": "Атлантикан аьхкенан хан", "WAT": "Малхбузен Африка, стандартан хан", "MDT": "MDT", "WART": "Малхбузен Аргентина, стандартан хан", "TMST": "Туркменин аьхкенан хан", "CAT": "Юккъера Африка", "ACDT": "Юккъера Австрали, аьхкенан хан", "JST": "Япони, стандартан хан", "∅∅∅": "Амазонка, аьхкенан хан", "LHDT": "Лорд-Хау, аьхкенан хан", "WIB": "Малхбузен Индонези", "TMT": "Туркменин стандартан хан", "GYT": "Гайана", "MESZ": "Юккъера Европа, аьхкенан хан", "ACWDT": "Юккъера Австрали, малхбузен аьхкенан хан", "WEZ": "Малхбузен Европа, стандартан хан", "WARST": "Малхбузен Аргентина, аьхкенан хан", "GFT": "Французийн Гвиана", "ART": "Аргентина, стандартан хан", "BT": "Бутан", "MYT": "Малайзи", "JDT": "Япони, аьхкенан хан", "UYST": "Уругвай, аьхкенан хан", "ACWST": "Юккъера Австрали, малхбузен стандартан хан", "AEST": "Малхбален Австрали, стандартан хан", "HKT": "Гонконг, стандартан хан", "OEZ": "Малхбален Европа, стандартан хан", "AWDT": "Малхбузен Австрали, аьхкенан хан", "HAST": "Гавайн-алеутийн стандартан хан", "WIT": "Малхбален Индонези", "IST": "Инди", "CDT": "Юккъера Америка, аьхкенан хан", "AWST": "Малхбузен Австрали, стандартан хан", "MEZ": "Юккъера Европа, стандартан хан", "BOT": "Боливи", "UYT": "Уругвай, стандартан хан", "EST": "Малхбален Америка, стандартан хан", "PST": "Тийна океанан стандартан хан"},
+ timezones: map[string]string{"NZST": "Керла Зеланди, стандартан хан", "NZDT": "Керла Зеланди, аьхкенан хан", "WAST": "Малхбузен Африка, аьхкенан хан", "HAT": "Ньюфаундленд, аьхкенан хан", "SGT": "Сингапур", "AEDT": "Малхбален Австрали, аьхкенан хан", "CST": "Юккъера Америка, стандартан хан", "AKST": "Аляска, стандартан хан", "IST": "Инди", "CAT": "Юккъера Африка", "WEZ": "Малхбузен Европа, стандартан хан", "HNT": "Ньюфаундленд, стандартан хан", "OEZ": "Малхбален Европа, стандартан хан", "UYST": "Уругвай, аьхкенан хан", "WARST": "Малхбузен Аргентина, аьхкенан хан", "HKT": "Гонконг, стандартан хан", "BOT": "Боливи", "SRT": "Суринам", "UYT": "Уругвай, стандартан хан", "∅∅∅": "Азоран гӀайренаш, аьхкенан хан", "CHADT": "Чатем, аьхкенан хан", "ART": "Аргентина, стандартан хан", "JDT": "Япони, аьхкенан хан", "TMT": "Туркменин стандартан хан", "ChST": "Чаморро", "LHDT": "Лорд-Хау, аьхкенан хан", "HKST": "Гонконг, аьхкенан хан", "MDT": "MDT", "PDT": "Тийна океанан аьхкенан хан", "BT": "Бутан", "CDT": "Юккъера Америка, аьхкенан хан", "EDT": "Малхбален Америка, аьхкенан хан", "HADT": "Гавайн-алеутийн аьхкенан хан", "VET": "Венесуэла", "ADT": "Атлантикан аьхкенан хан", "AWDT": "Малхбузен Австрали, аьхкенан хан", "PST": "Тийна океанан стандартан хан", "HAST": "Гавайн-алеутийн стандартан хан", "ACST": "Юккъера Австрали, стандартан хан", "GYT": "Гайана", "ACWDT": "Юккъера Австрали, малхбузен аьхкенан хан", "ARST": "Аргентина, аьхкенан хан", "MEZ": "Юккъера Европа, стандартан хан", "WESZ": "Малхбузен Европа, аьхкенан хан", "COT": "Колумби, стандартан хан", "WIB": "Малхбузен Индонези", "GMT": "Гринвичица юкъара хан", "CLST": "Чили, аьхкенан хан", "WART": "Малхбузен Аргентина, стандартан хан", "MST": "MST", "MESZ": "Юккъера Европа, аьхкенан хан", "COST": "Колумби, аьхкенан хан", "CLT": "Чили, стандартан хан", "GFT": "Французийн Гвиана", "ACWST": "Юккъера Австрали, малхбузен стандартан хан", "JST": "Япони, стандартан хан", "WAT": "Малхбузен Африка, стандартан хан", "LHST": "Лорд-Хау, стандартан хан", "MYT": "Малайзи", "WIT": "Малхбален Индонези", "WITA": "Юккъера Индонези", "EST": "Малхбален Америка, стандартан хан", "ECT": "Эквадор", "SAST": "Къилба Африка", "CHAST": "Чатем, стандартан хан", "AKDT": "Аляска, аьхкенан хан", "TMST": "Туркменин аьхкенан хан", "AEST": "Малхбален Австрали, стандартан хан", "OESZ": "Малхбален Европа, аьхкенан хан", "AST": "Атлантикан стандартан хан", "AWST": "Малхбузен Австрали, стандартан хан", "EAT": "Малхбален Африка", "ACDT": "Юккъера Австрали, аьхкенан хан"},
}
}
@@ -125,7 +125,7 @@ func (ce *ce_RU) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (ce *ce_RU) MonthsNarrow() []string {
- return ce.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/ce_RU/ce_RU_test.go b/ce_RU/ce_RU_test.go
new file mode 100644
index 00000000..281f8d24
--- /dev/null
+++ b/ce_RU/ce_RU_test.go
@@ -0,0 +1,1120 @@
+package ce_RU
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ce_RU"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/cgg/cgg.go b/cgg/cgg.go
index e040355a..9c0dbf93 100644
--- a/cgg/cgg.go
+++ b/cgg/cgg.go
@@ -57,7 +57,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"", ""},
erasWide: []string{"Kurisito Atakaijire", "Kurisito Yaijire"},
- timezones: map[string]string{"SAST": "SAST", "WAT": "WAT", "BT": "BT", "ACST": "ACST", "JST": "JST", "JDT": "JDT", "UYST": "UYST", "ACWDT": "ACWDT", "ADT": "ADT", "OESZ": "OESZ", "MDT": "MDT", "TMST": "TMST", "NZST": "NZST", "CLT": "CLT", "COST": "COST", "∅∅∅": "∅∅∅", "GMT": "GMT", "MST": "MST", "MESZ": "MESZ", "CHAST": "CHAST", "AKDT": "AKDT", "CAT": "CAT", "GYT": "GYT", "CST": "CST", "BOT": "BOT", "HKST": "HKST", "MYT": "MYT", "EDT": "EDT", "OEZ": "OEZ", "ACDT": "ACDT", "ART": "ART", "SGT": "SGT", "IST": "IST", "WITA": "WITA", "AWST": "AWST", "ACWST": "ACWST", "MEZ": "MEZ", "AEST": "AEST", "ECT": "ECT", "WIT": "WIT", "WIB": "WIB", "HAT": "HAT", "ARST": "ARST", "AKST": "AKST", "UYT": "UYT", "WEZ": "WEZ", "ChST": "ChST", "CHADT": "CHADT", "WAST": "WAST", "LHST": "LHST", "LHDT": "LHDT", "CLST": "CLST", "WESZ": "WESZ", "HNT": "HNT", "TMT": "TMT", "SRT": "SRT", "CDT": "CDT", "COT": "COT", "HAST": "HAST", "EAT": "EAT", "PST": "PST", "NZDT": "NZDT", "EST": "EST", "WARST": "WARST", "VET": "VET", "HKT": "HKT", "PDT": "PDT", "AEDT": "AEDT", "AST": "AST", "HADT": "HADT", "WART": "WART", "GFT": "GFT", "AWDT": "AWDT"},
+ timezones: map[string]string{"MESZ": "MESZ", "AEDT": "AEDT", "WAST": "WAST", "LHST": "LHST", "CDT": "CDT", "ACWDT": "ACWDT", "NZDT": "NZDT", "HAT": "HAT", "ACDT": "ACDT", "HKT": "HKT", "CHAST": "CHAST", "MEZ": "MEZ", "SAST": "SAST", "CLT": "CLT", "ARST": "ARST", "CAT": "CAT", "HKST": "HKST", "AWST": "AWST", "CHADT": "CHADT", "AST": "AST", "PDT": "PDT", "TMST": "TMST", "WART": "WART", "WARST": "WARST", "AEST": "AEST", "MYT": "MYT", "BT": "BT", "AKDT": "AKDT", "PST": "PST", "BOT": "BOT", "UYST": "UYST", "ACST": "ACST", "ADT": "ADT", "ChST": "ChST", "GMT": "GMT", "MST": "MST", "EAT": "EAT", "LHDT": "LHDT", "HAST": "HAST", "HNT": "HNT", "TMT": "TMT", "CST": "CST", "ACWST": "ACWST", "UYT": "UYT", "GFT": "GFT", "VET": "VET", "HADT": "HADT", "NZST": "NZST", "∅∅∅": "∅∅∅", "COST": "COST", "WEZ": "WEZ", "AWDT": "AWDT", "CLST": "CLST", "ECT": "ECT", "JST": "JST", "WESZ": "WESZ", "OEZ": "OEZ", "OESZ": "OESZ", "MDT": "MDT", "WIT": "WIT", "EDT": "EDT", "SGT": "SGT", "WIB": "WIB", "ART": "ART", "JDT": "JDT", "EST": "EST", "COT": "COT", "WITA": "WITA", "SRT": "SRT", "AKST": "AKST", "IST": "IST", "WAT": "WAT", "GYT": "GYT"},
}
}
diff --git a/cgg/cgg_test.go b/cgg/cgg_test.go
new file mode 100644
index 00000000..3fae92e9
--- /dev/null
+++ b/cgg/cgg_test.go
@@ -0,0 +1,1120 @@
+package cgg
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "cgg"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/cgg_UG/cgg_UG.go b/cgg_UG/cgg_UG.go
index 4405a294..256653c0 100644
--- a/cgg_UG/cgg_UG.go
+++ b/cgg_UG/cgg_UG.go
@@ -57,7 +57,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"", ""},
erasWide: []string{"Kurisito Atakaijire", "Kurisito Yaijire"},
- timezones: map[string]string{"AKST": "AKST", "CHADT": "CHADT", "WAST": "WAST", "JST": "JST", "IST": "IST", "JDT": "JDT", "CST": "CST", "MEZ": "MEZ", "ACWDT": "ACWDT", "CAT": "CAT", "HKT": "HKT", "SAST": "SAST", "TMT": "TMT", "EAT": "EAT", "MESZ": "MESZ", "ChST": "ChST", "SGT": "SGT", "GMT": "GMT", "ARST": "ARST", "WIB": "WIB", "TMST": "TMST", "AWST": "AWST", "LHDT": "LHDT", "GYT": "GYT", "UYT": "UYT", "WAT": "WAT", "WITA": "WITA", "CHAST": "CHAST", "NZDT": "NZDT", "COST": "COST", "WARST": "WARST", "ART": "ART", "VET": "VET", "HAT": "HAT", "WIT": "WIT", "GFT": "GFT", "COT": "COT", "EDT": "EDT", "BT": "BT", "CLT": "CLT", "PDT": "PDT", "AST": "AST", "ADT": "ADT", "HADT": "HADT", "HKST": "HKST", "ACDT": "ACDT", "UYST": "UYST", "WART": "WART", "HNT": "HNT", "OESZ": "OESZ", "AKDT": "AKDT", "MST": "MST", "AWDT": "AWDT", "LHST": "LHST", "OEZ": "OEZ", "∅∅∅": "∅∅∅", "BOT": "BOT", "AEDT": "AEDT", "ECT": "ECT", "EST": "EST", "MYT": "MYT", "PST": "PST", "HAST": "HAST", "WEZ": "WEZ", "WESZ": "WESZ", "SRT": "SRT", "NZST": "NZST", "ACWST": "ACWST", "ACST": "ACST", "MDT": "MDT", "CLST": "CLST", "CDT": "CDT", "AEST": "AEST"},
+ timezones: map[string]string{"ADT": "ADT", "MEZ": "MEZ", "TMT": "TMT", "GMT": "GMT", "ACWST": "ACWST", "JDT": "JDT", "MDT": "MDT", "GFT": "GFT", "IST": "IST", "PST": "PST", "ART": "ART", "ARST": "ARST", "AEST": "AEST", "CLT": "CLT", "EST": "EST", "NZDT": "NZDT", "WEZ": "WEZ", "SGT": "SGT", "UYST": "UYST", "ACST": "ACST", "CDT": "CDT", "BT": "BT", "MYT": "MYT", "COT": "COT", "COST": "COST", "WAT": "WAT", "HNT": "HNT", "ChST": "ChST", "OESZ": "OESZ", "CST": "CST", "ECT": "ECT", "WIT": "WIT", "AWST": "AWST", "EDT": "EDT", "HADT": "HADT", "NZST": "NZST", "TMST": "TMST", "AEDT": "AEDT", "OEZ": "OEZ", "LHDT": "LHDT", "CHAST": "CHAST", "MESZ": "MESZ", "BOT": "BOT", "GYT": "GYT", "LHST": "LHST", "EAT": "EAT", "WARST": "WARST", "SRT": "SRT", "AKST": "AKST", "HAST": "HAST", "WAST": "WAST", "HAT": "HAT", "MST": "MST", "AST": "AST", "AWDT": "AWDT", "CAT": "CAT", "CLST": "CLST", "WART": "WART", "HKST": "HKST", "ACWDT": "ACWDT", "AKDT": "AKDT", "WESZ": "WESZ", "WIB": "WIB", "HKT": "HKT", "CHADT": "CHADT", "∅∅∅": "∅∅∅", "UYT": "UYT", "ACDT": "ACDT", "VET": "VET", "WITA": "WITA", "JST": "JST", "PDT": "PDT", "SAST": "SAST"},
}
}
diff --git a/cgg_UG/cgg_UG_test.go b/cgg_UG/cgg_UG_test.go
new file mode 100644
index 00000000..6620db68
--- /dev/null
+++ b/cgg_UG/cgg_UG_test.go
@@ -0,0 +1,1120 @@
+package cgg_UG
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "cgg_UG"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/chr/chr.go b/chr/chr.go
index a923156c..3ff1cda9 100644
--- a/chr/chr.go
+++ b/chr/chr.go
@@ -69,7 +69,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ᎤᏓᎷᎸ", "ᎤᎶᏐᏅ"},
erasNarrow: []string{"", ""},
erasWide: []string{"Ꮟ ᏥᏌ ᎾᏕᎲᏍᎬᎾ", "ᎠᎩᏃᎮᎵᏓᏍᏗᏱ ᎠᏕᏘᏱᏍᎬ ᏱᎰᏩ ᏧᏓᏂᎸᎢᏍᏗ"},
- timezones: map[string]string{"GFT": "GFT", "MYT": "MYT", "AWDT": "AWDT", "UYT": "UYT", "BT": "BT", "∅∅∅": "∅∅∅", "CAT": "CAT", "ADT": "ADT", "NZDT": "NZDT", "VET": "VET", "SGT": "SGT", "SAST": "SAST", "HNT": "HNT", "NZST": "NZST", "AEST": "AEST", "EDT": "ᎧᎸᎬᎢᏗᏢ ᎢᎦ ᎢᏳᏩᎪᏗ", "CST": "ᎠᏰᎵ ᏰᎵᏊ ᏗᏙᎳᎩ ᎢᏳᏩᎪᏗ", "MEZ": "MEZ", "EAT": "EAT", "ACDT": "ACDT", "AWST": "AWST", "WEZ": "WEZ", "ACWST": "ACWST", "UYST": "UYST", "AEDT": "AEDT", "ARST": "ARST", "AKDT": "AKDT", "LHST": "LHST", "ACWDT": "ACWDT", "WIB": "WIB", "HKT": "HKT", "LHDT": "LHDT", "ChST": "ChST", "HADT": "HADT", "JST": "JST", "WIT": "WIT", "GMT": "ᎢᏤ ᎢᏳᏍᏗ ᎢᏳᏩᎪᏗ", "WAST": "WAST", "HAT": "HAT", "PDT": "ᏭᏕᎵᎬ ᎢᎦ ᎢᏳᏩᎪᏗ", "CHADT": "CHADT", "CLST": "CLST", "IST": "IST", "TMST": "TMST", "AST": "AST", "WITA": "WITA", "WAT": "WAT", "HKST": "HKST", "ACST": "ACST", "AKST": "AKST", "MDT": "ᎣᏓᎸ ᎢᎦ ᎢᏳᏩᎪᏗ", "ECT": "ECT", "HAST": "HAST", "TMT": "TMT", "ART": "ART", "PST": "ᏭᏕᎵᎬ ᏰᎵᏊ ᏗᏙᎳᎩ ᎢᏳᏩᎪᏗ", "MST": "ᎣᏓᎸ ᏰᎵᏊ ᏗᏙᎳᎩ ᎢᏳᏩᎪᏗ", "EST": "ᎧᎸᎬᎢᏗᏢ ᏰᎵᏊ ᏗᏙᎳᎩ ᎢᏳᏩᎪᏗ", "COST": "COST", "OESZ": "OESZ", "BOT": "BOT", "CLT": "CLT", "WESZ": "WESZ", "COT": "COT", "WART": "WART", "OEZ": "OEZ", "JDT": "JDT", "SRT": "SRT", "MESZ": "MESZ", "CHAST": "CHAST", "GYT": "GYT", "CDT": "ᎠᏰᎵ ᎢᎦ ᎢᏳᏩᎪᏗ", "WARST": "WARST"},
+ timezones: map[string]string{"UYST": "UYST", "ADT": "ADT", "EST": "ᎧᎸᎬᎢᏗᏢ ᏰᎵᏊ ᏗᏙᎳᎩ ᎢᏳᏩᎪᏗ", "HAT": "HAT", "WARST": "WARST", "AST": "AST", "WEZ": "WEZ", "AEST": "AEST", "AEDT": "AEDT", "GYT": "GYT", "SRT": "SRT", "SAST": "SAST", "HNT": "HNT", "LHDT": "LHDT", "AWST": "AWST", "JDT": "JDT", "PST": "ᏭᏕᎵᎬ ᏰᎵᏊ ᏗᏙᎳᎩ ᎢᏳᏩᎪᏗ", "IST": "IST", "UYT": "UYT", "ACDT": "ACDT", "AKST": "AKST", "ChST": "ChST", "LHST": "LHST", "WESZ": "WESZ", "WAST": "WAST", "OEZ": "OEZ", "GMT": "ᎢᏤ ᎢᏳᏍᏗ ᎢᏳᏩᎪᏗ", "MST": "ᎣᏓᎸ ᏰᎵᏊ ᏗᏙᎳᎩ ᎢᏳᏩᎪᏗ", "ARST": "ARST", "MESZ": "MESZ", "∅∅∅": "∅∅∅", "TMT": "TMT", "CHAST": "CHAST", "ACWST": "ACWST", "ECT": "ECT", "VET": "VET", "AWDT": "AWDT", "ART": "ART", "WIB": "WIB", "CHADT": "CHADT", "HKST": "HKST", "ACWDT": "ACWDT", "JST": "JST", "HAST": "HAST", "CDT": "ᎠᏰᎵ ᎢᎦ ᎢᏳᏩᎪᏗ", "NZST": "NZST", "CLST": "CLST", "CST": "ᎠᏰᎵ ᏰᎵᏊ ᏗᏙᎳᎩ ᎢᏳᏩᎪᏗ", "AKDT": "AKDT", "EDT": "ᎧᎸᎬᎢᏗᏢ ᎢᎦ ᎢᏳᏩᎪᏗ", "PDT": "ᏭᏕᎵᎬ ᎢᎦ ᎢᏳᏩᎪᏗ", "CAT": "CAT", "GFT": "GFT", "HKT": "HKT", "WITA": "WITA", "TMST": "TMST", "BT": "BT", "CLT": "CLT", "SGT": "SGT", "COST": "COST", "MDT": "ᎣᏓᎸ ᎢᎦ ᎢᏳᏩᎪᏗ", "MYT": "MYT", "WIT": "WIT", "WART": "WART", "NZDT": "NZDT", "BOT": "BOT", "COT": "COT", "WAT": "WAT", "OESZ": "OESZ", "EAT": "EAT", "ACST": "ACST", "MEZ": "MEZ", "HADT": "HADT"},
}
}
diff --git a/chr/chr_test.go b/chr/chr_test.go
new file mode 100644
index 00000000..4c960a42
--- /dev/null
+++ b/chr/chr_test.go
@@ -0,0 +1,1120 @@
+package chr
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "chr"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/chr_US/chr_US.go b/chr_US/chr_US.go
index b6e7e61a..a11eb0a2 100644
--- a/chr_US/chr_US.go
+++ b/chr_US/chr_US.go
@@ -69,7 +69,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ᎤᏓᎷᎸ", "ᎤᎶᏐᏅ"},
erasNarrow: []string{"", ""},
erasWide: []string{"Ꮟ ᏥᏌ ᎾᏕᎲᏍᎬᎾ", "ᎠᎩᏃᎮᎵᏓᏍᏗᏱ ᎠᏕᏘᏱᏍᎬ ᏱᎰᏩ ᏧᏓᏂᎸᎢᏍᏗ"},
- timezones: map[string]string{"WART": "WART", "ARST": "ARST", "JST": "JST", "JDT": "JDT", "HADT": "HADT", "HKST": "HKST", "OESZ": "OESZ", "GMT": "ᎢᏤ ᎢᏳᏍᏗ ᎢᏳᏩᎪᏗ", "PST": "ᏭᏕᎵᎬ ᏰᎵᏊ ᏗᏙᎳᎩ ᎢᏳᏩᎪᏗ", "AKST": "AKST", "MESZ": "MESZ", "EDT": "ᎧᎸᎬᎢᏗᏢ ᎢᎦ ᎢᏳᏩᎪᏗ", "AEST": "AEST", "AST": "AST", "GFT": "GFT", "ChST": "ChST", "WESZ": "WESZ", "VET": "VET", "CDT": "ᎠᏰᎵ ᎢᎦ ᎢᏳᏩᎪᏗ", "CLT": "CLT", "COT": "COT", "COST": "COST", "HAST": "HAST", "ACDT": "ACDT", "AKDT": "AKDT", "PDT": "ᏭᏕᎵᎬ ᎢᎦ ᎢᏳᏩᎪᏗ", "SGT": "SGT", "HKT": "HKT", "IST": "IST", "EAT": "EAT", "BOT": "BOT", "GYT": "GYT", "AWDT": "AWDT", "WARST": "WARST", "WIT": "WIT", "∅∅∅": "∅∅∅", "MDT": "MDT", "BT": "BT", "HNT": "HNT", "CLST": "CLST", "SAST": "SAST", "UYST": "UYST", "ACWDT": "ACWDT", "MST": "MST", "LHDT": "LHDT", "SRT": "SRT", "CHADT": "CHADT", "WEZ": "WEZ", "WAT": "WAT", "HAT": "HAT", "TMT": "TMT", "AWST": "AWST", "NZDT": "NZDT", "WIB": "WIB", "ART": "ART", "CST": "ᎠᏰᎵ ᏰᎵᏊ ᏗᏙᎳᎩ ᎢᏳᏩᎪᏗ", "MEZ": "MEZ", "ACWST": "ACWST", "ECT": "ECT", "ACST": "ACST", "LHST": "LHST", "UYT": "UYT", "WAST": "WAST", "WITA": "WITA", "OEZ": "OEZ", "EST": "ᎧᎸᎬᎢᏗᏢ ᏰᎵᏊ ᏗᏙᎳᎩ ᎢᏳᏩᎪᏗ", "CHAST": "CHAST", "AEDT": "AEDT", "CAT": "CAT", "ADT": "ADT", "TMST": "TMST", "MYT": "MYT", "NZST": "NZST"},
+ timezones: map[string]string{"NZST": "NZST", "ACWST": "ACWST", "BOT": "BOT", "WARST": "WARST", "UYT": "UYT", "GYT": "GYT", "MYT": "MYT", "CLT": "CLT", "WART": "WART", "VET": "VET", "AWST": "AWST", "WAST": "WAST", "TMT": "TMT", "AEDT": "AEDT", "UYST": "UYST", "AKDT": "AKDT", "AST": "AST", "JDT": "JDT", "HADT": "HADT", "HAST": "HAST", "NZDT": "NZDT", "OEZ": "OEZ", "GMT": "ᎢᏤ ᎢᏳᏍᏗ ᎢᏳᏩᎪᏗ", "AKST": "AKST", "ART": "ART", "EDT": "ᎧᎸᎬᎢᏗᏢ ᎢᎦ ᎢᏳᏩᎪᏗ", "WEZ": "WEZ", "HAT": "HAT", "LHST": "LHST", "LHDT": "LHDT", "CLST": "CLST", "CST": "ᎠᏰᎵ ᏰᎵᏊ ᏗᏙᎳᎩ ᎢᏳᏩᎪᏗ", "SRT": "SRT", "MESZ": "MESZ", "AWDT": "AWDT", "WITA": "WITA", "CHADT": "CHADT", "BT": "BT", "ECT": "ECT", "ARST": "ARST", "OESZ": "OESZ", "ChST": "ChST", "HKST": "HKST", "COST": "COST", "HNT": "HNT", "COT": "COT", "EAT": "EAT", "CDT": "ᎠᏰᎵ ᎢᎦ ᎢᏳᏩᎪᏗ", "PST": "ᏭᏕᎵᎬ ᏰᎵᏊ ᏗᏙᎳᎩ ᎢᏳᏩᎪᏗ", "WESZ": "WESZ", "ACDT": "ACDT", "EST": "ᎧᎸᎬᎢᏗᏢ ᏰᎵᏊ ᏗᏙᎳᎩ ᎢᏳᏩᎪᏗ", "MEZ": "MEZ", "ACWDT": "ACWDT", "PDT": "ᏭᏕᎵᎬ ᎢᎦ ᎢᏳᏩᎪᏗ", "MDT": "ᎣᏓᎸ ᎢᎦ ᎢᏳᏩᎪᏗ", "CHAST": "CHAST", "MST": "ᎣᏓᎸ ᏰᎵᏊ ᏗᏙᎳᎩ ᎢᏳᏩᎪᏗ", "∅∅∅": "∅∅∅", "TMST": "TMST", "SGT": "SGT", "AEST": "AEST", "ACST": "ACST", "IST": "IST", "WIT": "WIT", "GFT": "GFT", "HKT": "HKT", "SAST": "SAST", "WIB": "WIB", "WAT": "WAT", "ADT": "ADT", "JST": "JST", "CAT": "CAT"},
}
}
diff --git a/chr_US/chr_US_test.go b/chr_US/chr_US_test.go
new file mode 100644
index 00000000..348f842c
--- /dev/null
+++ b/chr_US/chr_US_test.go
@@ -0,0 +1,1120 @@
+package chr_US
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "chr_US"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ckb/ckb.go b/ckb/ckb.go
index 92624310..e29b0009 100644
--- a/ckb/ckb.go
+++ b/ckb/ckb.go
@@ -59,7 +59,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"پ.ن", "ز"},
erasNarrow: []string{"پ.ن", "ز"},
erasWide: []string{"پێش زایین", "زایینی"},
- timezones: map[string]string{"∅∅∅": "∅∅∅", "BT": "BT", "ART": "ART", "MEZ": "MEZ", "BOT": "BOT", "CHADT": "CHADT", "WAST": "WAST", "ChST": "ChST", "WAT": "WAT", "UYST": "UYST", "CAT": "CAT", "EDT": "EDT", "SGT": "SGT", "ACST": "ACST", "AEDT": "AEDT", "EST": "EST", "ECT": "ECT", "ARST": "ARST", "TMT": "TMT", "AST": "AST", "HKT": "HKT", "LHDT": "LHDT", "CDT": "CDT", "MESZ": "MESZ", "CHAST": "CHAST", "SAST": "SAST", "WART": "WART", "TMST": "TMST", "ACWST": "ACWST", "CLST": "CLST", "HADT": "HADT", "ACDT": "ACDT", "PST": "PST", "NZDT": "NZDT", "UYT": "UYT", "WEZ": "WEZ", "ADT": "ADT", "AWDT": "AWDT", "WESZ": "WESZ", "VET": "VET", "HNT": "HNT", "WIT": "WIT", "EAT": "EAT", "AKDT": "AKDT", "GYT": "GYT", "CST": "CST", "HKST": "HKST", "GFT": "GFT", "MST": "MST", "NZST": "NZST", "HAST": "HAST", "AKST": "AKST", "AWST": "AWST", "ACWDT": "ACWDT", "COST": "COST", "GMT": "GMT", "WITA": "WITA", "LHST": "LHST", "IST": "IST", "OEZ": "OEZ", "OESZ": "OESZ", "WIB": "WIB", "MYT": "MYT", "COT": "COT", "WARST": "WARST", "MDT": "MDT", "PDT": "PDT", "JDT": "JDT", "HAT": "HAT", "JST": "JST", "SRT": "SRT", "AEST": "AEST", "CLT": "CLT"},
+ timezones: map[string]string{"WIB": "WIB", "GMT": "GMT", "AEST": "AEST", "CLT": "CLT", "∅∅∅": "∅∅∅", "ACWDT": "ACWDT", "HADT": "HADT", "AST": "AST", "GYT": "GYT", "MST": "MST", "CHAST": "CHAST", "WITA": "WITA", "WEZ": "WEZ", "BT": "BT", "LHDT": "LHDT", "EST": "EST", "HNT": "HNT", "AKDT": "AKDT", "ACWST": "ACWST", "SAST": "SAST", "OEZ": "OEZ", "AEDT": "AEDT", "WART": "WART", "PST": "PST", "WAT": "WAT", "EDT": "EDT", "HAT": "HAT", "EAT": "EAT", "LHST": "LHST", "CST": "CST", "CHADT": "CHADT", "ADT": "ADT", "MESZ": "MESZ", "SGT": "SGT", "CLST": "CLST", "ACDT": "ACDT", "VET": "VET", "BOT": "BOT", "WAST": "WAST", "OESZ": "OESZ", "ChST": "ChST", "MYT": "MYT", "ACST": "ACST", "AWST": "AWST", "NZST": "NZST", "UYST": "UYST", "SRT": "SRT", "TMT": "TMT", "UYT": "UYT", "HKST": "HKST", "COST": "COST", "CAT": "CAT", "HAST": "HAST", "WIT": "WIT", "HKT": "HKT", "ECT": "ECT", "JDT": "JDT", "MEZ": "MEZ", "NZDT": "NZDT", "IST": "IST", "PDT": "PDT", "MDT": "MDT", "ART": "ART", "ARST": "ARST", "TMST": "TMST", "WESZ": "WESZ", "CDT": "CDT", "AKST": "AKST", "COT": "COT", "AWDT": "AWDT", "WARST": "WARST", "GFT": "GFT", "JST": "JST"},
}
}
@@ -122,7 +122,7 @@ func (ckb *ckb) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (ckb *ckb) MonthsNarrow() []string {
- return ckb.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/ckb/ckb_test.go b/ckb/ckb_test.go
new file mode 100644
index 00000000..f554f2ea
--- /dev/null
+++ b/ckb/ckb_test.go
@@ -0,0 +1,1120 @@
+package ckb
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ckb"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ckb_IQ/ckb_IQ.go b/ckb_IQ/ckb_IQ.go
index 61cf07a1..d1a3f44a 100644
--- a/ckb_IQ/ckb_IQ.go
+++ b/ckb_IQ/ckb_IQ.go
@@ -59,7 +59,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"پ.ن", "ز"},
erasNarrow: []string{"پ.ن", "ز"},
erasWide: []string{"پێش زایین", "زایینی"},
- timezones: map[string]string{"HAT": "HAT", "UYT": "UYT", "AEDT": "AEDT", "HKST": "HKST", "HADT": "HADT", "GFT": "GFT", "IST": "IST", "AWDT": "AWDT", "GYT": "GYT", "HNT": "HNT", "EAT": "EAT", "AKST": "AKST", "EST": "EST", "AEST": "AEST", "OEZ": "OEZ", "CHAST": "CHAST", "BT": "BT", "HKT": "HKT", "PDT": "PDT", "NZDT": "NZDT", "VET": "VET", "WART": "WART", "BOT": "BOT", "CLT": "CLT", "EDT": "EDT", "WIT": "WIT", "ACST": "ACST", "ARST": "ARST", "TMT": "TMT", "TMST": "TMST", "MDT": "MDT", "JST": "JST", "UYST": "UYST", "ChST": "ChST", "CAT": "CAT", "WIB": "WIB", "∅∅∅": "∅∅∅", "AWST": "AWST", "SRT": "SRT", "ACDT": "ACDT", "JDT": "JDT", "CST": "CST", "WARST": "WARST", "LHST": "LHST", "PST": "PST", "SAST": "SAST", "COST": "COST", "WITA": "WITA", "OESZ": "OESZ", "WESZ": "WESZ", "ACWDT": "ACWDT", "GMT": "GMT", "MYT": "MYT", "MEZ": "MEZ", "SGT": "SGT", "ACWST": "ACWST", "AKDT": "AKDT", "CDT": "CDT", "CLST": "CLST", "WEZ": "WEZ", "AST": "AST", "WAT": "WAT", "WAST": "WAST", "MST": "MST", "LHDT": "LHDT", "CHADT": "CHADT", "COT": "COT", "ADT": "ADT", "HAST": "HAST", "ART": "ART", "NZST": "NZST", "MESZ": "MESZ", "ECT": "ECT"},
+ timezones: map[string]string{"TMT": "TMT", "CAT": "CAT", "GYT": "GYT", "GMT": "GMT", "EAT": "EAT", "HKST": "HKST", "MEZ": "MEZ", "NZDT": "NZDT", "AKST": "AKST", "GFT": "GFT", "CHAST": "CHAST", "WIB": "WIB", "ACDT": "ACDT", "WESZ": "WESZ", "OEZ": "OEZ", "UYST": "UYST", "PST": "PST", "WEZ": "WEZ", "ARST": "ARST", "HNT": "HNT", "CST": "CST", "CLT": "CLT", "JST": "JST", "NZST": "NZST", "AEST": "AEST", "WARST": "WARST", "ACWDT": "ACWDT", "AST": "AST", "EDT": "EDT", "MDT": "MDT", "∅∅∅": "∅∅∅", "ACWST": "ACWST", "OESZ": "OESZ", "BT": "BT", "AWDT": "AWDT", "SGT": "SGT", "ChST": "ChST", "LHDT": "LHDT", "WIT": "WIT", "ART": "ART", "JDT": "JDT", "AKDT": "AKDT", "IST": "IST", "AEDT": "AEDT", "WAT": "WAT", "LHST": "LHST", "WART": "WART", "WITA": "WITA", "SAST": "SAST", "TMST": "TMST", "COST": "COST", "UYT": "UYT", "CHADT": "CHADT", "PDT": "PDT", "WAST": "WAST", "CDT": "CDT", "ACST": "ACST", "VET": "VET", "CLST": "CLST", "SRT": "SRT", "BOT": "BOT", "COT": "COT", "EST": "EST", "MESZ": "MESZ", "MST": "MST", "MYT": "MYT", "HKT": "HKT", "AWST": "AWST", "HAST": "HAST", "HAT": "HAT", "ADT": "ADT", "HADT": "HADT", "ECT": "ECT"},
}
}
@@ -122,7 +122,7 @@ func (ckb *ckb_IQ) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (ckb *ckb_IQ) MonthsNarrow() []string {
- return ckb.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/ckb_IQ/ckb_IQ_test.go b/ckb_IQ/ckb_IQ_test.go
new file mode 100644
index 00000000..51c244e5
--- /dev/null
+++ b/ckb_IQ/ckb_IQ_test.go
@@ -0,0 +1,1120 @@
+package ckb_IQ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ckb_IQ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ckb_IR/ckb_IR.go b/ckb_IR/ckb_IR.go
index ab9e211d..63275a99 100644
--- a/ckb_IR/ckb_IR.go
+++ b/ckb_IR/ckb_IR.go
@@ -59,7 +59,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"پ.ن", "ز"},
erasNarrow: []string{"پ.ن", "ز"},
erasWide: []string{"پێش زایین", "زایینی"},
- timezones: map[string]string{"CAT": "CAT", "TMT": "TMT", "VET": "VET", "ACWDT": "ACWDT", "CHADT": "CHADT", "CLST": "CLST", "HAST": "HAST", "ART": "ART", "AKDT": "AKDT", "MESZ": "MESZ", "ACDT": "ACDT", "WEZ": "WEZ", "WAT": "WAT", "WIB": "WIB", "EAT": "EAT", "EDT": "EDT", "WARST": "WARST", "GFT": "GFT", "AWDT": "AWDT", "CST": "CST", "WAST": "WAST", "WITA": "WITA", "OEZ": "OEZ", "SRT": "SRT", "SGT": "SGT", "HKT": "HKT", "ChST": "ChST", "LHDT": "LHDT", "MYT": "MYT", "CDT": "CDT", "CHAST": "CHAST", "WESZ": "WESZ", "WART": "WART", "SAST": "SAST", "GMT": "GMT", "BOT": "BOT", "MEZ": "MEZ", "NZST": "NZST", "ACWST": "ACWST", "WIT": "WIT", "∅∅∅": "∅∅∅", "JST": "JST", "ECT": "ECT", "HKST": "HKST", "BT": "BT", "HAT": "HAT", "OESZ": "OESZ", "JDT": "JDT", "EST": "EST", "COST": "COST", "AST": "AST", "IST": "IST", "GYT": "GYT", "UYST": "UYST", "COT": "COT", "ADT": "ADT", "LHST": "LHST", "NZDT": "NZDT", "CLT": "CLT", "ACST": "ACST", "PST": "PST", "AWST": "AWST", "AEDT": "AEDT", "ARST": "ARST", "TMST": "TMST", "MDT": "MDT", "HADT": "HADT", "AKST": "AKST", "PDT": "PDT", "AEST": "AEST", "HNT": "HNT", "MST": "MST", "UYT": "UYT"},
+ timezones: map[string]string{"AKDT": "AKDT", "ADT": "ADT", "MDT": "MDT", "CDT": "CDT", "IST": "IST", "MESZ": "MESZ", "GFT": "GFT", "MYT": "MYT", "ACWDT": "ACWDT", "NZST": "NZST", "EDT": "EDT", "∅∅∅": "∅∅∅", "COT": "COT", "JDT": "JDT", "AWST": "AWST", "BOT": "BOT", "CLT": "CLT", "ACDT": "ACDT", "WART": "WART", "JST": "JST", "PDT": "PDT", "WIT": "WIT", "MST": "MST", "ACST": "ACST", "HAT": "HAT", "SAST": "SAST", "TMST": "TMST", "WAST": "WAST", "SGT": "SGT", "BT": "BT", "EAT": "EAT", "HKT": "HKT", "HKST": "HKST", "AST": "AST", "EST": "EST", "WAT": "WAT", "WESZ": "WESZ", "ChST": "ChST", "CHADT": "CHADT", "AKST": "AKST", "HAST": "HAST", "LHST": "LHST", "ECT": "ECT", "ACWST": "ACWST", "COST": "COST", "CAT": "CAT", "LHDT": "LHDT", "VET": "VET", "WITA": "WITA", "AWDT": "AWDT", "ARST": "ARST", "WARST": "WARST", "WEZ": "WEZ", "HNT": "HNT", "UYT": "UYT", "SRT": "SRT", "HADT": "HADT", "TMT": "TMT", "OESZ": "OESZ", "GMT": "GMT", "CLST": "CLST", "MEZ": "MEZ", "AEST": "AEST", "GYT": "GYT", "UYST": "UYST", "ART": "ART", "PST": "PST", "OEZ": "OEZ", "AEDT": "AEDT", "NZDT": "NZDT", "WIB": "WIB", "CST": "CST", "CHAST": "CHAST"},
}
}
@@ -122,7 +122,7 @@ func (ckb *ckb_IR) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (ckb *ckb_IR) MonthsNarrow() []string {
- return ckb.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/ckb_IR/ckb_IR_test.go b/ckb_IR/ckb_IR_test.go
new file mode 100644
index 00000000..0e401027
--- /dev/null
+++ b/ckb_IR/ckb_IR_test.go
@@ -0,0 +1,1120 @@
+package ckb_IR
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ckb_IR"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/cmd/generate_resources.go b/cmd/generate_resources.go
index 9a1afc89..678bfaf5 100644
--- a/cmd/generate_resources.go
+++ b/cmd/generate_resources.go
@@ -274,6 +274,37 @@ func main() {
if err = cmd.Run(); err != nil {
log.Panic(err)
}
+
+ filename = fmt.Sprintf(locFilename, trans.Locale, trans.Locale+"_test")
+
+ if _, err := os.Stat(filename); err == nil {
+ fmt.Println("*************** test file exists, skipping:", filename)
+ continue
+ }
+
+ output, err = os.Create(filename)
+ if err != nil {
+ log.Fatal(err)
+ }
+ defer output.Close()
+
+ if err := tmpl.ExecuteTemplate(output, "tests", trans); err != nil {
+ log.Fatal(err)
+ }
+
+ output.Close()
+
+ // after file written run gofmt on file to ensure best formatting
+ cmd = exec.Command("goimports", "-w", filename)
+ if err = cmd.Run(); err != nil {
+ log.Panic(err)
+ }
+
+ // this simplifies some syntax that I can;t find an option for in goimports, namely '-s'
+ cmd = exec.Command("gofmt", "-s", "-w", filename)
+ if err = cmd.Run(); err != nil {
+ log.Panic(err)
+ }
}
}
diff --git a/cmd/tests.tmpl b/cmd/tests.tmpl
new file mode 100644
index 00000000..2d2147a8
--- /dev/null
+++ b/cmd/tests.tmpl
@@ -0,0 +1,1123 @@
+{{ define "tests" }}
+package {{ .Locale }}
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "{{ .Locale }}"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+{{ end }} \ No newline at end of file
diff --git a/cmd/translator.tmpl b/cmd/translator.tmpl
index 0bd42b6f..d2903bf7 100644
--- a/cmd/translator.tmpl
+++ b/cmd/translator.tmpl
@@ -193,7 +193,11 @@ func({{ .BaseLocale }} *{{ .Locale }}) MonthAbbreviated(month time.Month) string
// MonthsAbbreviated returns the locales abbreviated months
func({{ .BaseLocale }} *{{ .Locale }}) MonthsAbbreviated() []string {
+ {{- if gt (len .FmtMonthsAbbreviated) 0 }}
return {{ .BaseLocale }}.monthsAbbreviated[1:]
+ {{ else }}
+ return nil
+ {{- end -}}
}
// MonthNarrow returns the locales narrow month given the 'month' provided
@@ -203,7 +207,11 @@ func({{ .BaseLocale }} *{{ .Locale }}) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func({{ .BaseLocale }} *{{ .Locale }}) MonthsNarrow() []string {
+ {{- if gt (len .FmtMonthsNarrow) 0 }}
return {{ .BaseLocale }}.monthsNarrow[1:]
+ {{ else }}
+ return nil
+ {{- end -}}
}
// MonthWide returns the locales wide month given the 'month' provided
@@ -213,7 +221,11 @@ func({{ .BaseLocale }} *{{ .Locale }}) MonthWide(month time.Month) string {
// MonthsWide returns the locales wide months
func({{ .BaseLocale }} *{{ .Locale }}) MonthsWide() []string {
+ {{- if gt (len .FmtMonthsWide) 0 }}
return {{ .BaseLocale }}.monthsWide[1:]
+ {{ else }}
+ return nil
+ {{- end -}}
}
// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
diff --git a/cs/cs.go b/cs/cs.go
index 6101117c..4f66203c 100644
--- a/cs/cs.go
+++ b/cs/cs.go
@@ -48,7 +48,7 @@ func New() locales.Translator {
locale: "cs",
pluralsCardinal: []locales.PluralRule{2, 4, 5, 6},
pluralsOrdinal: []locales.PluralRule{6},
- pluralsRange: []locales.PluralRule{5, 6, 2, 4},
+ pluralsRange: []locales.PluralRule{4, 5, 6, 2},
timeSeparator: ":",
currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AU$", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "R$", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYR", "BZD", "CA$", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNX ", "CN¥", "COP", "COU", "CRC", "CSD", "Kčs", "CUC", "CUP", "CVE", "CYP", "Kč", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "€", "FIM", "FJD", "FKP", "FRF", "£", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HK$", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JP¥", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "₩", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MX$", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZ$", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "NT$", "TZS", "UAH", "UAK", "UGS", "UGX", "US$", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "FCFA", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "EC$", "XDR", "ECU", "XFO", "XFU", "CFA", "XPD", "CFPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
percentSuffix: " ",
@@ -67,7 +67,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"př. n. l.", "n. l."},
erasNarrow: []string{"př.n.l.", "n.l."},
erasWide: []string{"př. n. l.", "n. l."},
- timezones: map[string]string{"AWDT": "Západoaustralský letní čas", "MESZ": "Středoevropský letní čas", "WIT": "Východoindonéský čas", "TMT": "Turkmenský standardní čas", "CHADT": "Chathamský letní čas", "WESZ": "Západoevropský letní čas", "COST": "Kolumbijský letní čas", "HNT": "Newfoundlandský standardní čas", "UYST": "Uruguayský letní čas", "ACDT": "Středoaustralský letní čas", "WEZ": "Západoevropský standardní čas", "HADT": "Havajsko-aleutský letní čas", "SAST": "Jihoafrický čas", "ChST": "Chamorrský čas", "COT": "Kolumbijský standardní čas", "WARST": "Západoargentinský letní čas", "TMST": "Turkmenský letní čas", "EAT": "Východoafrický čas", "AKDT": "Aljašský letní čas", "ECT": "Ekvádorský čas", "SGT": "Singapurský čas", "∅∅∅": "Acrejský letní čas", "LHDT": "Letní čas ostrova lorda Howa", "GYT": "Guyanský čas", "UYT": "Uruguayský standardní čas", "ACWDT": "Středozápadní australský letní čas", "WIB": "Západoindonéský čas", "ACST": "Středoaustralský standardní čas", "AKST": "Aljašský standardní čas", "NZST": "Novozélandský standardní čas", "CST": "Severoamerický centrální standardní čas", "CLST": "Chilský letní čas", "ADT": "Atlantický letní čas", "JST": "Japonský standardní čas", "OESZ": "Východoevropský letní čas", "ARST": "Argentinský letní čas", "JDT": "Japonský letní čas", "EST": "Severoamerický východní standardní čas", "EDT": "Severoamerický východní letní čas", "WAT": "Západoafrický standardní čas", "GFT": "Francouzskoguyanský čas", "BOT": "Bolivijský čas", "AEST": "Východoaustralský standardní čas", "CHAST": "Chathamský standardní čas", "BT": "Bhútánský čas", "NZDT": "Novozélandský letní čas", "PDT": "Severoamerický pacifický letní čas", "ART": "Argentinský standardní čas", "MDT": "Macajský letní čas", "IST": "Indický čas", "CAT": "Středoafrický čas", "HKT": "Hongkongský standardní čas", "HKST": "Hongkongský letní čas", "WART": "Západoargentinský standardní čas", "GMT": "Greenwichský střední čas", "MYT": "Malajský čas", "HAT": "Newfoundlandský letní čas", "AWST": "Západoaustralský standardní čas", "AEDT": "Východoaustralský letní čas", "AST": "Atlantický standardní čas", "CDT": "Severoamerický centrální letní čas", "SRT": "Surinamský čas", "PST": "Severoamerický pacifický standardní čas", "OEZ": "Východoevropský standardní čas", "MST": "Macajský standardní čas", "WITA": "Středoindonéský čas", "LHST": "Standardní čas ostrova lorda Howa", "MEZ": "Středoevropský standardní čas", "CLT": "Chilský standardní čas", "VET": "Venezuelský čas", "ACWST": "Středozápadní australský standardní čas", "HAST": "Havajsko-aleutský standardní čas", "WAST": "Západoafrický letní čas"},
+ timezones: map[string]string{"COT": "Kolumbijský standardní čas", "TMT": "Turkmenský standardní čas", "ACWST": "Středozápadní australský standardní čas", "CLST": "Chilský letní čas", "CHAST": "Chathamský standardní čas", "ART": "Argentinský standardní čas", "WITA": "Středoindonéský čas", "PDT": "Severoamerický pacifický letní čas", "HADT": "Havajsko-aleutský letní čas", "WAT": "Západoafrický standardní čas", "CDT": "Severoamerický centrální letní čas", "TMST": "Turkmenský letní čas", "AEDT": "Východoaustralský letní čas", "UYT": "Uruguayský standardní čas", "HNT": "Newfoundlandský standardní čas", "HAT": "Newfoundlandský letní čas", "AWDT": "Západoaustralský letní čas", "CLT": "Chilský standardní čas", "WART": "Západoargentinský standardní čas", "ECT": "Ekvádorský čas", "JDT": "Japonský letní čas", "IST": "Indický čas", "COST": "Kolumbijský letní čas", "CAT": "Středoafrický čas", "MST": "Severoamerický horský standardní čas", "BT": "Bhútánský čas", "HKST": "Hongkongský letní čas", "WIB": "Západoindonéský čas", "OEZ": "Východoevropský standardní čas", "OESZ": "Východoevropský letní čas", "CST": "Severoamerický centrální standardní čas", "HKT": "Hongkongský standardní čas", "ADT": "Atlantický letní čas", "ACWDT": "Středozápadní australský letní čas", "SAST": "Jihoafrický čas", "ChST": "Chamorrský čas", "AEST": "Východoaustralský standardní čas", "JST": "Japonský standardní čas", "LHDT": "Letní čas ostrova lorda Howa", "CHADT": "Chathamský letní čas", "ARST": "Argentinský letní čas", "GMT": "Greenwichský střední čas", "WIT": "Východoindonéský čas", "EAT": "Východoafrický čas", "WARST": "Západoargentinský letní čas", "AKST": "Aljašský standardní čas", "HAST": "Havajsko-aleutský standardní čas", "SGT": "Singapurský čas", "WEZ": "Západoevropský standardní čas", "NZDT": "Novozélandský letní čas", "WESZ": "Západoevropský letní čas", "MESZ": "Středoevropský letní čas", "GFT": "Francouzskoguyanský čas", "VET": "Venezuelský čas", "BOT": "Bolivijský čas", "WAST": "Západoafrický letní čas", "UYST": "Uruguayský letní čas", "∅∅∅": "Amazonský letní čas", "GYT": "Guyanský čas", "MDT": "Severoamerický horský letní čas", "MYT": "Malajský čas", "ACST": "Středoaustralský standardní čas", "NZST": "Novozélandský standardní čas", "EST": "Severoamerický východní standardní čas", "EDT": "Severoamerický východní letní čas", "AWST": "Západoaustralský standardní čas", "AKDT": "Aljašský letní čas", "PST": "Severoamerický pacifický standardní čas", "MEZ": "Středoevropský standardní čas", "LHST": "Standardní čas ostrova lorda Howa", "SRT": "Surinamský čas", "ACDT": "Středoaustralský letní čas", "AST": "Atlantický standardní čas"},
}
}
diff --git a/cs/cs_test.go b/cs/cs_test.go
new file mode 100644
index 00000000..77c1bb91
--- /dev/null
+++ b/cs/cs_test.go
@@ -0,0 +1,1120 @@
+package cs
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "cs"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/cs_CZ/cs_CZ.go b/cs_CZ/cs_CZ.go
index 188b2393..0d767ad2 100644
--- a/cs_CZ/cs_CZ.go
+++ b/cs_CZ/cs_CZ.go
@@ -48,7 +48,7 @@ func New() locales.Translator {
locale: "cs_CZ",
pluralsCardinal: []locales.PluralRule{2, 4, 5, 6},
pluralsOrdinal: []locales.PluralRule{6},
- pluralsRange: []locales.PluralRule{6, 2, 4, 5},
+ pluralsRange: []locales.PluralRule{2, 4, 5, 6},
timeSeparator: ":",
currencies: []string{"ADP ", "AED ", "AFA ", "AFN ", "ALK ", "ALL ", "AMD ", "ANG ", "AOA ", "AOK ", "AON ", "AOR ", "ARA ", "ARL ", "ARM ", "ARP ", "ARS ", "ATS ", "AUD ", "AWG ", "AZM ", "AZN ", "BAD ", "BAM ", "BAN ", "BBD ", "BDT ", "BEC ", "BEF ", "BEL ", "BGL ", "BGM ", "BGN ", "BGO ", "BHD ", "BIF ", "BMD ", "BND ", "BOB ", "BOL ", "BOP ", "BOV ", "BRB ", "BRC ", "BRE ", "BRL ", "BRN ", "BRR ", "BRZ ", "BSD ", "BTN ", "BUK ", "BWP ", "BYB ", "BYR ", "BZD ", "CAD ", "CDF ", "CHE ", "CHF ", "CHW ", "CLE ", "CLF ", "CLP ", "CNX ", "CNY ", "COP ", "COU ", "CRC ", "CSD ", "CSK ", "CUC ", "CUP ", "CVE ", "CYP ", "CZK ", "DDM ", "DEM ", "DJF ", "DKK ", "DOP ", "DZD ", "ECS ", "ECV ", "EEK ", "EGP ", "ERN ", "ESA ", "ESB ", "ESP ", "ETB ", "EUR ", "FIM ", "FJD ", "FKP ", "FRF ", "GBP ", "GEK ", "GEL ", "GHC ", "GHS ", "GIP ", "GMD ", "GNF ", "GNS ", "GQE ", "GRD ", "GTQ ", "GWE ", "GWP ", "GYD ", "HKD ", "HNL ", "HRD ", "HRK ", "HTG ", "HUF ", "IDR ", "IEP ", "ILP ", "ILR ", "ILS ", "INR ", "IQD ", "IRR ", "ISJ ", "ISK ", "ITL ", "JMD ", "JOD ", "JPY ", "KES ", "KGS ", "KHR ", "KMF ", "KPW ", "KRH ", "KRO ", "KRW ", "KWD ", "KYD ", "KZT ", "LAK ", "LBP ", "LKR ", "LRD ", "LSL ", "LTL ", "LTT ", "LUC ", "LUF ", "LUL ", "LVL ", "LVR ", "LYD ", "MAD ", "MAF ", "MCF ", "MDC ", "MDL ", "MGA ", "MGF ", "MKD ", "MKN ", "MLF ", "MMK ", "MNT ", "MOP ", "MRO ", "MTL ", "MTP ", "MUR ", "MVP ", "MVR ", "MWK ", "MXN ", "MXP ", "MXV ", "MYR ", "MZE ", "MZM ", "MZN ", "NAD ", "NGN ", "NIC ", "NIO ", "NLG ", "NOK ", "NPR ", "NZD ", "OMR ", "PAB ", "PEI ", "PEN ", "PES ", "PGK ", "PHP ", "PKR ", "PLN ", "PLZ ", "PTE ", "PYG ", "QAR ", "RHD ", "ROL ", "RON ", "RSD ", "RUB ", "RUR ", "RWF ", "SAR ", "SBD ", "SCR ", "SDD ", "SDG ", "SDP ", "SEK ", "SGD ", "SHP ", "SIT ", "SKK ", "SLL ", "SOS ", "SRD ", "SRG ", "SSP ", "STD ", "SUR ", "SVC ", "SYP ", "SZL ", "THB ", "TJR ", "TJS ", "TMM ", "TMT ", "TND ", "TOP ", "TPE ", "TRL ", "TRY ", "TTD ", "TWD ", "TZS ", "UAH ", "UAK ", "UGS ", "UGX ", "USD ", "USN ", "USS ", "UYI ", "UYP ", "UYU ", "UZS ", "VEB ", "VEF ", "VND ", "VNN ", "VUV ", "WST ", "XAF ", "XAG ", "XAU ", "XBA ", "XBB ", "XBC ", "XBD ", "XCD ", "XDR ", "XEU ", "XFO ", "XFU ", "XOF ", "XPD ", "XPF ", "XPT ", "XRE ", "XSU ", "XTS ", "XUA ", "XXX ", "YDD ", "YER ", "YUD ", "YUM ", "YUN ", "YUR ", "ZAL ", "ZAR ", "ZMK ", "ZMW ", "ZRN ", "ZRZ ", "ZWD ", "ZWL ", "ZWR "},
percentSuffix: " ",
@@ -67,7 +67,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"př. n. l.", "n. l."},
erasNarrow: []string{"př.n.l.", "n.l."},
erasWide: []string{"př. n. l.", "n. l."},
- timezones: map[string]string{"AST": "Atlantický standardní čas", "WITA": "Středoindonéský čas", "UYT": "Uruguayský standardní čas", "COT": "Kolumbijský standardní čas", "CHADT": "Chathamský letní čas", "AEST": "Východoaustralský standardní čas", "ChST": "Chamorrský čas", "ARST": "Argentinský letní čas", "JDT": "Japonský letní čas", "HKST": "Hongkongský letní čas", "PDT": "Severoamerický pacifický letní čas", "ACWST": "Středozápadní australský standardní čas", "AKST": "Aljašský standardní čas", "CLST": "Chilský letní čas", "COST": "Kolumbijský letní čas", "WAT": "Západoafrický standardní čas", "WIB": "Západoindonéský čas", "TMST": "Turkmenský letní čas", "ART": "Argentinský standardní čas", "EDT": "Severoamerický východní letní čas", "TMT": "Turkmenský standardní čas", "UYST": "Uruguayský letní čas", "CDT": "Severoamerický centrální letní čas", "VET": "Venezuelský čas", "EST": "Severoamerický východní standardní čas", "GFT": "Francouzskoguyanský čas", "MDT": "Macajský letní čas", "AWDT": "Západoaustralský letní čas", "WAST": "Západoafrický letní čas", "HKT": "Hongkongský standardní čas", "IST": "Indický čas", "HNT": "Newfoundlandský standardní čas", "CST": "Severoamerický centrální standardní čas", "HADT": "Havajsko-aleutský letní čas", "BOT": "Bolivijský čas", "ACST": "Středoaustralský standardní čas", "LHST": "Standardní čas ostrova lorda Howa", "BT": "Bhútánský čas", "WIT": "Východoindonéský čas", "MESZ": "Středoevropský letní čas", "ECT": "Ekvádorský čas", "GYT": "Guyanský čas", "LHDT": "Letní čas ostrova lorda Howa", "EAT": "Východoafrický čas", "ACDT": "Středoaustralský letní čas", "WARST": "Západoargentinský letní čas", "OEZ": "Východoevropský standardní čas", "AEDT": "Východoaustralský letní čas", "CAT": "Středoafrický čas", "ADT": "Atlantický letní čas", "HAT": "Newfoundlandský letní čas", "AWST": "Západoaustralský standardní čas", "MEZ": "Středoevropský standardní čas", "OESZ": "Východoevropský letní čas", "GMT": "Greenwichský střední čas", "WEZ": "Západoevropský standardní čas", "SAST": "Jihoafrický čas", "MST": "Macajský standardní čas", "CHAST": "Chathamský standardní čas", "HAST": "Havajsko-aleutský standardní čas", "SRT": "Surinamský čas", "AKDT": "Aljašský letní čas", "JST": "Japonský standardní čas", "PST": "Severoamerický pacifický standardní čas", "NZST": "Novozélandský standardní čas", "NZDT": "Novozélandský letní čas", "CLT": "Chilský standardní čas", "WESZ": "Západoevropský letní čas", "∅∅∅": "Amazonský letní čas", "MYT": "Malajský čas", "WART": "Západoargentinský standardní čas", "ACWDT": "Středozápadní australský letní čas", "SGT": "Singapurský čas"},
+ timezones: map[string]string{"WAT": "Západoafrický standardní čas", "UYT": "Uruguayský standardní čas", "CHAST": "Chathamský standardní čas", "CHADT": "Chathamský letní čas", "OEZ": "Východoevropský standardní čas", "OESZ": "Východoevropský letní čas", "CLT": "Chilský standardní čas", "ADT": "Atlantický letní čas", "BOT": "Bolivijský čas", "COST": "Kolumbijský letní čas", "VET": "Venezuelský čas", "PDT": "Severoamerický pacifický letní čas", "HAT": "Newfoundlandský letní čas", "CLST": "Chilský letní čas", "UYST": "Uruguayský letní čas", "MST": "Macajský standardní čas", "MEZ": "Středoevropský standardní čas", "ACWDT": "Středozápadní australský letní čas", "BT": "Bhútánský čas", "HAST": "Havajsko-aleutský standardní čas", "HADT": "Havajsko-aleutský letní čas", "IST": "Indický čas", "WIT": "Východoindonéský čas", "SRT": "Surinamský čas", "ACST": "Středoaustralský standardní čas", "ART": "Argentinský standardní čas", "AKST": "Aljašský standardní čas", "SAST": "Jihoafrický čas", "WEZ": "Západoevropský standardní čas", "SGT": "Singapurský čas", "WIB": "Západoindonéský čas", "TMT": "Turkmenský standardní čas", "AEDT": "Východoaustralský letní čas", "AWST": "Západoaustralský standardní čas", "AWDT": "Západoaustralský letní čas", "GMT": "Greenwichský střední čas", "NZDT": "Novozélandský letní čas", "TMST": "Turkmenský letní čas", "CAT": "Středoafrický čas", "AEST": "Východoaustralský standardní čas", "GYT": "Guyanský čas", "LHST": "Standardní čas ostrova lorda Howa", "JDT": "Japonský letní čas", "EST": "Severoamerický východní standardní čas", "CST": "Severoamerický centrální standardní čas", "ACWST": "Středozápadní australský standardní čas", "AKDT": "Aljašský letní čas", "COT": "Kolumbijský standardní čas", "CDT": "Severoamerický centrální letní čas", "∅∅∅": "Azorský letní čas", "NZST": "Novozélandský standardní čas", "MDT": "Macajský letní čas", "WART": "Západoargentinský standardní čas", "WARST": "Západoargentinský letní čas", "WESZ": "Západoevropský letní čas", "ChST": "Chamorrský čas", "MESZ": "Středoevropský letní čas", "WITA": "Středoindonéský čas", "AST": "Atlantický standardní čas", "EDT": "Severoamerický východní letní čas", "MYT": "Malajský čas", "EAT": "Východoafrický čas", "ECT": "Ekvádorský čas", "HKT": "Hongkongský standardní čas", "PST": "Severoamerický pacifický standardní čas", "HNT": "Newfoundlandský standardní čas", "WAST": "Západoafrický letní čas", "HKST": "Hongkongský letní čas", "JST": "Japonský standardní čas", "LHDT": "Letní čas ostrova lorda Howa", "ACDT": "Středoaustralský letní čas", "GFT": "Francouzskoguyanský čas", "ARST": "Argentinský letní čas"},
}
}
diff --git a/cs_CZ/cs_CZ_test.go b/cs_CZ/cs_CZ_test.go
new file mode 100644
index 00000000..9cec35fb
--- /dev/null
+++ b/cs_CZ/cs_CZ_test.go
@@ -0,0 +1,1120 @@
+package cs_CZ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "cs_CZ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/cu/cu.go b/cu/cu.go
index 62c21f78..201b0906 100644
--- a/cu/cu.go
+++ b/cu/cu.go
@@ -72,7 +72,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"пре́дъ р.\u00a0х.", "по р.\u00a0х."},
erasNarrow: []string{"", ""},
erasWide: []string{"пре́дъ р.\u00a0х.", "по р.\u00a0х."},
- timezones: map[string]string{"JDT": "JDT", "AKDT": "AKDT", "LHST": "LHST", "WAT": "WAT", "HKT": "HKT", "CDT": "среднеамерїка́нское лѣ́тнее вре́мѧ", "CHAST": "CHAST", "SGT": "SGT", "ARST": "ARST", "MYT": "MYT", "AWDT": "AWDT", "WESZ": "западноєѵрѡпе́йское лѣ́тнее вре́мѧ", "ACWST": "ACWST", "WITA": "WITA", "WIB": "WIB", "HNT": "HNT", "LHDT": "LHDT", "MEZ": "среднеєѵрѡпе́йское зи́мнее вре́мѧ", "AST": "а҆тланті́ческое зи́мнее вре́мѧ", "HADT": "HADT", "HKST": "HKST", "NZDT": "NZDT", "WIT": "WIT", "GMT": "сре́днее вре́мѧ по грі́нꙋичꙋ", "BOT": "BOT", "MDT": "а҆мерїка́нское наго́рнее лѣ́тнее вре́мѧ", "CAT": "CAT", "ADT": "а҆тланті́ческое лѣ́тнее вре́мѧ", "HAST": "HAST", "∅∅∅": "∅∅∅", "UYT": "UYT", "WEZ": "западноєѵрѡпе́йское зи́мнее вре́мѧ", "EST": "восточноамерїка́нское зи́мнее вре́мѧ", "EAT": "EAT", "GYT": "GYT", "MESZ": "среднеєѵрѡпе́йское лѣ́тнее вре́мѧ", "AEDT": "AEDT", "COT": "COT", "WAST": "WAST", "CST": "среднеамерїка́нское зи́мнее вре́мѧ", "VET": "VET", "EDT": "восточноамерїка́нское лѣ́тнее вре́мѧ", "IST": "IST", "WART": "WART", "HAT": "HAT", "PST": "тихоѻкеа́нское зи́мнее вре́мѧ", "PDT": "тихоѻкеа́нское лѣ́тнее вре́мѧ", "CHADT": "CHADT", "CLST": "CLST", "COST": "COST", "OEZ": "восточноєѵрѡпе́йское зи́мнее вре́мѧ", "GFT": "GFT", "TMT": "TMT", "JST": "JST", "NZST": "NZST", "UYST": "UYST", "MST": "а҆мерїка́нское наго́рнее зи́мнее вре́мѧ", "SAST": "SAST", "ACDT": "ACDT", "BT": "BT", "ACST": "ACST", "AWST": "AWST", "WARST": "WARST", "ChST": "ChST", "ECT": "ECT", "SRT": "SRT", "AEST": "AEST", "OESZ": "восточноєѵрѡпе́йское лѣ́тнее вре́мѧ", "TMST": "TMST", "AKST": "AKST", "CLT": "CLT", "ACWDT": "ACWDT", "ART": "ART"},
+ timezones: map[string]string{"HAT": "HAT", "HKST": "HKST", "AKDT": "AKDT", "HADT": "HADT", "LHST": "LHST", "ACST": "ACST", "ADT": "а҆тланті́ческое лѣ́тнее вре́мѧ", "ACWDT": "ACWDT", "CLT": "CLT", "OESZ": "восточноєѵрѡпе́йское лѣ́тнее вре́мѧ", "WART": "WART", "HKT": "HKT", "MEZ": "среднеєѵрѡпе́йское зи́мнее вре́мѧ", "WIB": "WIB", "MYT": "MYT", "CLST": "CLST", "UYT": "UYT", "CST": "среднеамерїка́нское зи́мнее вре́мѧ", "WARST": "WARST", "VET": "VET", "AST": "а҆тланті́ческое зи́мнее вре́мѧ", "WAT": "WAT", "SGT": "SGT", "COST": "COST", "TMT": "TMT", "AEDT": "AEDT", "MST": "MST", "EST": "восточноамерїка́нское зи́мнее вре́мѧ", "SAST": "SAST", "WIT": "WIT", "MDT": "MDT", "ECT": "ECT", "AKST": "AKST", "AWST": "AWST", "JDT": "JDT", "PST": "тихоѻкеа́нское зи́мнее вре́мѧ", "MESZ": "среднеєѵрѡпе́йское лѣ́тнее вре́мѧ", "∅∅∅": "∅∅∅", "TMST": "TMST", "GYT": "GYT", "JST": "JST", "WAST": "WAST", "GMT": "сре́днее вре́мѧ по грі́нꙋичꙋ", "ACWST": "ACWST", "AWDT": "AWDT", "ARST": "ARST", "ChST": "ChST", "BT": "BT", "IST": "IST", "HAST": "HAST", "OEZ": "восточноєѵрѡпе́йское зи́мнее вре́мѧ", "CHAST": "CHAST", "BOT": "BOT", "WEZ": "западноєѵрѡпе́йское зи́мнее вре́мѧ", "AEST": "AEST", "LHDT": "LHDT", "SRT": "SRT", "HNT": "HNT", "ACDT": "ACDT", "GFT": "GFT", "ART": "ART", "PDT": "тихоѻкеа́нское лѣ́тнее вре́мѧ", "CHADT": "CHADT", "WITA": "WITA", "EDT": "восточноамерїка́нское лѣ́тнее вре́мѧ", "NZST": "NZST", "NZDT": "NZDT", "CAT": "CAT", "WESZ": "западноєѵрѡпе́йское лѣ́тнее вре́мѧ", "COT": "COT", "EAT": "EAT", "UYST": "UYST", "CDT": "среднеамерїка́нское лѣ́тнее вре́мѧ"},
}
}
diff --git a/cu/cu_test.go b/cu/cu_test.go
new file mode 100644
index 00000000..91c734a4
--- /dev/null
+++ b/cu/cu_test.go
@@ -0,0 +1,1120 @@
+package cu
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "cu"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/cu_RU/cu_RU.go b/cu_RU/cu_RU.go
index 05747a1d..dfd6e07a 100644
--- a/cu_RU/cu_RU.go
+++ b/cu_RU/cu_RU.go
@@ -72,7 +72,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"пре́дъ р.\u00a0х.", "по р.\u00a0х."},
erasNarrow: []string{"", ""},
erasWide: []string{"пре́дъ р.\u00a0х.", "по р.\u00a0х."},
- timezones: map[string]string{"AKST": "AKST", "CST": "среднеамерїка́нское зи́мнее вре́мѧ", "CHADT": "CHADT", "CLST": "CLST", "EST": "восточноамерїка́нское зи́мнее вре́мѧ", "GFT": "GFT", "JDT": "JDT", "CHAST": "CHAST", "HAST": "HAST", "WIT": "WIT", "AWDT": "AWDT", "TMST": "TMST", "UYT": "UYT", "CDT": "среднеамерїка́нское лѣ́тнее вре́мѧ", "MESZ": "среднеєѵрѡпе́йское лѣ́тнее вре́мѧ", "NZST": "NZST", "BT": "BT", "OESZ": "восточноєѵрѡпе́йское лѣ́тнее вре́мѧ", "MST": "MST", "JST": "JST", "ACST": "ACST", "LHDT": "LHDT", "WEZ": "западноєѵрѡпе́йское зи́мнее вре́мѧ", "WESZ": "западноєѵрѡпе́йское лѣ́тнее вре́мѧ", "ACWDT": "ACWDT", "ADT": "а҆тланті́ческое лѣ́тнее вре́мѧ", "WAT": "WAT", "HNT": "HNT", "HADT": "HADT", "HAT": "HAT", "MDT": "MDT", "ACDT": "ACDT", "GYT": "GYT", "BOT": "BOT", "EDT": "восточноамерїка́нское лѣ́тнее вре́мѧ", "WART": "WART", "SAST": "SAST", "VET": "VET", "COT": "COT", "SRT": "SRT", "UYST": "UYST", "AEDT": "AEDT", "CAT": "CAT", "ART": "ART", "MEZ": "среднеєѵрѡпе́йское зи́мнее вре́мѧ", "WITA": "WITA", "∅∅∅": "∅∅∅", "MYT": "MYT", "PDT": "тихоѻкеа́нское лѣ́тнее вре́мѧ", "LHST": "LHST", "GMT": "сре́днее вре́мѧ по грі́нꙋичꙋ", "ARST": "ARST", "NZDT": "NZDT", "WARST": "WARST", "WIB": "WIB", "AEST": "AEST", "COST": "COST", "HKST": "HKST", "IST": "IST", "EAT": "EAT", "AKDT": "AKDT", "SGT": "SGT", "OEZ": "восточноєѵрѡпе́йское зи́мнее вре́мѧ", "TMT": "TMT", "AWST": "AWST", "ACWST": "ACWST", "ECT": "ECT", "HKT": "HKT", "PST": "тихоѻкеа́нское зи́мнее вре́мѧ", "CLT": "CLT", "ChST": "ChST", "WAST": "WAST", "AST": "а҆тланті́ческое зи́мнее вре́мѧ"},
+ timezones: map[string]string{"ACST": "ACST", "ARST": "ARST", "EST": "восточноамерїка́нское зи́мнее вре́мѧ", "COST": "COST", "ChST": "ChST", "HAT": "HAT", "TMT": "TMT", "WESZ": "западноєѵрѡпе́йское лѣ́тнее вре́мѧ", "MEZ": "среднеєѵрѡпе́йское зи́мнее вре́мѧ", "PST": "тихоѻкеа́нское зи́мнее вре́мѧ", "SGT": "SGT", "WIB": "WIB", "MYT": "MYT", "HKST": "HKST", "ART": "ART", "ADT": "а҆тланті́ческое лѣ́тнее вре́мѧ", "ACWST": "ACWST", "GYT": "GYT", "OEZ": "восточноєѵрѡпе́йское зи́мнее вре́мѧ", "HKT": "HKT", "UYST": "UYST", "MST": "а҆мерїка́нское наго́рнее зи́мнее вре́мѧ", "WART": "WART", "AKST": "AKST", "ACWDT": "ACWDT", "PDT": "тихоѻкеа́нское лѣ́тнее вре́мѧ", "GMT": "сре́днее вре́мѧ по грі́нꙋичꙋ", "UYT": "UYT", "BOT": "BOT", "OESZ": "восточноєѵрѡпе́йское лѣ́тнее вре́мѧ", "MDT": "а҆мерїка́нское наго́рнее лѣ́тнее вре́мѧ", "AST": "а҆тланті́ческое зи́мнее вре́мѧ", "SAST": "SAST", "VET": "VET", "WITA": "WITA", "WAT": "WAT", "JST": "JST", "SRT": "SRT", "NZDT": "NZDT", "COT": "COT", "WEZ": "западноєѵрѡпе́йское зи́мнее вре́мѧ", "CST": "среднеамерїка́нское зи́мнее вре́мѧ", "JDT": "JDT", "IST": "IST", "AEDT": "AEDT", "EAT": "EAT", "BT": "BT", "AWST": "AWST", "NZST": "NZST", "TMST": "TMST", "CLT": "CLT", "AWDT": "AWDT", "MESZ": "среднеєѵрѡпе́йское лѣ́тнее вре́мѧ", "HADT": "HADT", "CHADT": "CHADT", "ECT": "ECT", "AEST": "AEST", "WIT": "WIT", "LHST": "LHST", "WARST": "WARST", "GFT": "GFT", "CHAST": "CHAST", "CAT": "CAT", "WAST": "WAST", "AKDT": "AKDT", "CDT": "среднеамерїка́нское лѣ́тнее вре́мѧ", "ACDT": "ACDT", "HAST": "HAST", "LHDT": "LHDT", "∅∅∅": "∅∅∅", "EDT": "восточноамерїка́нское лѣ́тнее вре́мѧ", "HNT": "HNT", "CLST": "CLST"},
}
}
diff --git a/cu_RU/cu_RU_test.go b/cu_RU/cu_RU_test.go
new file mode 100644
index 00000000..3f32150c
--- /dev/null
+++ b/cu_RU/cu_RU_test.go
@@ -0,0 +1,1120 @@
+package cu_RU
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "cu_RU"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/cy/cy.go b/cy/cy.go
index 51729717..4cc519b0 100644
--- a/cy/cy.go
+++ b/cy/cy.go
@@ -65,7 +65,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"CC", "OC"},
erasNarrow: []string{"C", "O"},
erasWide: []string{"Cyn Crist", "Oed Crist"},
- timezones: map[string]string{"OESZ": "Amser Haf Dwyrain Ewrop", "HAT": "Amser Haf Newfoundland", "TMST": "Amser Haf Tyrcmenistan", "GYT": "Amser Guyana", "CST": "Amser Safonol Canolbarth Gogledd America", "AEDT": "Amser Haf Dwyrain Awstralia", "AST": "Amser Safonol Cefnfor yr Iwerydd", "HKST": "Amser Haf Hong Kong", "WITA": "Amser Canolbarth Indonesia", "EAT": "Amser Dwyrain Affrica", "AKDT": "Amser Haf Alaska", "ECT": "Amser Ecuador", "IST": "Amser India", "SRT": "Amser Suriname", "LHDT": "Amser Haf yr Arglwydd Howe", "BOT": "Amser Bolivia", "WARST": "Amser Haf Gorllewin Ariannin", "GMT": "Amser Safonol Greenwich", "MDT": "MDT", "ART": "Amser Safonol Ariannin", "AWDT": "Amser Haf Gorllewin Awstralia", "ACST": "Amser Safonol Canolbarth Awstralia", "TMT": "Amser Safonol Tyrcmenistan", "AKST": "Amser Safonol Alaska", "VET": "Amser Venezuela", "EST": "Amser Safonol Dwyrain Gogledd America", "HAST": "Amser Safonol Hawaii-Aleutian", "MESZ": "Amser Haf Canolbarth Ewrop", "NZST": "Amser Safonol Seland Newydd", "UYST": "Amser Haf Uruguay", "WEZ": "Amser Safonol Gorllewin Ewrop", "WESZ": "Amser Haf Gorllewin Ewrop", "WIT": "Amser Dwyrain Indonesia", "HNT": "Amser Safonol Newfoundland", "CLST": "Amser Haf Chile", "WAST": "Amser Haf Gorllewin Affrica", "OEZ": "Amser Safonol Dwyrain Ewrop", "CDT": "Amser Haf Canolbarth Gogledd America", "ACWDT": "Amser Haf Canolbarth Gorllewin Awstralia", "ChST": "Amser Chamorro", "HADT": "Amser Haf Hawaii-Aleutian", "WAT": "Amser Safonol Gorllewin Affrica", "BT": "Amser Bhutan", "COT": "Amser Safonol Colombia", "MST": "MST", "∅∅∅": "Amser Haf Amazonas", "PDT": "Amser Haf Cefnfor Tawel Gogledd America", "HKT": "Amser Safonol Hong Kong", "ARST": "Amser Haf Ariannin", "ADT": "Amser Haf Cefnfor yr Iwerydd", "JST": "Amser Safonol Siapan", "MEZ": "Amser Safonol Canolbarth Ewrop", "CHAST": "Amser Safonol Chatham", "CHADT": "Amser Haf Chatham", "EDT": "Amser Haf Dwyrain Gogledd America", "SGT": "Amser Singapore", "WART": "Amser Safonol Gorllewin Ariannin", "JDT": "Amser Haf Siapan", "MYT": "Amser Malaysia", "NZDT": "Amser Haf Seland Newydd", "ACWST": "Amser Safonol Canolbarth Gorllewin Awstralia", "COST": "Amser Haf Colombia", "PST": "Amser Safonol Cefnfor Tawel Gogledd America", "LHST": "Amser Safonol yr Arglwydd Howe", "CLT": "Amser Safonol Chile", "SAST": "Amser Safonol De Affrica", "AWST": "Amser Safonol Gorllewin Awstralia", "UYT": "Amser Safonol Uruguay", "AEST": "Amser Safonol Dwyrain Awstralia", "CAT": "Amser Canolbarth Affrica", "WIB": "Amser Gorllewin Indonesia", "GFT": "Amser Guyane Ffrengig", "ACDT": "Amser Haf Canolbarth Awstralia"},
+ timezones: map[string]string{"CLT": "Amser Safonol Chile", "UYT": "Amser Safonol Uruguay", "WARST": "Amser Haf Gorllewin Ariannin", "CHAST": "Amser Safonol Chatham", "ARST": "Amser Haf Ariannin", "WIB": "Amser Gorllewin Indonesia", "ACDT": "Amser Haf Canolbarth Awstralia", "CHADT": "Amser Haf Chatham", "LHST": "Amser Safonol yr Arglwydd Howe", "WESZ": "Amser Haf Gorllewin Ewrop", "CLST": "Amser Haf Chile", "WART": "Amser Safonol Gorllewin Ariannin", "AWDT": "Amser Haf Gorllewin Awstralia", "JDT": "Amser Haf Siapan", "WAT": "Amser Safonol Gorllewin Affrica", "HAT": "Amser Haf Newfoundland", "TMT": "Amser Safonol Tyrcmenistan", "MYT": "Amser Malaysia", "AKST": "Amser Safonol Alaska", "AKDT": "Amser Haf Alaska", "WAST": "Amser Haf Gorllewin Affrica", "MST": "Amser Safonol Mynyddoedd Gogledd America", "EDT": "Amser Haf Dwyrain Gogledd America", "MEZ": "Amser Safonol Canolbarth Ewrop", "HAST": "Amser Safonol Hawaii-Aleutian", "HADT": "Amser Haf Hawaii-Aleutian", "NZDT": "Amser Haf Seland Newydd", "AEDT": "Amser Haf Dwyrain Awstralia", "WITA": "Amser Canolbarth Indonesia", "COT": "Amser Safonol Colombia", "CST": "Amser Safonol Canolbarth Gogledd America", "CDT": "Amser Haf Canolbarth Gogledd America", "PDT": "Amser Haf Cefnfor Tawel Gogledd America", "BOT": "Amser Bolivia", "MDT": "Amser Haf Mynyddoedd Gogledd America", "ACST": "Amser Safonol Canolbarth Awstralia", "ACWST": "Amser Safonol Canolbarth Gorllewin Awstralia", "OESZ": "Amser Haf Dwyrain Ewrop", "EAT": "Amser Dwyrain Affrica", "∅∅∅": "Amser Haf Periw", "ECT": "Amser Ecuador", "ACWDT": "Amser Haf Canolbarth Gorllewin Awstralia", "AEST": "Amser Safonol Dwyrain Awstralia", "HNT": "Amser Safonol Newfoundland", "COST": "Amser Haf Colombia", "ADT": "Amser Haf Cefnfor yr Iwerydd", "WEZ": "Amser Safonol Gorllewin Ewrop", "OEZ": "Amser Safonol Dwyrain Ewrop", "LHDT": "Amser Haf yr Arglwydd Howe", "IST": "Amser India", "EST": "Amser Safonol Dwyrain Gogledd America", "PST": "Amser Safonol Cefnfor Tawel Gogledd America", "ChST": "Amser Chamorro", "TMST": "Amser Haf Tyrcmenistan", "BT": "Amser Bhutan", "UYST": "Amser Haf Uruguay", "HKT": "Amser Safonol Hong Kong", "AWST": "Amser Safonol Gorllewin Awstralia", "SGT": "Amser Singapore", "GYT": "Amser Guyana", "GFT": "Amser Guyane Ffrengig", "VET": "Amser Venezuela", "MESZ": "Amser Haf Canolbarth Ewrop", "GMT": "Amser Safonol Greenwich", "HKST": "Amser Haf Hong Kong", "ART": "Amser Safonol Ariannin", "WIT": "Amser Dwyrain Indonesia", "SRT": "Amser Suriname", "AST": "Amser Safonol Cefnfor yr Iwerydd", "JST": "Amser Safonol Siapan", "NZST": "Amser Safonol Seland Newydd", "SAST": "Amser Safonol De Affrica", "CAT": "Amser Canolbarth Affrica"},
}
}
diff --git a/cy/cy_test.go b/cy/cy_test.go
new file mode 100644
index 00000000..feda64d4
--- /dev/null
+++ b/cy/cy_test.go
@@ -0,0 +1,1120 @@
+package cy
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "cy"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/cy_GB/cy_GB.go b/cy_GB/cy_GB.go
index 10480536..5e510626 100644
--- a/cy_GB/cy_GB.go
+++ b/cy_GB/cy_GB.go
@@ -65,7 +65,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"CC", "OC"},
erasNarrow: []string{"C", "O"},
erasWide: []string{"Cyn Crist", "Oed Crist"},
- timezones: map[string]string{"EST": "Amser Safonol Dwyrain Gogledd America", "HKST": "Amser Haf Hong Kong", "CHAST": "Amser Safonol Chatham", "PDT": "Amser Haf Cefnfor Tawel Gogledd America", "NZST": "Amser Safonol Seland Newydd", "CST": "Amser Safonol Canolbarth Gogledd America", "ACWDT": "Amser Haf Canolbarth Gorllewin Awstralia", "WEZ": "Amser Safonol Gorllewin Ewrop", "HAST": "Amser Safonol Hawaii-Aleutian", "SGT": "Amser Singapore", "TMST": "Amser Haf Tyrcmenistan", "AEST": "Amser Safonol Dwyrain Awstralia", "COT": "Amser Safonol Colombia", "COST": "Amser Haf Colombia", "IST": "Amser India", "ACDT": "Amser Haf Canolbarth Awstralia", "TMT": "Amser Safonol Tyrcmenistan", "AKDT": "Amser Haf Alaska", "MESZ": "Amser Haf Canolbarth Ewrop", "ChST": "Amser Chamorro", "WESZ": "Amser Haf Gorllewin Ewrop", "OESZ": "Amser Haf Dwyrain Ewrop", "HNT": "Amser Safonol Newfoundland", "WIT": "Amser Dwyrain Indonesia", "MYT": "Amser Malaysia", "CDT": "Amser Haf Canolbarth Gogledd America", "AEDT": "Amser Haf Dwyrain Awstralia", "EDT": "Amser Haf Dwyrain Gogledd America", "HKT": "Amser Safonol Hong Kong", "EAT": "Amser Dwyrain Affrica", "MEZ": "Amser Safonol Canolbarth Ewrop", "ACWST": "Amser Safonol Canolbarth Gorllewin Awstralia", "VET": "Amser Venezuela", "CAT": "Amser Canolbarth Affrica", "AST": "Amser Safonol Cefnfor yr Iwerydd", "WAST": "Amser Haf Gorllewin Affrica", "WITA": "Amser Canolbarth Indonesia", "ACST": "Amser Safonol Canolbarth Awstralia", "LHDT": "Amser Haf yr Arglwydd Howe", "GYT": "Amser Guyana", "WAT": "Amser Safonol Gorllewin Affrica", "BT": "Amser Bhutan", "MDT": "MDT", "GMT": "Amser Safonol Greenwich", "WIB": "Amser Gorllewin Indonesia", "AWDT": "Amser Haf Gorllewin Awstralia", "JST": "Amser Safonol Siapan", "AKST": "Amser Safonol Alaska", "UYST": "Amser Haf Uruguay", "∅∅∅": "Amser Haf Brasília", "PST": "Amser Safonol Cefnfor Tawel Gogledd America", "JDT": "Amser Haf Siapan", "NZDT": "Amser Haf Seland Newydd", "BOT": "Amser Bolivia", "ECT": "Amser Ecuador", "HAT": "Amser Haf Newfoundland", "LHST": "Amser Safonol yr Arglwydd Howe", "UYT": "Amser Safonol Uruguay", "SAST": "Amser Safonol De Affrica", "OEZ": "Amser Safonol Dwyrain Ewrop", "ARST": "Amser Haf Ariannin", "AWST": "Amser Safonol Gorllewin Awstralia", "SRT": "Amser Suriname", "HADT": "Amser Haf Hawaii-Aleutian", "MST": "MST", "WARST": "Amser Haf Gorllewin Ariannin", "CHADT": "Amser Haf Chatham", "CLT": "Amser Safonol Chile", "ADT": "Amser Haf Cefnfor yr Iwerydd", "CLST": "Amser Haf Chile", "WART": "Amser Safonol Gorllewin Ariannin", "GFT": "Amser Guyane Ffrengig", "ART": "Amser Safonol Ariannin"},
+ timezones: map[string]string{"CLT": "Amser Safonol Chile", "EAT": "Amser Dwyrain Affrica", "CHAST": "Amser Safonol Chatham", "ACWST": "Amser Safonol Canolbarth Gorllewin Awstralia", "HNT": "Amser Safonol Newfoundland", "WAT": "Amser Safonol Gorllewin Affrica", "CDT": "Amser Haf Canolbarth Gogledd America", "ADT": "Amser Haf Cefnfor yr Iwerydd", "OESZ": "Amser Haf Dwyrain Ewrop", "UYST": "Amser Haf Uruguay", "CST": "Amser Safonol Canolbarth Gogledd America", "OEZ": "Amser Safonol Dwyrain Ewrop", "VET": "Amser Venezuela", "EST": "Amser Safonol Dwyrain Gogledd America", "NZST": "Amser Safonol Seland Newydd", "SAST": "Amser Safonol De Affrica", "HAT": "Amser Haf Newfoundland", "GYT": "Amser Guyana", "ARST": "Amser Haf Ariannin", "PDT": "Amser Haf Cefnfor Tawel Gogledd America", "ACST": "Amser Safonol Canolbarth Awstralia", "MST": "Amser Safonol Mynyddoedd Gogledd America", "HKT": "Amser Safonol Hong Kong", "AWDT": "Amser Haf Gorllewin Awstralia", "AKDT": "Amser Haf Alaska", "HAST": "Amser Safonol Hawaii-Aleutian", "LHST": "Amser Safonol yr Arglwydd Howe", "BOT": "Amser Bolivia", "ChST": "Amser Chamorro", "CHADT": "Amser Haf Chatham", "AST": "Amser Safonol Cefnfor yr Iwerydd", "CAT": "Amser Canolbarth Affrica", "GMT": "Amser Safonol Greenwich", "WIT": "Amser Dwyrain Indonesia", "GFT": "Amser Guyane Ffrengig", "ECT": "Amser Ecuador", "∅∅∅": "∅∅∅", "TMST": "Amser Haf Tyrcmenistan", "CLST": "Amser Haf Chile", "WARST": "Amser Haf Gorllewin Ariannin", "NZDT": "Amser Haf Seland Newydd", "IST": "Amser India", "HKST": "Amser Haf Hong Kong", "ART": "Amser Safonol Ariannin", "JST": "Amser Safonol Siapan", "AKST": "Amser Safonol Alaska", "PST": "Amser Safonol Cefnfor Tawel Gogledd America", "TMT": "Amser Safonol Tyrcmenistan", "AEST": "Amser Safonol Dwyrain Awstralia", "ACDT": "Amser Haf Canolbarth Awstralia", "WITA": "Amser Canolbarth Indonesia", "JDT": "Amser Haf Siapan", "SGT": "Amser Singapore", "WIB": "Amser Gorllewin Indonesia", "WEZ": "Amser Safonol Gorllewin Ewrop", "WESZ": "Amser Haf Gorllewin Ewrop", "LHDT": "Amser Haf yr Arglwydd Howe", "UYT": "Amser Safonol Uruguay", "WART": "Amser Safonol Gorllewin Ariannin", "SRT": "Amser Suriname", "ACWDT": "Amser Haf Canolbarth Gorllewin Awstralia", "EDT": "Amser Haf Dwyrain Gogledd America", "COT": "Amser Safonol Colombia", "BT": "Amser Bhutan", "MYT": "Amser Malaysia", "AWST": "Amser Safonol Gorllewin Awstralia", "COST": "Amser Haf Colombia", "WAST": "Amser Haf Gorllewin Affrica", "MDT": "Amser Haf Mynyddoedd Gogledd America", "MEZ": "Amser Safonol Canolbarth Ewrop", "MESZ": "Amser Haf Canolbarth Ewrop", "HADT": "Amser Haf Hawaii-Aleutian", "AEDT": "Amser Haf Dwyrain Awstralia"},
}
}
diff --git a/cy_GB/cy_GB_test.go b/cy_GB/cy_GB_test.go
new file mode 100644
index 00000000..2689e07e
--- /dev/null
+++ b/cy_GB/cy_GB_test.go
@@ -0,0 +1,1120 @@
+package cy_GB
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "cy_GB"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/da/da.go b/da/da.go
index 7646747e..89778e95 100644
--- a/da/da.go
+++ b/da/da.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"f.Kr.", "e.Kr."},
erasNarrow: []string{"fKr", "eKr"},
erasWide: []string{"f.Kr.", "e.Kr."},
- timezones: map[string]string{"COT": "Colombiansk normaltid", "MYT": "Malaysisk tid", "MESZ": "Centraleuropæisk sommertid", "WARST": "Vestargentinsk sommertid", "OESZ": "Østeuropæisk sommertid", "ACST": "Centralaustralsk normaltid", "∅∅∅": "Azorerne-sommertid", "CAT": "Centralafrikansk tid", "CHADT": "Chatham-sommertid", "UYST": "Uruguayansk sommertid", "NZST": "Newzealandsk normaltid", "MDT": "Mountain-sommertid", "ACWDT": "Vestlig centralaustralsk sommertid", "HAST": "Hawaii-Aleutian-normaltid", "IST": "Indisk normaltid", "TMST": "Turkmensk sommertid", "AKST": "Alaska-normaltid", "BOT": "Boliviansk tid", "AEST": "Østaustralsk normaltid", "ADT": "Atlantic-sommertid", "GYT": "Guyana-tid", "CST": "Central-normaltid", "HAT": "Newfoundlandsk sommertid", "AEDT": "Østaustralsk sommertid", "WIB": "Vestindonesisk tid", "ART": "Argentinsk normaltid", "CDT": "Central-sommertid", "MEZ": "Centraleuropæisk normaltid", "BT": "Bhutanesisk tid", "AST": "Atlantic-normaltid", "SGT": "Singaporeansk normaltid", "COST": "Colombiansk sommertid", "WAT": "Vestafrikansk normaltid", "ARST": "Argentinsk sommertid", "JDT": "Japansk sommertid", "NZDT": "Newzealandsk sommertid", "WEZ": "Vesteuropæisk normaltid", "ACWST": "Vestlig centralaustralsk normaltid", "ChST": "Chamorro-tid", "EST": "Eastern-normaltid", "HNT": "Newfoundlandsk normaltid", "ACDT": "Centralaustralsk sommertid", "PST": "Pacific-normaltid", "AWDT": "Vestaustralsk sommertid", "EDT": "Eastern-sommertid", "SAST": "Sydafrikansk tid", "HKT": "Hongkong-normaltid", "GFT": "Fransk Guyana-tid", "GMT": "GMT", "LHDT": "Lord Howe-sommertid", "CLST": "Chilensk sommertid", "ECT": "Ecuadoriansk tid", "WAST": "Vestafrikansk sommertid", "HKST": "Hongkong-sommertid", "AWST": "Vestaustralsk normaltid", "UYT": "Uruguayansk normaltid", "LHST": "Lord Howe-normaltid", "MST": "Mountain-normaltid", "TMT": "Turkmensk normaltid", "AKDT": "Alaska-sommertid", "PDT": "Pacific-sommertid", "OEZ": "Østeuropæisk normaltid", "EAT": "Østafrikansk tid", "JST": "Japansk normaltid", "CLT": "Chilensk normaltid", "WITA": "Centralindonesisk tid", "WIT": "Østindonesisk tid", "CHAST": "Chatham-normaltid", "WART": "Vestargentinsk normaltid", "WESZ": "Vesteuropæisk sommertid", "HADT": "Hawaii-Aleutian-sommertid", "SRT": "Surinam-tid", "VET": "Venezuelansk tid"},
+ timezones: map[string]string{"TMT": "Turkmensk normaltid", "OEZ": "Østeuropæisk normaltid", "ChST": "Chamorro-tid", "GYT": "Guyana-tid", "EAT": "Østafrikansk tid", "BT": "Bhutanesisk tid", "NZDT": "Newzealandsk sommertid", "COST": "Colombiansk sommertid", "HKST": "Hongkong-sommertid", "CHAST": "Chatham-normaltid", "COT": "Colombiansk normaltid", "MEZ": "Centraleuropæisk normaltid", "TMST": "Turkmensk sommertid", "WAST": "Vestafrikansk sommertid", "MDT": "Mountain-sommertid", "MYT": "Malaysisk tid", "CLST": "Chilensk sommertid", "WITA": "Centralindonesisk tid", "EST": "Eastern-normaltid", "PDT": "Pacific-sommertid", "UYST": "Uruguayansk sommertid", "SRT": "Surinam-tid", "HKT": "Hongkong-normaltid", "ADT": "Atlantic-sommertid", "CLT": "Chilensk normaltid", "WIB": "Vestindonesisk tid", "HADT": "Hawaii-Aleutian-sommertid", "HAT": "Newfoundlandsk sommertid", "WART": "Vestargentinsk normaltid", "SAST": "Sydafrikansk tid", "LHDT": "Lord Howe-sommertid", "ACDT": "Centralaustralsk sommertid", "AKST": "Alaska-normaltid", "EDT": "Eastern-sommertid", "HAST": "Hawaii-Aleutian-normaltid", "WEZ": "Vesteuropæisk normaltid", "WIT": "Østindonesisk tid", "ACWST": "Vestlig centralaustralsk normaltid", "∅∅∅": "Amazonas-sommertid", "ECT": "Ecuadoriansk tid", "ART": "Argentinsk normaltid", "ACST": "Centralaustralsk normaltid", "NZST": "Newzealandsk normaltid", "AEDT": "Østaustralsk sommertid", "MESZ": "Centraleuropæisk sommertid", "AWDT": "Vestaustralsk sommertid", "JDT": "Japansk sommertid", "BOT": "Boliviansk tid", "PST": "Pacific-normaltid", "HNT": "Newfoundlandsk normaltid", "ACWDT": "Vestlig centralaustralsk sommertid", "WAT": "Vestafrikansk normaltid", "WESZ": "Vesteuropæisk sommertid", "SGT": "Singaporeansk normaltid", "GMT": "GMT", "LHST": "Lord Howe-normaltid", "CST": "Central-normaltid", "CDT": "Central-sommertid", "AKDT": "Alaska-sommertid", "VET": "Venezuelansk tid", "IST": "Indisk normaltid", "WARST": "Vestargentinsk sommertid", "AST": "Atlantic-normaltid", "JST": "Japansk normaltid", "CAT": "Centralafrikansk tid", "AEST": "Østaustralsk normaltid", "MST": "Mountain-normaltid", "GFT": "Fransk Guyana-tid", "ARST": "Argentinsk sommertid", "OESZ": "Østeuropæisk sommertid", "UYT": "Uruguayansk normaltid", "CHADT": "Chatham-sommertid", "AWST": "Vestaustralsk normaltid"},
}
}
diff --git a/da/da_test.go b/da/da_test.go
new file mode 100644
index 00000000..26437b21
--- /dev/null
+++ b/da/da_test.go
@@ -0,0 +1,1120 @@
+package da
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "da"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/da_DK/da_DK.go b/da_DK/da_DK.go
index 7ad16d48..32963eb9 100644
--- a/da_DK/da_DK.go
+++ b/da_DK/da_DK.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"f.Kr.", "e.Kr."},
erasNarrow: []string{"fKr", "eKr"},
erasWide: []string{"f.Kr.", "e.Kr."},
- timezones: map[string]string{"OESZ": "Østeuropæisk sommertid", "MYT": "Malaysisk tid", "BOT": "Boliviansk tid", "COT": "Colombiansk normaltid", "HAST": "Hawaii-Aleutian-normaltid", "SGT": "Singaporeansk normaltid", "HAT": "Newfoundlandsk sommertid", "MDT": "Macao-sommertid", "CDT": "Central-sommertid", "ChST": "Chamorro-tid", "CLST": "Chilensk sommertid", "ECT": "Ecuadoriansk tid", "BT": "Bhutanesisk tid", "WART": "Vestargentinsk normaltid", "SRT": "Surinam-tid", "PDT": "Pacific-sommertid", "LHDT": "Lord Howe-sommertid", "CHADT": "Chatham-sommertid", "CAT": "Centralafrikansk tid", "ADT": "Atlantic-sommertid", "WIT": "Østindonesisk tid", "WESZ": "Vesteuropæisk sommertid", "HADT": "Hawaii-Aleutian-sommertid", "WITA": "Centralindonesisk tid", "ACDT": "Centralaustralsk sommertid", "NZST": "Newzealandsk normaltid", "AST": "Atlantic-normaltid", "AKST": "Alaska-normaltid", "AWDT": "Vestaustralsk sommertid", "WEZ": "Vesteuropæisk normaltid", "WIB": "Vestindonesisk tid", "GMT": "GMT", "MST": "Macao-normaltid", "ARST": "Argentinsk sommertid", "TMT": "Turkmensk normaltid", "PST": "Pacific-normaltid", "VET": "Venezuelansk tid", "COST": "Colombiansk sommertid", "HKT": "Hongkong-normaltid", "HKST": "Hongkong-sommertid", "OEZ": "Østeuropæisk normaltid", "∅∅∅": "Amazonas-sommertid", "EST": "Eastern-normaltid", "SAST": "Sydafrikansk tid", "HNT": "Newfoundlandsk normaltid", "CST": "Central-normaltid", "NZDT": "Newzealandsk sommertid", "UYST": "Uruguayansk sommertid", "CLT": "Chilensk normaltid", "ACWDT": "Vestlig centralaustralsk sommertid", "GFT": "Fransk Guyana-tid", "EAT": "Østafrikansk tid", "TMST": "Turkmensk sommertid", "AKDT": "Alaska-sommertid", "AWST": "Vestaustralsk normaltid", "LHST": "Lord Howe-normaltid", "UYT": "Uruguayansk normaltid", "WAST": "Vestafrikansk sommertid", "JST": "Japansk normaltid", "MEZ": "Centraleuropæisk normaltid", "WARST": "Vestargentinsk sommertid", "ART": "Argentinsk normaltid", "GYT": "Guyana-tid", "MESZ": "Centraleuropæisk sommertid", "CHAST": "Chatham-normaltid", "EDT": "Eastern-sommertid", "IST": "Indisk normaltid", "JDT": "Japansk sommertid", "AEDT": "Østaustralsk sommertid", "ACST": "Centralaustralsk normaltid", "WAT": "Vestafrikansk normaltid", "ACWST": "Vestlig centralaustralsk normaltid", "AEST": "Østaustralsk normaltid"},
+ timezones: map[string]string{"ACDT": "Centralaustralsk sommertid", "HAST": "Hawaii-Aleutian-normaltid", "PST": "Pacific-normaltid", "HAT": "Newfoundlandsk sommertid", "AEST": "Østaustralsk normaltid", "EST": "Eastern-normaltid", "COT": "Colombiansk normaltid", "UYT": "Uruguayansk normaltid", "BT": "Bhutanesisk tid", "MST": "Mountain-normaltid", "ACST": "Centralaustralsk normaltid", "WARST": "Vestargentinsk sommertid", "GMT": "GMT", "CST": "Central-normaltid", "ACWST": "Vestlig centralaustralsk normaltid", "ARST": "Argentinsk sommertid", "MESZ": "Centraleuropæisk sommertid", "WIB": "Vestindonesisk tid", "GFT": "Fransk Guyana-tid", "VET": "Venezuelansk tid", "WESZ": "Vesteuropæisk sommertid", "GYT": "Guyana-tid", "ADT": "Atlantic-sommertid", "SAST": "Sydafrikansk tid", "IST": "Indisk normaltid", "COST": "Colombiansk sommertid", "OESZ": "Østeuropæisk sommertid", "CLST": "Chilensk sommertid", "ECT": "Ecuadoriansk tid", "WAST": "Vestafrikansk sommertid", "HNT": "Newfoundlandsk normaltid", "OEZ": "Østeuropæisk normaltid", "CHADT": "Chatham-sommertid", "AKST": "Alaska-normaltid", "HADT": "Hawaii-Aleutian-sommertid", "TMST": "Turkmensk sommertid", "WITA": "Centralindonesisk tid", "JST": "Japansk normaltid", "ART": "Argentinsk normaltid", "MDT": "Mountain-sommertid", "MYT": "Malaysisk tid", "WART": "Vestargentinsk normaltid", "HKT": "Hongkong-normaltid", "HKST": "Hongkong-sommertid", "AWST": "Vestaustralsk normaltid", "AEDT": "Østaustralsk sommertid", "∅∅∅": "Brasiliansk sommertid", "SRT": "Surinam-tid", "CHAST": "Chatham-normaltid", "NZDT": "Newzealandsk sommertid", "TMT": "Turkmensk normaltid", "JDT": "Japansk sommertid", "AKDT": "Alaska-sommertid", "PDT": "Pacific-sommertid", "CAT": "Centralafrikansk tid", "SGT": "Singaporeansk normaltid", "EAT": "Østafrikansk tid", "MEZ": "Centraleuropæisk normaltid", "EDT": "Eastern-sommertid", "WAT": "Vestafrikansk normaltid", "ChST": "Chamorro-tid", "LHST": "Lord Howe-normaltid", "CDT": "Central-sommertid", "AST": "Atlantic-normaltid", "ACWDT": "Vestlig centralaustralsk sommertid", "BOT": "Boliviansk tid", "CLT": "Chilensk normaltid", "AWDT": "Vestaustralsk sommertid", "NZST": "Newzealandsk normaltid", "UYST": "Uruguayansk sommertid", "WIT": "Østindonesisk tid", "LHDT": "Lord Howe-sommertid", "WEZ": "Vesteuropæisk normaltid"},
}
}
diff --git a/da_DK/da_DK_test.go b/da_DK/da_DK_test.go
new file mode 100644
index 00000000..71ed28d7
--- /dev/null
+++ b/da_DK/da_DK_test.go
@@ -0,0 +1,1120 @@
+package da_DK
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "da_DK"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/da_GL/da_GL.go b/da_GL/da_GL.go
index 3a936e80..225c50f0 100644
--- a/da_GL/da_GL.go
+++ b/da_GL/da_GL.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"f.Kr.", "e.Kr."},
erasNarrow: []string{"fKr", "eKr"},
erasWide: []string{"f.Kr.", "e.Kr."},
- timezones: map[string]string{"AST": "Atlantic-normaltid", "ART": "Argentinsk normaltid", "AWST": "Vestaustralsk normaltid", "UYT": "Uruguayansk normaltid", "AEDT": "Østaustralsk sommertid", "CLT": "Chilensk normaltid", "EAT": "Østafrikansk tid", "LHST": "Lord Howe-normaltid", "SRT": "Surinam-tid", "PDT": "Pacific-sommertid", "TMT": "Turkmensk normaltid", "MST": "Macao-normaltid", "NZDT": "Newzealandsk sommertid", "WARST": "Vestargentinsk sommertid", "HNT": "Newfoundlandsk normaltid", "IST": "Indisk normaltid", "ACST": "Centralaustralsk normaltid", "∅∅∅": "Amazonas-sommertid", "WAST": "Vestafrikansk sommertid", "WEZ": "Vesteuropæisk normaltid", "WESZ": "Vesteuropæisk sommertid", "BT": "Bhutanesisk tid", "HKT": "Hongkong-normaltid", "HAT": "Newfoundlandsk sommertid", "WIB": "Vestindonesisk tid", "LHDT": "Lord Howe-sommertid", "ChST": "Chamorro-tid", "HKST": "Hongkong-sommertid", "WAT": "Vestafrikansk normaltid", "ARST": "Argentinsk sommertid", "MYT": "Malaysisk tid", "CDT": "Central-sommertid", "COT": "Colombiansk normaltid", "GFT": "Fransk Guyana-tid", "MEZ": "Centraleuropæisk normaltid", "CLST": "Chilensk sommertid", "AWDT": "Vestaustralsk sommertid", "NZST": "Newzealandsk normaltid", "CST": "Central-normaltid", "MESZ": "Centraleuropæisk sommertid", "ECT": "Ecuadoriansk tid", "WART": "Vestargentinsk normaltid", "GMT": "GMT", "OEZ": "Østeuropæisk normaltid", "GYT": "Guyana-tid", "BOT": "Boliviansk tid", "TMST": "Turkmensk sommertid", "UYST": "Uruguayansk sommertid", "ACWST": "Vestlig centralaustralsk normaltid", "ACWDT": "Vestlig centralaustralsk sommertid", "EDT": "Eastern-sommertid", "SGT": "Singaporeansk normaltid", "HADT": "Hawaii-Aleutian-sommertid", "ACDT": "Centralaustralsk sommertid", "JST": "Japansk normaltid", "AKST": "Alaska-normaltid", "VET": "Venezuelansk tid", "SAST": "Sydafrikansk tid", "WITA": "Centralindonesisk tid", "WIT": "Østindonesisk tid", "PST": "Pacific-normaltid", "HAST": "Hawaii-Aleutian-normaltid", "CHADT": "Chatham-sommertid", "ADT": "Atlantic-sommertid", "JDT": "Japansk sommertid", "AEST": "Østaustralsk normaltid", "EST": "Eastern-normaltid", "OESZ": "Østeuropæisk sommertid", "CHAST": "Chatham-normaltid", "COST": "Colombiansk sommertid", "CAT": "Centralafrikansk tid", "MDT": "Macao-sommertid", "AKDT": "Alaska-sommertid"},
+ timezones: map[string]string{"WITA": "Centralindonesisk tid", "IST": "Indisk normaltid", "GMT": "GMT", "UYST": "Uruguayansk sommertid", "CST": "Central-normaltid", "HKT": "Hongkong-normaltid", "BOT": "Boliviansk tid", "EST": "Eastern-normaltid", "MESZ": "Centraleuropæisk sommertid", "UYT": "Uruguayansk normaltid", "MDT": "Macao-sommertid", "SGT": "Singaporeansk normaltid", "NZDT": "Newzealandsk sommertid", "HNT": "Newfoundlandsk normaltid", "OESZ": "Østeuropæisk sommertid", "WART": "Vestargentinsk normaltid", "CHAST": "Chatham-normaltid", "AST": "Atlantic-normaltid", "AWDT": "Vestaustralsk sommertid", "COST": "Colombiansk sommertid", "BT": "Bhutanesisk tid", "AKDT": "Alaska-sommertid", "ACWST": "Vestlig centralaustralsk normaltid", "ACWDT": "Vestlig centralaustralsk sommertid", "GYT": "Guyana-tid", "ACDT": "Centralaustralsk sommertid", "ECT": "Ecuadoriansk tid", "HAT": "Newfoundlandsk sommertid", "COT": "Colombiansk normaltid", "ChST": "Chamorro-tid", "EAT": "Østafrikansk tid", "SRT": "Surinam-tid", "WEZ": "Vesteuropæisk normaltid", "ART": "Argentinsk normaltid", "HADT": "Hawaii-Aleutian-sommertid", "NZST": "Newzealandsk normaltid", "MST": "Macao-normaltid", "ARST": "Argentinsk sommertid", "HAST": "Hawaii-Aleutian-normaltid", "WIB": "Vestindonesisk tid", "CLT": "Chilensk normaltid", "ADT": "Atlantic-sommertid", "MEZ": "Centraleuropæisk normaltid", "WARST": "Vestargentinsk sommertid", "EDT": "Eastern-sommertid", "HKST": "Hongkong-sommertid", "JST": "Japansk normaltid", "PST": "Pacific-normaltid", "CAT": "Centralafrikansk tid", "LHST": "Lord Howe-normaltid", "CDT": "Central-sommertid", "∅∅∅": "Azorerne-sommertid", "SAST": "Sydafrikansk tid", "TMT": "Turkmensk normaltid", "WESZ": "Vesteuropæisk sommertid", "ACST": "Centralaustralsk normaltid", "CHADT": "Chatham-sommertid", "JDT": "Japansk sommertid", "TMST": "Turkmensk sommertid", "WAST": "Vestafrikansk sommertid", "OEZ": "Østeuropæisk normaltid", "GFT": "Fransk Guyana-tid", "AWST": "Vestaustralsk normaltid", "VET": "Venezuelansk tid", "PDT": "Pacific-sommertid", "AEDT": "Østaustralsk sommertid", "WIT": "Østindonesisk tid", "LHDT": "Lord Howe-sommertid", "AKST": "Alaska-normaltid", "AEST": "Østaustralsk normaltid", "MYT": "Malaysisk tid", "CLST": "Chilensk sommertid", "WAT": "Vestafrikansk normaltid"},
}
}
diff --git a/da_GL/da_GL_test.go b/da_GL/da_GL_test.go
new file mode 100644
index 00000000..b5d1ee8a
--- /dev/null
+++ b/da_GL/da_GL_test.go
@@ -0,0 +1,1120 @@
+package da_GL
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "da_GL"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/dav/dav.go b/dav/dav.go
index c713eb9f..997ac324 100644
--- a/dav/dav.go
+++ b/dav/dav.go
@@ -63,7 +63,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"KK", "BK"},
erasNarrow: []string{"", ""},
erasWide: []string{"Kabla ya Kristo", "Baada ya Kristo"},
- timezones: map[string]string{"HAT": "HAT", "ART": "ART", "ECT": "ECT", "ACST": "ACST", "JST": "JST", "MESZ": "MESZ", "AEST": "AEST", "COST": "COST", "WEZ": "WEZ", "OEZ": "OEZ", "GMT": "GMT", "GYT": "GYT", "CST": "CST", "NZDT": "NZDT", "HADT": "HADT", "SGT": "SGT", "WITA": "WITA", "OESZ": "OESZ", "MYT": "MYT", "UYST": "UYST", "AST": "AST", "MDT": "MDT", "ACDT": "ACDT", "PST": "PST", "HAST": "HAST", "WART": "WART", "∅∅∅": "∅∅∅", "TMT": "TMT", "HKST": "HKST", "WAST": "WAST", "AEDT": "AEDT", "HNT": "HNT", "LHST": "LHST", "UYT": "UYT", "MEZ": "MEZ", "CHAST": "CHAST", "SRT": "SRT", "AKST": "AKST", "CDT": "CDT", "WESZ": "WESZ", "ADT": "ADT", "BT": "BT", "GFT": "GFT", "WIT": "WIT", "WIB": "WIB", "CLT": "CLT", "COT": "COT", "AKDT": "AKDT", "ACWST": "ACWST", "WAT": "WAT", "CLST": "CLST", "WARST": "WARST", "EAT": "EAT", "JDT": "JDT", "NZST": "NZST", "IST": "IST", "LHDT": "LHDT", "ACWDT": "ACWDT", "AWDT": "AWDT", "BOT": "BOT", "EST": "EST", "SAST": "SAST", "CAT": "CAT", "EDT": "EDT", "TMST": "TMST", "PDT": "PDT", "AWST": "AWST", "ChST": "ChST", "VET": "VET", "ARST": "ARST", "MST": "MST", "CHADT": "CHADT", "HKT": "HKT"},
+ timezones: map[string]string{"TMT": "TMT", "TMST": "TMST", "OEZ": "OEZ", "ARST": "ARST", "HAST": "HAST", "ACDT": "ACDT", "ECT": "ECT", "AKST": "AKST", "SGT": "SGT", "CAT": "CAT", "MYT": "MYT", "UYT": "UYT", "SRT": "SRT", "PDT": "PDT", "BOT": "BOT", "CLT": "CLT", "LHDT": "LHDT", "ACWST": "ACWST", "OESZ": "OESZ", "EAT": "EAT", "WIB": "WIB", "WITA": "WITA", "COT": "COT", "WESZ": "WESZ", "HKT": "HKT", "ART": "ART", "AKDT": "AKDT", "SAST": "SAST", "WAST": "WAST", "GMT": "GMT", "AEDT": "AEDT", "WIT": "WIT", "IST": "IST", "HAT": "HAT", "GFT": "GFT", "JDT": "JDT", "MEZ": "MEZ", "∅∅∅": "∅∅∅", "PST": "PST", "LHST": "LHST", "CST": "CST", "WART": "WART", "WARST": "WARST", "AWST": "AWST", "GYT": "GYT", "AEST": "AEST", "UYST": "UYST", "COST": "COST", "AWDT": "AWDT", "MESZ": "MESZ", "NZST": "NZST", "HNT": "HNT", "WAT": "WAT", "CHAST": "CHAST", "ACWDT": "ACWDT", "NZDT": "NZDT", "EDT": "EDT", "WEZ": "WEZ", "VET": "VET", "JST": "JST", "AST": "AST", "ADT": "ADT", "EST": "EST", "CLST": "CLST", "BT": "BT", "CDT": "CDT", "ChST": "ChST", "MST": "MST", "MDT": "MDT", "HADT": "HADT", "ACST": "ACST", "HKST": "HKST", "CHADT": "CHADT"},
}
}
diff --git a/dav/dav_test.go b/dav/dav_test.go
new file mode 100644
index 00000000..ad597b3f
--- /dev/null
+++ b/dav/dav_test.go
@@ -0,0 +1,1120 @@
+package dav
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "dav"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/dav_KE/dav_KE.go b/dav_KE/dav_KE.go
index 3cd56330..cbad64f7 100644
--- a/dav_KE/dav_KE.go
+++ b/dav_KE/dav_KE.go
@@ -63,7 +63,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"KK", "BK"},
erasNarrow: []string{"", ""},
erasWide: []string{"Kabla ya Kristo", "Baada ya Kristo"},
- timezones: map[string]string{"ARST": "ARST", "TMST": "TMST", "MEZ": "MEZ", "CHADT": "CHADT", "HAST": "HAST", "HKST": "HKST", "ACST": "ACST", "MESZ": "MESZ", "AEDT": "AEDT", "EDT": "EDT", "OEZ": "OEZ", "LHDT": "LHDT", "AKST": "AKST", "WEZ": "WEZ", "WAT": "WAT", "MDT": "MDT", "GYT": "GYT", "JST": "JST", "CLT": "CLT", "ECT": "ECT", "SGT": "SGT", "HAT": "HAT", "OESZ": "OESZ", "WIT": "WIT", "ART": "ART", "SRT": "SRT", "BOT": "BOT", "UYST": "UYST", "WARST": "WARST", "SAST": "SAST", "COST": "COST", "AST": "AST", "WAST": "WAST", "IST": "IST", "ACDT": "ACDT", "PST": "PST", "WIB": "WIB", "EAT": "EAT", "MYT": "MYT", "ADT": "ADT", "WART": "WART", "UYT": "UYT", "ACWDT": "ACWDT", "ChST": "ChST", "HADT": "HADT", "AWDT": "AWDT", "WESZ": "WESZ", "HKT": "HKT", "AWST": "AWST", "ACWST": "ACWST", "CLST": "CLST", "WITA": "WITA", "CST": "CST", "AEST": "AEST", "CHAST": "CHAST", "GFT": "GFT", "AKDT": "AKDT", "CDT": "CDT", "COT": "COT", "CAT": "CAT", "∅∅∅": "∅∅∅", "EST": "EST", "HNT": "HNT", "TMT": "TMT", "PDT": "PDT", "LHST": "LHST", "JDT": "JDT", "NZDT": "NZDT", "VET": "VET", "GMT": "GMT", "MST": "MST", "NZST": "NZST", "BT": "BT"},
+ timezones: map[string]string{"WART": "WART", "VET": "VET", "MYT": "MYT", "ACWDT": "ACWDT", "AKDT": "AKDT", "EDT": "EDT", "NZDT": "NZDT", "HAT": "HAT", "SGT": "SGT", "TMST": "TMST", "WIT": "WIT", "ACST": "ACST", "AKST": "AKST", "IST": "IST", "MESZ": "MESZ", "BOT": "BOT", "WESZ": "WESZ", "ChST": "ChST", "CHAST": "CHAST", "UYT": "UYT", "ARST": "ARST", "∅∅∅": "∅∅∅", "HNT": "HNT", "TMT": "TMT", "AEDT": "AEDT", "OESZ": "OESZ", "MST": "MST", "HKST": "HKST", "PDT": "PDT", "NZST": "NZST", "LHDT": "LHDT", "AST": "AST", "ADT": "ADT", "ACWST": "ACWST", "WAT": "WAT", "LHST": "LHST", "HKT": "HKT", "GMT": "GMT", "WIB": "WIB", "GYT": "GYT", "GFT": "GFT", "PST": "PST", "HAST": "HAST", "COST": "COST", "CAT": "CAT", "CLT": "CLT", "UYST": "UYST", "WARST": "WARST", "WITA": "WITA", "WAST": "WAST", "CLST": "CLST", "CST": "CST", "EAT": "EAT", "AWST": "AWST", "EST": "EST", "MEZ": "MEZ", "SAST": "SAST", "CDT": "CDT", "JDT": "JDT", "WEZ": "WEZ", "BT": "BT", "SRT": "SRT", "ECT": "ECT", "AWDT": "AWDT", "ART": "ART", "JST": "JST", "HADT": "HADT", "COT": "COT", "AEST": "AEST", "OEZ": "OEZ", "MDT": "MDT", "ACDT": "ACDT", "CHADT": "CHADT"},
}
}
diff --git a/dav_KE/dav_KE_test.go b/dav_KE/dav_KE_test.go
new file mode 100644
index 00000000..6df36071
--- /dev/null
+++ b/dav_KE/dav_KE_test.go
@@ -0,0 +1,1120 @@
+package dav_KE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "dav_KE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/de/de.go b/de/de.go
index a677c4f9..e6882885 100644
--- a/de/de.go
+++ b/de/de.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"v. Chr.", "n. Chr."},
erasNarrow: []string{"v. Chr.", "n. Chr."},
erasWide: []string{"v. Chr.", "n. Chr."},
- timezones: map[string]string{"EDT": "Nordamerikanische Ostküsten-Sommerzeit", "HKT": "Hongkong-Normalzeit", "HAST": "Hawaii-Aleuten-Normalzeit", "BT": "Bhutan-Zeit", "WIT": "Ostindonesische Zeit", "PDT": "Nordamerikanische Westküsten-Sommerzeit", "UYT": "Uruguyanische Normalzeit", "WESZ": "Westeuropäische Sommerzeit", "ChST": "Chamorro-Zeit", "COT": "Kolumbianische Normalzeit", "WIB": "Westindonesische Zeit", "GFT": "Französisch-Guayana-Zeit", "EST": "Nordamerikanische Ostküsten-Normalzeit", "SAST": "Südafrikanische Zeit", "WAST": "Westafrikanische Sommerzeit", "ACST": "Zentralaustralische Normalzeit", "AKST": "Alaska-Normalzeit", "VET": "Venezuela-Zeit", "ECT": "Ecuadorianische Zeit", "WAT": "Westafrikanische Normalzeit", "MEZ": "Mitteleuropäische Normalzeit", "MESZ": "Mitteleuropäische Sommerzeit", "AEST": "Ostaustralische Normalzeit", "EAT": "Ostafrikanische Zeit", "JST": "Japanische Normalzeit", "SGT": "Singapur-Zeit", "GMT": "Mittlere Greenwich-Zeit", "AWST": "Westaustralische Normalzeit", "NZDT": "Neuseeland-Sommerzeit", "COST": "Kolumbianische Sommerzeit", "ADT": "Atlantik-Sommerzeit", "ARST": "Argentinische Sommerzeit", "AST": "Atlantik-Normalzeit", "WART": "Westargentinische Normalzeit", "IST": "Indische Zeit", "LHDT": "Lord-Howe-Sommerzeit", "WEZ": "Westeuropäische Normalzeit", "MST": "Rocky Mountain-Normalzeit", "∅∅∅": "Brasília-Sommerzeit", "LHST": "Lord-Howe-Normalzeit", "BOT": "Bolivianische Zeit", "CAT": "Zentralafrikanische Zeit", "HADT": "Hawaii-Aleuten-Sommerzeit", "SRT": "Suriname-Zeit", "CST": "Nordamerikanische Inland-Normalzeit", "UYST": "Uruguayanische Sommerzeit", "HKST": "Hongkong-Sommerzeit", "OESZ": "Osteuropäische Sommerzeit", "TMST": "Turkmenistan-Sommerzeit", "AWDT": "Westaustralische Sommerzeit", "GYT": "Guyana-Zeit", "CLT": "Chilenische Normalzeit", "CLST": "Chilenische Sommerzeit", "AEDT": "Ostaustralische Sommerzeit", "ART": "Argentinische Normalzeit", "CDT": "Nordamerikanische Inland-Sommerzeit", "HAT": "Neufundland-Sommerzeit", "TMT": "Turkmenistan-Normalzeit", "ACDT": "Zentralaustralische Sommerzeit", "CHAST": "Chatham-Normalzeit", "ACWST": "Zentral-/Westaustralische Normalzeit", "ACWDT": "Zentral-/Westaustralische Sommerzeit", "WITA": "Zentralindonesische Zeit", "MYT": "Malaysische Zeit", "AKDT": "Alaska-Sommerzeit", "PST": "Nordamerikanische Westküsten-Normalzeit", "NZST": "Neuseeland-Normalzeit", "CHADT": "Chatham-Sommerzeit", "WARST": "Westargentinische Sommerzeit", "HNT": "Neufundland-Normalzeit", "MDT": "Rocky-Mountain-Sommerzeit", "OEZ": "Osteuropäische Normalzeit", "JDT": "Japanische Sommerzeit"},
+ timezones: map[string]string{"ACWST": "Zentral-/Westaustralische Normalzeit", "AKDT": "Alaska-Sommerzeit", "WAT": "Westafrikanische Normalzeit", "AEDT": "Ostaustralische Sommerzeit", "MESZ": "Mitteleuropäische Sommerzeit", "BOT": "Bolivianische Zeit", "GYT": "Guyana-Zeit", "GFT": "Französisch-Guayana-Zeit", "CHAST": "Chatham-Normalzeit", "AKST": "Alaska-Normalzeit", "ADT": "Atlantik-Sommerzeit", "CLST": "Chilenische Sommerzeit", "BT": "Bhutan-Zeit", "SAST": "Südafrikanische Zeit", "WESZ": "Westeuropäische Sommerzeit", "SGT": "Singapur-Zeit", "OEZ": "Osteuropäische Normalzeit", "HKT": "Hongkong-Normalzeit", "PST": "Nordamerikanische Westküsten-Normalzeit", "NZST": "Neuseeland-Normalzeit", "COT": "Kolumbianische Normalzeit", "MDT": "Macau-Sommerzeit", "WEZ": "Westeuropäische Normalzeit", "WIB": "Westindonesische Zeit", "UYT": "Uruguyanische Normalzeit", "WART": "Westargentinische Normalzeit", "VET": "Venezuela-Zeit", "NZDT": "Neuseeland-Sommerzeit", "HAT": "Neufundland-Sommerzeit", "IST": "Indische Zeit", "CAT": "Zentralafrikanische Zeit", "ChST": "Chamorro-Zeit", "JDT": "Japanische Sommerzeit", "AST": "Atlantik-Normalzeit", "EDT": "Nordamerikanische Ostküsten-Sommerzeit", "HAST": "Hawaii-Aleuten-Normalzeit", "WARST": "Westargentinische Sommerzeit", "HKST": "Hongkong-Sommerzeit", "AWST": "Westaustralische Normalzeit", "JST": "Japanische Normalzeit", "COST": "Kolumbianische Sommerzeit", "TMT": "Turkmenistan-Normalzeit", "CHADT": "Chatham-Sommerzeit", "MST": "Macau-Normalzeit", "AWDT": "Westaustralische Sommerzeit", "WITA": "Zentralindonesische Zeit", "LHDT": "Lord-Howe-Sommerzeit", "UYST": "Uruguayanische Sommerzeit", "ECT": "Ecuadorianische Zeit", "ACWDT": "Zentral-/Westaustralische Sommerzeit", "PDT": "Nordamerikanische Westküsten-Sommerzeit", "HADT": "Hawaii-Aleuten-Sommerzeit", "WIT": "Ostindonesische Zeit", "SRT": "Suriname-Zeit", "WAST": "Westafrikanische Sommerzeit", "AEST": "Ostaustralische Normalzeit", "OESZ": "Osteuropäische Sommerzeit", "MYT": "Malaysische Zeit", "CLT": "Chilenische Normalzeit", "∅∅∅": "Azoren-Sommerzeit", "ARST": "Argentinische Sommerzeit", "CST": "Nordamerikanische Inland-Normalzeit", "CDT": "Nordamerikanische Inland-Sommerzeit", "ART": "Argentinische Normalzeit", "HNT": "Neufundland-Normalzeit", "LHST": "Lord-Howe-Normalzeit", "EAT": "Ostafrikanische Zeit", "ACDT": "Zentralaustralische Sommerzeit", "EST": "Nordamerikanische Ostküsten-Normalzeit", "TMST": "Turkmenistan-Sommerzeit", "GMT": "Mittlere Greenwich-Zeit", "ACST": "Zentralaustralische Normalzeit", "MEZ": "Mitteleuropäische Normalzeit"},
}
}
diff --git a/de/de_test.go b/de/de_test.go
new file mode 100644
index 00000000..825cb300
--- /dev/null
+++ b/de/de_test.go
@@ -0,0 +1,1120 @@
+package de
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "de"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/de_AT/de_AT.go b/de_AT/de_AT.go
index c4b9574b..e014e93f 100644
--- a/de_AT/de_AT.go
+++ b/de_AT/de_AT.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"v. Chr.", "n. Chr."},
erasNarrow: []string{"v. Chr.", "n. Chr."},
erasWide: []string{"v. Chr.", "n. Chr."},
- timezones: map[string]string{"EDT": "Nordamerikanische Ostküsten-Sommerzeit", "TMT": "Turkmenistan-Normalzeit", "∅∅∅": "Amazonas-Sommerzeit", "AKST": "Alaska-Normalzeit", "CLT": "Chilenische Normalzeit", "ACWST": "Zentral-/Westaustralische Normalzeit", "JST": "Japanische Normalzeit", "PDT": "Nordamerikanische Westküsten-Sommerzeit", "ChST": "Chamorro-Zeit", "BT": "Bhutan-Zeit", "EST": "Nordamerikanische Ostküsten-Normalzeit", "AST": "Atlantik-Normalzeit", "ADT": "Atlantik-Sommerzeit", "HKT": "Hongkong-Normalzeit", "HKST": "Hongkong-Sommerzeit", "GMT": "Mittlere Greenwich-Zeit", "VET": "Venezuela-Zeit", "AEDT": "Ostaustralische Sommerzeit", "WITA": "Zentralindonesische Zeit", "OEZ": "Osteuropäische Normalzeit", "OESZ": "Osteuropäische Sommerzeit", "TMST": "Turkmenistan-Sommerzeit", "PST": "Nordamerikanische Westküsten-Normalzeit", "HAT": "Neufundland-Sommerzeit", "ACDT": "Zentralaustralische Sommerzeit", "LHDT": "Lord-Howe-Sommerzeit", "ECT": "Ecuadorianische Zeit", "ART": "Argentinische Normalzeit", "ARST": "Argentinische Sommerzeit", "SGT": "Singapur-Zeit", "MDT": "Macau-Sommerzeit", "AWDT": "Westaustralische Sommerzeit", "ACWDT": "Zentral-/Westaustralische Sommerzeit", "CAT": "Zentralafrikanische Zeit", "MESZ": "Mitteleuropäische Sommerzeit", "UYST": "Uruguayanische Sommerzeit", "CLST": "Chilenische Sommerzeit", "HNT": "Neufundland-Normalzeit", "ACST": "Zentralaustralische Normalzeit", "BOT": "Bolivianische Zeit", "CHAST": "Chatham-Normalzeit", "WART": "Westargentinische Normalzeit", "IST": "Indische Zeit", "EAT": "Ostafrikanische Zeit", "MEZ": "Mitteleuropäische Normalzeit", "NZDT": "Neuseeland-Sommerzeit", "AWST": "Westaustralische Normalzeit", "UYT": "Uruguyanische Normalzeit", "WEZ": "Westeuropäische Normalzeit", "CDT": "Nordamerikanische Inland-Sommerzeit", "NZST": "Neuseeland-Normalzeit", "COT": "Kolumbianische Normalzeit", "WARST": "Westargentinische Sommerzeit", "GFT": "Französisch-Guayana-Zeit", "SRT": "Suriname-Zeit", "LHST": "Lord-Howe-Normalzeit", "GYT": "Guyana-Zeit", "HADT": "Hawaii-Aleuten-Sommerzeit", "WAT": "Westafrikanische Normalzeit", "WIT": "Ostindonesische Zeit", "MST": "Macau-Normalzeit", "CST": "Nordamerikanische Inland-Normalzeit", "CHADT": "Chatham-Sommerzeit", "WAST": "Westafrikanische Sommerzeit", "MYT": "Malaysische Zeit", "WESZ": "Westeuropäische Sommerzeit", "COST": "Kolumbianische Sommerzeit", "HAST": "Hawaii-Aleuten-Normalzeit", "SAST": "Südafrikanische Zeit", "WIB": "Westindonesische Zeit", "JDT": "Japanische Sommerzeit", "AKDT": "Alaska-Sommerzeit", "AEST": "Ostaustralische Normalzeit"},
+ timezones: map[string]string{"MEZ": "Mitteleuropäische Normalzeit", "SGT": "Singapur-Zeit", "OESZ": "Osteuropäische Sommerzeit", "AKDT": "Alaska-Sommerzeit", "ECT": "Ecuadorianische Zeit", "SAST": "Südafrikanische Zeit", "IST": "Indische Zeit", "HAT": "Neufundland-Sommerzeit", "COT": "Kolumbianische Normalzeit", "SRT": "Suriname-Zeit", "ACDT": "Zentralaustralische Sommerzeit", "GFT": "Französisch-Guayana-Zeit", "EDT": "Nordamerikanische Ostküsten-Sommerzeit", "MDT": "Rocky-Mountain-Sommerzeit", "VET": "Venezuela-Zeit", "AST": "Atlantik-Normalzeit", "LHDT": "Lord-Howe-Sommerzeit", "ADT": "Atlantik-Sommerzeit", "AWDT": "Westaustralische Sommerzeit", "ART": "Argentinische Normalzeit", "ARST": "Argentinische Sommerzeit", "TMT": "Turkmenistan-Normalzeit", "ChST": "Chamorro-Zeit", "CDT": "Nordamerikanische Inland-Sommerzeit", "AKST": "Alaska-Normalzeit", "NZST": "Neuseeland-Normalzeit", "COST": "Kolumbianische Sommerzeit", "WART": "Westargentinische Normalzeit", "WARST": "Westargentinische Sommerzeit", "HKST": "Hongkong-Sommerzeit", "CHAST": "Chatham-Normalzeit", "UYST": "Uruguayanische Sommerzeit", "ACWST": "Zentral-/Westaustralische Normalzeit", "MESZ": "Mitteleuropäische Sommerzeit", "NZDT": "Neuseeland-Sommerzeit", "WESZ": "Westeuropäische Sommerzeit", "GYT": "Guyana-Zeit", "CLST": "Chilenische Sommerzeit", "MYT": "Malaysische Zeit", "ACWDT": "Zentral-/Westaustralische Sommerzeit", "PST": "Nordamerikanische Westküsten-Normalzeit", "WAT": "Westafrikanische Normalzeit", "AEST": "Ostaustralische Normalzeit", "BT": "Bhutan-Zeit", "CHADT": "Chatham-Sommerzeit", "WITA": "Zentralindonesische Zeit", "JST": "Japanische Normalzeit", "UYT": "Uruguyanische Normalzeit", "PDT": "Nordamerikanische Westküsten-Sommerzeit", "HADT": "Hawaii-Aleuten-Sommerzeit", "HKT": "Hongkong-Normalzeit", "MST": "Rocky Mountain-Normalzeit", "CST": "Nordamerikanische Inland-Normalzeit", "WAST": "Westafrikanische Sommerzeit", "LHST": "Lord-Howe-Normalzeit", "HAST": "Hawaii-Aleuten-Normalzeit", "TMST": "Turkmenistan-Sommerzeit", "CAT": "Zentralafrikanische Zeit", "OEZ": "Osteuropäische Normalzeit", "∅∅∅": "Brasília-Sommerzeit", "EAT": "Ostafrikanische Zeit", "BOT": "Bolivianische Zeit", "EST": "Nordamerikanische Ostküsten-Normalzeit", "WEZ": "Westeuropäische Normalzeit", "AEDT": "Ostaustralische Sommerzeit", "WIT": "Ostindonesische Zeit", "WIB": "Westindonesische Zeit", "JDT": "Japanische Sommerzeit", "ACST": "Zentralaustralische Normalzeit", "AWST": "Westaustralische Normalzeit", "HNT": "Neufundland-Normalzeit", "GMT": "Mittlere Greenwich-Zeit", "CLT": "Chilenische Normalzeit"},
}
}
diff --git a/de_AT/de_AT_test.go b/de_AT/de_AT_test.go
new file mode 100644
index 00000000..fccc4a7d
--- /dev/null
+++ b/de_AT/de_AT_test.go
@@ -0,0 +1,1120 @@
+package de_AT
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "de_AT"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/de_BE/de_BE.go b/de_BE/de_BE.go
index b6bbc224..27fc3df3 100644
--- a/de_BE/de_BE.go
+++ b/de_BE/de_BE.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"v. Chr.", "n. Chr."},
erasNarrow: []string{"v. Chr.", "n. Chr."},
erasWide: []string{"v. Chr.", "n. Chr."},
- timezones: map[string]string{"WEZ": "Westeuropäische Normalzeit", "HADT": "Hawaii-Aleuten-Sommerzeit", "OEZ": "Osteuropäische Normalzeit", "NZST": "Neuseeland-Normalzeit", "AST": "Atlantik-Normalzeit", "WART": "Westargentinische Normalzeit", "WARST": "Westargentinische Sommerzeit", "WIT": "Ostindonesische Zeit", "EAT": "Ostafrikanische Zeit", "ART": "Argentinische Normalzeit", "TMST": "Turkmenistan-Sommerzeit", "MESZ": "Mitteleuropäische Sommerzeit", "UYT": "Uruguyanische Normalzeit", "COT": "Kolumbianische Normalzeit", "IST": "Indische Zeit", "GFT": "Französisch-Guayana-Zeit", "AWST": "Westaustralische Normalzeit", "GYT": "Guyana-Zeit", "HAST": "Hawaii-Aleuten-Normalzeit", "SGT": "Singapur-Zeit", "OESZ": "Osteuropäische Sommerzeit", "UYST": "Uruguayanische Sommerzeit", "MDT": "Rocky-Mountain-Sommerzeit", "∅∅∅": "Brasília-Sommerzeit", "WAT": "Westafrikanische Normalzeit", "NZDT": "Neuseeland-Sommerzeit", "EST": "Nordamerikanische Ostküsten-Normalzeit", "SAST": "Südafrikanische Zeit", "WITA": "Zentralindonesische Zeit", "ADT": "Atlantik-Sommerzeit", "AKDT": "Alaska-Sommerzeit", "LHDT": "Lord-Howe-Sommerzeit", "JST": "Japanische Normalzeit", "CDT": "Nordamerikanische Inland-Sommerzeit", "WESZ": "Westeuropäische Sommerzeit", "GMT": "Mittlere Greenwich-Zeit", "TMT": "Turkmenistan-Normalzeit", "PDT": "Nordamerikanische Westküsten-Sommerzeit", "AEST": "Ostaustralische Normalzeit", "CAT": "Zentralafrikanische Zeit", "HAT": "Neufundland-Sommerzeit", "ACDT": "Zentralaustralische Sommerzeit", "MEZ": "Mitteleuropäische Normalzeit", "BOT": "Bolivianische Zeit", "EDT": "Nordamerikanische Ostküsten-Sommerzeit", "ARST": "Argentinische Sommerzeit", "AKST": "Alaska-Normalzeit", "LHST": "Lord-Howe-Normalzeit", "ACWST": "Zentral-/Westaustralische Normalzeit", "CLT": "Chilenische Normalzeit", "HKST": "Hongkong-Sommerzeit", "AWDT": "Westaustralische Sommerzeit", "CLST": "Chilenische Sommerzeit", "ECT": "Ecuadorianische Zeit", "BT": "Bhutan-Zeit", "HKT": "Hongkong-Normalzeit", "HNT": "Neufundland-Normalzeit", "PST": "Nordamerikanische Westküsten-Normalzeit", "CST": "Nordamerikanische Inland-Normalzeit", "MST": "Rocky Mountain-Normalzeit", "ACST": "Zentralaustralische Normalzeit", "JDT": "Japanische Sommerzeit", "SRT": "Suriname-Zeit", "ACWDT": "Zentral-/Westaustralische Sommerzeit", "ChST": "Chamorro-Zeit", "MYT": "Malaysische Zeit", "VET": "Venezuela-Zeit", "WIB": "Westindonesische Zeit", "AEDT": "Ostaustralische Sommerzeit", "CHAST": "Chatham-Normalzeit", "CHADT": "Chatham-Sommerzeit", "COST": "Kolumbianische Sommerzeit", "WAST": "Westafrikanische Sommerzeit"},
+ timezones: map[string]string{"AST": "Atlantik-Normalzeit", "MESZ": "Mitteleuropäische Sommerzeit", "CST": "Nordamerikanische Inland-Normalzeit", "GFT": "Französisch-Guayana-Zeit", "WITA": "Zentralindonesische Zeit", "OESZ": "Osteuropäische Sommerzeit", "EAT": "Ostafrikanische Zeit", "ACDT": "Zentralaustralische Sommerzeit", "AEST": "Ostaustralische Normalzeit", "NZDT": "Neuseeland-Sommerzeit", "ECT": "Ecuadorianische Zeit", "ART": "Argentinische Normalzeit", "HKT": "Hongkong-Normalzeit", "ARST": "Argentinische Sommerzeit", "IST": "Indische Zeit", "MYT": "Malaysische Zeit", "SRT": "Suriname-Zeit", "VET": "Venezuela-Zeit", "WAST": "Westafrikanische Sommerzeit", "WEZ": "Westeuropäische Normalzeit", "BT": "Bhutan-Zeit", "CHADT": "Chatham-Sommerzeit", "ADT": "Atlantik-Sommerzeit", "WAT": "Westafrikanische Normalzeit", "OEZ": "Osteuropäische Normalzeit", "ChST": "Chamorro-Zeit", "LHDT": "Lord-Howe-Sommerzeit", "SAST": "Südafrikanische Zeit", "CAT": "Zentralafrikanische Zeit", "WIB": "Westindonesische Zeit", "HKST": "Hongkong-Sommerzeit", "SGT": "Singapur-Zeit", "AWST": "Westaustralische Normalzeit", "PDT": "Nordamerikanische Westküsten-Sommerzeit", "GMT": "Mittlere Greenwich-Zeit", "AEDT": "Ostaustralische Sommerzeit", "CLST": "Chilenische Sommerzeit", "JDT": "Japanische Sommerzeit", "ACWST": "Zentral-/Westaustralische Normalzeit", "MDT": "Macau-Sommerzeit", "ACWDT": "Zentral-/Westaustralische Sommerzeit", "BOT": "Bolivianische Zeit", "WESZ": "Westeuropäische Sommerzeit", "HNT": "Neufundland-Normalzeit", "UYT": "Uruguyanische Normalzeit", "WART": "Westargentinische Normalzeit", "∅∅∅": "Azoren-Sommerzeit", "LHST": "Lord-Howe-Normalzeit", "UYST": "Uruguayanische Sommerzeit", "NZST": "Neuseeland-Normalzeit", "COT": "Kolumbianische Normalzeit", "MEZ": "Mitteleuropäische Normalzeit", "TMT": "Turkmenistan-Normalzeit", "GYT": "Guyana-Zeit", "WARST": "Westargentinische Sommerzeit", "AKST": "Alaska-Normalzeit", "AKDT": "Alaska-Sommerzeit", "HAST": "Hawaii-Aleuten-Normalzeit", "PST": "Nordamerikanische Westküsten-Normalzeit", "COST": "Kolumbianische Sommerzeit", "TMST": "Turkmenistan-Sommerzeit", "WIT": "Ostindonesische Zeit", "ACST": "Zentralaustralische Normalzeit", "JST": "Japanische Normalzeit", "HAT": "Neufundland-Sommerzeit", "CLT": "Chilenische Normalzeit", "MST": "Macau-Normalzeit", "AWDT": "Westaustralische Sommerzeit", "HADT": "Hawaii-Aleuten-Sommerzeit", "EST": "Nordamerikanische Ostküsten-Normalzeit", "EDT": "Nordamerikanische Ostküsten-Sommerzeit", "CDT": "Nordamerikanische Inland-Sommerzeit", "CHAST": "Chatham-Normalzeit"},
}
}
diff --git a/de_BE/de_BE_test.go b/de_BE/de_BE_test.go
new file mode 100644
index 00000000..5d56e161
--- /dev/null
+++ b/de_BE/de_BE_test.go
@@ -0,0 +1,1120 @@
+package de_BE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "de_BE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/de_CH/de_CH.go b/de_CH/de_CH.go
index 4d580893..ba19ed4b 100644
--- a/de_CH/de_CH.go
+++ b/de_CH/de_CH.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"v. Chr.", "n. Chr."},
erasNarrow: []string{"v. Chr.", "n. Chr."},
erasWide: []string{"v. Chr.", "n. Chr."},
- timezones: map[string]string{"COT": "Kolumbianische Normalzeit", "OESZ": "Osteuropäische Sommerzeit", "HAT": "Neufundland-Sommerzeit", "AWDT": "Westaustralische Sommerzeit", "GYT": "Guyana-Zeit", "MESZ": "Mitteleuropäische Sommerzeit", "VET": "Venezuela-Zeit", "EDT": "Nordamerikanische Ostküsten-Sommerzeit", "SRT": "Suriname-Zeit", "JST": "Japanische Normalzeit", "HADT": "Hawaii-Aleuten-Sommerzeit", "ART": "Argentinische Normalzeit", "NZST": "Neuseeland-Normalzeit", "UYST": "Uruguayanische Sommerzeit", "ChST": "Chamorro-Zeit", "OEZ": "Osteuropäische Normalzeit", "BT": "Bhutan-Zeit", "MDT": "Macau-Sommerzeit", "ACDT": "Zentralaustralische Sommerzeit", "AEDT": "Ostaustralische Sommerzeit", "SGT": "Singapur-Zeit", "EST": "Nordamerikanische Ostküsten-Normalzeit", "WIB": "Westindonesische Zeit", "HNT": "Neufundland-Normalzeit", "WIT": "Ostindonesische Zeit", "MYT": "Malaysische Zeit", "CAT": "Zentralafrikanische Zeit", "WITA": "Zentralindonesische Zeit", "PST": "Nordamerikanische Westküsten-Normalzeit", "AWST": "Westaustralische Normalzeit", "ECT": "Ecuadorianische Zeit", "TMST": "Turkmenistan-Sommerzeit", "LHDT": "Lord-Howe-Sommerzeit", "JDT": "Japanische Sommerzeit", "WESZ": "Westeuropäische Sommerzeit", "WAST": "Westafrikanische Sommerzeit", "TMT": "Turkmenistan-Normalzeit", "BOT": "Bolivianische Zeit", "WEZ": "Westeuropäische Normalzeit", "AEST": "Ostaustralische Normalzeit", "HAST": "Hawaii-Aleuten-Normalzeit", "HKT": "Hongkong-Normalzeit", "WART": "Westargentinische Normalzeit", "IST": "Indische Zeit", "EAT": "Ostafrikanische Zeit", "ARST": "Argentinische Sommerzeit", "AKST": "Alaska-Normalzeit", "MEZ": "Mitteleuropäische Normalzeit", "ACWDT": "Zentral-/Westaustralische Sommerzeit", "AST": "Atlantik-Normalzeit", "NZDT": "Neuseeland-Sommerzeit", "ACWST": "Zentral-/Westaustralische Normalzeit", "CLT": "Chilenische Normalzeit", "MST": "Macau-Normalzeit", "HKST": "Hongkong-Sommerzeit", "GFT": "Französisch-Guayana-Zeit", "AKDT": "Alaska-Sommerzeit", "CHAST": "Chatham-Normalzeit", "SAST": "Südafrikanische Zeit", "CLST": "Chilenische Sommerzeit", "ACST": "Zentralaustralische Normalzeit", "∅∅∅": "Brasília-Sommerzeit", "WAT": "Westafrikanische Normalzeit", "CST": "Nordamerikanische Inland-Normalzeit", "CHADT": "Chatham-Sommerzeit", "COST": "Kolumbianische Sommerzeit", "GMT": "Mittlere Greenwich-Zeit", "PDT": "Nordamerikanische Westküsten-Sommerzeit", "LHST": "Lord-Howe-Normalzeit", "UYT": "Uruguyanische Normalzeit", "ADT": "Atlantik-Sommerzeit", "CDT": "Nordamerikanische Inland-Sommerzeit", "WARST": "Westargentinische Sommerzeit"},
+ timezones: map[string]string{"COST": "Kolumbianische Sommerzeit", "EDT": "Nordamerikanische Ostküsten-Sommerzeit", "BOT": "Bolivianische Zeit", "TMT": "Turkmenistan-Normalzeit", "BT": "Bhutan-Zeit", "CHAST": "Chatham-Normalzeit", "AWDT": "Westaustralische Sommerzeit", "WART": "Westargentinische Normalzeit", "ACST": "Zentralaustralische Normalzeit", "WESZ": "Westeuropäische Sommerzeit", "GYT": "Guyana-Zeit", "LHST": "Lord-Howe-Normalzeit", "EAT": "Ostafrikanische Zeit", "OEZ": "Osteuropäische Normalzeit", "HKST": "Hongkong-Sommerzeit", "ECT": "Ecuadorianische Zeit", "AST": "Atlantik-Normalzeit", "HADT": "Hawaii-Aleuten-Sommerzeit", "HKT": "Hongkong-Normalzeit", "AWST": "Westaustralische Normalzeit", "AKST": "Alaska-Normalzeit", "PST": "Nordamerikanische Westküsten-Normalzeit", "MYT": "Malaysische Zeit", "CLT": "Chilenische Normalzeit", "∅∅∅": "Brasília-Sommerzeit", "GFT": "Französisch-Guayana-Zeit", "NZST": "Neuseeland-Normalzeit", "IST": "Indische Zeit", "AEST": "Ostaustralische Normalzeit", "MDT": "Rocky-Mountain-Sommerzeit", "SAST": "Südafrikanische Zeit", "MST": "Rocky Mountain-Normalzeit", "UYST": "Uruguayanische Sommerzeit", "EST": "Nordamerikanische Ostküsten-Normalzeit", "WEZ": "Westeuropäische Normalzeit", "COT": "Kolumbianische Normalzeit", "WIB": "Westindonesische Zeit", "ACWDT": "Zentral-/Westaustralische Sommerzeit", "JDT": "Japanische Sommerzeit", "WAT": "Westafrikanische Normalzeit", "AEDT": "Ostaustralische Sommerzeit", "SRT": "Suriname-Zeit", "CST": "Nordamerikanische Inland-Normalzeit", "PDT": "Nordamerikanische Westküsten-Sommerzeit", "MEZ": "Mitteleuropäische Normalzeit", "GMT": "Mittlere Greenwich-Zeit", "VET": "Venezuela-Zeit", "JST": "Japanische Normalzeit", "ADT": "Atlantik-Sommerzeit", "NZDT": "Neuseeland-Sommerzeit", "HAT": "Neufundland-Sommerzeit", "LHDT": "Lord-Howe-Sommerzeit", "UYT": "Uruguyanische Normalzeit", "WITA": "Zentralindonesische Zeit", "ACDT": "Zentralaustralische Sommerzeit", "CHADT": "Chatham-Sommerzeit", "ACWST": "Zentral-/Westaustralische Normalzeit", "SGT": "Singapur-Zeit", "WAST": "Westafrikanische Sommerzeit", "WARST": "Westargentinische Sommerzeit", "CDT": "Nordamerikanische Inland-Sommerzeit", "AKDT": "Alaska-Sommerzeit", "HAST": "Hawaii-Aleuten-Normalzeit", "TMST": "Turkmenistan-Sommerzeit", "CAT": "Zentralafrikanische Zeit", "CLST": "Chilenische Sommerzeit", "WIT": "Ostindonesische Zeit", "ChST": "Chamorro-Zeit", "ARST": "Argentinische Sommerzeit", "HNT": "Neufundland-Normalzeit", "OESZ": "Osteuropäische Sommerzeit", "ART": "Argentinische Normalzeit", "MESZ": "Mitteleuropäische Sommerzeit"},
}
}
diff --git a/de_CH/de_CH_test.go b/de_CH/de_CH_test.go
new file mode 100644
index 00000000..b528b5c9
--- /dev/null
+++ b/de_CH/de_CH_test.go
@@ -0,0 +1,1120 @@
+package de_CH
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "de_CH"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/de_DE/de_DE.go b/de_DE/de_DE.go
index 5345e690..0f1b5c4b 100644
--- a/de_DE/de_DE.go
+++ b/de_DE/de_DE.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"v. Chr.", "n. Chr."},
erasNarrow: []string{"v. Chr.", "n. Chr."},
erasWide: []string{"v. Chr.", "n. Chr."},
- timezones: map[string]string{"AST": "Atlantik-Normalzeit", "JST": "Japanische Normalzeit", "CLST": "Chilenische Sommerzeit", "AEDT": "Ostaustralische Sommerzeit", "LHDT": "Lord-Howe-Sommerzeit", "NZDT": "Neuseeland-Sommerzeit", "SRT": "Suriname-Zeit", "BOT": "Bolivianische Zeit", "COST": "Kolumbianische Sommerzeit", "WART": "Westargentinische Normalzeit", "WARST": "Westargentinische Sommerzeit", "MDT": "Macau-Sommerzeit", "GYT": "Guyana-Zeit", "CHADT": "Chatham-Sommerzeit", "SAST": "Südafrikanische Zeit", "OESZ": "Osteuropäische Sommerzeit", "TMT": "Turkmenistan-Normalzeit", "ACDT": "Zentralaustralische Sommerzeit", "ARST": "Argentinische Sommerzeit", "EST": "Nordamerikanische Ostküsten-Normalzeit", "BT": "Bhutan-Zeit", "HKST": "Hongkong-Sommerzeit", "WIB": "Westindonesische Zeit", "ACST": "Zentralaustralische Normalzeit", "UYT": "Uruguyanische Normalzeit", "WEZ": "Westeuropäische Normalzeit", "ADT": "Atlantik-Sommerzeit", "HAST": "Hawaii-Aleuten-Normalzeit", "WAT": "Westafrikanische Normalzeit", "HKT": "Hongkong-Normalzeit", "HNT": "Neufundland-Normalzeit", "TMST": "Turkmenistan-Sommerzeit", "PDT": "Nordamerikanische Westküsten-Sommerzeit", "AEST": "Ostaustralische Normalzeit", "AKDT": "Alaska-Sommerzeit", "CAT": "Zentralafrikanische Zeit", "WIT": "Ostindonesische Zeit", "ACWST": "Zentral-/Westaustralische Normalzeit", "EDT": "Nordamerikanische Ostküsten-Sommerzeit", "WITA": "Zentralindonesische Zeit", "PST": "Nordamerikanische Westküsten-Normalzeit", "MEZ": "Mitteleuropäische Normalzeit", "VET": "Venezuela-Zeit", "EAT": "Ostafrikanische Zeit", "WAST": "Westafrikanische Sommerzeit", "GMT": "Mittlere Greenwich-Zeit", "MESZ": "Mitteleuropäische Sommerzeit", "UYST": "Uruguayanische Sommerzeit", "CLT": "Chilenische Normalzeit", "GFT": "Französisch-Guayana-Zeit", "MST": "Macau-Normalzeit", "AWDT": "Westaustralische Sommerzeit", "CST": "Nordamerikanische Inland-Normalzeit", "HAT": "Neufundland-Sommerzeit", "AKST": "Alaska-Normalzeit", "LHST": "Lord-Howe-Normalzeit", "CHAST": "Chatham-Normalzeit", "ChST": "Chamorro-Zeit", "JDT": "Japanische Sommerzeit", "CDT": "Nordamerikanische Inland-Sommerzeit", "IST": "Indische Zeit", "COT": "Kolumbianische Normalzeit", "ECT": "Ecuadorianische Zeit", "HADT": "Hawaii-Aleuten-Sommerzeit", "SGT": "Singapur-Zeit", "ART": "Argentinische Normalzeit", "∅∅∅": "Amazonas-Sommerzeit", "AWST": "Westaustralische Normalzeit", "ACWDT": "Zentral-/Westaustralische Sommerzeit", "OEZ": "Osteuropäische Normalzeit", "MYT": "Malaysische Zeit", "NZST": "Neuseeland-Normalzeit", "WESZ": "Westeuropäische Sommerzeit"},
+ timezones: map[string]string{"EDT": "Nordamerikanische Ostküsten-Sommerzeit", "CLST": "Chilenische Sommerzeit", "WESZ": "Westeuropäische Sommerzeit", "GFT": "Französisch-Guayana-Zeit", "MDT": "Macau-Sommerzeit", "AWDT": "Westaustralische Sommerzeit", "TMT": "Turkmenistan-Normalzeit", "ACDT": "Zentralaustralische Sommerzeit", "JDT": "Japanische Sommerzeit", "IST": "Indische Zeit", "TMST": "Turkmenistan-Sommerzeit", "EAT": "Ostafrikanische Zeit", "WITA": "Zentralindonesische Zeit", "PST": "Nordamerikanische Westküsten-Normalzeit", "HNT": "Neufundland-Normalzeit", "UYT": "Uruguyanische Normalzeit", "EST": "Nordamerikanische Ostküsten-Normalzeit", "WART": "Westargentinische Normalzeit", "HKT": "Hongkong-Normalzeit", "BOT": "Bolivianische Zeit", "COST": "Kolumbianische Sommerzeit", "GYT": "Guyana-Zeit", "CDT": "Nordamerikanische Inland-Sommerzeit", "COT": "Kolumbianische Normalzeit", "WAST": "Westafrikanische Sommerzeit", "OESZ": "Osteuropäische Sommerzeit", "GMT": "Mittlere Greenwich-Zeit", "SAST": "Südafrikanische Zeit", "PDT": "Nordamerikanische Westküsten-Sommerzeit", "SGT": "Singapur-Zeit", "OEZ": "Osteuropäische Normalzeit", "CHAST": "Chatham-Normalzeit", "CHADT": "Chatham-Sommerzeit", "AKDT": "Alaska-Sommerzeit", "MEZ": "Mitteleuropäische Normalzeit", "MYT": "Malaysische Zeit", "UYST": "Uruguayanische Sommerzeit", "LHST": "Lord-Howe-Normalzeit", "WIT": "Ostindonesische Zeit", "VET": "Venezuela-Zeit", "MST": "Macau-Normalzeit", "ARST": "Argentinische Sommerzeit", "NZDT": "Neuseeland-Sommerzeit", "∅∅∅": "Azoren-Sommerzeit", "NZST": "Neuseeland-Normalzeit", "CST": "Nordamerikanische Inland-Normalzeit", "WARST": "Westargentinische Sommerzeit", "HAST": "Hawaii-Aleuten-Normalzeit", "HADT": "Hawaii-Aleuten-Sommerzeit", "CAT": "Zentralafrikanische Zeit", "AEDT": "Ostaustralische Sommerzeit", "HKST": "Hongkong-Sommerzeit", "ECT": "Ecuadorianische Zeit", "ADT": "Atlantik-Sommerzeit", "MESZ": "Mitteleuropäische Sommerzeit", "BT": "Bhutan-Zeit", "LHDT": "Lord-Howe-Sommerzeit", "ACWDT": "Zentral-/Westaustralische Sommerzeit", "ChST": "Chamorro-Zeit", "CLT": "Chilenische Normalzeit", "ART": "Argentinische Normalzeit", "WIB": "Westindonesische Zeit", "WAT": "Westafrikanische Normalzeit", "WEZ": "Westeuropäische Normalzeit", "JST": "Japanische Normalzeit", "ACWST": "Zentral-/Westaustralische Normalzeit", "AKST": "Alaska-Normalzeit", "AST": "Atlantik-Normalzeit", "HAT": "Neufundland-Sommerzeit", "AEST": "Ostaustralische Normalzeit", "AWST": "Westaustralische Normalzeit", "ACST": "Zentralaustralische Normalzeit", "SRT": "Suriname-Zeit"},
}
}
diff --git a/de_DE/de_DE_test.go b/de_DE/de_DE_test.go
new file mode 100644
index 00000000..9425f378
--- /dev/null
+++ b/de_DE/de_DE_test.go
@@ -0,0 +1,1120 @@
+package de_DE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "de_DE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/de_LI/de_LI.go b/de_LI/de_LI.go
index 3ec37f1e..6e8e9499 100644
--- a/de_LI/de_LI.go
+++ b/de_LI/de_LI.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"v. Chr.", "n. Chr."},
erasNarrow: []string{"v. Chr.", "n. Chr."},
erasWide: []string{"v. Chr.", "n. Chr."},
- timezones: map[string]string{"CLT": "Chilenische Normalzeit", "WAT": "Westafrikanische Normalzeit", "HKT": "Hongkong-Normalzeit", "ACST": "Zentralaustralische Normalzeit", "AWDT": "Westaustralische Sommerzeit", "LHDT": "Lord-Howe-Sommerzeit", "CHADT": "Chatham-Sommerzeit", "OESZ": "Osteuropäische Sommerzeit", "ACDT": "Zentralaustralische Sommerzeit", "AEST": "Ostaustralische Normalzeit", "MST": "Rocky Mountain-Normalzeit", "MDT": "Rocky-Mountain-Sommerzeit", "SAST": "Südafrikanische Zeit", "WAST": "Westafrikanische Sommerzeit", "IST": "Indische Zeit", "BOT": "Bolivianische Zeit", "WEZ": "Westeuropäische Normalzeit", "ECT": "Ecuadorianische Zeit", "PDT": "Nordamerikanische Westküsten-Sommerzeit", "CLST": "Chilenische Sommerzeit", "∅∅∅": "Brasília-Sommerzeit", "CAT": "Zentralafrikanische Zeit", "EST": "Nordamerikanische Ostküsten-Normalzeit", "GMT": "Mittlere Greenwich-Zeit", "JDT": "Japanische Sommerzeit", "WART": "Westargentinische Normalzeit", "MYT": "Malaysische Zeit", "UYST": "Uruguayanische Sommerzeit", "ACWDT": "Zentral-/Westaustralische Sommerzeit", "SGT": "Singapur-Zeit", "WARST": "Westargentinische Sommerzeit", "HAT": "Neufundland-Sommerzeit", "PST": "Nordamerikanische Westküsten-Normalzeit", "NZST": "Neuseeland-Normalzeit", "HKST": "Hongkong-Sommerzeit", "GFT": "Französisch-Guayana-Zeit", "TMST": "Turkmenistan-Sommerzeit", "ACWST": "Zentral-/Westaustralische Normalzeit", "AST": "Atlantik-Normalzeit", "EAT": "Ostafrikanische Zeit", "COST": "Kolumbianische Sommerzeit", "ART": "Argentinische Normalzeit", "ARST": "Argentinische Sommerzeit", "CST": "Nordamerikanische Inland-Normalzeit", "MEZ": "Mitteleuropäische Normalzeit", "MESZ": "Mitteleuropäische Sommerzeit", "WIB": "Westindonesische Zeit", "TMT": "Turkmenistan-Normalzeit", "WESZ": "Westeuropäische Sommerzeit", "AEDT": "Ostaustralische Sommerzeit", "VET": "Venezuela-Zeit", "HAST": "Hawaii-Aleuten-Normalzeit", "BT": "Bhutan-Zeit", "WITA": "Zentralindonesische Zeit", "UYT": "Uruguyanische Normalzeit", "CHAST": "Chatham-Normalzeit", "ADT": "Atlantik-Sommerzeit", "WIT": "Ostindonesische Zeit", "AKDT": "Alaska-Sommerzeit", "SRT": "Suriname-Zeit", "COT": "Kolumbianische Normalzeit", "AKST": "Alaska-Normalzeit", "AWST": "Westaustralische Normalzeit", "ChST": "Chamorro-Zeit", "EDT": "Nordamerikanische Ostküsten-Sommerzeit", "HNT": "Neufundland-Normalzeit", "GYT": "Guyana-Zeit", "JST": "Japanische Normalzeit", "NZDT": "Neuseeland-Sommerzeit", "HADT": "Hawaii-Aleuten-Sommerzeit", "OEZ": "Osteuropäische Normalzeit", "LHST": "Lord-Howe-Normalzeit", "CDT": "Nordamerikanische Inland-Sommerzeit"},
+ timezones: map[string]string{"CST": "Nordamerikanische Inland-Normalzeit", "CHADT": "Chatham-Sommerzeit", "ARST": "Argentinische Sommerzeit", "HAT": "Neufundland-Sommerzeit", "ChST": "Chamorro-Zeit", "EAT": "Ostafrikanische Zeit", "AEST": "Ostaustralische Normalzeit", "UYST": "Uruguayanische Sommerzeit", "SAST": "Südafrikanische Zeit", "NZDT": "Neuseeland-Sommerzeit", "WAT": "Westafrikanische Normalzeit", "WIT": "Ostindonesische Zeit", "GFT": "Französisch-Guayana-Zeit", "SGT": "Singapur-Zeit", "HKT": "Hongkong-Normalzeit", "ACWST": "Zentral-/Westaustralische Normalzeit", "ACST": "Zentralaustralische Normalzeit", "VET": "Venezuela-Zeit", "HKST": "Hongkong-Sommerzeit", "HADT": "Hawaii-Aleuten-Sommerzeit", "NZST": "Neuseeland-Normalzeit", "TMT": "Turkmenistan-Normalzeit", "CAT": "Zentralafrikanische Zeit", "WAST": "Westafrikanische Sommerzeit", "JDT": "Japanische Sommerzeit", "IST": "Indische Zeit", "GYT": "Guyana-Zeit", "∅∅∅": "Brasília-Sommerzeit", "WART": "Westargentinische Normalzeit", "OEZ": "Osteuropäische Normalzeit", "AEDT": "Ostaustralische Sommerzeit", "SRT": "Suriname-Zeit", "CDT": "Nordamerikanische Inland-Sommerzeit", "ECT": "Ecuadorianische Zeit", "HNT": "Neufundland-Normalzeit", "COT": "Kolumbianische Normalzeit", "GMT": "Mittlere Greenwich-Zeit", "AWDT": "Westaustralische Sommerzeit", "AKST": "Alaska-Normalzeit", "PST": "Nordamerikanische Westküsten-Normalzeit", "EST": "Nordamerikanische Ostküsten-Normalzeit", "MST": "Rocky Mountain-Normalzeit", "BT": "Bhutan-Zeit", "CHAST": "Chatham-Normalzeit", "WARST": "Westargentinische Sommerzeit", "MESZ": "Mitteleuropäische Sommerzeit", "HAST": "Hawaii-Aleuten-Normalzeit", "WESZ": "Westeuropäische Sommerzeit", "MYT": "Malaysische Zeit", "ACDT": "Zentralaustralische Sommerzeit", "LHDT": "Lord-Howe-Sommerzeit", "OESZ": "Osteuropäische Sommerzeit", "MDT": "Rocky-Mountain-Sommerzeit", "CLT": "Chilenische Normalzeit", "COST": "Kolumbianische Sommerzeit", "WIB": "Westindonesische Zeit", "AWST": "Westaustralische Normalzeit", "ACWDT": "Zentral-/Westaustralische Sommerzeit", "TMST": "Turkmenistan-Sommerzeit", "CLST": "Chilenische Sommerzeit", "UYT": "Uruguyanische Normalzeit", "AKDT": "Alaska-Sommerzeit", "MEZ": "Mitteleuropäische Normalzeit", "ART": "Argentinische Normalzeit", "WITA": "Zentralindonesische Zeit", "JST": "Japanische Normalzeit", "LHST": "Lord-Howe-Normalzeit", "PDT": "Nordamerikanische Westküsten-Sommerzeit", "EDT": "Nordamerikanische Ostküsten-Sommerzeit", "BOT": "Bolivianische Zeit", "WEZ": "Westeuropäische Normalzeit", "AST": "Atlantik-Normalzeit", "ADT": "Atlantik-Sommerzeit"},
}
}
diff --git a/de_LI/de_LI_test.go b/de_LI/de_LI_test.go
new file mode 100644
index 00000000..83e75bf3
--- /dev/null
+++ b/de_LI/de_LI_test.go
@@ -0,0 +1,1120 @@
+package de_LI
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "de_LI"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/de_LU/de_LU.go b/de_LU/de_LU.go
index 8be471c7..bf1d8f99 100644
--- a/de_LU/de_LU.go
+++ b/de_LU/de_LU.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"v. Chr.", "n. Chr."},
erasNarrow: []string{"v. Chr.", "n. Chr."},
erasWide: []string{"v. Chr.", "n. Chr."},
- timezones: map[string]string{"WART": "Westargentinische Normalzeit", "PDT": "Nordamerikanische Westküsten-Sommerzeit", "CHAST": "Chatham-Normalzeit", "COST": "Kolumbianische Sommerzeit", "ADT": "Atlantik-Sommerzeit", "WARST": "Westargentinische Sommerzeit", "JDT": "Japanische Sommerzeit", "CHADT": "Chatham-Sommerzeit", "AEDT": "Ostaustralische Sommerzeit", "EDT": "Nordamerikanische Ostküsten-Sommerzeit", "WIB": "Westindonesische Zeit", "LHST": "Lord-Howe-Normalzeit", "BOT": "Bolivianische Zeit", "UYST": "Uruguayanische Sommerzeit", "CLT": "Chilenische Normalzeit", "EST": "Nordamerikanische Ostküsten-Normalzeit", "WAST": "Westafrikanische Sommerzeit", "HNT": "Neufundland-Normalzeit", "MEZ": "Mitteleuropäische Normalzeit", "AST": "Atlantik-Normalzeit", "IST": "Indische Zeit", "OESZ": "Osteuropäische Sommerzeit", "COT": "Kolumbianische Normalzeit", "WITA": "Zentralindonesische Zeit", "ACDT": "Zentralaustralische Sommerzeit", "∅∅∅": "Brasília-Sommerzeit", "HKST": "Hongkong-Sommerzeit", "HADT": "Hawaii-Aleuten-Sommerzeit", "SAST": "Südafrikanische Zeit", "PST": "Nordamerikanische Westküsten-Normalzeit", "NZST": "Neuseeland-Normalzeit", "WESZ": "Westeuropäische Sommerzeit", "ACWDT": "Zentral-/Westaustralische Sommerzeit", "ChST": "Chamorro-Zeit", "MESZ": "Mitteleuropäische Sommerzeit", "AEST": "Ostaustralische Normalzeit", "BT": "Bhutan-Zeit", "ACST": "Zentralaustralische Normalzeit", "WAT": "Westafrikanische Normalzeit", "GMT": "Mittlere Greenwich-Zeit", "AKDT": "Alaska-Sommerzeit", "GYT": "Guyana-Zeit", "CST": "Nordamerikanische Inland-Normalzeit", "VET": "Venezuela-Zeit", "MDT": "Rocky-Mountain-Sommerzeit", "CAT": "Zentralafrikanische Zeit", "WEZ": "Westeuropäische Normalzeit", "MYT": "Malaysische Zeit", "GFT": "Französisch-Guayana-Zeit", "TMT": "Turkmenistan-Normalzeit", "EAT": "Ostafrikanische Zeit", "ART": "Argentinische Normalzeit", "ARST": "Argentinische Sommerzeit", "SGT": "Singapur-Zeit", "OEZ": "Osteuropäische Normalzeit", "HAT": "Neufundland-Sommerzeit", "HKT": "Hongkong-Normalzeit", "LHDT": "Lord-Howe-Sommerzeit", "AKST": "Alaska-Normalzeit", "CLST": "Chilenische Sommerzeit", "ACWST": "Zentral-/Westaustralische Normalzeit", "JST": "Japanische Normalzeit", "ECT": "Ecuadorianische Zeit", "MST": "Rocky Mountain-Normalzeit", "AWDT": "Westaustralische Sommerzeit", "CDT": "Nordamerikanische Inland-Sommerzeit", "SRT": "Suriname-Zeit", "AWST": "Westaustralische Normalzeit", "NZDT": "Neuseeland-Sommerzeit", "UYT": "Uruguyanische Normalzeit", "HAST": "Hawaii-Aleuten-Normalzeit", "WIT": "Ostindonesische Zeit", "TMST": "Turkmenistan-Sommerzeit"},
+ timezones: map[string]string{"IST": "Indische Zeit", "EDT": "Nordamerikanische Ostküsten-Sommerzeit", "HNT": "Neufundland-Normalzeit", "CLT": "Chilenische Normalzeit", "UYST": "Uruguayanische Sommerzeit", "EAT": "Ostafrikanische Zeit", "LHDT": "Lord-Howe-Sommerzeit", "PDT": "Nordamerikanische Westküsten-Sommerzeit", "CAT": "Zentralafrikanische Zeit", "UYT": "Uruguyanische Normalzeit", "BT": "Bhutan-Zeit", "HKST": "Hongkong-Sommerzeit", "CHAST": "Chatham-Normalzeit", "NZST": "Neuseeland-Normalzeit", "GMT": "Mittlere Greenwich-Zeit", "PST": "Nordamerikanische Westküsten-Normalzeit", "SAST": "Südafrikanische Zeit", "ACST": "Zentralaustralische Normalzeit", "JDT": "Japanische Sommerzeit", "HAST": "Hawaii-Aleuten-Normalzeit", "BOT": "Bolivianische Zeit", "WEZ": "Westeuropäische Normalzeit", "WAT": "Westafrikanische Normalzeit", "∅∅∅": "Brasília-Sommerzeit", "ACDT": "Zentralaustralische Sommerzeit", "ARST": "Argentinische Sommerzeit", "AKDT": "Alaska-Sommerzeit", "TMST": "Turkmenistan-Sommerzeit", "CHADT": "Chatham-Sommerzeit", "ACWST": "Zentral-/Westaustralische Normalzeit", "MESZ": "Mitteleuropäische Sommerzeit", "COT": "Kolumbianische Normalzeit", "WIB": "Westindonesische Zeit", "GYT": "Guyana-Zeit", "SRT": "Suriname-Zeit", "WAST": "Westafrikanische Sommerzeit", "MYT": "Malaysische Zeit", "CDT": "Nordamerikanische Inland-Sommerzeit", "ACWDT": "Zentral-/Westaustralische Sommerzeit", "SGT": "Singapur-Zeit", "EST": "Nordamerikanische Ostküsten-Normalzeit", "OEZ": "Osteuropäische Normalzeit", "MST": "Rocky Mountain-Normalzeit", "WARST": "Westargentinische Sommerzeit", "ECT": "Ecuadorianische Zeit", "MEZ": "Mitteleuropäische Normalzeit", "WIT": "Ostindonesische Zeit", "GFT": "Französisch-Guayana-Zeit", "ChST": "Chamorro-Zeit", "AWST": "Westaustralische Normalzeit", "HADT": "Hawaii-Aleuten-Sommerzeit", "NZDT": "Neuseeland-Sommerzeit", "COST": "Kolumbianische Sommerzeit", "OESZ": "Osteuropäische Sommerzeit", "LHST": "Lord-Howe-Normalzeit", "CST": "Nordamerikanische Inland-Normalzeit", "AWDT": "Westaustralische Sommerzeit", "JST": "Japanische Normalzeit", "AKST": "Alaska-Normalzeit", "HAT": "Neufundland-Sommerzeit", "TMT": "Turkmenistan-Normalzeit", "WESZ": "Westeuropäische Sommerzeit", "MDT": "Rocky-Mountain-Sommerzeit", "WART": "Westargentinische Normalzeit", "VET": "Venezuela-Zeit", "HKT": "Hongkong-Normalzeit", "ART": "Argentinische Normalzeit", "ADT": "Atlantik-Sommerzeit", "AEST": "Ostaustralische Normalzeit", "AEDT": "Ostaustralische Sommerzeit", "CLST": "Chilenische Sommerzeit", "WITA": "Zentralindonesische Zeit", "AST": "Atlantik-Normalzeit"},
}
}
diff --git a/de_LU/de_LU_test.go b/de_LU/de_LU_test.go
new file mode 100644
index 00000000..caef380b
--- /dev/null
+++ b/de_LU/de_LU_test.go
@@ -0,0 +1,1120 @@
+package de_LU
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "de_LU"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/dje/dje.go b/dje/dje.go
index 0883149d..0acea5b3 100644
--- a/dje/dje.go
+++ b/dje/dje.go
@@ -61,7 +61,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"IJ", "IZ"},
erasNarrow: []string{"", ""},
erasWide: []string{"Isaa jine", "Isaa zamanoo"},
- timezones: map[string]string{"NZDT": "NZDT", "WESZ": "WESZ", "ACWDT": "ACWDT", "AST": "AST", "ART": "ART", "TMT": "TMT", "HADT": "HADT", "AEST": "AEST", "AEDT": "AEDT", "WAST": "WAST", "HAT": "HAT", "MST": "MST", "AWDT": "AWDT", "AWST": "AWST", "OEZ": "OEZ", "UYT": "UYT", "BT": "BT", "JDT": "JDT", "AKDT": "AKDT", "NZST": "NZST", "CHADT": "CHADT", "EST": "EST", "WARST": "WARST", "OESZ": "OESZ", "TMST": "TMST", "PDT": "PDT", "ChST": "ChST", "HNT": "HNT", "LHDT": "LHDT", "MESZ": "MESZ", "WEZ": "WEZ", "HAST": "HAST", "WIB": "WIB", "CLT": "CLT", "CLST": "CLST", "WAT": "WAT", "WITA": "WITA", "SRT": "SRT", "HKST": "HKST", "BOT": "BOT", "CAT": "CAT", "ECT": "ECT", "SGT": "SGT", "HKT": "HKT", "GYT": "GYT", "VET": "VET", "MYT": "MYT", "JST": "JST", "CST": "CST", "WART": "WART", "WIT": "WIT", "ACDT": "ACDT", "ARST": "ARST", "LHST": "LHST", "MEZ": "MEZ", "COST": "COST", "∅∅∅": "∅∅∅", "MDT": "MDT", "ACWST": "ACWST", "UYST": "UYST", "CHAST": "CHAST", "PST": "PST", "CDT": "CDT", "EDT": "EDT", "SAST": "SAST", "GMT": "GMT", "IST": "IST", "ACST": "ACST", "EAT": "EAT", "ADT": "ADT", "GFT": "GFT", "AKST": "AKST", "COT": "COT"},
+ timezones: map[string]string{"CLST": "CLST", "AWST": "AWST", "NZST": "NZST", "WAT": "WAT", "TMST": "TMST", "CLT": "CLT", "CST": "CST", "CDT": "CDT", "SAST": "SAST", "HAST": "HAST", "AEDT": "AEDT", "LHST": "LHST", "CHAST": "CHAST", "LHDT": "LHDT", "MDT": "MDT", "ART": "ART", "EDT": "EDT", "PDT": "PDT", "GFT": "GFT", "AWDT": "AWDT", "JST": "JST", "CAT": "CAT", "WESZ": "WESZ", "TMT": "TMT", "ChST": "ChST", "ADT": "ADT", "PST": "PST", "MESZ": "MESZ", "SGT": "SGT", "BT": "BT", "UYST": "UYST", "ACDT": "ACDT", "SRT": "SRT", "ECT": "ECT", "MEZ": "MEZ", "COT": "COT", "MYT": "MYT", "VET": "VET", "AKST": "AKST", "ARST": "ARST", "BOT": "BOT", "OEZ": "OEZ", "WARST": "WARST", "HKST": "HKST", "WART": "WART", "HKT": "HKT", "AKDT": "AKDT", "AST": "AST", "COST": "COST", "WIB": "WIB", "OESZ": "OESZ", "EST": "EST", "HNT": "HNT", "GMT": "GMT", "UYT": "UYT", "WIT": "WIT", "HAT": "HAT", "ACWDT": "ACWDT", "WITA": "WITA", "JDT": "JDT", "NZDT": "NZDT", "WAST": "WAST", "WEZ": "WEZ", "AEST": "AEST", "EAT": "EAT", "MST": "MST", "ACST": "ACST", "CHADT": "CHADT", "HADT": "HADT", "GYT": "GYT", "ACWST": "ACWST", "IST": "IST", "∅∅∅": "∅∅∅"},
}
}
diff --git a/dje/dje_test.go b/dje/dje_test.go
new file mode 100644
index 00000000..533dcfdc
--- /dev/null
+++ b/dje/dje_test.go
@@ -0,0 +1,1120 @@
+package dje
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "dje"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/dje_NE/dje_NE.go b/dje_NE/dje_NE.go
index d1b83e79..64a60ec7 100644
--- a/dje_NE/dje_NE.go
+++ b/dje_NE/dje_NE.go
@@ -61,7 +61,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"IJ", "IZ"},
erasNarrow: []string{"", ""},
erasWide: []string{"Isaa jine", "Isaa zamanoo"},
- timezones: map[string]string{"HADT": "HADT", "MST": "MST", "JDT": "JDT", "EDT": "EDT", "EAT": "EAT", "PDT": "PDT", "LHDT": "LHDT", "MEZ": "MEZ", "AST": "AST", "OESZ": "OESZ", "MDT": "MDT", "BOT": "BOT", "WEZ": "WEZ", "CLT": "CLT", "HKT": "HKT", "WART": "WART", "ARST": "ARST", "PST": "PST", "JST": "JST", "NZST": "NZST", "CAT": "CAT", "HAST": "HAST", "COST": "COST", "WITA": "WITA", "ART": "ART", "TMST": "TMST", "CST": "CST", "ACWDT": "ACWDT", "CHAST": "CHAST", "COT": "COT", "WARST": "WARST", "ACST": "ACST", "AKST": "AKST", "AWDT": "AWDT", "MYT": "MYT", "NZDT": "NZDT", "AEDT": "AEDT", "AKDT": "AKDT", "ADT": "ADT", "SGT": "SGT", "HKST": "HKST", "LHST": "LHST", "WESZ": "WESZ", "BT": "BT", "WAT": "WAT", "GFT": "GFT", "WIB": "WIB", "GYT": "GYT", "UYT": "UYT", "ECT": "ECT", "SAST": "SAST", "OEZ": "OEZ", "ACDT": "ACDT", "∅∅∅": "∅∅∅", "AEST": "AEST", "CHADT": "CHADT", "CLST": "CLST", "HNT": "HNT", "HAT": "HAT", "TMT": "TMT", "SRT": "SRT", "UYST": "UYST", "EST": "EST", "CDT": "CDT", "ACWST": "ACWST", "VET": "VET", "GMT": "GMT", "AWST": "AWST", "IST": "IST", "WIT": "WIT", "MESZ": "MESZ", "ChST": "ChST", "WAST": "WAST"},
+ timezones: map[string]string{"SAST": "SAST", "MEZ": "MEZ", "AKDT": "AKDT", "WIB": "WIB", "AEST": "AEST", "ChST": "ChST", "AWST": "AWST", "ADT": "ADT", "HAST": "HAST", "CAT": "CAT", "HAT": "HAT", "HKST": "HKST", "AKST": "AKST", "TMT": "TMT", "EAT": "EAT", "JST": "JST", "CLT": "CLT", "MYT": "MYT", "CST": "CST", "VET": "VET", "WITA": "WITA", "NZST": "NZST", "PST": "PST", "OEZ": "OEZ", "ACWST": "ACWST", "NZDT": "NZDT", "EST": "EST", "COST": "COST", "SGT": "SGT", "GFT": "GFT", "BOT": "BOT", "WEZ": "WEZ", "HNT": "HNT", "GYT": "GYT", "WART": "WART", "SRT": "SRT", "EDT": "EDT", "PDT": "PDT", "∅∅∅": "∅∅∅", "COT": "COT", "AEDT": "AEDT", "ECT": "ECT", "HADT": "HADT", "GMT": "GMT", "UYST": "UYST", "WIT": "WIT", "MDT": "MDT", "LHST": "LHST", "JDT": "JDT", "CDT": "CDT", "HKT": "HKT", "ARST": "ARST", "IST": "IST", "TMST": "TMST", "LHDT": "LHDT", "CHADT": "CHADT", "ACWDT": "ACWDT", "WESZ": "WESZ", "OESZ": "OESZ", "WARST": "WARST", "CHAST": "CHAST", "AST": "AST", "ART": "ART", "WAST": "WAST", "CLST": "CLST", "UYT": "UYT", "MST": "MST", "ACDT": "ACDT", "MESZ": "MESZ", "WAT": "WAT", "BT": "BT", "ACST": "ACST", "AWDT": "AWDT"},
}
}
diff --git a/dje_NE/dje_NE_test.go b/dje_NE/dje_NE_test.go
new file mode 100644
index 00000000..1faaeaf3
--- /dev/null
+++ b/dje_NE/dje_NE_test.go
@@ -0,0 +1,1120 @@
+package dje_NE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "dje_NE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/dsb/dsb.go b/dsb/dsb.go
index 85794217..b7894be6 100644
--- a/dsb/dsb.go
+++ b/dsb/dsb.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"pś.Chr.n.", "pó Chr.n."},
erasNarrow: []string{"", ""},
erasWide: []string{"pśed Kristusowym naroźenim", "pó Kristusowem naroźenju"},
- timezones: map[string]string{"WEZ": "Pódwjacornoeuropski standardny cas", "ECT": "Ekuadorski cas", "HKST": "Hongkongski lěśojski cas", "IST": "Indiski cas", "TMST": "Turkmeniski lěśojski cas", "JST": "Japański standardny cas", "SRT": "Surinamski cas", "SAST": "Pódpołdnjowoafriski cas", "GFT": "Francojskoguyański cas", "CLT": "Chilski standardny cas", "VET": "Venezuelski cas", "EST": "Pódpołnocnoameriski pódzajtšny standardny cas", "WART": "Pódwjacornoargentinski standardny cas", "HAT": "Nowofundlandski lěśojski cas", "MDT": "MDT", "LHDT": "lěśojski cas kupy Lord-Howe", "MEZ": "Srjejźoeuropski standardny cas", "GYT": "Guyański cas", "CST": "Pódpołnocnoameriski centralny standardny cas", "WAT": "Pódwjacornoafriski standardny cas", "AEDT": "Pódzajtšnoawstralski lěśojski cas", "SGT": "Singapurski cas", "WARST": "Pódwjacornoargentinski lěśojski cas", "HADT": "Hawaiisko-aleutski lěśojski cas", "MESZ": "Srjejźoeuropski lěśojski cas", "BOT": "Boliwiski cas", "COST": "Kolumbiski lěśojski cas", "ACWDT": "Srjejźopódwjacorny awstralski lěśojski cas", "EAT": "Pódzajtšnoafriski cas", "ACST": "Srjejźoawstralski standardny cas", "∅∅∅": "Amaconaski lěśojski cas", "HNT": "Nowofundlandski standardny cas", "MST": "MST", "MYT": "Malajziski cas", "WAST": "Pódwjacornoafriski lěśojski cas", "COT": "Kolumbiski standardny cas", "ART": "Argentinski standardny cas", "AWST": "Pódwjacornoawstralski standardny cas", "AEST": "Pódzajtšnoawstralski standardny cas", "PST": "Pódpołnocnoameriski pacifiski standardny cas", "CDT": "Pódpołnocnoameriski centralny lěśojski cas", "CHAST": "Chathamski standardny cas", "CAT": "Srjejźoafriski cas", "OESZ": "Pódzajtšnoeuropski lěśojski cas", "AKST": "Alaskojski standardny cas", "LHST": "Standardny cas kupy Lord-Howe", "NZST": "Nowoseelandski standardny cas", "ACWST": "Srjejźopódwjacorny awstralski standardny cas", "ChST": "Chamorrski cas", "AST": "Atlantiski standardny cas", "BT": "Bhutański cas", "WITA": "Srjejźoindoneski cas", "TMT": "Turkmeniski standardny cas", "PDT": "Pódpołnocnoameriski pacifiski lěśojski cas", "AWDT": "Pódwjacornoawstralski lěśojski cas", "HKT": "Hongkongski standardny cas", "WIT": "Pódzajtšnoindoneski", "WIB": "Pódwjacornoindoneski cas", "OEZ": "Pódzajtšnoeuropski standardny cas", "JDT": "Japański lěśojski cas", "UYT": "Uruguayski standardny cas", "HAST": "Hawaiisko-aleutski standardny cas", "EDT": "Pódpołnocnoameriski pódzajtšny lěśojski cas", "AKDT": "Alaskojski lěśojski cas", "CLST": "Chilski lěśojski cas", "WESZ": "Pódwjacornoeuropski lěśojski cas", "ACDT": "Srjejźoawstralski lěśojski cas", "UYST": "Uruguayski lěśojski cas", "GMT": "Greenwichski cas", "ADT": "Atlantiski lěśojski cas", "ARST": "Argentinski lěśojski cas", "NZDT": "Nowoseelandski lěśojski cas", "CHADT": "Chathamski lěśojski cas"},
+ timezones: map[string]string{"ChST": "Chamorrski cas", "WART": "Pódwjacornoargentinski standardny cas", "ADT": "Atlantiski lěśojski cas", "IST": "Indiski cas", "TMT": "Turkmeniski standardny cas", "CAT": "Srjejźoafriski cas", "AEDT": "Pódzajtšnoawstralski lěśojski cas", "CHAST": "Chathamski standardny cas", "WESZ": "Pódwjacornoeuropski lěśojski cas", "COST": "Kolumbiski lěśojski cas", "SRT": "Surinamski cas", "HAST": "Hawaiisko-aleutski standardny cas", "MDT": "MDT", "WITA": "Srjejźoindoneski cas", "GYT": "Guyański cas", "CHADT": "Chathamski lěśojski cas", "AWDT": "Pódwjacornoawstralski lěśojski cas", "HADT": "Hawaiisko-aleutski lěśojski cas", "UYST": "Uruguayski lěśojski cas", "EAT": "Pódzajtšnoafriski cas", "MYT": "Malajziski cas", "GFT": "Francojskoguyański cas", "MST": "MST", "NZDT": "Nowoseelandski lěśojski cas", "∅∅∅": "Acorski lěśojski cas", "JDT": "Japański lěśojski cas", "ARST": "Argentinski lěśojski cas", "NZST": "Nowoseelandski standardny cas", "EST": "Pódpołnocnoameriski pódzajtšny standardny cas", "COT": "Kolumbiski standardny cas", "VET": "Venezuelski cas", "AWST": "Pódwjacornoawstralski standardny cas", "SGT": "Singapurski cas", "CLT": "Chilski standardny cas", "HKT": "Hongkongski standardny cas", "ART": "Argentinski standardny cas", "MESZ": "Srjejźoeuropski lěśojski cas", "WIB": "Pódwjacornoindoneski cas", "UYT": "Uruguayski standardny cas", "WIT": "Pódzajtšnoindoneski", "LHST": "Standardny cas kupy Lord-Howe", "ACST": "Srjejźoawstralski standardny cas", "HKST": "Hongkongski lěśojski cas", "AKDT": "Alaskojski lěśojski cas", "ACWDT": "Srjejźopódwjacorny awstralski lěśojski cas", "MEZ": "Srjejźoeuropski standardny cas", "OEZ": "Pódzajtšnoeuropski standardny cas", "ACWST": "Srjejźopódwjacorny awstralski standardny cas", "PDT": "Pódpołnocnoameriski pacifiski lěśojski cas", "HNT": "Nowofundlandski standardny cas", "BT": "Bhutański cas", "LHDT": "lěśojski cas kupy Lord-Howe", "CST": "Pódpołnocnoameriski centralny standardny cas", "ACDT": "Srjejźoawstralski lěśojski cas", "AKST": "Alaskojski standardny cas", "EDT": "Pódpołnocnoameriski pódzajtšny lěśojski cas", "WAT": "Pódwjacornoafriski standardny cas", "AEST": "Pódzajtšnoawstralski standardny cas", "GMT": "Greenwichski cas", "CDT": "Pódpołnocnoameriski centralny lěśojski cas", "WARST": "Pódwjacornoargentinski lěśojski cas", "ECT": "Ekuadorski cas", "AST": "Atlantiski standardny cas", "BOT": "Boliwiski cas", "PST": "Pódpołnocnoameriski pacifiski standardny cas", "WEZ": "Pódwjacornoeuropski standardny cas", "OESZ": "Pódzajtšnoeuropski lěśojski cas", "JST": "Japański standardny cas", "SAST": "Pódpołdnjowoafriski cas", "TMST": "Turkmeniski lěśojski cas", "WAST": "Pódwjacornoafriski lěśojski cas", "HAT": "Nowofundlandski lěśojski cas", "CLST": "Chilski lěśojski cas"},
}
}
diff --git a/dsb/dsb_test.go b/dsb/dsb_test.go
new file mode 100644
index 00000000..d770a8a1
--- /dev/null
+++ b/dsb/dsb_test.go
@@ -0,0 +1,1120 @@
+package dsb
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "dsb"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/dsb_DE/dsb_DE.go b/dsb_DE/dsb_DE.go
index 3cadce0c..c8525e9a 100644
--- a/dsb_DE/dsb_DE.go
+++ b/dsb_DE/dsb_DE.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"pś.Chr.n.", "pó Chr.n."},
erasNarrow: []string{"", ""},
erasWide: []string{"pśed Kristusowym naroźenim", "pó Kristusowem naroźenju"},
- timezones: map[string]string{"UYT": "Uruguayski standardny cas", "ChST": "Chamorrski cas", "HADT": "Hawaiisko-aleutski lěśojski cas", "WART": "Pódwjacornoargentinski standardny cas", "MST": "MST", "NZST": "Nowoseelandski standardny cas", "SAST": "Pódpołdnjowoafriski cas", "WITA": "Srjejźoindoneski cas", "GYT": "Guyański cas", "WIB": "Pódwjacornoindoneski cas", "OESZ": "Pódzajtšnoeuropski lěśojski cas", "HNT": "Nowofundlandski standardny cas", "LHDT": "lěśojski cas kupy Lord-Howe", "CDT": "Pódpołnocnoameriski centralny lěśojski cas", "EDT": "Pódpołnocnoameriski pódzajtšny lěśojski cas", "AST": "Atlantiski standardny cas", "HAST": "Hawaiisko-aleutski standardny cas", "AEST": "Pódzajtšnoawstralski standardny cas", "WIT": "Pódzajtšnoindoneski", "HAT": "Nowofundlandski lěśojski cas", "TMT": "Turkmeniski standardny cas", "EST": "Pódpołnocnoameriski pódzajtšny standardny cas", "COT": "Kolumbiski standardny cas", "WARST": "Pódwjacornoargentinski lěśojski cas", "UYST": "Uruguayski lěśojski cas", "CLT": "Chilski standardny cas", "ART": "Argentinski standardny cas", "JST": "Japański standardny cas", "JDT": "Japański lěśojski cas", "MDT": "MDT", "∅∅∅": "Brasília lěśojski cas", "ADT": "Atlantiski lěśojski cas", "OEZ": "Pódzajtšnoeuropski standardny cas", "VET": "Venezuelski cas", "AEDT": "Pódzajtšnoawstralski lěśojski cas", "ECT": "Ekuadorski cas", "WAST": "Pódwjacornoafriski lěśojski cas", "MESZ": "Srjejźoeuropski lěśojski cas", "CHADT": "Chathamski lěśojski cas", "SRT": "Surinamski cas", "IST": "Indiski cas", "ACDT": "Srjejźoawstralski lěśojski cas", "ARST": "Argentinski lěśojski cas", "AKDT": "Alaskojski lěśojski cas", "PDT": "Pódpołnocnoameriski pacifiski lěśojski cas", "AWST": "Pódwjacornoawstralski standardny cas", "CST": "Pódpołnocnoameriski centralny standardny cas", "MEZ": "Srjejźoeuropski standardny cas", "COST": "Kolumbiski lěśojski cas", "EAT": "Pódzajtšnoafriski cas", "AKST": "Alaskojski standardny cas", "CHAST": "Chathamski standardny cas", "WESZ": "Pódwjacornoeuropski lěśojski cas", "TMST": "Turkmeniski lěśojski cas", "ACST": "Srjejźoawstralski standardny cas", "MYT": "Malajziski cas", "NZDT": "Nowoseelandski lěśojski cas", "CLST": "Chilski lěśojski cas", "SGT": "Singapurski cas", "HKT": "Hongkongski standardny cas", "HKST": "Hongkongski lěśojski cas", "PST": "Pódpołnocnoameriski pacifiski standardny cas", "LHST": "Standardny cas kupy Lord-Howe", "BOT": "Boliwiski cas", "ACWST": "Srjejźopódwjacorny awstralski standardny cas", "BT": "Bhutański cas", "GMT": "Greenwichski cas", "AWDT": "Pódwjacornoawstralski lěśojski cas", "GFT": "Francojskoguyański cas", "WEZ": "Pódwjacornoeuropski standardny cas", "CAT": "Srjejźoafriski cas", "WAT": "Pódwjacornoafriski standardny cas", "ACWDT": "Srjejźopódwjacorny awstralski lěśojski cas"},
+ timezones: map[string]string{"CAT": "Srjejźoafriski cas", "CDT": "Pódpołnocnoameriski centralny lěśojski cas", "∅∅∅": "Acorski lěśojski cas", "ECT": "Ekuadorski cas", "ART": "Argentinski standardny cas", "JDT": "Japański lěśojski cas", "WIB": "Pódwjacornoindoneski cas", "CHAST": "Chathamski standardny cas", "ACWDT": "Srjejźopódwjacorny awstralski lěśojski cas", "EAT": "Pódzajtšnoafriski cas", "WART": "Pódwjacornoargentinski standardny cas", "PST": "Pódpołnocnoameriski pacifiski standardny cas", "HNT": "Nowofundlandski standardny cas", "HAT": "Nowofundlandski lěśojski cas", "TMT": "Turkmeniski standardny cas", "ACDT": "Srjejźoawstralski lěśojski cas", "GFT": "Francojskoguyański cas", "NZST": "Nowoseelandski standardny cas", "OESZ": "Pódzajtšnoeuropski lěśojski cas", "BT": "Bhutański cas", "CST": "Pódpołnocnoameriski centralny standardny cas", "ADT": "Atlantiski lěśojski cas", "SAST": "Pódpołdnjowoafriski cas", "MYT": "Malajziski cas", "MST": "MST", "HKST": "Hongkongski lěśojski cas", "AWDT": "Pódwjacornoawstralski lěśojski cas", "AEST": "Pódzajtšnoawstralski standardny cas", "HKT": "Hongkongski standardny cas", "BOT": "Boliwiski cas", "COT": "Kolumbiski standardny cas", "UYT": "Uruguayski standardny cas", "WIT": "Pódzajtšnoindoneski", "ARST": "Argentinski lěśojski cas", "JST": "Japański standardny cas", "SGT": "Singapurski cas", "UYST": "Uruguayski lěśojski cas", "AST": "Atlantiski standardny cas", "COST": "Kolumbiski lěśojski cas", "SRT": "Surinamski cas", "CLT": "Chilski standardny cas", "MDT": "MDT", "AKDT": "Alaskojski lěśojski cas", "IST": "Indiski cas", "TMST": "Turkmeniski lěśojski cas", "WAST": "Pódwjacornoafriski lěśojski cas", "MESZ": "Srjejźoeuropski lěśojski cas", "EDT": "Pódpołnocnoameriski pódzajtšny lěśojski cas", "AEDT": "Pódzajtšnoawstralski lěśojski cas", "LHDT": "lěśojski cas kupy Lord-Howe", "ACST": "Srjejźoawstralski standardny cas", "OEZ": "Pódzajtšnoeuropski standardny cas", "AWST": "Pódwjacornoawstralski standardny cas", "WITA": "Srjejźoindoneski cas", "EST": "Pódpołnocnoameriski pódzajtšny standardny cas", "WAT": "Pódwjacornoafriski standardny cas", "GYT": "Guyański cas", "WARST": "Pódwjacornoargentinski lěśojski cas", "VET": "Venezuelski cas", "CHADT": "Chathamski lěśojski cas", "PDT": "Pódpołnocnoameriski pacifiski lěśojski cas", "WEZ": "Pódwjacornoeuropski standardny cas", "LHST": "Standardny cas kupy Lord-Howe", "GMT": "Greenwichski cas", "ACWST": "Srjejźopódwjacorny awstralski standardny cas", "MEZ": "Srjejźoeuropski standardny cas", "HAST": "Hawaiisko-aleutski standardny cas", "HADT": "Hawaiisko-aleutski lěśojski cas", "NZDT": "Nowoseelandski lěśojski cas", "AKST": "Alaskojski standardny cas", "WESZ": "Pódwjacornoeuropski lěśojski cas", "ChST": "Chamorrski cas", "CLST": "Chilski lěśojski cas"},
}
}
diff --git a/dsb_DE/dsb_DE_test.go b/dsb_DE/dsb_DE_test.go
new file mode 100644
index 00000000..0f81371e
--- /dev/null
+++ b/dsb_DE/dsb_DE_test.go
@@ -0,0 +1,1120 @@
+package dsb_DE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "dsb_DE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/dua/dua.go b/dua/dua.go
index 5a333126..2bafac5c 100644
--- a/dua/dua.go
+++ b/dua/dua.go
@@ -67,7 +67,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ɓ.Ys", "mb.Ys"},
erasNarrow: []string{"", ""},
erasWide: []string{"ɓoso ɓwá yáɓe lá", "mbúsa kwédi a Yés"},
- timezones: map[string]string{"EAT": "EAT", "MYT": "MYT", "HAST": "HAST", "AWST": "AWST", "LHST": "LHST", "MEZ": "MEZ", "WAST": "WAST", "BT": "BT", "MDT": "MDT", "AKST": "AKST", "PDT": "PDT", "NZST": "NZST", "NZDT": "NZDT", "BOT": "BOT", "EST": "EST", "ADT": "ADT", "∅∅∅": "∅∅∅", "JST": "JST", "WESZ": "WESZ", "WARST": "WARST", "OESZ": "OESZ", "ACDT": "ACDT", "CLST": "CLST", "WIB": "WIB", "HNT": "HNT", "ACST": "ACST", "JDT": "JDT", "ACWST": "ACWST", "OEZ": "OEZ", "TMST": "TMST", "UYT": "UYT", "ECT": "ECT", "CAT": "CAT", "AST": "AST", "IST": "IST", "AKDT": "AKDT", "CST": "CST", "CLT": "CLT", "WEZ": "WEZ", "WAT": "WAT", "GMT": "GMT", "ARST": "ARST", "WART": "WART", "WITA": "WITA", "GFT": "GFT", "MST": "MST", "VET": "VET", "CHADT": "CHADT", "AEST": "AEST", "WIT": "WIT", "TMT": "TMT", "AWDT": "AWDT", "LHDT": "LHDT", "CHAST": "CHAST", "HKST": "HKST", "MESZ": "MESZ", "EDT": "EDT", "COST": "COST", "SAST": "SAST", "ChST": "ChST", "COT": "COT", "HAT": "HAT", "ART": "ART", "PST": "PST", "CDT": "CDT", "HADT": "HADT", "HKT": "HKT", "UYST": "UYST", "ACWDT": "ACWDT", "AEDT": "AEDT", "SGT": "SGT", "SRT": "SRT", "GYT": "GYT"},
+ timezones: map[string]string{"CLT": "CLT", "UYST": "UYST", "IST": "IST", "COT": "COT", "OESZ": "OESZ", "LHDT": "LHDT", "JDT": "JDT", "VET": "VET", "WIB": "WIB", "GYT": "GYT", "HAT": "HAT", "AWDT": "AWDT", "GMT": "GMT", "AEDT": "AEDT", "BT": "BT", "ARST": "ARST", "CAT": "CAT", "CHADT": "CHADT", "EAT": "EAT", "ECT": "ECT", "ACWST": "ACWST", "ART": "ART", "HADT": "HADT", "CLST": "CLST", "NZDT": "NZDT", "SAST": "SAST", "TMST": "TMST", "ACST": "ACST", "WARST": "WARST", "AWST": "AWST", "HAST": "HAST", "MYT": "MYT", "CHAST": "CHAST", "WESZ": "WESZ", "HNT": "HNT", "OEZ": "OEZ", "LHST": "LHST", "AKST": "AKST", "BOT": "BOT", "COST": "COST", "SRT": "SRT", "UYT": "UYT", "ACDT": "ACDT", "CST": "CST", "GFT": "GFT", "JST": "JST", "MESZ": "MESZ", "NZST": "NZST", "MDT": "MDT", "AST": "AST", "ChST": "ChST", "CDT": "CDT", "WART": "WART", "HKT": "HKT", "PDT": "PDT", "WIT": "WIT", "∅∅∅": "∅∅∅", "ACWDT": "ACWDT", "WITA": "WITA", "WAT": "WAT", "SGT": "SGT", "MST": "MST", "EST": "EST", "WAST": "WAST", "HKST": "HKST", "AKDT": "AKDT", "EDT": "EDT", "PST": "PST", "MEZ": "MEZ", "WEZ": "WEZ", "TMT": "TMT", "AEST": "AEST", "ADT": "ADT"},
}
}
diff --git a/dua/dua_test.go b/dua/dua_test.go
new file mode 100644
index 00000000..358f6a88
--- /dev/null
+++ b/dua/dua_test.go
@@ -0,0 +1,1120 @@
+package dua
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "dua"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/dua_CM/dua_CM.go b/dua_CM/dua_CM.go
index 1d85b12d..c9b84555 100644
--- a/dua_CM/dua_CM.go
+++ b/dua_CM/dua_CM.go
@@ -67,7 +67,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ɓ.Ys", "mb.Ys"},
erasNarrow: []string{"", ""},
erasWide: []string{"ɓoso ɓwá yáɓe lá", "mbúsa kwédi a Yés"},
- timezones: map[string]string{"HKT": "HKT", "ACST": "ACST", "MYT": "MYT", "AKST": "AKST", "MEZ": "MEZ", "EDT": "EDT", "WART": "WART", "WITA": "WITA", "HAT": "HAT", "AWST": "AWST", "LHST": "LHST", "MDT": "MDT", "CST": "CST", "NZST": "NZST", "WIT": "WIT", "WIB": "WIB", "EAT": "EAT", "AWDT": "AWDT", "GMT": "GMT", "TMST": "TMST", "PST": "PST", "COT": "COT", "HNT": "HNT", "CHAST": "CHAST", "SGT": "SGT", "MESZ": "MESZ", "BOT": "BOT", "ACWDT": "ACWDT", "TMT": "TMT", "MST": "MST", "ACDT": "ACDT", "ARST": "ARST", "GYT": "GYT", "AST": "AST", "WEZ": "WEZ", "COST": "COST", "WAT": "WAT", "JST": "JST", "JDT": "JDT", "PDT": "PDT", "CDT": "CDT", "ART": "ART", "NZDT": "NZDT", "UYST": "UYST", "CHADT": "CHADT", "ACWST": "ACWST", "WARST": "WARST", "VET": "VET", "AEST": "AEST", "HADT": "HADT", "LHDT": "LHDT", "UYT": "UYT", "WAST": "WAST", "AKDT": "AKDT", "ChST": "ChST", "HKST": "HKST", "∅∅∅": "∅∅∅", "CLST": "CLST", "AEDT": "AEDT", "HAST": "HAST", "BT": "BT", "OEZ": "OEZ", "ADT": "ADT", "IST": "IST", "SRT": "SRT", "CLT": "CLT", "WESZ": "WESZ", "CAT": "CAT", "SAST": "SAST", "OESZ": "OESZ", "GFT": "GFT", "EST": "EST", "ECT": "ECT"},
+ timezones: map[string]string{"MEZ": "MEZ", "WAT": "WAT", "AEST": "AEST", "OEZ": "OEZ", "MYT": "MYT", "AKDT": "AKDT", "BOT": "BOT", "WART": "WART", "ACWDT": "ACWDT", "HKST": "HKST", "CHAST": "CHAST", "AST": "AST", "JST": "JST", "CLT": "CLT", "LHDT": "LHDT", "CHADT": "CHADT", "ECT": "ECT", "EDT": "EDT", "COT": "COT", "GMT": "GMT", "AEDT": "AEDT", "LHST": "LHST", "CLST": "CLST", "UYT": "UYT", "WARST": "WARST", "SRT": "SRT", "VET": "VET", "AKST": "AKST", "PST": "PST", "HADT": "HADT", "UYST": "UYST", "∅∅∅": "∅∅∅", "TMT": "TMT", "OESZ": "OESZ", "GFT": "GFT", "MST": "MST", "ADT": "ADT", "SAST": "SAST", "WAST": "WAST", "SGT": "SGT", "ACDT": "ACDT", "IST": "IST", "MESZ": "MESZ", "HAST": "HAST", "NZDT": "NZDT", "WIB": "WIB", "TMST": "TMST", "ART": "ART", "CST": "CST", "HNT": "HNT", "HAT": "HAT", "COST": "COST", "CAT": "CAT", "ChST": "ChST", "WIT": "WIT", "EAT": "EAT", "HKT": "HKT", "ACWST": "ACWST", "JDT": "JDT", "NZST": "NZST", "MDT": "MDT", "WITA": "WITA", "WESZ": "WESZ", "GYT": "GYT", "AWST": "AWST", "AWDT": "AWDT", "EST": "EST", "PDT": "PDT", "WEZ": "WEZ", "CDT": "CDT", "ARST": "ARST", "BT": "BT", "ACST": "ACST"},
}
}
diff --git a/dua_CM/dua_CM_test.go b/dua_CM/dua_CM_test.go
new file mode 100644
index 00000000..b0b0d559
--- /dev/null
+++ b/dua_CM/dua_CM_test.go
@@ -0,0 +1,1120 @@
+package dua_CM
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "dua_CM"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/dyo/dyo.go b/dyo/dyo.go
index 472b7695..83f80f93 100644
--- a/dyo/dyo.go
+++ b/dyo/dyo.go
@@ -63,7 +63,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ArY", "AtY"},
erasNarrow: []string{"", ""},
erasWide: []string{"Ariŋuu Yeesu", "Atooŋe Yeesu"},
- timezones: map[string]string{"SRT": "SRT", "LHST": "LHST", "MEZ": "MEZ", "WESZ": "WESZ", "MST": "MST", "CHAST": "CHAST", "HADT": "HADT", "WAT": "WAT", "HKST": "HKST", "OESZ": "OESZ", "ACDT": "ACDT", "LHDT": "LHDT", "MYT": "MYT", "∅∅∅": "∅∅∅", "WIB": "WIB", "HNT": "HNT", "CLST": "CLST", "HAT": "HAT", "ARST": "ARST", "AWDT": "AWDT", "CDT": "CDT", "CLT": "CLT", "COT": "COT", "CHADT": "CHADT", "WARST": "WARST", "UYST": "UYST", "AEDT": "AEDT", "ChST": "ChST", "HAST": "HAST", "SGT": "SGT", "BT": "BT", "ART": "ART", "IST": "IST", "EAT": "EAT", "PST": "PST", "GYT": "GYT", "WEZ": "WEZ", "CAT": "CAT", "HKT": "HKT", "GFT": "GFT", "JDT": "JDT", "PDT": "PDT", "NZST": "NZST", "ACWST": "ACWST", "MDT": "MDT", "TMST": "TMST", "JST": "JST", "UYT": "UYT", "ADT": "ADT", "SAST": "SAST", "MESZ": "MESZ", "AEST": "AEST", "WAST": "WAST", "WITA": "WITA", "EDT": "EDT", "ECT": "ECT", "WIT": "WIT", "TMT": "TMT", "AKDT": "AKDT", "CST": "CST", "VET": "VET", "ACWDT": "ACWDT", "AST": "AST", "WART": "WART", "ACST": "ACST", "AKST": "AKST", "NZDT": "NZDT", "EST": "EST", "GMT": "GMT", "AWST": "AWST", "BOT": "BOT", "COST": "COST", "OEZ": "OEZ"},
+ timezones: map[string]string{"WARST": "WARST", "MDT": "MDT", "HKT": "HKT", "CHADT": "CHADT", "ADT": "ADT", "WESZ": "WESZ", "UYST": "UYST", "VET": "VET", "AKST": "AKST", "COST": "COST", "BT": "BT", "CLST": "CLST", "UYT": "UYT", "ACST": "ACST", "AWDT": "AWDT", "JDT": "JDT", "HAST": "HAST", "ChST": "ChST", "ARST": "ARST", "MESZ": "MESZ", "SGT": "SGT", "TMT": "TMT", "LHST": "LHST", "GYT": "GYT", "CLT": "CLT", "HKST": "HKST", "IST": "IST", "EDT": "EDT", "NZST": "NZST", "BOT": "BOT", "WAST": "WAST", "EAT": "EAT", "ACDT": "ACDT", "ACWST": "ACWST", "WITA": "WITA", "PDT": "PDT", "CAT": "CAT", "WIB": "WIB", "∅∅∅": "∅∅∅", "AST": "AST", "NZDT": "NZDT", "AEST": "AEST", "MYT": "MYT", "WIT": "WIT", "AKDT": "AKDT", "SAST": "SAST", "HNT": "HNT", "CHAST": "CHAST", "MEZ": "MEZ", "HAT": "HAT", "TMST": "TMST", "ECT": "ECT", "EST": "EST", "PST": "PST", "GMT": "GMT", "CDT": "CDT", "HADT": "HADT", "WEZ": "WEZ", "AEDT": "AEDT", "WART": "WART", "ACWDT": "ACWDT", "AWST": "AWST", "JST": "JST", "WAT": "WAT", "OESZ": "OESZ", "CST": "CST", "MST": "MST", "SRT": "SRT", "ART": "ART", "COT": "COT", "OEZ": "OEZ", "LHDT": "LHDT", "GFT": "GFT"},
}
}
diff --git a/dyo/dyo_test.go b/dyo/dyo_test.go
new file mode 100644
index 00000000..f896b316
--- /dev/null
+++ b/dyo/dyo_test.go
@@ -0,0 +1,1120 @@
+package dyo
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "dyo"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/dyo_SN/dyo_SN.go b/dyo_SN/dyo_SN.go
index 030eced5..e79b8390 100644
--- a/dyo_SN/dyo_SN.go
+++ b/dyo_SN/dyo_SN.go
@@ -63,7 +63,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ArY", "AtY"},
erasNarrow: []string{"", ""},
erasWide: []string{"Ariŋuu Yeesu", "Atooŋe Yeesu"},
- timezones: map[string]string{"BOT": "BOT", "UYST": "UYST", "AEDT": "AEDT", "COST": "COST", "GMT": "GMT", "MDT": "MDT", "CDT": "CDT", "MESZ": "MESZ", "CHADT": "CHADT", "COT": "COT", "HKST": "HKST", "SAST": "SAST", "EAT": "EAT", "PST": "PST", "CST": "CST", "JDT": "JDT", "ECT": "ECT", "WITA": "WITA", "ARST": "ARST", "AKST": "AKST", "ACWST": "ACWST", "ADT": "ADT", "BT": "BT", "HNT": "HNT", "HAT": "HAT", "ART": "ART", "AEST": "AEST", "TMT": "TMT", "TMST": "TMST", "ChST": "ChST", "LHDT": "LHDT", "EST": "EST", "WAT": "WAT", "WIT": "WIT", "MST": "MST", "ACDT": "ACDT", "NZST": "NZST", "ACWDT": "ACWDT", "EDT": "EDT", "LHST": "LHST", "AWST": "AWST", "MEZ": "MEZ", "GFT": "GFT", "GYT": "GYT", "WEZ": "WEZ", "CAT": "CAT", "OEZ": "OEZ", "∅∅∅": "∅∅∅", "CLST": "CLST", "AWDT": "AWDT", "CLT": "CLT", "WART": "WART", "HAST": "HAST", "HKT": "HKT", "WARST": "WARST", "OESZ": "OESZ", "SRT": "SRT", "PDT": "PDT", "VET": "VET", "HADT": "HADT", "SGT": "SGT", "WAST": "WAST", "WIB": "WIB", "UYT": "UYT", "CHAST": "CHAST", "WESZ": "WESZ", "AST": "AST", "IST": "IST", "AKDT": "AKDT", "NZDT": "NZDT", "ACST": "ACST", "MYT": "MYT", "JST": "JST"},
+ timezones: map[string]string{"WIT": "WIT", "WARST": "WARST", "CHAST": "CHAST", "HADT": "HADT", "BOT": "BOT", "WEZ": "WEZ", "WESZ": "WESZ", "GYT": "GYT", "CLST": "CLST", "JST": "JST", "IST": "IST", "MEZ": "MEZ", "AEDT": "AEDT", "MDT": "MDT", "EAT": "EAT", "WART": "WART", "SRT": "SRT", "AWST": "AWST", "CST": "CST", "MST": "MST", "HKST": "HKST", "OESZ": "OESZ", "∅∅∅": "∅∅∅", "TMST": "TMST", "BT": "BT", "VET": "VET", "WITA": "WITA", "ART": "ART", "NZST": "NZST", "ACST": "ACST", "ACWST": "ACWST", "NZDT": "NZDT", "CLT": "CLT", "GFT": "GFT", "GMT": "GMT", "PDT": "PDT", "COT": "COT", "LHST": "LHST", "AKST": "AKST", "CAT": "CAT", "ChST": "ChST", "HKT": "HKT", "TMT": "TMT", "HNT": "HNT", "UYT": "UYT", "WAT": "WAT", "AWDT": "AWDT", "AKDT": "AKDT", "EST": "EST", "SAST": "SAST", "WIB": "WIB", "OEZ": "OEZ", "ADT": "ADT", "HAST": "HAST", "CHADT": "CHADT", "ARST": "ARST", "SGT": "SGT", "MYT": "MYT", "ECT": "ECT", "MESZ": "MESZ", "JDT": "JDT", "PST": "PST", "HAT": "HAT", "LHDT": "LHDT", "UYST": "UYST", "AST": "AST", "EDT": "EDT", "WAST": "WAST", "COST": "COST", "AEST": "AEST", "ACDT": "ACDT", "CDT": "CDT", "ACWDT": "ACWDT"},
}
}
diff --git a/dyo_SN/dyo_SN_test.go b/dyo_SN/dyo_SN_test.go
new file mode 100644
index 00000000..43316545
--- /dev/null
+++ b/dyo_SN/dyo_SN_test.go
@@ -0,0 +1,1120 @@
+package dyo_SN
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "dyo_SN"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/dz/dz.go b/dz/dz.go
index 11e96206..36ee7ed3 100644
--- a/dz/dz.go
+++ b/dz/dz.go
@@ -69,7 +69,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BCE", "CE"},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"IST": "རྒྱ་གར་ཆུ་ཚོད", "OEZ": "ཤར་ཕྱོགས་ཡུ་རོ་པེན་ཚད་ལྡན་ཆུ་ཚོད", "PDT": "བྱང་ཨ་མི་རི་ཀ་པེ་སི་ཕིག་ཉིན་སྲུང་ཆུ་ཚོད", "UYST": "ཡུ་རུ་གུ་ཝཱའི་བྱཱར་དུས་ཆུ་ཚོད", "WEZ": "ནུབ་ཕྱོགས་ཡུ་རོ་པེན་ཚད་ལྡན་ཆུ་ཚོད", "CAT": "དབུས་ཕྱོགས་ཨཕ་རི་ཀཱ་ཆུ་ཚོད", "ADT": "ཨེཊ་ལེན་ཊིཀ་ཉིན་སྲུང་ཆུ་ཚོད", "SAST": "ལྷོ་ཕྱོགས་ཨཕ་རི་ཀཱ་ཆུ་ཚོད", "TMST": "TMST", "LHST": "LHST", "UYT": "ཡུ་རུ་གུ་ཝཱའི་ཚད་ལྡན་ཆུ་ཚོད", "AWDT": "ནུབ་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཉིན་སྲུང་ཆུ་ཚོད", "MESZ": "དབུས་ཕྱོགས་ཡུ་རོ་པེན་བྱཱར་དུས་ཆུ་ཚོད", "CLT": "ཅི་ལི་ཚད་ལྡན་ཆུ་ཚོད", "ACST": "དབུས་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཚད་ལྡན་ཆུ་ཚོད", "PST": "བྱང་ཨ་མི་རི་ཀ་པེ་སི་ཕིག་ཚད་ལྡན་ཆུ་ཚོད", "CST": "བྱང་ཨ་མི་རི་ཀ་དབུས་ཕྱོགས་ཚད་ལྡན་ཆུ་ཚོད", "BOT": "བྷོ་ལི་བི་ཡ་ཆུ་ཚོད", "VET": "བེ་ནི་ཛུ་ཝེ་ལ་ཆུ་ཚོད", "AEDT": "ཤར་ཕྱོགས་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཉིན་སྲུང་ཆུ་ཚོད", "ChST": "ChST", "OESZ": "ཤར་ཕྱོགས་ཡུ་རོ་པེན་བྱཱར་དུས་ཆུ་ཚོད", "HNT": "ནིའུ་ཕའུནཌ་ལེནཌ་ཚད་ལྡན་ཆུ་ཚོད", "TMT": "TMT", "LHDT": "LHDT", "CHAST": "CHAST", "EST": "བྱང་ཨ་མི་རི་ཀ་ཤར་ཕྱོགས་ཚད་ལྡན་ཆུ་ཚོད", "EDT": "བྱང་ཨ་མི་རི་ཀ་ཤར་ཕྱོགས་ཉིན་སྲུང་ཆུ་ཚོད", "SRT": "སུ་རི་ནཱམ་ཆུ་ཚོད", "AKST": "ཨ་ལསི་ཀ་ཚད་ལྡན་ཆུ་ཚོད", "NZST": "ནིའུ་ཛི་ལེནཌ་ཚད་ལྡན་ཆུ་ཚོད", "WAST": "ནུབ་ཕྱོགས་ཨཕ་རི་ཀཱ་བྱཱར་དུས་ཆུ་ཚོད", "MST": "MST", "∅∅∅": "ཨེ་མ་ཛཱོན་བྱཱར་དུས་ཆུ་ཚོད", "JDT": "ཇ་པཱན་ཉིན་སྲུང་ཆུ་ཚོད", "HADT": "ཧ་ཝའི་-ཨེ་ལིའུ་ཤེན་ཉིན་སྲུང་ཆུ་ཚོད", "WIB": "ནུབ་ཕྱོགས་ཨིན་ཌོ་ནེ་ཤི་ཡ་ཆུ་ཚོད", "AKDT": "ཨ་ལསི་ཀ་ཉིན་སྲུང་ཆུ་ཚོད", "WESZ": "ནུབ་ཕྱོགས་ཡུ་རོ་པེན་བྱཱར་དུས་ཆུ་ཚོད", "HAT": "ནིའུ་ཕའུནཌ་ལེནཌ་ཉིན་སྲུང་ཆུ་ཚོད", "EAT": "ཤར་ཕྱོགས་ཨཕ་རི་ཀཱ་ཆུ་ཚོད", "MDT": "MDT", "MYT": "MYT", "AST": "ཨེཊ་ལེན་ཊིཀ་ཚད་ལྡན་ཆུ་ཚོད", "BT": "འབྲུག་ཡུལ་ཆུ་ཚོད", "WITA": "དབུས་ཕྱོགས་ཨིན་ཌོ་ནེ་ཤི་ཡ་ཆུ་ཚོད", "MEZ": "དབུས་ཕྱོགས་ཡུ་རོ་པེན་ཚད་ལྡན་ཆུ་ཚོད", "ACWDT": "དབུས་ནུབ་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཉིན་སྲུང་ཆུ་ཚོད", "ECT": "ཨེ་ཀུ་ཌཽ་ཆུ་ཚོད", "HKST": "HKST", "WART": "ནུབ་ཕྱོགས་ཨར་ཇེན་ཊི་ན་ཚད་ལྡན་ཆུ་ཚོད", "GMT": "གིརིན་ཝིཆ་ལུ་ཡོད་པའི་ཆུ་ཚོད", "ART": "ཨར་ཇེན་ཊི་ན་ཚད་ལྡན་ཆུ་ཚོད", "NZDT": "ནིའུ་ཛི་ལེནཌ་ཉིན་སྲུང་ཆུ་ཚོད", "HAST": "ཧ་ཝའི་-ཨེ་ལིའུ་ཤེན་ཚད་ལྡན་ཆུ་ཚོད", "WAT": "ནུབ་ཕྱོགས་ཨཕ་རི་ཀཱ་ཚད་ལྡན་ཆུ་ཚོད", "ACDT": "དབུས་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཉིན་སྲུང་ཆུ་ཚོད", "AWST": "ནུབ་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཚད་ལྡན་ཆུ་ཚོད", "JST": "ཇ་པཱན་ཚད་ལྡན་ཆུ་ཚོད", "CDT": "བྱང་ཨ་མི་རི་ཀ་དབུས་ཕྱོགས་ཉིན་སྲུང་ཆུ་ཚོད", "AEST": "ཤར་ཕྱོགས་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཚད་ལྡན་ཆུ་ཚོད", "COT": "ཀོ་ལོམ་བྷི་ཡ་ཚད་ལྡན་ཆུ་ཚོད", "WARST": "ནུབ་ཕྱོགས་ཨར་ཇེན་ཊི་ན་བྱཱར་དུས་ཆུ་ཚོད", "COST": "ཀོ་ལོམ་བྷི་ཡ་བྱཱར་དུས་ཆུ་ཚོད", "HKT": "HKT", "ACWST": "དབུས་ནུབ་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཚད་ལྡན་ཆུ་ཚོད", "GFT": "ཕིརེནཅ་གི་ཡ་ན་ཆུ་ཚོད", "GYT": "གུ་ཡ་ན་ཆུ་ཚོད", "CLST": "ཅི་ལི་བྱཱར་དུས་ཆུ་ཚོད", "WIT": "ཤར་ཕྱོགས་ཨིན་ཌོ་ནེ་ཤི་ཡ་ཆུ་ཚོད", "ARST": "ཨར་ཇེན་ཊི་ན་བྱཱར་དུས་ཆུ་ཚོད", "CHADT": "CHADT", "SGT": "SGT"},
+ timezones: map[string]string{"AST": "ཨེཊ་ལེན་ཊིཀ་ཚད་ལྡན་ཆུ་ཚོད", "JDT": "ཇ་པཱན་ཉིན་སྲུང་ཆུ་ཚོད", "IST": "རྒྱ་གར་ཆུ་ཚོད", "SAST": "ལྷོ་ཕྱོགས་ཨཕ་རི་ཀཱ་ཆུ་ཚོད", "WAT": "ནུབ་ཕྱོགས་ཨཕ་རི་ཀཱ་ཚད་ལྡན་ཆུ་ཚོད", "OEZ": "ཤར་ཕྱོགས་ཡུ་རོ་པེན་ཚད་ལྡན་ཆུ་ཚོད", "MEZ": "དབུས་ཕྱོགས་ཡུ་རོ་པེན་ཚད་ལྡན་ཆུ་ཚོད", "NZDT": "ནིའུ་ཛི་ལེནཌ་ཉིན་སྲུང་ཆུ་ཚོད", "HNT": "ནིའུ་ཕའུནཌ་ལེནཌ་ཚད་ལྡན་ཆུ་ཚོད", "CLST": "ཅི་ལི་བྱཱར་དུས་ཆུ་ཚོད", "WARST": "ནུབ་ཕྱོགས་ཨར་ཇེན་ཊི་ན་བྱཱར་དུས་ཆུ་ཚོད", "SRT": "སུ་རི་ནཱམ་ཆུ་ཚོད", "AKST": "ཨ་ལསི་ཀ་ཚད་ལྡན་ཆུ་ཚོད", "COST": "ཀོ་ལོམ་བྷི་ཡ་བྱཱར་དུས་ཆུ་ཚོད", "MST": "བྱང་ཨ་མི་རི་ཀ་མའུ་ཊེན་ཚད་ལྡན་ཆུ་ཚོད", "UYT": "ཡུ་རུ་གུ་ཝཱའི་ཚད་ལྡན་ཆུ་ཚོད", "EAT": "ཤར་ཕྱོགས་ཨཕ་རི་ཀཱ་ཆུ་ཚོད", "ACWDT": "དབུས་ནུབ་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཉིན་སྲུང་ཆུ་ཚོད", "AWST": "ནུབ་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཚད་ལྡན་ཆུ་ཚོད", "COT": "ཀོ་ལོམ་བྷི་ཡ་ཚད་ལྡན་ཆུ་ཚོད", "TMT": "TMT", "BT": "འབྲུག་ཡུལ་ཆུ་ཚོད", "CHADT": "CHADT", "EST": "བྱང་ཨ་མི་རི་ཀ་ཤར་ཕྱོགས་ཚད་ལྡན་ཆུ་ཚོད", "CAT": "དབུས་ཕྱོགས་ཨཕ་རི་ཀཱ་ཆུ་ཚོད", "WART": "ནུབ་ཕྱོགས་ཨར་ཇེན་ཊི་ན་ཚད་ལྡན་ཆུ་ཚོད", "GFT": "ཕིརེནཅ་གི་ཡ་ན་ཆུ་ཚོད", "EDT": "བྱང་ཨ་མི་རི་ཀ་ཤར་ཕྱོགས་ཉིན་སྲུང་ཆུ་ཚོད", "PST": "བྱང་ཨ་མི་རི་ཀ་པེ་སི་ཕིག་ཚད་ལྡན་ཆུ་ཚོད", "PDT": "བྱང་ཨ་མི་རི་ཀ་པེ་སི་ཕིག་ཉིན་སྲུང་ཆུ་ཚོད", "BOT": "བྷོ་ལི་བི་ཡ་ཆུ་ཚོད", "WIT": "ཤར་ཕྱོགས་ཨིན་ཌོ་ནེ་ཤི་ཡ་ཆུ་ཚོད", "NZST": "ནིའུ་ཛི་ལེནཌ་ཚད་ལྡན་ཆུ་ཚོད", "HKST": "HKST", "MESZ": "དབུས་ཕྱོགས་ཡུ་རོ་པེན་བྱཱར་དུས་ཆུ་ཚོད", "WESZ": "ནུབ་ཕྱོགས་ཡུ་རོ་པེན་བྱཱར་དུས་ཆུ་ཚོད", "ECT": "ཨེ་ཀུ་ཌཽ་ཆུ་ཚོད", "AKDT": "ཨ་ལསི་ཀ་ཉིན་སྲུང་ཆུ་ཚོད", "HAT": "ནིའུ་ཕའུནཌ་ལེནཌ་ཉིན་སྲུང་ཆུ་ཚོད", "WITA": "དབུས་ཕྱོགས་ཨིན་ཌོ་ནེ་ཤི་ཡ་ཆུ་ཚོད", "ADT": "ཨེཊ་ལེན་ཊིཀ་ཉིན་སྲུང་ཆུ་ཚོད", "TMST": "TMST", "CLT": "ཅི་ལི་ཚད་ལྡན་ཆུ་ཚོད", "WEZ": "ནུབ་ཕྱོགས་ཡུ་རོ་པེན་ཚད་ལྡན་ཆུ་ཚོད", "OESZ": "ཤར་ཕྱོགས་ཡུ་རོ་པེན་བྱཱར་དུས་ཆུ་ཚོད", "AEDT": "ཤར་ཕྱོགས་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཉིན་སྲུང་ཆུ་ཚོད", "ChST": "ChST", "GYT": "གུ་ཡ་ན་ཆུ་ཚོད", "MDT": "བྱང་ཨ་མི་རི་ཀ་མའུ་ཊེན་ཉིན་སྲུང་ཆུ་ཚོད", "ACWST": "དབུས་ནུབ་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཚད་ལྡན་ཆུ་ཚོད", "AWDT": "ནུབ་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཉིན་སྲུང་ཆུ་ཚོད", "HAST": "ཧ་ཝའི་-ཨེ་ལིའུ་ཤེན་ཚད་ལྡན་ཆུ་ཚོད", "AEST": "ཤར་ཕྱོགས་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཚད་ལྡན་ཆུ་ཚོད", "JST": "ཇ་པཱན་ཚད་ལྡན་ཆུ་ཚོད", "WAST": "ནུབ་ཕྱོགས་ཨཕ་རི་ཀཱ་བྱཱར་དུས་ཆུ་ཚོད", "SGT": "SGT", "GMT": "གིརིན་ཝིཆ་ལུ་ཡོད་པའི་ཆུ་ཚོད", "ART": "ཨར་ཇེན་ཊི་ན་ཚད་ལྡན་ཆུ་ཚོད", "CST": "བྱང་ཨ་མི་རི་ཀ་དབུས་ཕྱོགས་ཚད་ལྡན་ཆུ་ཚོད", "HKT": "HKT", "CHAST": "CHAST", "VET": "བེ་ནི་ཛུ་ཝེ་ལ་ཆུ་ཚོད", "HADT": "ཧ་ཝའི་-ཨེ་ལིའུ་ཤེན་ཉིན་སྲུང་ཆུ་ཚོད", "UYST": "ཡུ་རུ་གུ་ཝཱའི་བྱཱར་དུས་ཆུ་ཚོད", "LHDT": "LHDT", "MYT": "MYT", "∅∅∅": "པ་རུ་བྱཱར་དུས་ཆུ་ཚོད", "ACST": "དབུས་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཚད་ལྡན་ཆུ་ཚོད", "ACDT": "དབུས་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཉིན་སྲུང་ཆུ་ཚོད", "CDT": "བྱང་ཨ་མི་རི་ཀ་དབུས་ཕྱོགས་ཉིན་སྲུང་ཆུ་ཚོད", "ARST": "ཨར་ཇེན་ཊི་ན་བྱཱར་དུས་ཆུ་ཚོད", "LHST": "LHST", "WIB": "ནུབ་ཕྱོགས་ཨིན་ཌོ་ནེ་ཤི་ཡ་ཆུ་ཚོད"},
}
}
diff --git a/dz/dz_test.go b/dz/dz_test.go
new file mode 100644
index 00000000..be077081
--- /dev/null
+++ b/dz/dz_test.go
@@ -0,0 +1,1120 @@
+package dz
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "dz"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/dz_BT/dz_BT.go b/dz_BT/dz_BT.go
index b69b4fd5..49c3feca 100644
--- a/dz_BT/dz_BT.go
+++ b/dz_BT/dz_BT.go
@@ -69,7 +69,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BCE", "CE"},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"SRT": "སུ་རི་ནཱམ་ཆུ་ཚོད", "PST": "བྱང་ཨ་མི་རི་ཀ་པེ་སི་ཕིག་ཚད་ལྡན་ཆུ་ཚོད", "NZDT": "ནིའུ་ཛི་ལེནཌ་ཉིན་སྲུང་ཆུ་ཚོད", "VET": "བེ་ནི་ཛུ་ཝེ་ལ་ཆུ་ཚོད", "GMT": "གིརིན་ཝིཆ་ལུ་ཡོད་པའི་ཆུ་ཚོད", "EDT": "བྱང་ཨ་མི་རི་ཀ་ཤར་ཕྱོགས་ཉིན་སྲུང་ཆུ་ཚོད", "SAST": "ལྷོ་ཕྱོགས་ཨཕ་རི་ཀཱ་ཆུ་ཚོད", "HNT": "ནིའུ་ཕའུནཌ་ལེནཌ་ཚད་ལྡན་ཆུ་ཚོད", "PDT": "བྱང་ཨ་མི་རི་ཀ་པེ་སི་ཕིག་ཉིན་སྲུང་ཆུ་ཚོད", "MEZ": "དབུས་ཕྱོགས་ཡུ་རོ་པེན་ཚད་ལྡན་ཆུ་ཚོད", "WESZ": "ནུབ་ཕྱོགས་ཡུ་རོ་པེན་བྱཱར་དུས་ཆུ་ཚོད", "ChST": "ChST", "EST": "བྱང་ཨ་མི་རི་ཀ་ཤར་ཕྱོགས་ཚད་ལྡན་ཆུ་ཚོད", "OESZ": "ཤར་ཕྱོགས་ཡུ་རོ་པེན་བྱཱར་དུས་ཆུ་ཚོད", "CLT": "ཅི་ལི་ཚད་ལྡན་ཆུ་ཚོད", "TMST": "TMST", "ART": "ཨར་ཇེན་ཊི་ན་ཚད་ལྡན་ཆུ་ཚོད", "WARST": "ནུབ་ཕྱོགས་ཨར་ཇེན་ཊི་ན་བྱཱར་དུས་ཆུ་ཚོད", "BOT": "བྷོ་ལི་བི་ཡ་ཆུ་ཚོད", "UYST": "ཡུ་རུ་གུ་ཝཱའི་བྱཱར་དུས་ཆུ་ཚོད", "AEDT": "ཤར་ཕྱོགས་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཉིན་སྲུང་ཆུ་ཚོད", "COST": "ཀོ་ལོམ་བྷི་ཡ་བྱཱར་དུས་ཆུ་ཚོད", "WAT": "ནུབ་ཕྱོགས་ཨཕ་རི་ཀཱ་ཚད་ལྡན་ཆུ་ཚོད", "BT": "འབྲུག་ཡུལ་ཆུ་ཚོད", "ACDT": "དབུས་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཉིན་སྲུང་ཆུ་ཚོད", "UYT": "ཡུ་རུ་གུ་ཝཱའི་ཚད་ལྡན་ཆུ་ཚོད", "CHAST": "CHAST", "MST": "བྱང་ཨ་མི་རི་ཀ་མའུ་ཊེན་ཚད་ལྡན་ཆུ་ཚོད", "CST": "བྱང་ཨ་མི་རི་ཀ་དབུས་ཕྱོགས་ཚད་ལྡན་ཆུ་ཚོད", "CLST": "ཅི་ལི་བྱཱར་དུས་ཆུ་ཚོད", "MDT": "བྱང་ཨ་མི་རི་ཀ་མའུ་ཊེན་ཉིན་སྲུང་ཆུ་ཚོད", "ACST": "དབུས་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཚད་ལྡན་ཆུ་ཚོད", "AWST": "ནུབ་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཚད་ལྡན་ཆུ་ཚོད", "SGT": "SGT", "HKT": "HKT", "HAT": "ནིའུ་ཕའུནཌ་ལེནཌ་ཉིན་སྲུང་ཆུ་ཚོད", "OEZ": "ཤར་ཕྱོགས་ཡུ་རོ་པེན་ཚད་ལྡན་ཆུ་ཚོད", "AWDT": "ནུབ་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཉིན་སྲུང་ཆུ་ཚོད", "CDT": "བྱང་ཨ་མི་རི་ཀ་དབུས་ཕྱོགས་ཉིན་སྲུང་ཆུ་ཚོད", "∅∅∅": "བྲ་ཛི་ལི་ཡ་བྱཱར་དུས་ཆུ་ཚོད", "AST": "ཨེཊ་ལེན་ཊིཀ་ཚད་ལྡན་ཆུ་ཚོད", "EAT": "ཤར་ཕྱོགས་ཨཕ་རི་ཀཱ་ཆུ་ཚོད", "JST": "ཇ་པཱན་ཚད་ལྡན་ཆུ་ཚོད", "GYT": "གུ་ཡ་ན་ཆུ་ཚོད", "HAST": "ཧ་ཝའི་-ཨེ་ལིའུ་ཤེན་ཚད་ལྡན་ཆུ་ཚོད", "MYT": "MYT", "AKST": "ཨ་ལསི་ཀ་ཚད་ལྡན་ཆུ་ཚོད", "AKDT": "ཨ་ལསི་ཀ་ཉིན་སྲུང་ཆུ་ཚོད", "MESZ": "དབུས་ཕྱོགས་ཡུ་རོ་པེན་བྱཱར་དུས་ཆུ་ཚོད", "CHADT": "CHADT", "WEZ": "ནུབ་ཕྱོགས་ཡུ་རོ་པེན་ཚད་ལྡན་ཆུ་ཚོད", "ACWST": "དབུས་ནུབ་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཚད་ལྡན་ཆུ་ཚོད", "WART": "ནུབ་ཕྱོགས་ཨར་ཇེན་ཊི་ན་ཚད་ལྡན་ཆུ་ཚོད", "JDT": "ཇ་པཱན་ཉིན་སྲུང་ཆུ་ཚོད", "WAST": "ནུབ་ཕྱོགས་ཨཕ་རི་ཀཱ་བྱཱར་དུས་ཆུ་ཚོད", "IST": "རྒྱ་གར་ཆུ་ཚོད", "ADT": "ཨེཊ་ལེན་ཊིཀ་ཉིན་སྲུང་ཆུ་ཚོད", "WIT": "ཤར་ཕྱོགས་ཨིན་ཌོ་ནེ་ཤི་ཡ་ཆུ་ཚོད", "ARST": "ཨར་ཇེན་ཊི་ན་བྱཱར་དུས་ཆུ་ཚོད", "CAT": "དབུས་ཕྱོགས་ཨཕ་རི་ཀཱ་ཆུ་ཚོད", "COT": "ཀོ་ལོམ་བྷི་ཡ་ཚད་ལྡན་ཆུ་ཚོད", "ECT": "ཨེ་ཀུ་ཌཽ་ཆུ་ཚོད", "HKST": "HKST", "WITA": "དབུས་ཕྱོགས་ཨིན་ཌོ་ནེ་ཤི་ཡ་ཆུ་ཚོད", "WIB": "ནུབ་ཕྱོགས་ཨིན་ཌོ་ནེ་ཤི་ཡ་ཆུ་ཚོད", "GFT": "ཕིརེནཅ་གི་ཡ་ན་ཆུ་ཚོད", "NZST": "ནིའུ་ཛི་ལེནཌ་ཚད་ལྡན་ཆུ་ཚོད", "ACWDT": "དབུས་ནུབ་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཉིན་སྲུང་ཆུ་ཚོད", "HADT": "ཧ་ཝའི་-ཨེ་ལིའུ་ཤེན་ཉིན་སྲུང་ཆུ་ཚོད", "LHDT": "LHDT", "AEST": "ཤར་ཕྱོགས་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཚད་ལྡན་ཆུ་ཚོད", "TMT": "TMT", "LHST": "LHST"},
+ timezones: map[string]string{"CST": "བྱང་ཨ་མི་རི་ཀ་དབུས་ཕྱོགས་ཚད་ལྡན་ཆུ་ཚོད", "ACST": "དབུས་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཚད་ལྡན་ཆུ་ཚོད", "HKT": "HKT", "ChST": "ChST", "JDT": "ཇ་པཱན་ཉིན་སྲུང་ཆུ་ཚོད", "NZST": "ནིའུ་ཛི་ལེནཌ་ཚད་ལྡན་ཆུ་ཚོད", "BOT": "བྷོ་ལི་བི་ཡ་ཆུ་ཚོད", "OEZ": "ཤར་ཕྱོགས་ཡུ་རོ་པེན་ཚད་ལྡན་ཆུ་ཚོད", "OESZ": "ཤར་ཕྱོགས་ཡུ་རོ་པེན་བྱཱར་དུས་ཆུ་ཚོད", "VET": "བེ་ནི་ཛུ་ཝེ་ལ་ཆུ་ཚོད", "AWDT": "ནུབ་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཉིན་སྲུང་ཆུ་ཚོད", "GMT": "གིརིན་ཝིཆ་ལུ་ཡོད་པའི་ཆུ་ཚོད", "GFT": "ཕིརེནཅ་གི་ཡ་ན་ཆུ་ཚོད", "PDT": "བྱང་ཨ་མི་རི་ཀ་པེ་སི་ཕིག་ཉིན་སྲུང་ཆུ་ཚོད", "COT": "ཀོ་ལོམ་བྷི་ཡ་ཚད་ལྡན་ཆུ་ཚོད", "AEST": "ཤར་ཕྱོགས་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཚད་ལྡན་ཆུ་ཚོད", "AEDT": "ཤར་ཕྱོགས་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཉིན་སྲུང་ཆུ་ཚོད", "CDT": "བྱང་ཨ་མི་རི་ཀ་དབུས་ཕྱོགས་ཉིན་སྲུང་ཆུ་ཚོད", "JST": "ཇ་པཱན་ཚད་ལྡན་ཆུ་ཚོད", "AKDT": "ཨ་ལསི་ཀ་ཉིན་སྲུང་ཆུ་ཚོད", "SAST": "ལྷོ་ཕྱོགས་ཨཕ་རི་ཀཱ་ཆུ་ཚོད", "COST": "ཀོ་ལོམ་བྷི་ཡ་བྱཱར་དུས་ཆུ་ཚོད", "CLST": "ཅི་ལི་བྱཱར་དུས་ཆུ་ཚོད", "AWST": "ནུབ་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཚད་ལྡན་ཆུ་ཚོད", "ARST": "ཨར་ཇེན་ཊི་ན་བྱཱར་དུས་ཆུ་ཚོད", "EDT": "བྱང་ཨ་མི་རི་ཀ་ཤར་ཕྱོགས་ཉིན་སྲུང་ཆུ་ཚོད", "MESZ": "དབུས་ཕྱོགས་ཡུ་རོ་པེན་བྱཱར་དུས་ཆུ་ཚོད", "WIB": "ནུབ་ཕྱོགས་ཨིན་ཌོ་ནེ་ཤི་ཡ་ཆུ་ཚོད", "WAST": "ནུབ་ཕྱོགས་ཨཕ་རི་ཀཱ་བྱཱར་དུས་ཆུ་ཚོད", "GYT": "གུ་ཡ་ན་ཆུ་ཚོད", "MYT": "MYT", "WITA": "དབུས་ཕྱོགས་ཨིན་ཌོ་ནེ་ཤི་ཡ་ཆུ་ཚོད", "WEZ": "ནུབ་ཕྱོགས་ཡུ་རོ་པེན་ཚད་ལྡན་ཆུ་ཚོད", "ACWDT": "དབུས་ནུབ་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཉིན་སྲུང་ཆུ་ཚོད", "IST": "རྒྱ་གར་ཆུ་ཚོད", "WESZ": "ནུབ་ཕྱོགས་ཡུ་རོ་པེན་བྱཱར་དུས་ཆུ་ཚོད", "LHDT": "LHDT", "PST": "བྱང་ཨ་མི་རི་ཀ་པེ་སི་ཕིག་ཚད་ལྡན་ཆུ་ཚོད", "HADT": "ཧ་ཝའི་-ཨེ་ལིའུ་ཤེན་ཉིན་སྲུང་ཆུ་ཚོད", "ADT": "ཨེཊ་ལེན་ཊིཀ་ཉིན་སྲུང་ཆུ་ཚོད", "LHST": "LHST", "CLT": "ཅི་ལི་ཚད་ལྡན་ཆུ་ཚོད", "EAT": "ཤར་ཕྱོགས་ཨཕ་རི་ཀཱ་ཆུ་ཚོད", "WART": "ནུབ་ཕྱོགས་ཨར་ཇེན་ཊི་ན་ཚད་ལྡན་ཆུ་ཚོད", "∅∅∅": "ཨེ་ཛོརས་བྱཱར་དུས་ཆུ་ཚོད", "AKST": "ཨ་ལསི་ཀ་ཚད་ལྡན་ཆུ་ཚོད", "HAST": "ཧ་ཝའི་-ཨེ་ལིའུ་ཤེན་ཚད་ལྡན་ཆུ་ཚོད", "WARST": "ནུབ་ཕྱོགས་ཨར་ཇེན་ཊི་ན་བྱཱར་དུས་ཆུ་ཚོད", "CHAST": "CHAST", "MDT": "MDT", "SGT": "SGT", "UYT": "ཡུ་རུ་གུ་ཝཱའི་ཚད་ལྡན་ཆུ་ཚོད", "ACDT": "དབུས་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཉིན་སྲུང་ཆུ་ཚོད", "MST": "MST", "ART": "ཨར་ཇེན་ཊི་ན་ཚད་ལྡན་ཆུ་ཚོད", "EST": "བྱང་ཨ་མི་རི་ཀ་ཤར་ཕྱོགས་ཚད་ལྡན་ཆུ་ཚོད", "HAT": "ནིའུ་ཕའུནཌ་ལེནཌ་ཉིན་སྲུང་ཆུ་ཚོད", "WIT": "ཤར་ཕྱོགས་ཨིན་ཌོ་ནེ་ཤི་ཡ་ཆུ་ཚོད", "BT": "འབྲུག་ཡུལ་ཆུ་ཚོད", "ECT": "ཨེ་ཀུ་ཌཽ་ཆུ་ཚོད", "AST": "ཨེཊ་ལེན་ཊིཀ་ཚད་ལྡན་ཆུ་ཚོད", "ACWST": "དབུས་ནུབ་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཚད་ལྡན་ཆུ་ཚོད", "WAT": "ནུབ་ཕྱོགས་ཨཕ་རི་ཀཱ་ཚད་ལྡན་ཆུ་ཚོད", "SRT": "སུ་རི་ནཱམ་ཆུ་ཚོད", "CHADT": "CHADT", "HKST": "HKST", "HNT": "ནིའུ་ཕའུནཌ་ལེནཌ་ཚད་ལྡན་ཆུ་ཚོད", "TMT": "TMT", "TMST": "TMST", "CAT": "དབུས་ཕྱོགས་ཨཕ་རི་ཀཱ་ཆུ་ཚོད", "UYST": "ཡུ་རུ་གུ་ཝཱའི་བྱཱར་དུས་ཆུ་ཚོད", "MEZ": "དབུས་ཕྱོགས་ཡུ་རོ་པེན་ཚད་ལྡན་ཆུ་ཚོད", "NZDT": "ནིའུ་ཛི་ལེནཌ་ཉིན་སྲུང་ཆུ་ཚོད"},
}
}
diff --git a/dz_BT/dz_BT_test.go b/dz_BT/dz_BT_test.go
new file mode 100644
index 00000000..f993342f
--- /dev/null
+++ b/dz_BT/dz_BT_test.go
@@ -0,0 +1,1120 @@
+package dz_BT
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "dz_BT"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ebu/ebu.go b/ebu/ebu.go
index d8675d05..acb36a49 100644
--- a/ebu/ebu.go
+++ b/ebu/ebu.go
@@ -63,7 +63,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"MK", "TK"},
erasNarrow: []string{"", ""},
erasWide: []string{"Mbere ya Kristo", "Thutha wa Kristo"},
- timezones: map[string]string{"HNT": "HNT", "ACWDT": "ACWDT", "BT": "BT", "WARST": "WARST", "UYT": "UYT", "COST": "COST", "OEZ": "OEZ", "WITA": "WITA", "TMST": "TMST", "AWST": "AWST", "MESZ": "MESZ", "NZST": "NZST", "HAT": "HAT", "EAT": "EAT", "WESZ": "WESZ", "CHADT": "CHADT", "EDT": "EDT", "IST": "IST", "GMT": "GMT", "JDT": "JDT", "MYT": "MYT", "ACWST": "ACWST", "CAT": "CAT", "SGT": "SGT", "GFT": "GFT", "AKST": "AKST", "GYT": "GYT", "VET": "VET", "COT": "COT", "HAST": "HAST", "EST": "EST", "MDT": "MDT", "ART": "ART", "∅∅∅": "∅∅∅", "AWDT": "AWDT", "LHST": "LHST", "CDT": "CDT", "ChST": "ChST", "WAT": "WAT", "MST": "MST", "TMT": "TMT", "NZDT": "NZDT", "BOT": "BOT", "UYST": "UYST", "WEZ": "WEZ", "WIB": "WIB", "ACST": "ACST", "PDT": "PDT", "MEZ": "MEZ", "HKT": "HKT", "AKDT": "AKDT", "PST": "PST", "SAST": "SAST", "OESZ": "OESZ", "ACDT": "ACDT", "CLT": "CLT", "CLST": "CLST", "ECT": "ECT", "HADT": "HADT", "JST": "JST", "CHAST": "CHAST", "WART": "WART", "ADT": "ADT", "WAST": "WAST", "WIT": "WIT", "ARST": "ARST", "SRT": "SRT", "LHDT": "LHDT", "CST": "CST", "AEDT": "AEDT", "AEST": "AEST", "AST": "AST", "HKST": "HKST"},
+ timezones: map[string]string{"PDT": "PDT", "TMST": "TMST", "HNT": "HNT", "MST": "MST", "ACWST": "ACWST", "CLT": "CLT", "ACST": "ACST", "VET": "VET", "CLST": "CLST", "CST": "CST", "JST": "JST", "EDT": "EDT", "WAST": "WAST", "WEZ": "WEZ", "WESZ": "WESZ", "ChST": "ChST", "AWDT": "AWDT", "ARST": "ARST", "NZST": "NZST", "AEST": "AEST", "CDT": "CDT", "WARST": "WARST", "TMT": "TMT", "AWST": "AWST", "SAST": "SAST", "IST": "IST", "∅∅∅": "∅∅∅", "MYT": "MYT", "CHAST": "CHAST", "ACWDT": "ACWDT", "EAT": "EAT", "EST": "EST", "CAT": "CAT", "GFT": "GFT", "ECT": "ECT", "AKDT": "AKDT", "AST": "AST", "SGT": "SGT", "COST": "COST", "WIT": "WIT", "CHADT": "CHADT", "ADT": "ADT", "BT": "BT", "MDT": "MDT", "ACDT": "ACDT", "GYT": "GYT", "UYST": "UYST", "BOT": "BOT", "WAT": "WAT", "OESZ": "OESZ", "JDT": "JDT", "NZDT": "NZDT", "OEZ": "OEZ", "UYT": "UYT", "LHST": "LHST", "HKST": "HKST", "AEDT": "AEDT", "LHDT": "LHDT", "AKST": "AKST", "PST": "PST", "MEZ": "MEZ", "MESZ": "MESZ", "HADT": "HADT", "COT": "COT", "HKT": "HKT", "WITA": "WITA", "HAST": "HAST", "HAT": "HAT", "WART": "WART", "SRT": "SRT", "ART": "ART", "WIB": "WIB", "GMT": "GMT"},
}
}
diff --git a/ebu/ebu_test.go b/ebu/ebu_test.go
new file mode 100644
index 00000000..46011e5a
--- /dev/null
+++ b/ebu/ebu_test.go
@@ -0,0 +1,1120 @@
+package ebu
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ebu"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ebu_KE/ebu_KE.go b/ebu_KE/ebu_KE.go
index 536262fd..87fe11e3 100644
--- a/ebu_KE/ebu_KE.go
+++ b/ebu_KE/ebu_KE.go
@@ -63,7 +63,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"MK", "TK"},
erasNarrow: []string{"", ""},
erasWide: []string{"Mbere ya Kristo", "Thutha wa Kristo"},
- timezones: map[string]string{"CAT": "CAT", "AST": "AST", "WAST": "WAST", "IST": "IST", "JST": "JST", "BT": "BT", "COT": "COT", "ECT": "ECT", "GMT": "GMT", "PST": "PST", "VET": "VET", "EDT": "EDT", "HADT": "HADT", "HKST": "HKST", "EAT": "EAT", "BOT": "BOT", "COST": "COST", "TMT": "TMT", "AKDT": "AKDT", "PDT": "PDT", "CHAST": "CHAST", "WAT": "WAT", "HNT": "HNT", "WIT": "WIT", "ART": "ART", "HKT": "HKT", "NZDT": "NZDT", "MESZ": "MESZ", "WARST": "WARST", "WITA": "WITA", "ACDT": "ACDT", "TMST": "TMST", "WEZ": "WEZ", "ACWST": "ACWST", "∅∅∅": "∅∅∅", "OEZ": "OEZ", "ACST": "ACST", "MST": "MST", "AWST": "AWST", "NZST": "NZST", "HAT": "HAT", "GFT": "GFT", "OESZ": "OESZ", "MDT": "MDT", "LHDT": "LHDT", "UYT": "UYT", "ACWDT": "ACWDT", "ADT": "ADT", "HAST": "HAST", "SAST": "SAST", "AWDT": "AWDT", "JDT": "JDT", "SGT": "SGT", "MYT": "MYT", "MEZ": "MEZ", "CHADT": "CHADT", "SRT": "SRT", "UYST": "UYST", "CDT": "CDT", "AEDT": "AEDT", "WIB": "WIB", "ARST": "ARST", "LHST": "LHST", "GYT": "GYT", "CLT": "CLT", "WESZ": "WESZ", "WART": "WART", "AKST": "AKST", "ChST": "ChST", "CLST": "CLST", "CST": "CST", "AEST": "AEST", "EST": "EST"},
+ timezones: map[string]string{"PDT": "PDT", "JST": "JST", "JDT": "JDT", "PST": "PST", "NZDT": "NZDT", "LHST": "LHST", "HKT": "HKT", "CLT": "CLT", "UYT": "UYT", "ACST": "ACST", "TMST": "TMST", "OESZ": "OESZ", "ECT": "ECT", "MEZ": "MEZ", "HAT": "HAT", "TMT": "TMT", "CLST": "CLST", "CHAST": "CHAST", "AKDT": "AKDT", "HAST": "HAST", "SAST": "SAST", "WART": "WART", "AKST": "AKST", "AEST": "AEST", "AWST": "AWST", "ART": "ART", "WIT": "WIT", "ARST": "ARST", "WAST": "WAST", "LHDT": "LHDT", "AWDT": "AWDT", "ACWST": "ACWST", "NZST": "NZST", "CDT": "CDT", "WARST": "WARST", "HADT": "HADT", "CST": "CST", "WITA": "WITA", "AEDT": "AEDT", "MYT": "MYT", "BT": "BT", "MESZ": "MESZ", "SGT": "SGT", "WIB": "WIB", "EAT": "EAT", "SRT": "SRT", "VET": "VET", "ACWDT": "ACWDT", "WEZ": "WEZ", "WESZ": "WESZ", "GYT": "GYT", "OEZ": "OEZ", "UYST": "UYST", "ACDT": "ACDT", "∅∅∅": "∅∅∅", "COT": "COT", "ChST": "ChST", "HNT": "HNT", "COST": "COST", "CAT": "CAT", "WAT": "WAT", "HKST": "HKST", "IST": "IST", "EST": "EST", "EDT": "EDT", "MDT": "MDT", "GFT": "GFT", "CHADT": "CHADT", "AST": "AST", "ADT": "ADT", "BOT": "BOT", "GMT": "GMT", "MST": "MST"},
}
}
diff --git a/ebu_KE/ebu_KE_test.go b/ebu_KE/ebu_KE_test.go
new file mode 100644
index 00000000..58eeae61
--- /dev/null
+++ b/ebu_KE/ebu_KE_test.go
@@ -0,0 +1,1120 @@
+package ebu_KE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ebu_KE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ee/ee.go b/ee/ee.go
index d8118f52..61ffd4a6 100644
--- a/ee/ee.go
+++ b/ee/ee.go
@@ -65,7 +65,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"hY", "Yŋ"},
erasNarrow: []string{"hY", "Yŋ"},
erasWide: []string{"Hafi Yesu Va Do ŋgɔ", "Yesu Ŋɔli"},
- timezones: map[string]string{"∅∅∅": "Brasilia dzomeŋɔli gaƒoƒome", "COST": "Kolombia dzomeŋɔli gaƒoƒome", "OEZ": "Ɣedzeƒe Europe gaƒoƒoɖoanyime", "SRT": "Suriname gaƒoƒome", "ACWDT": "Australia ɣetoɖofe ŋkekeme gaƒoƒome", "AEST": "Ɣedzeƒe Australia gaƒoƒoɖoanyime", "ECT": "Ikuedɔ dzomeŋɔli gaƒoƒome", "IST": "IST", "MEZ": "Titina Europe gaƒoƒoɖoanyime", "CLT": "Tsile gaƒoƒoɖoanyime", "WEZ": "Ɣetoɖoƒe Europe gaƒoƒoɖoanyime", "WAST": "Ɣetoɖoƒe Africa ŋkekeme gaƒoƒome", "ACDT": "Titina Australia ŋkekeme gaƒoƒome", "GYT": "Gayana gaƒoƒome", "JST": "Japan gaƒoƒoɖanyime", "MESZ": "Titina Europe ŋkekeme gaƒoƒome", "NZST": "NZST", "MST": "America Todzidukɔwo ƒe gaƒoƒoɖoanyime", "HADT": "Hawaii-Aleutia ŋkekeme gaƒoƒome", "ADT": "Atlantic ŋkekeme gaƒoƒome", "GFT": "Frentsi Guiana gaƒoƒome", "EAT": "Ɣedzeƒe Africa gaƒoƒome", "PDT": "Pacific ŋkekme gaƒoƒome", "CST": "Titina America gaƒoƒoɖoanyime", "CHAST": "CHAST", "CLST": "Tsile dzomeŋɔli gaƒoƒome", "HKT": "Hɔng Kɔng gaƒoƒoɖoanyi me", "SAST": "Anyiehe Africa gaƒoƒome", "BT": "BT", "HKST": "Hɔng Kɔng dzomeŋɔli gaƒoƒome", "WIT": "WIT", "WIB": "WIB", "UYST": "Uruguai dzomeŋɔli gaƒoƒome", "COT": "Kolombia gaƒoƒoɖoanyime", "HAST": "Hawaii-Aleutia gaƒoƒoɖoanyime", "WARST": "Ɣetoɖoƒe Argentina dzomeŋɔli gaƒoƒome", "AKST": "Alaska gaƒoƒoɖoanyime", "ChST": "ChST", "EST": "Ɣedzeƒe America gaƒoƒoɖoanyime", "OESZ": "Ɣedzeƒe Europe ŋkekeme gaƒoƒome", "AWST": "Ɣetoɖoƒe Australia gaƒoƒoɖoanyime", "MDT": "America Todzidukɔwo ƒe ŋkekme gaƒoƒome", "CHADT": "CHADT", "VET": "Venezuela gaƒoƒome", "AEDT": "Ɣedzeƒe Australia ŋkekeme gaƒoƒome", "NZDT": "NZDT", "WITA": "WITA", "ARST": "Argentina dzomeŋɔli gaƒoƒome", "AKDT": "Alaska ŋkekeme gaƒoƒome", "ACWST": "Australia ɣetoɖofe gaƒoƒoɖoanyime", "EDT": "Ɣedzeƒe America ŋkekeme gaƒoƒome", "TMST": "Tɛkmenistan dzomeŋɔli gaƒoƒome", "ACST": "Titina Australia gaƒoƒoɖoanyime", "WAT": "Ɣetoɖoƒe Afrika gaƒoƒoɖoanyime", "GMT": "Greenwich gaƒoƒome", "HNT": "Niufaunɖlanɖ gaƒoƒoɖoanyime", "TMT": "Tɛkmenistan gaƒoƒoɖoanyime", "UYT": "Uruguai gaƒoƒoɖoanyime", "CDT": "Titina America ŋkekeme gaƒoƒome", "AST": "Atlantic gaƒoƒoɖoanyime", "SGT": "SGT", "MYT": "MYT", "PST": "Pacific gaƒoƒoɖoanyime", "WESZ": "Ɣetoɖoƒe Europe ŋkekeme gaƒoƒome", "HAT": "Niufaunɖlanɖ ŋkekeme gaƒoƒome", "ART": "Argentina gaƒoƒoɖoanyime", "LHST": "LHST", "AWDT": "Ɣetoɖoƒe Australia ŋkekeme gaƒoƒome", "LHDT": "LHDT", "BOT": "Bolivia gaƒoƒome", "CAT": "Titina Afrika gaƒoƒome", "WART": "Ɣetoɖoƒe Argentina gaƒoƒoɖoanyime", "JDT": "Japan ŋkekeme gaƒoƒome"},
+ timezones: map[string]string{"ADT": "Atlantic ŋkekeme gaƒoƒome", "WIT": "WIT", "CST": "Titina America gaƒoƒoɖoanyime", "HKST": "Hɔng Kɔng dzomeŋɔli gaƒoƒome", "JDT": "Japan ŋkekeme gaƒoƒome", "LHDT": "LHDT", "WEZ": "Ɣetoɖoƒe Europe gaƒoƒoɖoanyime", "LHST": "LHST", "AEDT": "Ɣedzeƒe Australia ŋkekeme gaƒoƒome", "ACWDT": "Australia ɣetoɖofe ŋkekeme gaƒoƒome", "EST": "Ɣedzeƒe America gaƒoƒoɖoanyime", "AKDT": "Alaska ŋkekeme gaƒoƒome", "MESZ": "Titina Europe ŋkekeme gaƒoƒome", "NZST": "NZST", "SGT": "SGT", "COST": "Kolombia dzomeŋɔli gaƒoƒome", "WIB": "WIB", "ART": "Argentina gaƒoƒoɖoanyime", "JST": "Japan gaƒoƒoɖanyime", "BT": "BT", "WARST": "Ɣetoɖoƒe Argentina dzomeŋɔli gaƒoƒome", "SAST": "Anyiehe Africa gaƒoƒome", "IST": "IST", "∅∅∅": "Eker dzomeŋɔli gaƒoƒome", "COT": "Kolombia gaƒoƒoɖoanyime", "HKT": "Hɔng Kɔng gaƒoƒoɖoanyi me", "NZDT": "NZDT", "AST": "Atlantic gaƒoƒoɖoanyime", "TMT": "Tɛkmenistan gaƒoƒoɖoanyime", "OEZ": "Ɣedzeƒe Europe gaƒoƒoɖoanyime", "CDT": "Titina America ŋkekeme gaƒoƒome", "WESZ": "Ɣetoɖoƒe Europe ŋkekeme gaƒoƒome", "WAT": "Ɣetoɖoƒe Afrika gaƒoƒoɖoanyime", "HAST": "Hawaii-Aleutia gaƒoƒoɖoanyime", "BOT": "Bolivia gaƒoƒome", "TMST": "Tɛkmenistan dzomeŋɔli gaƒoƒome", "CLT": "Tsile gaƒoƒoɖoanyime", "ECT": "Ikuedɔ dzomeŋɔli gaƒoƒome", "PDT": "Pacific ŋkekme gaƒoƒome", "ACDT": "Titina Australia ŋkekeme gaƒoƒome", "WITA": "WITA", "ACST": "Titina Australia gaƒoƒoɖoanyime", "VET": "Venezuela gaƒoƒome", "HADT": "Hawaii-Aleutia ŋkekeme gaƒoƒome", "MDT": "Makau ŋkekeme gaƒoƒome", "AWST": "Ɣetoɖoƒe Australia gaƒoƒoɖoanyime", "GMT": "Greenwich gaƒoƒome", "MYT": "MYT", "CHAST": "CHAST", "CHADT": "CHADT", "WART": "Ɣetoɖoƒe Argentina gaƒoƒoɖoanyime", "AWDT": "Ɣetoɖoƒe Australia ŋkekeme gaƒoƒome", "PST": "Pacific gaƒoƒoɖoanyime", "HNT": "Niufaunɖlanɖ gaƒoƒoɖoanyime", "AEST": "Ɣedzeƒe Australia gaƒoƒoɖoanyime", "ACWST": "Australia ɣetoɖofe gaƒoƒoɖoanyime", "AKST": "Alaska gaƒoƒoɖoanyime", "GFT": "Frentsi Guiana gaƒoƒome", "CLST": "Tsile dzomeŋɔli gaƒoƒome", "EAT": "Ɣedzeƒe Africa gaƒoƒome", "MEZ": "Titina Europe gaƒoƒoɖoanyime", "CAT": "Titina Afrika gaƒoƒome", "WAST": "Ɣetoɖoƒe Africa ŋkekeme gaƒoƒome", "ChST": "ChST", "GYT": "Gayana gaƒoƒome", "UYT": "Uruguai gaƒoƒoɖoanyime", "MST": "Makau gaƒoƒoɖoanyime", "EDT": "Ɣedzeƒe America ŋkekeme gaƒoƒome", "UYST": "Uruguai dzomeŋɔli gaƒoƒome", "OESZ": "Ɣedzeƒe Europe ŋkekeme gaƒoƒome", "SRT": "Suriname gaƒoƒome", "ARST": "Argentina dzomeŋɔli gaƒoƒome", "HAT": "Niufaunɖlanɖ ŋkekeme gaƒoƒome"},
}
}
diff --git a/ee/ee_test.go b/ee/ee_test.go
new file mode 100644
index 00000000..dd9eb74c
--- /dev/null
+++ b/ee/ee_test.go
@@ -0,0 +1,1120 @@
+package ee
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ee"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ee_GH/ee_GH.go b/ee_GH/ee_GH.go
index 2fee9c98..dfe44ada 100644
--- a/ee_GH/ee_GH.go
+++ b/ee_GH/ee_GH.go
@@ -65,7 +65,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"hY", "Yŋ"},
erasNarrow: []string{"hY", "Yŋ"},
erasWide: []string{"Hafi Yesu Va Do ŋgɔ", "Yesu Ŋɔli"},
- timezones: map[string]string{"TMST": "Tɛkmenistan dzomeŋɔli gaƒoƒome", "CHADT": "CHADT", "IST": "IST", "CST": "Titina America gaƒoƒoɖoanyime", "BOT": "Bolivia gaƒoƒome", "UYT": "Uruguai gaƒoƒoɖoanyime", "WESZ": "Ɣetoɖoƒe Europe ŋkekeme gaƒoƒome", "HAT": "Niufaunɖlanɖ ŋkekeme gaƒoƒome", "WAST": "Ɣetoɖoƒe Africa ŋkekeme gaƒoƒome", "EAT": "Ɣedzeƒe Africa gaƒoƒome", "PST": "Pacific gaƒoƒoɖoanyime", "LHST": "LHST", "HADT": "Hawaii-Aleutia ŋkekeme gaƒoƒome", "SAST": "Anyiehe Africa gaƒoƒome", "AWST": "Ɣetoɖoƒe Australia gaƒoƒoɖoanyime", "ChST": "ChST", "ADT": "Atlantic ŋkekeme gaƒoƒome", "BT": "BT", "WARST": "Ɣetoɖoƒe Argentina dzomeŋɔli gaƒoƒome", "ACDT": "Titina Australia ŋkekeme gaƒoƒome", "AKDT": "Alaska ŋkekeme gaƒoƒome", "LHDT": "LHDT", "MESZ": "Titina Europe ŋkekeme gaƒoƒome", "UYST": "Uruguai dzomeŋɔli gaƒoƒome", "SGT": "SGT", "ACWDT": "Australia ɣetoɖofe ŋkekeme gaƒoƒome", "OEZ": "Ɣedzeƒe Europe gaƒoƒoɖoanyime", "SRT": "Suriname gaƒoƒome", "GYT": "Gayana gaƒoƒome", "ECT": "Ikuedɔ dzomeŋɔli gaƒoƒome", "COST": "Kolombia dzomeŋɔli gaƒoƒome", "WIT": "WIT", "ARST": "Argentina dzomeŋɔli gaƒoƒome", "EST": "Ɣedzeƒe America gaƒoƒoɖoanyime", "WAT": "Ɣetoɖoƒe Afrika gaƒoƒoɖoanyime", "ART": "Argentina gaƒoƒoɖoanyime", "TMT": "Tɛkmenistan gaƒoƒoɖoanyime", "JDT": "Japan ŋkekeme gaƒoƒome", "WEZ": "Ɣetoɖoƒe Europe gaƒoƒoɖoanyime", "CAT": "Titina Afrika gaƒoƒome", "WIB": "WIB", "MDT": "Makau ŋkekeme gaƒoƒome", "ACWST": "Australia ɣetoɖofe gaƒoƒoɖoanyime", "CLST": "Tsile dzomeŋɔli gaƒoƒome", "EDT": "Ɣedzeƒe America ŋkekeme gaƒoƒome", "∅∅∅": "Brasilia dzomeŋɔli gaƒoƒome", "ACST": "Titina Australia gaƒoƒoɖoanyime", "CHAST": "CHAST", "COT": "Kolombia gaƒoƒoɖoanyime", "WART": "Ɣetoɖoƒe Argentina gaƒoƒoɖoanyime", "MEZ": "Titina Europe gaƒoƒoɖoanyime", "AST": "Atlantic gaƒoƒoɖoanyime", "AKST": "Alaska gaƒoƒoɖoanyime", "VET": "Venezuela gaƒoƒome", "WITA": "WITA", "GMT": "Greenwich gaƒoƒome", "GFT": "Frentsi Guiana gaƒoƒome", "AWDT": "Ɣetoɖoƒe Australia ŋkekeme gaƒoƒome", "AEST": "Ɣedzeƒe Australia gaƒoƒoɖoanyime", "HAST": "Hawaii-Aleutia gaƒoƒoɖoanyime", "HNT": "Niufaunɖlanɖ gaƒoƒoɖoanyime", "PDT": "Pacific ŋkekme gaƒoƒome", "MYT": "MYT", "NZDT": "NZDT", "OESZ": "Ɣedzeƒe Europe ŋkekeme gaƒoƒome", "CDT": "Titina America ŋkekeme gaƒoƒome", "HKT": "Hɔng Kɔng gaƒoƒoɖoanyi me", "MST": "Makau gaƒoƒoɖoanyime", "JST": "Japan gaƒoƒoɖanyime", "NZST": "NZST", "AEDT": "Ɣedzeƒe Australia ŋkekeme gaƒoƒome", "CLT": "Tsile gaƒoƒoɖoanyime", "HKST": "Hɔng Kɔng dzomeŋɔli gaƒoƒome"},
+ timezones: map[string]string{"WAST": "Ɣetoɖoƒe Africa ŋkekeme gaƒoƒome", "GMT": "Greenwich gaƒoƒome", "HKT": "Hɔng Kɔng gaƒoƒoɖoanyi me", "ART": "Argentina gaƒoƒoɖoanyime", "SAST": "Anyiehe Africa gaƒoƒome", "IST": "IST", "WEZ": "Ɣetoɖoƒe Europe gaƒoƒoɖoanyime", "AEDT": "Ɣedzeƒe Australia ŋkekeme gaƒoƒome", "UYST": "Uruguai dzomeŋɔli gaƒoƒome", "BT": "BT", "WESZ": "Ɣetoɖoƒe Europe ŋkekeme gaƒoƒome", "LHDT": "LHDT", "ADT": "Atlantic ŋkekeme gaƒoƒome", "JDT": "Japan ŋkekeme gaƒoƒome", "OESZ": "Ɣedzeƒe Europe ŋkekeme gaƒoƒome", "MDT": "America Todzidukɔwo ƒe ŋkekme gaƒoƒome", "MYT": "MYT", "JST": "Japan gaƒoƒoɖanyime", "MESZ": "Titina Europe ŋkekeme gaƒoƒome", "EAT": "Ɣedzeƒe Africa gaƒoƒome", "CST": "Titina America gaƒoƒoɖoanyime", "EST": "Ɣedzeƒe America gaƒoƒoɖoanyime", "PST": "Pacific gaƒoƒoɖoanyime", "HKST": "Hɔng Kɔng dzomeŋɔli gaƒoƒome", "HAST": "Hawaii-Aleutia gaƒoƒoɖoanyime", "NZST": "NZST", "GYT": "Gayana gaƒoƒome", "UYT": "Uruguai gaƒoƒoɖoanyime", "ACST": "Titina Australia gaƒoƒoɖoanyime", "ECT": "Ikuedɔ dzomeŋɔli gaƒoƒome", "LHST": "LHST", "ARST": "Argentina dzomeŋɔli gaƒoƒome", "AST": "Atlantic gaƒoƒoɖoanyime", "BOT": "Bolivia gaƒoƒome", "WITA": "WITA", "PDT": "Pacific ŋkekme gaƒoƒome", "HAT": "Niufaunɖlanɖ ŋkekeme gaƒoƒome", "COT": "Kolombia gaƒoƒoɖoanyime", "TMT": "Tɛkmenistan gaƒoƒoɖoanyime", "ACDT": "Titina Australia ŋkekeme gaƒoƒome", "AWDT": "Ɣetoɖoƒe Australia ŋkekeme gaƒoƒome", "COST": "Kolombia dzomeŋɔli gaƒoƒome", "CDT": "Titina America ŋkekeme gaƒoƒome", "CHAST": "CHAST", "ACWDT": "Australia ɣetoɖofe ŋkekeme gaƒoƒome", "MST": "America Todzidukɔwo ƒe gaƒoƒoɖoanyime", "GFT": "Frentsi Guiana gaƒoƒome", "AKST": "Alaska gaƒoƒoɖoanyime", "NZDT": "NZDT", "HNT": "Niufaunɖlanɖ gaƒoƒoɖoanyime", "WIT": "WIT", "VET": "Venezuela gaƒoƒome", "AKDT": "Alaska ŋkekeme gaƒoƒome", "HADT": "Hawaii-Aleutia ŋkekeme gaƒoƒome", "AEST": "Ɣedzeƒe Australia gaƒoƒoɖoanyime", "CLT": "Tsile gaƒoƒoɖoanyime", "CHADT": "CHADT", "MEZ": "Titina Europe gaƒoƒoɖoanyime", "ACWST": "Australia ɣetoɖofe gaƒoƒoɖoanyime", "AWST": "Ɣetoɖoƒe Australia gaƒoƒoɖoanyime", "EDT": "Ɣedzeƒe America ŋkekeme gaƒoƒome", "SGT": "SGT", "WIB": "WIB", "TMST": "Tɛkmenistan dzomeŋɔli gaƒoƒome", "CLST": "Tsile dzomeŋɔli gaƒoƒome", "∅∅∅": "Brasilia dzomeŋɔli gaƒoƒome", "WARST": "Ɣetoɖoƒe Argentina dzomeŋɔli gaƒoƒome", "SRT": "Suriname gaƒoƒome", "WART": "Ɣetoɖoƒe Argentina gaƒoƒoɖoanyime", "CAT": "Titina Afrika gaƒoƒome", "WAT": "Ɣetoɖoƒe Afrika gaƒoƒoɖoanyime", "ChST": "ChST", "OEZ": "Ɣedzeƒe Europe gaƒoƒoɖoanyime"},
}
}
diff --git a/ee_GH/ee_GH_test.go b/ee_GH/ee_GH_test.go
new file mode 100644
index 00000000..8ddba1bf
--- /dev/null
+++ b/ee_GH/ee_GH_test.go
@@ -0,0 +1,1120 @@
+package ee_GH
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ee_GH"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ee_TG/ee_TG.go b/ee_TG/ee_TG.go
index 24971a0f..7653f1f0 100644
--- a/ee_TG/ee_TG.go
+++ b/ee_TG/ee_TG.go
@@ -65,7 +65,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"hY", "Yŋ"},
erasNarrow: []string{"hY", "Yŋ"},
erasWide: []string{"Hafi Yesu Va Do ŋgɔ", "Yesu Ŋɔli"},
- timezones: map[string]string{"ACDT": "Titina Australia ŋkekeme gaƒoƒome", "MYT": "MYT", "CDT": "Titina America ŋkekeme gaƒoƒome", "ACWST": "Australia ɣetoɖofe gaƒoƒoɖoanyime", "SGT": "SGT", "WITA": "WITA", "WIT": "WIT", "HNT": "Niufaunɖlanɖ gaƒoƒoɖoanyime", "LHST": "LHST", "CHADT": "CHADT", "CLT": "Tsile gaƒoƒoɖoanyime", "WAT": "Ɣetoɖoƒe Afrika gaƒoƒoɖoanyime", "BT": "BT", "WEZ": "Ɣetoɖoƒe Europe gaƒoƒoɖoanyime", "ACST": "Titina Australia gaƒoƒoɖoanyime", "AWDT": "Ɣetoɖoƒe Australia ŋkekeme gaƒoƒome", "COT": "Kolombia gaƒoƒoɖoanyime", "OEZ": "Ɣedzeƒe Europe gaƒoƒoɖoanyime", "EAT": "Ɣedzeƒe Africa gaƒoƒome", "JST": "Japan gaƒoƒoɖanyime", "NZST": "NZST", "NZDT": "NZDT", "HAST": "Hawaii-Aleutia gaƒoƒoɖoanyime", "GMT": "Greenwich gaƒoƒome", "SRT": "Suriname gaƒoƒome", "WESZ": "Ɣetoɖoƒe Europe ŋkekeme gaƒoƒome", "AEDT": "Ɣedzeƒe Australia ŋkekeme gaƒoƒome", "HKT": "Hɔng Kɔng gaƒoƒoɖoanyi me", "WIB": "WIB", "MST": "Makau gaƒoƒoɖoanyime", "PST": "Pacific gaƒoƒoɖoanyime", "MEZ": "Titina Europe gaƒoƒoɖoanyime", "UYT": "Uruguai gaƒoƒoɖoanyime", "CHAST": "CHAST", "OESZ": "Ɣedzeƒe Europe ŋkekeme gaƒoƒome", "ART": "Argentina gaƒoƒoɖoanyime", "∅∅∅": "Amazon dzomeŋɔli gaƒoƒome", "JDT": "Japan ŋkekeme gaƒoƒome", "AWST": "Ɣetoɖoƒe Australia gaƒoƒoɖoanyime", "ECT": "Ikuedɔ dzomeŋɔli gaƒoƒome", "ARST": "Argentina dzomeŋɔli gaƒoƒome", "PDT": "Pacific ŋkekme gaƒoƒome", "ACWDT": "Australia ɣetoɖofe ŋkekeme gaƒoƒome", "HAT": "Niufaunɖlanɖ ŋkekeme gaƒoƒome", "LHDT": "LHDT", "MESZ": "Titina Europe ŋkekeme gaƒoƒome", "VET": "Venezuela gaƒoƒome", "WART": "Ɣetoɖoƒe Argentina gaƒoƒoɖoanyime", "TMT": "Tɛkmenistan gaƒoƒoɖoanyime", "AKST": "Alaska gaƒoƒoɖoanyime", "ChST": "ChST", "WAST": "Ɣetoɖoƒe Africa ŋkekeme gaƒoƒome", "TMST": "Tɛkmenistan dzomeŋɔli gaƒoƒome", "HADT": "Hawaii-Aleutia ŋkekeme gaƒoƒome", "HKST": "Hɔng Kɔng dzomeŋɔli gaƒoƒome", "COST": "Kolombia dzomeŋɔli gaƒoƒome", "AKDT": "Alaska ŋkekeme gaƒoƒome", "GYT": "Gayana gaƒoƒome", "BOT": "Bolivia gaƒoƒome", "CAT": "Titina Afrika gaƒoƒome", "EST": "Ɣedzeƒe America gaƒoƒoɖoanyime", "CLST": "Tsile dzomeŋɔli gaƒoƒome", "AEST": "Ɣedzeƒe Australia gaƒoƒoɖoanyime", "EDT": "Ɣedzeƒe America ŋkekeme gaƒoƒome", "ADT": "Atlantic ŋkekeme gaƒoƒome", "GFT": "Frentsi Guiana gaƒoƒome", "CST": "Titina America gaƒoƒoɖoanyime", "SAST": "Anyiehe Africa gaƒoƒome", "WARST": "Ɣetoɖoƒe Argentina dzomeŋɔli gaƒoƒome", "IST": "IST", "MDT": "Makau ŋkekeme gaƒoƒome", "UYST": "Uruguai dzomeŋɔli gaƒoƒome", "AST": "Atlantic gaƒoƒoɖoanyime"},
+ timezones: map[string]string{"GFT": "Frentsi Guiana gaƒoƒome", "ART": "Argentina gaƒoƒoɖoanyime", "SAST": "Anyiehe Africa gaƒoƒome", "GYT": "Gayana gaƒoƒome", "MYT": "MYT", "WART": "Ɣetoɖoƒe Argentina gaƒoƒoɖoanyime", "ACWDT": "Australia ɣetoɖofe ŋkekeme gaƒoƒome", "HAT": "Niufaunɖlanɖ ŋkekeme gaƒoƒome", "BT": "BT", "MDT": "Makau ŋkekeme gaƒoƒome", "PST": "Pacific gaƒoƒoɖoanyime", "TMT": "Tɛkmenistan gaƒoƒoɖoanyime", "UYST": "Uruguai dzomeŋɔli gaƒoƒome", "CHAST": "CHAST", "VET": "Venezuela gaƒoƒome", "COST": "Kolombia dzomeŋɔli gaƒoƒome", "CLT": "Tsile gaƒoƒoɖoanyime", "JST": "Japan gaƒoƒoɖanyime", "HAST": "Hawaii-Aleutia gaƒoƒoɖoanyime", "TMST": "Tɛkmenistan dzomeŋɔli gaƒoƒome", "OESZ": "Ɣedzeƒe Europe ŋkekeme gaƒoƒome", "LHDT": "LHDT", "ACDT": "Titina Australia ŋkekeme gaƒoƒome", "MST": "Makau gaƒoƒoɖoanyime", "CAT": "Titina Afrika gaƒoƒome", "AEST": "Ɣedzeƒe Australia gaƒoƒoɖoanyime", "AEDT": "Ɣedzeƒe Australia ŋkekeme gaƒoƒome", "NZST": "NZST", "GMT": "Greenwich gaƒoƒome", "IST": "IST", "WAST": "Ɣetoɖoƒe Africa ŋkekeme gaƒoƒome", "CLST": "Tsile dzomeŋɔli gaƒoƒome", "CHADT": "CHADT", "ARST": "Argentina dzomeŋɔli gaƒoƒome", "NZDT": "NZDT", "WESZ": "Ɣetoɖoƒe Europe ŋkekeme gaƒoƒome", "HNT": "Niufaunɖlanɖ gaƒoƒoɖoanyime", "WIB": "WIB", "WIT": "WIT", "EAT": "Ɣedzeƒe Africa gaƒoƒome", "ACST": "Titina Australia gaƒoƒoɖoanyime", "SRT": "Suriname gaƒoƒome", "HKST": "Hɔng Kɔng dzomeŋɔli gaƒoƒome", "AKST": "Alaska gaƒoƒoɖoanyime", "EDT": "Ɣedzeƒe America ŋkekeme gaƒoƒome", "HADT": "Hawaii-Aleutia ŋkekeme gaƒoƒome", "COT": "Kolombia gaƒoƒoɖoanyime", "HKT": "Hɔng Kɔng gaƒoƒoɖoanyi me", "ACWST": "Australia ɣetoɖofe gaƒoƒoɖoanyime", "AKDT": "Alaska ŋkekeme gaƒoƒome", "MESZ": "Titina Europe ŋkekeme gaƒoƒome", "OEZ": "Ɣedzeƒe Europe gaƒoƒoɖoanyime", "ECT": "Ikuedɔ dzomeŋɔli gaƒoƒome", "WARST": "Ɣetoɖoƒe Argentina dzomeŋɔli gaƒoƒome", "∅∅∅": "Azores dzomeŋɔli gaƒoƒome", "ADT": "Atlantic ŋkekeme gaƒoƒome", "AWST": "Ɣetoɖoƒe Australia gaƒoƒoɖoanyime", "JDT": "Japan ŋkekeme gaƒoƒome", "WAT": "Ɣetoɖoƒe Afrika gaƒoƒoɖoanyime", "ChST": "ChST", "LHST": "LHST", "AST": "Atlantic gaƒoƒoɖoanyime", "EST": "Ɣedzeƒe America gaƒoƒoɖoanyime", "BOT": "Bolivia gaƒoƒome", "WEZ": "Ɣetoɖoƒe Europe gaƒoƒoɖoanyime", "UYT": "Uruguai gaƒoƒoɖoanyime", "CST": "Titina America gaƒoƒoɖoanyime", "CDT": "Titina America ŋkekeme gaƒoƒome", "AWDT": "Ɣetoɖoƒe Australia ŋkekeme gaƒoƒome", "WITA": "WITA", "PDT": "Pacific ŋkekme gaƒoƒome", "MEZ": "Titina Europe gaƒoƒoɖoanyime", "SGT": "SGT"},
}
}
diff --git a/ee_TG/ee_TG_test.go b/ee_TG/ee_TG_test.go
new file mode 100644
index 00000000..4ea1976f
--- /dev/null
+++ b/ee_TG/ee_TG_test.go
@@ -0,0 +1,1120 @@
+package ee_TG
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ee_TG"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/el/el.go b/el/el.go
index 617d4263..7fc3d334 100644
--- a/el/el.go
+++ b/el/el.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"π.Χ.", "μ.Χ."},
erasNarrow: []string{"", ""},
erasWide: []string{"προ Χριστού", "μετά Χριστόν"},
- timezones: map[string]string{"MEZ": "Χειμερινή ώρα Κεντρικής Ευρώπης", "COST": "Θερινή ώρα Κολομβίας", "SGT": "Ώρα Σιγκαπούρης", "ART": "Χειμερινή ώρα Αργεντινής", "GYT": "Ώρα Γουιάνας", "WARST": "Θερινή ώρα Δυτικής Αργεντινής", "WIB": "Ώρα: Δυτική Ινδονησία", "LHST": "Χειμερινή ώρα Λορντ Χάου", "CLT": "Χειμερινή ώρα Χιλής", "SAST": "Χειμερινή ώρα Νότιας Αφρικής", "WAST": "Θερινή ώρα Δυτικής Αφρικής", "TMST": "Θερινή ώρα Τουρκμενιστάν", "OESZ": "Θερινή ώρα Ανατολικής Ευρώπης", "AKDT": "Θερινή ώρα Αλάσκας", "NZST": "Χειμερινή ώρα Νέας Ζηλανδίας", "CST": "Κεντρική χειμερινή ώρα Βόρειας Αμερικής", "ACWST": "Χειμερινή ώρα Κεντροδυτικής Αυστραλίας", "ACWDT": "Θερινή ώρα Κεντροδυτικής Αυστραλίας", "∅∅∅": "Θερινή ώρα Μπραζίλια", "PST": "Χειμερινή ώρα Βόρειας Αμερικής", "EST": "Ανατολική χειμερινή ώρα Βόρειας Αμερικής", "ADT": "Θερινή ώρα Ατλαντικού", "WART": "Χειμερινή ώρα Δυτικής Αργεντινής", "HADT": "Θερινή ώρα Χαβάης-Αλεούτιων νήσων", "HKT": "Χειμερινή ώρα Χονγκ Κονγκ", "ACST": "Χειμερινή ώρα Κεντρικής Αυστραλίας", "AWDT": "Θερινή ώρα Δυτικής Αυστραλίας", "AEST": "Χειμερινή ώρα Ανατολικής Αυστραλίας", "AEDT": "Θερινή ώρα Ανατολικής Αυστραλίας", "CHADT": "Θερινή ώρα Τσάθαμ", "VET": "Ώρα Βενεζουέλας", "GFT": "Ώρα Γαλλικής Γουιάνας", "JDT": "Θερινή ώρα Ιαπωνίας", "MDT": "Ορεινή θερινή ώρα Βόρειας Αμερικής", "WESZ": "Θερινή ώρα Δυτικής Ευρώπης", "CAT": "Ώρα Κεντρικής Αφρικής", "AST": "Χειμερινή ώρα Ατλαντικού", "WITA": "Ώρα: Κεντρική Ινδονησία", "EAT": "Ώρα Ανατολικής Αφρικής", "LHDT": "Θερινή ώρα Λορντ Χάου", "UYST": "Θερινή ώρα Ουρουγουάης", "MESZ": "Θερινή ώρα Κεντρικής Ευρώπης", "HKST": "Θερινή ώρα Χονγκ Κονγκ", "GMT": "Μέση ώρα Γκρίνουιτς", "HNT": "Χειμερινή ώρα Νέας Γης", "ARST": "Θερινή ώρα Αργεντινής", "WIT": "Ώρα: Ανατολική Ινδονησία", "OEZ": "Χειμερινή ώρα Ανατολικής Ευρώπης", "TMT": "Χειμερινή ώρα Τουρκμενιστάν", "MYT": "Ώρα Μαλαισίας", "ChST": "Ώρα Τσαμόρο", "MST": "Ορεινή χειμερινή ώρα Βόρειας Αμερικής", "WEZ": "Χειμερινή ώρα Δυτικής Ευρώπης", "WAT": "Χειμερινή ώρα Δυτικής Αφρικής", "JST": "Χειμερινή ώρα Ιαπωνίας", "PDT": "Θερινή ώρα Βόρειας Αμερικής", "HAST": "Χειμερινή ώρα Χαβάης-Αλεούτιων νήσων", "IST": "Ώρα Ινδίας", "SRT": "Ώρα Σουρινάμ", "UYT": "Χειμερινή ώρα Ουρουγουάης", "BT": "Ώρα Μπουτάν", "HAT": "Θερινή ώρα Νέας Γης", "AWST": "Χειμερινή ώρα Δυτικής Αυστραλίας", "NZDT": "Θερινή ώρα Νέας Ζηλανδίας", "CHAST": "Χειμερινή ώρα Τσάθαμ", "EDT": "Ανατολική θερινή ώρα Βόρειας Αμερικής", "AKST": "Χειμερινή ώρα Αλάσκας", "BOT": "Ώρα Βολιβίας", "CDT": "Κεντρική θερινή ώρα Βόρειας Αμερικής", "CLST": "Θερινή ώρα Χιλής", "COT": "Χειμερινή ώρα Κολομβίας", "ECT": "Ώρα Εκουαδόρ", "ACDT": "Θερινή ώρα Κεντρικής Αυστραλίας"},
+ timezones: map[string]string{"CST": "Κεντρική χειμερινή ώρα Βόρειας Αμερικής", "WARST": "Θερινή ώρα Δυτικής Αργεντινής", "AWDT": "Θερινή ώρα Δυτικής Αυστραλίας", "PDT": "Θερινή ώρα Βόρειας Αμερικής", "WEZ": "Χειμερινή ώρα Δυτικής Ευρώπης", "JST": "Χειμερινή ώρα Ιαπωνίας", "JDT": "Θερινή ώρα Ιαπωνίας", "BOT": "Ώρα Βολιβίας", "MEZ": "Χειμερινή ώρα Κεντρικής Ευρώπης", "ACDT": "Θερινή ώρα Κεντρικής Αυστραλίας", "AKDT": "Θερινή ώρα Αλάσκας", "IST": "Ώρα Ινδίας", "PST": "Χειμερινή ώρα Βόρειας Αμερικής", "HADT": "Θερινή ώρα Χαβάης-Αλεούτιων νήσων", "ChST": "Ώρα Τσαμόρο", "NZST": "Χειμερινή ώρα Νέας Ζηλανδίας", "NZDT": "Θερινή ώρα Νέας Ζηλανδίας", "WIB": "Ώρα: Δυτική Ινδονησία", "CAT": "Ώρα Κεντρικής Αφρικής", "BT": "Ώρα Μπουτάν", "GMT": "Μέση ώρα Γκρίνουιτς", "AEDT": "Θερινή ώρα Ανατολικής Αυστραλίας", "UYT": "Χειμερινή ώρα Ουρουγουάης", "CLT": "Χειμερινή ώρα Χιλής", "CHAST": "Χειμερινή ώρα Τσάθαμ", "AEST": "Χειμερινή ώρα Ανατολικής Αυστραλίας", "LHDT": "Θερινή ώρα Λορντ Χάου", "GYT": "Ώρα Γουιάνας", "EAT": "Ώρα Ανατολικής Αφρικής", "∅∅∅": "Θερινή ώρα Μπραζίλια", "WART": "Χειμερινή ώρα Δυτικής Αργεντινής", "TMT": "Χειμερινή ώρα Τουρκμενιστάν", "SRT": "Ώρα Σουρινάμ", "HKT": "Χειμερινή ώρα Χονγκ Κονγκ", "SAST": "Χειμερινή ώρα Νότιας Αφρικής", "SGT": "Ώρα Σιγκαπούρης", "TMST": "Θερινή ώρα Τουρκμενιστάν", "HAT": "Θερινή ώρα Νέας Γης", "COST": "Θερινή ώρα Κολομβίας", "OEZ": "Χειμερινή ώρα Ανατολικής Ευρώπης", "CDT": "Κεντρική θερινή ώρα Βόρειας Αμερικής", "HAST": "Χειμερινή ώρα Χαβάης-Αλεούτιων νήσων", "LHST": "Χειμερινή ώρα Λορντ Χάου", "WAT": "Χειμερινή ώρα Δυτικής Αφρικής", "WESZ": "Θερινή ώρα Δυτικής Ευρώπης", "UYST": "Θερινή ώρα Ουρουγουάης", "MST": "Ορεινή χειμερινή ώρα Βόρειας Αμερικής", "MYT": "Ώρα Μαλαισίας", "ACST": "Χειμερινή ώρα Κεντρικής Αυστραλίας", "VET": "Ώρα Βενεζουέλας", "ACWST": "Χειμερινή ώρα Κεντροδυτικής Αυστραλίας", "WITA": "Ώρα: Κεντρική Ινδονησία", "COT": "Χειμερινή ώρα Κολομβίας", "AKST": "Χειμερινή ώρα Αλάσκας", "AST": "Χειμερινή ώρα Ατλαντικού", "ACWDT": "Θερινή ώρα Κεντροδυτικής Αυστραλίας", "ART": "Χειμερινή ώρα Αργεντινής", "EST": "Ανατολική χειμερινή ώρα Βόρειας Αμερικής", "WAST": "Θερινή ώρα Δυτικής Αφρικής", "HNT": "Χειμερινή ώρα Νέας Γης", "WIT": "Ώρα: Ανατολική Ινδονησία", "GFT": "Ώρα Γαλλικής Γουιάνας", "CHADT": "Θερινή ώρα Τσάθαμ", "ADT": "Θερινή ώρα Ατλαντικού", "AWST": "Χειμερινή ώρα Δυτικής Αυστραλίας", "ARST": "Θερινή ώρα Αργεντινής", "MDT": "Ορεινή θερινή ώρα Βόρειας Αμερικής", "CLST": "Θερινή ώρα Χιλής", "HKST": "Θερινή ώρα Χονγκ Κονγκ", "ECT": "Ώρα Εκουαδόρ", "EDT": "Ανατολική θερινή ώρα Βόρειας Αμερικής", "MESZ": "Θερινή ώρα Κεντρικής Ευρώπης", "OESZ": "Θερινή ώρα Ανατολικής Ευρώπης"},
}
}
diff --git a/el/el_test.go b/el/el_test.go
new file mode 100644
index 00000000..5cc18ee5
--- /dev/null
+++ b/el/el_test.go
@@ -0,0 +1,1120 @@
+package el
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "el"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/el_CY/el_CY.go b/el_CY/el_CY.go
index 1c5a476c..dc731b3e 100644
--- a/el_CY/el_CY.go
+++ b/el_CY/el_CY.go
@@ -48,7 +48,7 @@ func New() locales.Translator {
locale: "el_CY",
pluralsCardinal: []locales.PluralRule{2, 6},
pluralsOrdinal: []locales.PluralRule{6},
- pluralsRange: []locales.PluralRule{2, 6},
+ pluralsRange: []locales.PluralRule{6, 2},
decimal: ",",
group: ".",
minus: "-",
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"π.Χ.", "μ.Χ."},
erasNarrow: []string{"", ""},
erasWide: []string{"προ Χριστού", "μετά Χριστόν"},
- timezones: map[string]string{"AKST": "Χειμερινή ώρα Αλάσκας", "CHAST": "Χειμερινή ώρα Τσάθαμ", "ChST": "Ώρα Τσαμόρο", "COT": "Χειμερινή ώρα Κολομβίας", "HAST": "Χειμερινή ώρα Χαβάης-Αλεούτιων νήσων", "TMT": "Χειμερινή ώρα Τουρκμενιστάν", "NZDT": "Θερινή ώρα Νέας Ζηλανδίας", "CHADT": "Θερινή ώρα Τσάθαμ", "CAT": "Ώρα Κεντρικής Αφρικής", "SGT": "Ώρα Σιγκαπούρης", "PDT": "Θερινή ώρα Βόρειας Αμερικής", "JDT": "Θερινή ώρα Ιαπωνίας", "∅∅∅": "Θερινή ώρα Μπραζίλια", "HKT": "Χειμερινή ώρα Χονγκ Κονγκ", "ACDT": "Θερινή ώρα Κεντρικής Αυστραλίας", "GFT": "Ώρα Γαλλικής Γουιάνας", "AKDT": "Θερινή ώρα Αλάσκας", "CDT": "Κεντρική θερινή ώρα Βόρειας Αμερικής", "ECT": "Ώρα Εκουαδόρ", "HKST": "Θερινή ώρα Χονγκ Κονγκ", "GMT": "Μέση ώρα Γκρίνουιτς", "AWDT": "Θερινή ώρα Δυτικής Αυστραλίας", "WESZ": "Θερινή ώρα Δυτικής Ευρώπης", "ACWST": "Χειμερινή ώρα Κεντροδυτικής Αυστραλίας", "ADT": "Θερινή ώρα Ατλαντικού", "WAT": "Χειμερινή ώρα Δυτικής Αφρικής", "CST": "Κεντρική χειμερινή ώρα Βόρειας Αμερικής", "SRT": "Ώρα Σουρινάμ", "AWST": "Χειμερινή ώρα Δυτικής Αυστραλίας", "AEDT": "Θερινή ώρα Ανατολικής Αυστραλίας", "HADT": "Θερινή ώρα Χαβάης-Αλεούτιων νήσων", "HNT": "Χειμερινή ώρα Νέας Γης", "MYT": "Ώρα Μαλαισίας", "JST": "Χειμερινή ώρα Ιαπωνίας", "MEZ": "Χειμερινή ώρα Κεντρικής Ευρώπης", "WAST": "Θερινή ώρα Δυτικής Αφρικής", "WITA": "Ώρα: Κεντρική Ινδονησία", "ART": "Χειμερινή ώρα Αργεντινής", "TMST": "Θερινή ώρα Τουρκμενιστάν", "MST": "Χειμερινή ώρα Μακάο", "PST": "Χειμερινή ώρα Βόρειας Αμερικής", "NZST": "Χειμερινή ώρα Νέας Ζηλανδίας", "BT": "Ώρα Μπουτάν", "OESZ": "Θερινή ώρα Ανατολικής Ευρώπης", "ARST": "Θερινή ώρα Αργεντινής", "GYT": "Ώρα Γουιάνας", "UYST": "Θερινή ώρα Ουρουγουάης", "ACWDT": "Θερινή ώρα Κεντροδυτικής Αυστραλίας", "WART": "Χειμερινή ώρα Δυτικής Αργεντινής", "OEZ": "Χειμερινή ώρα Ανατολικής Ευρώπης", "HAT": "Θερινή ώρα Νέας Γης", "MESZ": "Θερινή ώρα Κεντρικής Ευρώπης", "UYT": "Χειμερινή ώρα Ουρουγουάης", "EST": "Ανατολική χειμερινή ώρα Βόρειας Αμερικής", "WARST": "Θερινή ώρα Δυτικής Αργεντινής", "LHST": "Χειμερινή ώρα Λορντ Χάου", "LHDT": "Θερινή ώρα Λορντ Χάου", "CLST": "Θερινή ώρα Χιλής", "WEZ": "Χειμερινή ώρα Δυτικής Ευρώπης", "SAST": "Χειμερινή ώρα Νότιας Αφρικής", "WIB": "Ώρα: Δυτική Ινδονησία", "MDT": "Θερινή ώρα Μακάο", "BOT": "Ώρα Βολιβίας", "CLT": "Χειμερινή ώρα Χιλής", "VET": "Ώρα Βενεζουέλας", "EDT": "Ανατολική θερινή ώρα Βόρειας Αμερικής", "AST": "Χειμερινή ώρα Ατλαντικού", "ACST": "Χειμερινή ώρα Κεντρικής Αυστραλίας", "EAT": "Ώρα Ανατολικής Αφρικής", "AEST": "Χειμερινή ώρα Ανατολικής Αυστραλίας", "COST": "Θερινή ώρα Κολομβίας", "WIT": "Ώρα: Ανατολική Ινδονησία", "IST": "Ώρα Ινδίας"},
+ timezones: map[string]string{"UYT": "Χειμερινή ώρα Ουρουγουάης", "CDT": "Κεντρική θερινή ώρα Βόρειας Αμερικής", "MDT": "Θερινή ώρα Μακάο", "AKST": "Χειμερινή ώρα Αλάσκας", "AEST": "Χειμερινή ώρα Ανατολικής Αυστραλίας", "CHAST": "Χειμερινή ώρα Τσάθαμ", "VET": "Ώρα Βενεζουέλας", "IST": "Ώρα Ινδίας", "MEZ": "Χειμερινή ώρα Κεντρικής Ευρώπης", "GFT": "Ώρα Γαλλικής Γουιάνας", "AST": "Χειμερινή ώρα Ατλαντικού", "PDT": "Θερινή ώρα Βόρειας Αμερικής", "PST": "Χειμερινή ώρα Βόρειας Αμερικής", "MESZ": "Θερινή ώρα Κεντρικής Ευρώπης", "COST": "Θερινή ώρα Κολομβίας", "TMT": "Χειμερινή ώρα Τουρκμενιστάν", "HKST": "Θερινή ώρα Χονγκ Κονγκ", "AKDT": "Θερινή ώρα Αλάσκας", "EDT": "Ανατολική θερινή ώρα Βόρειας Αμερικής", "LHDT": "Θερινή ώρα Λορντ Χάου", "ACST": "Χειμερινή ώρα Κεντρικής Αυστραλίας", "SAST": "Χειμερινή ώρα Νότιας Αφρικής", "OEZ": "Χειμερινή ώρα Ανατολικής Ευρώπης", "WIT": "Ώρα: Ανατολική Ινδονησία", "ChST": "Ώρα Τσαμόρο", "WARST": "Θερινή ώρα Δυτικής Αργεντινής", "CLST": "Θερινή ώρα Χιλής", "CST": "Κεντρική χειμερινή ώρα Βόρειας Αμερικής", "ACWDT": "Θερινή ώρα Κεντροδυτικής Αυστραλίας", "BOT": "Ώρα Βολιβίας", "CLT": "Χειμερινή ώρα Χιλής", "ACWST": "Χειμερινή ώρα Κεντροδυτικής Αυστραλίας", "AWDT": "Θερινή ώρα Δυτικής Αυστραλίας", "ARST": "Θερινή ώρα Αργεντινής", "WAST": "Θερινή ώρα Δυτικής Αφρικής", "BT": "Ώρα Μπουτάν", "HKT": "Χειμερινή ώρα Χονγκ Κονγκ", "CHADT": "Θερινή ώρα Τσάθαμ", "JDT": "Θερινή ώρα Ιαπωνίας", "SRT": "Ώρα Σουρινάμ", "WIB": "Ώρα: Δυτική Ινδονησία", "WEZ": "Χειμερινή ώρα Δυτικής Ευρώπης", "AEDT": "Θερινή ώρα Ανατολικής Αυστραλίας", "COT": "Χειμερινή ώρα Κολομβίας", "WAT": "Χειμερινή ώρα Δυτικής Αφρικής", "∅∅∅": "Θερινή ώρα Αζορών", "ART": "Χειμερινή ώρα Αργεντινής", "HAST": "Χειμερινή ώρα Χαβάης-Αλεούτιων νήσων", "SGT": "Ώρα Σιγκαπούρης", "UYST": "Θερινή ώρα Ουρουγουάης", "LHST": "Χειμερινή ώρα Λορντ Χάου", "WART": "Χειμερινή ώρα Δυτικής Αργεντινής", "HADT": "Θερινή ώρα Χαβάης-Αλεούτιων νήσων", "HNT": "Χειμερινή ώρα Νέας Γης", "HAT": "Θερινή ώρα Νέας Γης", "WITA": "Ώρα: Κεντρική Ινδονησία", "MYT": "Ώρα Μαλαισίας", "ACDT": "Θερινή ώρα Κεντρικής Αυστραλίας", "NZDT": "Θερινή ώρα Νέας Ζηλανδίας", "EST": "Ανατολική χειμερινή ώρα Βόρειας Αμερικής", "NZST": "Χειμερινή ώρα Νέας Ζηλανδίας", "TMST": "Θερινή ώρα Τουρκμενιστάν", "CAT": "Ώρα Κεντρικής Αφρικής", "GMT": "Μέση ώρα Γκρίνουιτς", "GYT": "Ώρα Γουιάνας", "JST": "Χειμερινή ώρα Ιαπωνίας", "ADT": "Θερινή ώρα Ατλαντικού", "AWST": "Χειμερινή ώρα Δυτικής Αυστραλίας", "OESZ": "Θερινή ώρα Ανατολικής Ευρώπης", "EAT": "Ώρα Ανατολικής Αφρικής", "MST": "Χειμερινή ώρα Μακάο", "ECT": "Ώρα Εκουαδόρ", "WESZ": "Θερινή ώρα Δυτικής Ευρώπης"},
}
}
diff --git a/el_CY/el_CY_test.go b/el_CY/el_CY_test.go
new file mode 100644
index 00000000..44007ebc
--- /dev/null
+++ b/el_CY/el_CY_test.go
@@ -0,0 +1,1120 @@
+package el_CY
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "el_CY"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/el_GR/el_GR.go b/el_GR/el_GR.go
index ed8c058c..74d9fb65 100644
--- a/el_GR/el_GR.go
+++ b/el_GR/el_GR.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"π.Χ.", "μ.Χ."},
erasNarrow: []string{"", ""},
erasWide: []string{"προ Χριστού", "μετά Χριστόν"},
- timezones: map[string]string{"AWST": "Χειμερινή ώρα Δυτικής Αυστραλίας", "AWDT": "Θερινή ώρα Δυτικής Αυστραλίας", "LHST": "Χειμερινή ώρα Λορντ Χάου", "CLT": "Χειμερινή ώρα Χιλής", "PDT": "Θερινή ώρα Βόρειας Αμερικής", "UYST": "Θερινή ώρα Ουρουγουάης", "AEDT": "Θερινή ώρα Ανατολικής Αυστραλίας", "COT": "Χειμερινή ώρα Κολομβίας", "JST": "Χειμερινή ώρα Ιαπωνίας", "JDT": "Θερινή ώρα Ιαπωνίας", "VET": "Ώρα Βενεζουέλας", "ECT": "Ώρα Εκουαδόρ", "WIB": "Ώρα: Δυτική Ινδονησία", "IST": "Ώρα Ινδίας", "OESZ": "Θερινή ώρα Ανατολικής Ευρώπης", "MYT": "Ώρα Μαλαισίας", "SAST": "Χειμερινή ώρα Νότιας Αφρικής", "WITA": "Ώρα: Κεντρική Ινδονησία", "CAT": "Ώρα Κεντρικής Αφρικής", "HKST": "Θερινή ώρα Χονγκ Κονγκ", "GFT": "Ώρα Γαλλικής Γουιάνας", "NZDT": "Θερινή ώρα Νέας Ζηλανδίας", "WESZ": "Θερινή ώρα Δυτικής Ευρώπης", "CST": "Κεντρική χειμερινή ώρα Βόρειας Αμερικής", "CHAST": "Χειμερινή ώρα Τσάθαμ", "CHADT": "Θερινή ώρα Τσάθαμ", "ART": "Χειμερινή ώρα Αργεντινής", "ARST": "Θερινή ώρα Αργεντινής", "TMST": "Θερινή ώρα Τουρκμενιστάν", "AKST": "Χειμερινή ώρα Αλάσκας", "AST": "Χειμερινή ώρα Ατλαντικού", "WAT": "Χειμερινή ώρα Δυτικής Αφρικής", "BOT": "Ώρα Βολιβίας", "UYT": "Χειμερινή ώρα Ουρουγουάης", "ChST": "Ώρα Τσαμόρο", "ADT": "Θερινή ώρα Ατλαντικού", "HKT": "Χειμερινή ώρα Χονγκ Κονγκ", "WAST": "Θερινή ώρα Δυτικής Αφρικής", "HAT": "Θερινή ώρα Νέας Γης", "COST": "Θερινή ώρα Κολομβίας", "∅∅∅": "Θερινή ώρα Αμαζονίου", "MEZ": "Χειμερινή ώρα Κεντρικής Ευρώπης", "WART": "Χειμερινή ώρα Δυτικής Αργεντινής", "EDT": "Ανατολική θερινή ώρα Βόρειας Αμερικής", "WARST": "Θερινή ώρα Δυτικής Αργεντινής", "ACDT": "Θερινή ώρα Κεντρικής Αυστραλίας", "MDT": "Θερινή ώρα Μακάο", "LHDT": "Θερινή ώρα Λορντ Χάου", "BT": "Ώρα Μπουτάν", "AKDT": "Θερινή ώρα Αλάσκας", "PST": "Χειμερινή ώρα Βόρειας Αμερικής", "HAST": "Χειμερινή ώρα Χαβάης-Αλεούτιων νήσων", "SGT": "Ώρα Σιγκαπούρης", "ACST": "Χειμερινή ώρα Κεντρικής Αυστραλίας", "SRT": "Ώρα Σουρινάμ", "CDT": "Κεντρική θερινή ώρα Βόρειας Αμερικής", "EST": "Ανατολική χειμερινή ώρα Βόρειας Αμερικής", "ACWDT": "Θερινή ώρα Κεντροδυτικής Αυστραλίας", "HADT": "Θερινή ώρα Χαβάης-Αλεούτιων νήσων", "HNT": "Χειμερινή ώρα Νέας Γης", "OEZ": "Χειμερινή ώρα Ανατολικής Ευρώπης", "TMT": "Χειμερινή ώρα Τουρκμενιστάν", "AEST": "Χειμερινή ώρα Ανατολικής Αυστραλίας", "MESZ": "Θερινή ώρα Κεντρικής Ευρώπης", "WEZ": "Χειμερινή ώρα Δυτικής Ευρώπης", "WIT": "Ώρα: Ανατολική Ινδονησία", "MST": "Χειμερινή ώρα Μακάο", "GYT": "Ώρα Γουιάνας", "NZST": "Χειμερινή ώρα Νέας Ζηλανδίας", "GMT": "Μέση ώρα Γκρίνουιτς", "EAT": "Ώρα Ανατολικής Αφρικής", "CLST": "Θερινή ώρα Χιλής", "ACWST": "Χειμερινή ώρα Κεντροδυτικής Αυστραλίας"},
+ timezones: map[string]string{"LHDT": "Θερινή ώρα Λορντ Χάου", "VET": "Ώρα Βενεζουέλας", "ACWDT": "Θερινή ώρα Κεντροδυτικής Αυστραλίας", "BOT": "Ώρα Βολιβίας", "HNT": "Χειμερινή ώρα Νέας Γης", "ChST": "Ώρα Τσαμόρο", "BT": "Ώρα Μπουτάν", "AWDT": "Θερινή ώρα Δυτικής Αυστραλίας", "NZDT": "Θερινή ώρα Νέας Ζηλανδίας", "SGT": "Ώρα Σιγκαπούρης", "OESZ": "Θερινή ώρα Ανατολικής Ευρώπης", "UYT": "Χειμερινή ώρα Ουρουγουάης", "ECT": "Ώρα Εκουαδόρ", "WIB": "Ώρα: Δυτική Ινδονησία", "EAT": "Ώρα Ανατολικής Αφρικής", "AST": "Χειμερινή ώρα Ατλαντικού", "ADT": "Θερινή ώρα Ατλαντικού", "ACWST": "Χειμερινή ώρα Κεντροδυτικής Αυστραλίας", "ARST": "Θερινή ώρα Αργεντινής", "GMT": "Μέση ώρα Γκρίνουιτς", "UYST": "Θερινή ώρα Ουρουγουάης", "SRT": "Ώρα Σουρινάμ", "GFT": "Ώρα Γαλλικής Γουιάνας", "AKST": "Χειμερινή ώρα Αλάσκας", "ART": "Χειμερινή ώρα Αργεντινής", "AEST": "Χειμερινή ώρα Ανατολικής Αυστραλίας", "AEDT": "Θερινή ώρα Ανατολικής Αυστραλίας", "GYT": "Ώρα Γουιάνας", "WAT": "Χειμερινή ώρα Δυτικής Αφρικής", "WAST": "Θερινή ώρα Δυτικής Αφρικής", "OEZ": "Χειμερινή ώρα Ανατολικής Ευρώπης", "CLST": "Θερινή ώρα Χιλής", "∅∅∅": "Θερινή ώρα Αζορών", "MST": "Χειμερινή ώρα Μακάο", "WESZ": "Θερινή ώρα Δυτικής Ευρώπης", "TMT": "Χειμερινή ώρα Τουρκμενιστάν", "COST": "Θερινή ώρα Κολομβίας", "TMST": "Θερινή ώρα Τουρκμενιστάν", "MDT": "Θερινή ώρα Μακάο", "CHAST": "Χειμερινή ώρα Τσάθαμ", "IST": "Ώρα Ινδίας", "EST": "Ανατολική χειμερινή ώρα Βόρειας Αμερικής", "PST": "Χειμερινή ώρα Βόρειας Αμερικής", "HAST": "Χειμερινή ώρα Χαβάης-Αλεούτιων νήσων", "HKST": "Θερινή ώρα Χονγκ Κονγκ", "JDT": "Θερινή ώρα Ιαπωνίας", "HAT": "Θερινή ώρα Νέας Γης", "CLT": "Χειμερινή ώρα Χιλής", "LHST": "Χειμερινή ώρα Λορντ Χάου", "CDT": "Κεντρική θερινή ώρα Βόρειας Αμερικής", "ACST": "Χειμερινή ώρα Κεντρικής Αυστραλίας", "WARST": "Θερινή ώρα Δυτικής Αργεντινής", "WITA": "Ώρα: Κεντρική Ινδονησία", "PDT": "Θερινή ώρα Βόρειας Αμερικής", "CST": "Κεντρική χειμερινή ώρα Βόρειας Αμερικής", "HKT": "Χειμερινή ώρα Χονγκ Κονγκ", "SAST": "Χειμερινή ώρα Νότιας Αφρικής", "WART": "Χειμερινή ώρα Δυτικής Αργεντινής", "CHADT": "Θερινή ώρα Τσάθαμ", "MEZ": "Χειμερινή ώρα Κεντρικής Ευρώπης", "HADT": "Θερινή ώρα Χαβάης-Αλεούτιων νήσων", "ACDT": "Θερινή ώρα Κεντρικής Αυστραλίας", "AWST": "Χειμερινή ώρα Δυτικής Αυστραλίας", "JST": "Χειμερινή ώρα Ιαπωνίας", "COT": "Χειμερινή ώρα Κολομβίας", "MYT": "Ώρα Μαλαισίας", "WIT": "Ώρα: Ανατολική Ινδονησία", "EDT": "Ανατολική θερινή ώρα Βόρειας Αμερικής", "NZST": "Χειμερινή ώρα Νέας Ζηλανδίας", "CAT": "Ώρα Κεντρικής Αφρικής", "AKDT": "Θερινή ώρα Αλάσκας", "MESZ": "Θερινή ώρα Κεντρικής Ευρώπης", "WEZ": "Χειμερινή ώρα Δυτικής Ευρώπης"},
}
}
diff --git a/el_GR/el_GR_test.go b/el_GR/el_GR_test.go
new file mode 100644
index 00000000..ef054d75
--- /dev/null
+++ b/el_GR/el_GR_test.go
@@ -0,0 +1,1120 @@
+package el_GR
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "el_GR"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en/en.go b/en/en.go
index 5ff3a3f8..f2b259bf 100644
--- a/en/en.go
+++ b/en/en.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"JDT": "Japan Daylight Time", "BOT": "Bolivia Time", "∅∅∅": "Acre Summer Time", "SGT": "Singapore Standard Time", "TMST": "Turkmenistan Summer Time", "NZST": "New Zealand Standard Time", "ChST": "Chamorro Standard Time", "AEST": "Australian Eastern Standard Time", "AEDT": "Australian Eastern Daylight Time", "GFT": "French Guiana Time", "ACDT": "Australian Central Daylight Time", "PST": "Pacific Standard Time", "MESZ": "Central European Summer Time", "ACWDT": "Australian Central Western Daylight Time", "ECT": "Ecuador Time", "EST": "Eastern Standard Time", "ADT": "Atlantic Daylight Time", "SAST": "South Africa Standard Time", "UYST": "Uruguay Summer Time", "PDT": "Pacific Daylight Time", "NZDT": "New Zealand Daylight Time", "WARST": "Western Argentina Summer Time", "GMT": "Greenwich Mean Time", "MST": "Macau Standard Time", "ACST": "Australian Central Standard Time", "LHST": "Lord Howe Standard Time", "HNT": "Newfoundland Standard Time", "WIB": "Western Indonesia Time", "HKST": "Hong Kong Summer Time", "WITA": "Central Indonesia Time", "OESZ": "Eastern European Summer Time", "CLST": "Chile Summer Time", "VET": "Venezuela Time", "CAT": "Central Africa Time", "WAST": "West Africa Summer Time", "IST": "India Standard Time", "ARST": "Argentina Summer Time", "CLT": "Chile Standard Time", "COST": "Colombia Summer Time", "HKT": "Hong Kong Standard Time", "LHDT": "Lord Howe Daylight Time", "MYT": "Malaysia Time", "WEZ": "Western European Standard Time", "ART": "Argentina Standard Time", "MDT": "Macau Summer Time", "GYT": "Guyana Time", "AKST": "Alaska Standard Time", "CST": "Central Standard Time", "MEZ": "Central European Standard Time", "ACWST": "Australian Central Western Standard Time", "BT": "Bhutan Time", "EAT": "East Africa Time", "JST": "Japan Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "AKDT": "Alaska Daylight Time", "WESZ": "Western European Summer Time", "OEZ": "Eastern European Standard Time", "AWST": "Australian Western Standard Time", "AWDT": "Australian Western Daylight Time", "COT": "Colombia Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "WART": "Western Argentina Standard Time", "WAT": "West Africa Standard Time", "UYT": "Uruguay Standard Time", "CHAST": "Chatham Standard Time", "EDT": "Eastern Daylight Time", "AST": "Atlantic Standard Time", "HAT": "Newfoundland Daylight Time", "WIT": "Eastern Indonesia Time", "CHADT": "Chatham Daylight Time", "TMT": "Turkmenistan Standard Time", "SRT": "Suriname Time", "CDT": "Central Daylight Time"},
+ timezones: map[string]string{"WARST": "Western Argentina Summer Time", "AEDT": "Australian Eastern Daylight Time", "NZDT": "New Zealand Daylight Time", "MST": "Mountain Standard Time", "ART": "Argentina Standard Time", "NZST": "New Zealand Standard Time", "PDT": "Pacific Daylight Time", "MESZ": "Central European Summer Time", "SGT": "Singapore Standard Time", "EAT": "East Africa Time", "CHAST": "Chatham Standard Time", "WITA": "Central Indonesia Time", "TMT": "Turkmenistan Standard Time", "CHADT": "Chatham Daylight Time", "AKDT": "Alaska Daylight Time", "AWST": "Australian Western Standard Time", "ACWDT": "Australian Central Western Daylight Time", "PST": "Pacific Standard Time", "WIB": "Western Indonesia Time", "WESZ": "Western European Summer Time", "CLST": "Chile Summer Time", "MYT": "Malaysia Time", "ECT": "Ecuador Time", "AKST": "Alaska Standard Time", "AST": "Atlantic Standard Time", "AWDT": "Australian Western Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "IST": "India Standard Time", "UYST": "Uruguay Summer Time", "GFT": "French Guiana Time", "HKT": "Hong Kong Standard Time", "OESZ": "Eastern European Summer Time", "LHDT": "Lord Howe Daylight Time", "JDT": "Japan Daylight Time", "GYT": "Guyana Time", "BOT": "Bolivia Time", "CST": "Central Standard Time", "CDT": "Central Daylight Time", "ACST": "Australian Central Standard Time", "WIT": "Eastern Indonesia Time", "COT": "Colombia Standard Time", "CAT": "Central Africa Time", "ADT": "Atlantic Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "OEZ": "Eastern European Standard Time", "UYT": "Uruguay Standard Time", "ACDT": "Australian Central Daylight Time", "HKST": "Hong Kong Summer Time", "WAT": "West Africa Standard Time", "HAT": "Newfoundland Daylight Time", "AEST": "Australian Eastern Standard Time", "WART": "Western Argentina Standard Time", "ARST": "Argentina Summer Time", "TMST": "Turkmenistan Summer Time", "ChST": "Chamorro Standard Time", "BT": "Bhutan Time", "MDT": "Mountain Daylight Time", "ACWST": "Australian Central Western Standard Time", "WEZ": "Western European Standard Time", "JST": "Japan Standard Time", "MEZ": "Central European Standard Time", "WAST": "West Africa Summer Time", "SAST": "South Africa Standard Time", "COST": "Colombia Summer Time", "GMT": "Greenwich Mean Time", "∅∅∅": "Brasilia Summer Time", "VET": "Venezuela Time", "EST": "Eastern Standard Time", "EDT": "Eastern Daylight Time", "HNT": "Newfoundland Standard Time", "CLT": "Chile Standard Time", "LHST": "Lord Howe Standard Time", "SRT": "Suriname Time"},
}
}
@@ -112,8 +112,8 @@ func (en *en) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
func (en *en) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
n := math.Abs(num)
- nMod10 := math.Mod(n, 10)
nMod100 := math.Mod(n, 100)
+ nMod10 := math.Mod(n, 10)
if nMod10 == 1 && nMod100 != 11 {
return locales.PluralRuleOne
diff --git a/en_001/en_001.go b/en_001/en_001.go
index bbc96e84..7f4e5c1f 100644
--- a/en_001/en_001.go
+++ b/en_001/en_001.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"TMT": "Turkmenistan Standard Time", "JDT": "Japan Daylight Time", "PDT": "Pacific Daylight Time", "SGT": "Singapore Standard Time", "WIT": "Eastern Indonesia Time", "OESZ": "Eastern European Summer Time", "GYT": "Guyana Time", "JST": "Japan Standard Time", "ECT": "Ecuador Time", "IST": "India Standard Time", "MDT": "Macau Summer Time", "MYT": "Malaysia Time", "HNT": "Newfoundland Standard Time", "∅∅∅": "Amazon Summer Time", "CDT": "Central Daylight Time", "AEST": "Australian Eastern Standard Time", "ACWST": "Australian Central Western Standard Time", "ACST": "Australian Central Standard Time", "LHST": "Lord Howe Standard Time", "EST": "Eastern Standard Time", "BT": "Bhutan Time", "AKDT": "Alaska Daylight Time", "NZDT": "New Zealand Daylight Time", "AEDT": "Australian Eastern Daylight Time", "ACWDT": "Australian Central Western Daylight Time", "WAST": "West Africa Summer Time", "LHDT": "Lord Howe Daylight Time", "AKST": "Alaska Standard Time", "ADT": "Atlantic Daylight Time", "SAST": "South Africa Standard Time", "ARST": "Argentina Summer Time", "MST": "Macau Standard Time", "EDT": "Eastern Daylight Time", "AST": "Atlantic Standard Time", "HKST": "Hong Kong Summer Time", "WARST": "Western Argentina Summer Time", "BOT": "Bolivia Time", "COST": "Colombia Summer Time", "ChST": "Chamorro Standard Time", "CHADT": "Chatham Daylight Time", "HAT": "Newfoundland Daylight Time", "MEZ": "Central European Standard Time", "ACDT": "Australian Central Daylight Time", "SRT": "Suriname Time", "VET": "Venezuela Time", "WESZ": "Western European Summer Time", "COT": "Colombia Standard Time", "WART": "Western Argentina Standard Time", "WAT": "West Africa Standard Time", "CST": "Central Standard Time", "CLST": "Chile Summer Time", "HADT": "Hawaii-Aleutian Daylight Time", "EAT": "East Africa Time", "AWDT": "Australian Western Daylight Time", "UYST": "Uruguay Summer Time", "MESZ": "Central European Summer Time", "GMT": "Greenwich Mean Time", "OEZ": "Eastern European Standard Time", "CAT": "Central Africa Time", "HAST": "Hawaii-Aleutian Standard Time", "HKT": "Hong Kong Standard Time", "NZST": "New Zealand Standard Time", "CLT": "Chile Standard Time", "PST": "Pacific Standard Time", "UYT": "Uruguay Standard Time", "CHAST": "Chatham Standard Time", "WEZ": "Western European Standard Time", "GFT": "French Guiana Time", "WITA": "Central Indonesia Time", "TMST": "Turkmenistan Summer Time", "AWST": "Australian Western Standard Time", "WIB": "Western Indonesia Time", "ART": "Argentina Standard Time"},
+ timezones: map[string]string{"COT": "Colombia Standard Time", "TMST": "Turkmenistan Summer Time", "WIT": "Eastern Indonesia Time", "LHDT": "Lord Howe Daylight Time", "EST": "Eastern Standard Time", "AEST": "Australian Eastern Standard Time", "AEDT": "Australian Eastern Daylight Time", "HKST": "Hong Kong Summer Time", "JST": "Japan Standard Time", "ACWST": "Australian Central Western Standard Time", "BOT": "Bolivia Time", "IST": "India Standard Time", "AST": "Atlantic Standard Time", "EDT": "Eastern Daylight Time", "UYST": "Uruguay Summer Time", "ACDT": "Australian Central Daylight Time", "MDT": "Macau Summer Time", "HAST": "Hawaii-Aleutian Standard Time", "UYT": "Uruguay Standard Time", "BT": "Bhutan Time", "ECT": "Ecuador Time", "MST": "Macau Standard Time", "AWDT": "Australian Western Daylight Time", "MEZ": "Central European Standard Time", "JDT": "Japan Daylight Time", "HNT": "Newfoundland Standard Time", "CLST": "Chile Summer Time", "WITA": "Central Indonesia Time", "ChST": "Chamorro Standard Time", "OEZ": "Eastern European Standard Time", "CDT": "Central Daylight Time", "PST": "Pacific Standard Time", "MESZ": "Central European Summer Time", "TMT": "Turkmenistan Standard Time", "WAT": "West Africa Standard Time", "WARST": "Western Argentina Summer Time", "ARST": "Argentina Summer Time", "AKDT": "Alaska Daylight Time", "MYT": "Malaysia Time", "CLT": "Chile Standard Time", "LHST": "Lord Howe Standard Time", "ACST": "Australian Central Standard Time", "∅∅∅": "Azores Summer Time", "CHADT": "Chatham Daylight Time", "ART": "Argentina Standard Time", "SGT": "Singapore Standard Time", "COST": "Colombia Summer Time", "ADT": "Atlantic Daylight Time", "WIB": "Western Indonesia Time", "WESZ": "Western European Summer Time", "GFT": "French Guiana Time", "VET": "Venezuela Time", "HKT": "Hong Kong Standard Time", "CHAST": "Chatham Standard Time", "AWST": "Australian Western Standard Time", "CST": "Central Standard Time", "ACWDT": "Australian Central Western Daylight Time", "NZST": "New Zealand Standard Time", "HAT": "Newfoundland Daylight Time", "WAST": "West Africa Summer Time", "SRT": "Suriname Time", "AKST": "Alaska Standard Time", "PDT": "Pacific Daylight Time", "NZDT": "New Zealand Daylight Time", "CAT": "Central Africa Time", "EAT": "East Africa Time", "HADT": "Hawaii-Aleutian Daylight Time", "WEZ": "Western European Standard Time", "GYT": "Guyana Time", "WART": "Western Argentina Standard Time", "SAST": "South Africa Standard Time", "OESZ": "Eastern European Summer Time", "GMT": "Greenwich Mean Time"},
}
}
diff --git a/en_001/en_001_test.go b/en_001/en_001_test.go
new file mode 100644
index 00000000..11db46d1
--- /dev/null
+++ b/en_001/en_001_test.go
@@ -0,0 +1,1120 @@
+package en_001
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_001"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_150/en_150.go b/en_150/en_150.go
index b35f28c4..408dfccd 100644
--- a/en_150/en_150.go
+++ b/en_150/en_150.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"ADT": "Atlantic Daylight Time", "OEZ": "Eastern European Standard Time", "AWDT": "Australian Western Daylight Time", "LHST": "Lord Howe Standard Time", "AKST": "Alaska Standard Time", "GFT": "French Guiana Time", "ARST": "Argentina Summer Time", "WEZ": "Western European Standard Time", "CAT": "Central Africa Time", "SGT": "Singapore Standard Time", "AST": "Atlantic Standard Time", "WAST": "West Africa Summer Time", "BT": "Bhutan Time", "NZST": "New Zealand Standard Time", "CST": "Central Standard Time", "EDT": "Eastern Daylight Time", "AWST": "Australian Western Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "∅∅∅": "Acre Summer Time", "WAT": "West Africa Standard Time", "HKT": "Hong Kong Standard Time", "WARST": "Western Argentina Summer Time", "HNT": "Newfoundland Standard Time", "WIT": "Eastern Indonesia Time", "AKDT": "Alaska Daylight Time", "CHAST": "Chatham Standard Time", "CHADT": "Chatham Daylight Time", "VET": "Venezuela Time", "PST": "Pacific Standard Time", "PDT": "Pacific Daylight Time", "MYT": "Malaysia Time", "BOT": "Bolivia Time", "WITA": "Central Indonesia Time", "WIB": "Western Indonesia Time", "IST": "India Standard Time", "NZDT": "New Zealand Daylight Time", "ACWST": "Australian Central Western Standard Time", "GMT": "Greenwich Mean Time", "TMT": "Turkmenistan Standard Time", "LHDT": "Lord Howe Daylight Time", "ART": "Argentina Standard Time", "EAT": "East Africa Time", "MESZ": "Central European Summer Time", "CLST": "Chile Summer Time", "MST": "Macau Standard Time", "ACWDT": "Australian Central Western Daylight Time", "AEDT": "Australian Eastern Daylight Time", "COST": "Colombia Summer Time", "COT": "Colombia Standard Time", "HKST": "Hong Kong Summer Time", "OESZ": "Eastern European Summer Time", "MEZ": "Central European Standard Time", "CDT": "Central Daylight Time", "AEST": "Australian Eastern Standard Time", "CLT": "Chile Standard Time", "WESZ": "Western European Summer Time", "JDT": "Japan Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "SAST": "South Africa Standard Time", "ECT": "Ecuador Time", "ChST": "Chamorro Standard Time", "HAT": "Newfoundland Daylight Time", "MDT": "Macau Summer Time", "ACST": "Australian Central Standard Time", "TMST": "Turkmenistan Summer Time", "SRT": "Suriname Time", "UYST": "Uruguay Summer Time", "WART": "Western Argentina Standard Time", "ACDT": "Australian Central Daylight Time", "GYT": "Guyana Time", "JST": "Japan Standard Time", "UYT": "Uruguay Standard Time", "EST": "Eastern Standard Time"},
+ timezones: map[string]string{"NZST": "New Zealand Standard Time", "EDT": "Eastern Daylight Time", "HNT": "Newfoundland Standard Time", "CHAST": "Chatham Standard Time", "AST": "Atlantic Standard Time", "AKST": "Alaska Standard Time", "ACWST": "Australian Central Western Standard Time", "MEZ": "Central European Standard Time", "OEZ": "Eastern European Standard Time", "GFT": "French Guiana Time", "AEDT": "Australian Eastern Daylight Time", "BT": "Bhutan Time", "AKDT": "Alaska Daylight Time", "AWST": "Australian Western Standard Time", "NZDT": "New Zealand Daylight Time", "CAT": "Central Africa Time", "GYT": "Guyana Time", "GMT": "Greenwich Mean Time", "CHADT": "Chatham Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "SGT": "Singapore Standard Time", "AEST": "Australian Eastern Standard Time", "CLT": "Chile Standard Time", "EST": "Eastern Standard Time", "SRT": "Suriname Time", "JDT": "Japan Daylight Time", "WEZ": "Western European Standard Time", "ACDT": "Australian Central Daylight Time", "JST": "Japan Standard Time", "IST": "India Standard Time", "TMST": "Turkmenistan Summer Time", "WAT": "West Africa Standard Time", "HAT": "Newfoundland Daylight Time", "UYT": "Uruguay Standard Time", "∅∅∅": "Brasilia Summer Time", "LHDT": "Lord Howe Daylight Time", "MST": "Mountain Standard Time", "MDT": "Mountain Daylight Time", "ART": "Argentina Standard Time", "ACWDT": "Australian Central Western Daylight Time", "AWDT": "Australian Western Daylight Time", "MYT": "Malaysia Time", "WIT": "Eastern Indonesia Time", "HADT": "Hawaii-Aleutian Daylight Time", "WESZ": "Western European Summer Time", "TMT": "Turkmenistan Standard Time", "WART": "Western Argentina Standard Time", "COST": "Colombia Summer Time", "WAST": "West Africa Summer Time", "EAT": "East Africa Time", "CST": "Central Standard Time", "ACST": "Australian Central Standard Time", "COT": "Colombia Standard Time", "ChST": "Chamorro Standard Time", "LHST": "Lord Howe Standard Time", "HKT": "Hong Kong Standard Time", "PST": "Pacific Standard Time", "PDT": "Pacific Daylight Time", "OESZ": "Eastern European Summer Time", "VET": "Venezuela Time", "SAST": "South Africa Standard Time", "CDT": "Central Daylight Time", "MESZ": "Central European Summer Time", "CLST": "Chile Summer Time", "ECT": "Ecuador Time", "ARST": "Argentina Summer Time", "BOT": "Bolivia Time", "WIB": "Western Indonesia Time", "WARST": "Western Argentina Summer Time", "HKST": "Hong Kong Summer Time", "ADT": "Atlantic Daylight Time", "UYST": "Uruguay Summer Time", "WITA": "Central Indonesia Time"},
}
}
diff --git a/en_150/en_150_test.go b/en_150/en_150_test.go
new file mode 100644
index 00000000..efa2e439
--- /dev/null
+++ b/en_150/en_150_test.go
@@ -0,0 +1,1120 @@
+package en_150
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_150"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_AG/en_AG.go b/en_AG/en_AG.go
index 9d298bcf..24b0c663 100644
--- a/en_AG/en_AG.go
+++ b/en_AG/en_AG.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"HADT": "Hawaii-Aleutian Daylight Time", "SAST": "South Africa Standard Time", "MST": "Macau Standard Time", "CLT": "Chile Standard Time", "WESZ": "Western European Summer Time", "AEDT": "Australian Eastern Daylight Time", "BT": "Bhutan Time", "OEZ": "Eastern European Standard Time", "SRT": "Suriname Time", "LHST": "Lord Howe Standard Time", "CDT": "Central Daylight Time", "EDT": "Eastern Daylight Time", "∅∅∅": "Brasilia Summer Time", "ACDT": "Australian Central Daylight Time", "MYT": "Malaysia Time", "NZDT": "New Zealand Daylight Time", "AST": "Atlantic Standard Time", "SGT": "Singapore Standard Time", "GMT": "Greenwich Mean Time", "TMST": "Turkmenistan Summer Time", "AKDT": "Alaska Daylight Time", "PDT": "Pacific Daylight Time", "LHDT": "Lord Howe Daylight Time", "ACWDT": "Australian Central Western Daylight Time", "EST": "Eastern Standard Time", "WART": "Western Argentina Standard Time", "IST": "India Standard Time", "AKST": "Alaska Standard Time", "CST": "Central Standard Time", "CLST": "Chile Summer Time", "CAT": "Central Africa Time", "ADT": "Atlantic Daylight Time", "WITA": "Central Indonesia Time", "ARST": "Argentina Summer Time", "MESZ": "Central European Summer Time", "NZST": "New Zealand Standard Time", "ACWST": "Australian Central Western Standard Time", "CHADT": "Chatham Daylight Time", "COT": "Colombia Standard Time", "COST": "Colombia Summer Time", "MDT": "Macau Summer Time", "JST": "Japan Standard Time", "WARST": "Western Argentina Summer Time", "OESZ": "Eastern European Summer Time", "EAT": "East Africa Time", "UYT": "Uruguay Standard Time", "HNT": "Newfoundland Standard Time", "HAT": "Newfoundland Daylight Time", "ACST": "Australian Central Standard Time", "MEZ": "Central European Standard Time", "WEZ": "Western European Standard Time", "HKST": "Hong Kong Summer Time", "TMT": "Turkmenistan Standard Time", "GYT": "Guyana Time", "AEST": "Australian Eastern Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "BOT": "Bolivia Time", "ECT": "Ecuador Time", "HKT": "Hong Kong Standard Time", "WIT": "Eastern Indonesia Time", "GFT": "French Guiana Time", "ART": "Argentina Standard Time", "PST": "Pacific Standard Time", "WIB": "Western Indonesia Time", "JDT": "Japan Daylight Time", "VET": "Venezuela Time", "CHAST": "Chatham Standard Time", "WAT": "West Africa Standard Time", "WAST": "West Africa Summer Time", "AWST": "Australian Western Standard Time", "AWDT": "Australian Western Daylight Time", "UYST": "Uruguay Summer Time", "ChST": "Chamorro Standard Time"},
+ timezones: map[string]string{"JST": "Japan Standard Time", "PDT": "Pacific Daylight Time", "MEZ": "Central European Standard Time", "CLST": "Chile Summer Time", "ACDT": "Australian Central Daylight Time", "OESZ": "Eastern European Summer Time", "CHAST": "Chatham Standard Time", "AWDT": "Australian Western Daylight Time", "PST": "Pacific Standard Time", "MESZ": "Central European Summer Time", "WARST": "Western Argentina Summer Time", "ChST": "Chamorro Standard Time", "MDT": "Mountain Daylight Time", "ACST": "Australian Central Standard Time", "AKDT": "Alaska Daylight Time", "AST": "Atlantic Standard Time", "EST": "Eastern Standard Time", "COT": "Colombia Standard Time", "TMST": "Turkmenistan Summer Time", "ADT": "Atlantic Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "NZST": "New Zealand Standard Time", "WART": "Western Argentina Standard Time", "ECT": "Ecuador Time", "WITA": "Central Indonesia Time", "ACWST": "Australian Central Western Standard Time", "NZDT": "New Zealand Daylight Time", "BOT": "Bolivia Time", "CDT": "Central Daylight Time", "HKST": "Hong Kong Summer Time", "AKST": "Alaska Standard Time", "HNT": "Newfoundland Standard Time", "CAT": "Central Africa Time", "LHDT": "Lord Howe Daylight Time", "GFT": "French Guiana Time", "ARST": "Argentina Summer Time", "WAST": "West Africa Summer Time", "CHADT": "Chatham Daylight Time", "AWST": "Australian Western Standard Time", "IST": "India Standard Time", "EDT": "Eastern Daylight Time", "MST": "Mountain Standard Time", "WIT": "Eastern Indonesia Time", "ART": "Argentina Standard Time", "COST": "Colombia Summer Time", "OEZ": "Eastern European Standard Time", "CLT": "Chile Standard Time", "SRT": "Suriname Time", "ACWDT": "Australian Central Western Daylight Time", "UYT": "Uruguay Standard Time", "UYST": "Uruguay Summer Time", "JDT": "Japan Daylight Time", "TMT": "Turkmenistan Standard Time", "AEDT": "Australian Eastern Daylight Time", "CST": "Central Standard Time", "SAST": "South Africa Standard Time", "∅∅∅": "Amazon Summer Time", "WAT": "West Africa Standard Time", "EAT": "East Africa Time", "LHST": "Lord Howe Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "WESZ": "Western European Summer Time", "GYT": "Guyana Time", "MYT": "Malaysia Time", "BT": "Bhutan Time", "SGT": "Singapore Standard Time", "WEZ": "Western European Standard Time", "GMT": "Greenwich Mean Time", "AEST": "Australian Eastern Standard Time", "HAT": "Newfoundland Daylight Time", "WIB": "Western Indonesia Time", "VET": "Venezuela Time", "HKT": "Hong Kong Standard Time"},
}
}
diff --git a/en_AG/en_AG_test.go b/en_AG/en_AG_test.go
new file mode 100644
index 00000000..a44c7ea7
--- /dev/null
+++ b/en_AG/en_AG_test.go
@@ -0,0 +1,1120 @@
+package en_AG
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_AG"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_AI/en_AI.go b/en_AI/en_AI.go
index a13efe4a..50afe01c 100644
--- a/en_AI/en_AI.go
+++ b/en_AI/en_AI.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"WIT": "Eastern Indonesia Time", "PDT": "Pacific Daylight Time", "CHADT": "Chatham Daylight Time", "ACWST": "Australian Central Western Standard Time", "AEDT": "Australian Eastern Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "ChST": "Chamorro Standard Time", "WESZ": "Western European Summer Time", "COST": "Colombia Summer Time", "SAST": "South Africa Standard Time", "JDT": "Japan Daylight Time", "VET": "Venezuela Time", "WEZ": "Western European Standard Time", "ACDT": "Australian Central Daylight Time", "OEZ": "Eastern European Standard Time", "MYT": "Malaysia Time", "MEZ": "Central European Standard Time", "COT": "Colombia Standard Time", "WARST": "Western Argentina Summer Time", "GMT": "Greenwich Mean Time", "UYST": "Uruguay Summer Time", "SGT": "Singapore Standard Time", "HAT": "Newfoundland Daylight Time", "TMT": "Turkmenistan Standard Time", "AKDT": "Alaska Daylight Time", "IST": "India Standard Time", "GYT": "Guyana Time", "PST": "Pacific Standard Time", "NZDT": "New Zealand Daylight Time", "BOT": "Bolivia Time", "MDT": "Mountain Daylight Time", "ACWDT": "Australian Central Western Daylight Time", "WAST": "West Africa Summer Time", "EAT": "East Africa Time", "SRT": "Suriname Time", "OESZ": "Eastern European Summer Time", "LHST": "Lord Howe Standard Time", "AWST": "Australian Western Standard Time", "∅∅∅": "Brasilia Summer Time", "EDT": "Eastern Daylight Time", "AST": "Atlantic Standard Time", "HKST": "Hong Kong Summer Time", "WIB": "Western Indonesia Time", "CST": "Central Standard Time", "WART": "Western Argentina Standard Time", "GFT": "French Guiana Time", "ART": "Argentina Standard Time", "MST": "Mountain Standard Time", "CHAST": "Chatham Standard Time", "AEST": "Australian Eastern Standard Time", "CAT": "Central Africa Time", "HKT": "Hong Kong Standard Time", "ARST": "Argentina Summer Time", "TMST": "Turkmenistan Summer Time", "MESZ": "Central European Summer Time", "CLST": "Chile Summer Time", "HNT": "Newfoundland Standard Time", "LHDT": "Lord Howe Daylight Time", "AKST": "Alaska Standard Time", "CDT": "Central Daylight Time", "ACST": "Australian Central Standard Time", "AWDT": "Australian Western Daylight Time", "UYT": "Uruguay Standard Time", "ECT": "Ecuador Time", "BT": "Bhutan Time", "EST": "Eastern Standard Time", "CLT": "Chile Standard Time", "WAT": "West Africa Standard Time", "NZST": "New Zealand Standard Time", "ADT": "Atlantic Daylight Time", "WITA": "Central Indonesia Time", "JST": "Japan Standard Time"},
+ timezones: map[string]string{"ADT": "Atlantic Daylight Time", "NZDT": "New Zealand Daylight Time", "WAT": "West Africa Standard Time", "CHAST": "Chatham Standard Time", "ARST": "Argentina Summer Time", "JDT": "Japan Daylight Time", "∅∅∅": "Amazon Summer Time", "GYT": "Guyana Time", "AWST": "Australian Western Standard Time", "AWDT": "Australian Western Daylight Time", "ART": "Argentina Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "AEST": "Australian Eastern Standard Time", "AKDT": "Alaska Daylight Time", "OESZ": "Eastern European Summer Time", "LHDT": "Lord Howe Daylight Time", "MYT": "Malaysia Time", "HAT": "Newfoundland Daylight Time", "TMT": "Turkmenistan Standard Time", "CST": "Central Standard Time", "GFT": "French Guiana Time", "HKST": "Hong Kong Summer Time", "ACWDT": "Australian Central Western Daylight Time", "IST": "India Standard Time", "NZST": "New Zealand Standard Time", "WEZ": "Western European Standard Time", "WESZ": "Western European Summer Time", "HKT": "Hong Kong Standard Time", "PST": "Pacific Standard Time", "BOT": "Bolivia Time", "CAT": "Central Africa Time", "WART": "Western Argentina Standard Time", "AST": "Atlantic Standard Time", "SGT": "Singapore Standard Time", "WIB": "Western Indonesia Time", "TMST": "Turkmenistan Summer Time", "GMT": "Greenwich Mean Time", "EAT": "East Africa Time", "ACWST": "Australian Central Western Standard Time", "MESZ": "Central European Summer Time", "ChST": "Chamorro Standard Time", "LHST": "Lord Howe Standard Time", "WIT": "Eastern Indonesia Time", "EDT": "Eastern Daylight Time", "UYT": "Uruguay Standard Time", "ECT": "Ecuador Time", "SAST": "South Africa Standard Time", "COT": "Colombia Standard Time", "CLST": "Chile Summer Time", "UYST": "Uruguay Summer Time", "WARST": "Western Argentina Summer Time", "VET": "Venezuela Time", "AKST": "Alaska Standard Time", "JST": "Japan Standard Time", "HNT": "Newfoundland Standard Time", "COST": "Colombia Summer Time", "ACST": "Australian Central Standard Time", "CHADT": "Chatham Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "WAST": "West Africa Summer Time", "BT": "Bhutan Time", "CLT": "Chile Standard Time", "CDT": "Central Daylight Time", "ACDT": "Australian Central Daylight Time", "SRT": "Suriname Time", "MDT": "Macau Summer Time", "WITA": "Central Indonesia Time", "EST": "Eastern Standard Time", "MEZ": "Central European Standard Time", "OEZ": "Eastern European Standard Time", "AEDT": "Australian Eastern Daylight Time", "PDT": "Pacific Daylight Time", "MST": "Macau Standard Time"},
}
}
diff --git a/en_AI/en_AI_test.go b/en_AI/en_AI_test.go
new file mode 100644
index 00000000..7aaa69dc
--- /dev/null
+++ b/en_AI/en_AI_test.go
@@ -0,0 +1,1120 @@
+package en_AI
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_AI"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_AS/en_AS.go b/en_AS/en_AS.go
index 49f92f27..ace9ef66 100644
--- a/en_AS/en_AS.go
+++ b/en_AS/en_AS.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"WAST": "West Africa Summer Time", "HAT": "Newfoundland Daylight Time", "WITA": "Central Indonesia Time", "ART": "Argentina Standard Time", "CST": "Central Standard Time", "NZST": "New Zealand Standard Time", "UYT": "Uruguay Standard Time", "∅∅∅": "Acre Summer Time", "CHADT": "Chatham Daylight Time", "ChST": "Chamorro Standard Time", "HKT": "Hong Kong Standard Time", "OEZ": "Eastern European Standard Time", "ACST": "Australian Central Standard Time", "NZDT": "New Zealand Daylight Time", "WEZ": "Western European Standard Time", "CLST": "Chile Summer Time", "EST": "Eastern Standard Time", "BT": "Bhutan Time", "AWST": "Australian Western Standard Time", "AWDT": "Australian Western Daylight Time", "BOT": "Bolivia Time", "CAT": "Central Africa Time", "COST": "Colombia Summer Time", "MDT": "Macau Summer Time", "PST": "Pacific Standard Time", "ACWDT": "Australian Central Western Daylight Time", "EDT": "Eastern Daylight Time", "COT": "Colombia Standard Time", "ECT": "Ecuador Time", "AKDT": "Alaska Daylight Time", "MYT": "Malaysia Time", "JDT": "Japan Daylight Time", "HNT": "Newfoundland Standard Time", "ACDT": "Australian Central Daylight Time", "CHAST": "Chatham Standard Time", "OESZ": "Eastern European Summer Time", "WAT": "West Africa Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "GMT": "Greenwich Mean Time", "WIT": "Eastern Indonesia Time", "AKST": "Alaska Standard Time", "GYT": "Guyana Time", "JST": "Japan Standard Time", "SGT": "Singapore Standard Time", "IST": "India Standard Time", "TMT": "Turkmenistan Standard Time", "CDT": "Central Daylight Time", "MESZ": "Central European Summer Time", "UYST": "Uruguay Summer Time", "WART": "Western Argentina Standard Time", "ARST": "Argentina Summer Time", "CLT": "Chile Standard Time", "HKST": "Hong Kong Summer Time", "VET": "Venezuela Time", "WESZ": "Western European Summer Time", "ACWST": "Australian Central Western Standard Time", "SAST": "South Africa Standard Time", "MST": "Macau Standard Time", "TMST": "Turkmenistan Summer Time", "PDT": "Pacific Daylight Time", "LHDT": "Lord Howe Daylight Time", "AEDT": "Australian Eastern Daylight Time", "AST": "Atlantic Standard Time", "EAT": "East Africa Time", "SRT": "Suriname Time", "MEZ": "Central European Standard Time", "WIB": "Western Indonesia Time", "GFT": "French Guiana Time", "LHST": "Lord Howe Standard Time", "AEST": "Australian Eastern Standard Time", "ADT": "Atlantic Daylight Time", "WARST": "Western Argentina Summer Time", "HAST": "Hawaii-Aleutian Standard Time"},
+ timezones: map[string]string{"SAST": "South Africa Standard Time", "COT": "Colombia Standard Time", "HAT": "Newfoundland Daylight Time", "CAT": "Central Africa Time", "ARST": "Argentina Summer Time", "ACWDT": "Australian Central Western Daylight Time", "NZDT": "New Zealand Daylight Time", "WESZ": "Western European Summer Time", "LHDT": "Lord Howe Daylight Time", "HKST": "Hong Kong Summer Time", "ART": "Argentina Standard Time", "NZST": "New Zealand Standard Time", "EDT": "Eastern Daylight Time", "JDT": "Japan Daylight Time", "PDT": "Pacific Daylight Time", "SGT": "Singapore Standard Time", "GMT": "Greenwich Mean Time", "MST": "Mountain Standard Time", "UYST": "Uruguay Summer Time", "CDT": "Central Daylight Time", "WITA": "Central Indonesia Time", "IST": "India Standard Time", "HNT": "Newfoundland Standard Time", "CLT": "Chile Standard Time", "WIT": "Eastern Indonesia Time", "EAT": "East Africa Time", "WARST": "Western Argentina Summer Time", "VET": "Venezuela Time", "CST": "Central Standard Time", "HKT": "Hong Kong Standard Time", "AKDT": "Alaska Daylight Time", "ACWST": "Australian Central Western Standard Time", "WEZ": "Western European Standard Time", "WAT": "West Africa Standard Time", "WAST": "West Africa Summer Time", "AEST": "Australian Eastern Standard Time", "GFT": "French Guiana Time", "AWDT": "Australian Western Daylight Time", "BOT": "Bolivia Time", "∅∅∅": "Amazon Summer Time", "PST": "Pacific Standard Time", "COST": "Colombia Summer Time", "TMT": "Turkmenistan Standard Time", "TMST": "Turkmenistan Summer Time", "ChST": "Chamorro Standard Time", "AWST": "Australian Western Standard Time", "AKST": "Alaska Standard Time", "ADT": "Atlantic Daylight Time", "AEDT": "Australian Eastern Daylight Time", "BT": "Bhutan Time", "ACDT": "Australian Central Daylight Time", "ACST": "Australian Central Standard Time", "CHADT": "Chatham Daylight Time", "MEZ": "Central European Standard Time", "CLST": "Chile Summer Time", "LHST": "Lord Howe Standard Time", "WIB": "Western Indonesia Time", "ECT": "Ecuador Time", "CHAST": "Chatham Standard Time", "JST": "Japan Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "EST": "Eastern Standard Time", "OEZ": "Eastern European Standard Time", "MDT": "Mountain Daylight Time", "MYT": "Malaysia Time", "UYT": "Uruguay Standard Time", "WART": "Western Argentina Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "GYT": "Guyana Time", "OESZ": "Eastern European Summer Time", "AST": "Atlantic Standard Time", "MESZ": "Central European Summer Time", "SRT": "Suriname Time"},
}
}
diff --git a/en_AS/en_AS_test.go b/en_AS/en_AS_test.go
new file mode 100644
index 00000000..14f10db2
--- /dev/null
+++ b/en_AS/en_AS_test.go
@@ -0,0 +1,1120 @@
+package en_AS
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_AS"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_AT/en_AT.go b/en_AT/en_AT.go
index be263f5b..5048a94d 100644
--- a/en_AT/en_AT.go
+++ b/en_AT/en_AT.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"AWDT": "Australian Western Daylight Time", "AEDT": "Australian Eastern Daylight Time", "EST": "Eastern Standard Time", "EAT": "East Africa Time", "AKDT": "Alaska Daylight Time", "JST": "Japan Standard Time", "SRT": "Suriname Time", "UYST": "Uruguay Summer Time", "EDT": "Eastern Daylight Time", "SAST": "South Africa Standard Time", "WAST": "West Africa Summer Time", "∅∅∅": "Amazon Summer Time", "ART": "Argentina Standard Time", "WIB": "Western Indonesia Time", "IST": "India Standard Time", "HKST": "Hong Kong Summer Time", "WIT": "Eastern Indonesia Time", "TMST": "Turkmenistan Summer Time", "HADT": "Hawaii-Aleutian Daylight Time", "WARST": "Western Argentina Summer Time", "MST": "Macau Standard Time", "AST": "Atlantic Standard Time", "BT": "Bhutan Time", "HAT": "Newfoundland Daylight Time", "ARST": "Argentina Summer Time", "AEST": "Australian Eastern Standard Time", "LHDT": "Lord Howe Daylight Time", "UYT": "Uruguay Standard Time", "CST": "Central Standard Time", "ACWST": "Australian Central Western Standard Time", "GMT": "Greenwich Mean Time", "MYT": "Malaysia Time", "JDT": "Japan Daylight Time", "ChST": "Chamorro Standard Time", "ACST": "Australian Central Standard Time", "AKST": "Alaska Standard Time", "CAT": "Central Africa Time", "HAST": "Hawaii-Aleutian Standard Time", "SGT": "Singapore Standard Time", "WAT": "West Africa Standard Time", "MDT": "Macau Summer Time", "PDT": "Pacific Daylight Time", "CDT": "Central Daylight Time", "BOT": "Bolivia Time", "CHAST": "Chatham Standard Time", "COT": "Colombia Standard Time", "ECT": "Ecuador Time", "ADT": "Atlantic Daylight Time", "TMT": "Turkmenistan Standard Time", "LHST": "Lord Howe Standard Time", "WITA": "Central Indonesia Time", "CLT": "Chile Standard Time", "WESZ": "Western European Summer Time", "GYT": "Guyana Time", "CHADT": "Chatham Daylight Time", "WEZ": "Western European Standard Time", "CLST": "Chile Summer Time", "OEZ": "Eastern European Standard Time", "OESZ": "Eastern European Summer Time", "HNT": "Newfoundland Standard Time", "MEZ": "Central European Standard Time", "MESZ": "Central European Summer Time", "GFT": "French Guiana Time", "PST": "Pacific Standard Time", "NZDT": "New Zealand Daylight Time", "ACWDT": "Australian Central Western Daylight Time", "HKT": "Hong Kong Standard Time", "NZST": "New Zealand Standard Time", "VET": "Venezuela Time", "COST": "Colombia Summer Time", "WART": "Western Argentina Standard Time", "ACDT": "Australian Central Daylight Time", "AWST": "Australian Western Standard Time"},
+ timezones: map[string]string{"HAST": "Hawaii-Aleutian Standard Time", "EDT": "Eastern Daylight Time", "GFT": "French Guiana Time", "SGT": "Singapore Standard Time", "EAT": "East Africa Time", "BT": "Bhutan Time", "LHDT": "Lord Howe Daylight Time", "WARST": "Western Argentina Summer Time", "CHAST": "Chatham Standard Time", "EST": "Eastern Standard Time", "HAT": "Newfoundland Daylight Time", "TMT": "Turkmenistan Standard Time", "JDT": "Japan Daylight Time", "ACWST": "Australian Central Western Standard Time", "SAST": "South Africa Standard Time", "HKST": "Hong Kong Summer Time", "AWST": "Australian Western Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "AWDT": "Australian Western Daylight Time", "AEDT": "Australian Eastern Daylight Time", "ChST": "Chamorro Standard Time", "CDT": "Central Daylight Time", "AKDT": "Alaska Daylight Time", "AST": "Atlantic Standard Time", "AEST": "Australian Eastern Standard Time", "MESZ": "Central European Summer Time", "UYT": "Uruguay Standard Time", "WART": "Western Argentina Standard Time", "HKT": "Hong Kong Standard Time", "AKST": "Alaska Standard Time", "NZDT": "New Zealand Daylight Time", "COT": "Colombia Standard Time", "WIB": "Western Indonesia Time", "WAST": "West Africa Summer Time", "OEZ": "Eastern European Standard Time", "GMT": "Greenwich Mean Time", "MST": "Macau Standard Time", "NZST": "New Zealand Standard Time", "∅∅∅": "Amazon Summer Time", "LHST": "Lord Howe Standard Time", "SRT": "Suriname Time", "ADT": "Atlantic Daylight Time", "WAT": "West Africa Standard Time", "WIT": "Eastern Indonesia Time", "HNT": "Newfoundland Standard Time", "ACDT": "Australian Central Daylight Time", "CHADT": "Chatham Daylight Time", "PST": "Pacific Standard Time", "PDT": "Pacific Daylight Time", "GYT": "Guyana Time", "UYST": "Uruguay Summer Time", "ACST": "Australian Central Standard Time", "WESZ": "Western European Summer Time", "CLT": "Chile Standard Time", "JST": "Japan Standard Time", "MEZ": "Central European Standard Time", "COST": "Colombia Summer Time", "MDT": "Macau Summer Time", "VET": "Venezuela Time", "IST": "India Standard Time", "TMST": "Turkmenistan Summer Time", "WEZ": "Western European Standard Time", "OESZ": "Eastern European Summer Time", "CLST": "Chile Summer Time", "MYT": "Malaysia Time", "WITA": "Central Indonesia Time", "ACWDT": "Australian Central Western Daylight Time", "ARST": "Argentina Summer Time", "CST": "Central Standard Time", "CAT": "Central Africa Time", "ECT": "Ecuador Time", "ART": "Argentina Standard Time", "BOT": "Bolivia Time"},
}
}
diff --git a/en_AT/en_AT_test.go b/en_AT/en_AT_test.go
new file mode 100644
index 00000000..91a08f03
--- /dev/null
+++ b/en_AT/en_AT_test.go
@@ -0,0 +1,1120 @@
+package en_AT
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_AT"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_AU/en_AU.go b/en_AU/en_AU.go
index b97ccd06..d2777303 100644
--- a/en_AU/en_AU.go
+++ b/en_AU/en_AU.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"HAT": "Newfoundland Daylight Time", "ChST": "Chamorro Standard Time", "ACWST": "Australian Central Western Standard Time", "CST": "Central Standard Time", "NZDT": "New Zealand Daylight Time", "∅∅∅": "Acre Summer Time", "BT": "Bhutan Time", "AKDT": "Alaska Daylight Time", "AWST": "Australian Western Standard Time", "BOT": "Bolivia Time", "CHADT": "Chatham Daylight Time", "WESZ": "Western European Summer Time", "ACWDT": "Australian Central Western Daylight Time", "WITA": "Central Indonesia Time", "TMST": "Turkmenistan Summer Time", "EAT": "Eastern Africa Time", "GYT": "Guyana Time", "JDT": "Japan Summer Time", "WARST": "Western Argentina Summer Time", "WAST": "West Africa Summer Time", "WIT": "Eastern Indonesia Time", "WEZ": "Western European Standard Time", "HKT": "Hong Kong Standard Time", "ACDT": "Australian Central Daylight Time", "LHDT": "Lord Howe Daylight Time", "TMT": "Turkmenistan Standard Time", "AEDT": "Australian Eastern Daylight Time", "ECT": "Ecuador Time", "SAST": "South Africa Standard Time", "OESZ": "Eastern European Summer Time", "ART": "Argentina Standard Time", "ARST": "Argentina Summer Time", "COT": "Colombia Standard Time", "MDT": "Macau Summer Time", "ACST": "Australian Central Standard Time", "AWDT": "Australian Western Daylight Time", "NZST": "New Zealand Standard Time", "EDT": "Eastern Daylight Time", "WAT": "West Africa Standard Time", "UYST": "Uruguay Summer Time", "GMT": "Greenwich Mean Time", "SRT": "Suriname Time", "CLT": "Chile Standard Time", "AST": "Atlantic Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "GFT": "French Guiana Time", "JST": "Japan Standard Time", "PDT": "Pacific Daylight Time", "IST": "India Standard Time", "CDT": "Central Daylight Time", "MESZ": "Central European Summer Time", "COST": "Colombia Summer Time", "VET": "Venezuela Time", "SGT": "Singapore Standard Time", "HKST": "Hong Kong Summer Time", "WIB": "Western Indonesia Time", "MEZ": "Central European Standard Time", "CHAST": "Chatham Standard Time", "OEZ": "Eastern European Standard Time", "PST": "Pacific Standard Time", "AEST": "Australian Eastern Standard Time", "CAT": "Central Africa Time", "ADT": "Atlantic Daylight Time", "WART": "Western Argentina Standard Time", "HNT": "Newfoundland Standard Time", "LHST": "Lord Howe Standard Time", "UYT": "Uruguay Standard Time", "EST": "Eastern Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "MST": "Macau Standard Time", "MYT": "Malaysia Time", "AKST": "Alaska Standard Time", "CLST": "Chile Summer Time"},
+ timezones: map[string]string{"HKST": "Hong Kong Summer Time", "UYST": "Uruguay Summer Time", "ECT": "Ecuador Time", "MST": "Macau Standard Time", "ACWST": "Australian Central Western Standard Time", "WAT": "West Africa Standard Time", "HNT": "Newfoundland Standard Time", "ChST": "Chamorro Standard Time", "OESZ": "Eastern European Summer Time", "TMT": "Turkmenistan Standard Time", "WIT": "Eastern Indonesia Time", "VET": "Venezuela Time", "NZDT": "New Zealand Daylight Time", "CHADT": "Chatham Daylight Time", "AWDT": "Australian Western Daylight Time", "∅∅∅": "Amazon Summer Time", "MYT": "Malaysia Time", "UYT": "Uruguay Standard Time", "EAT": "Eastern Africa Time", "ADT": "Atlantic Daylight Time", "IST": "India Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "BOT": "Bolivia Time", "COT": "Colombia Standard Time", "LHDT": "Lord Howe Daylight Time", "CLST": "Chile Summer Time", "ACST": "Australian Central Standard Time", "EST": "Eastern Standard Time", "AEDT": "Australian Eastern Daylight Time", "WARST": "Western Argentina Summer Time", "CHAST": "Chatham Standard Time", "JST": "Japan Standard Time", "MESZ": "Central European Summer Time", "TMST": "Turkmenistan Summer Time", "HKT": "Hong Kong Standard Time", "MDT": "Macau Summer Time", "AKDT": "Alaska Daylight Time", "PST": "Pacific Standard Time", "NZST": "New Zealand Standard Time", "AEST": "Australian Eastern Standard Time", "GFT": "French Guiana Time", "AST": "Atlantic Standard Time", "ACWDT": "Australian Central Western Daylight Time", "CAT": "Central Africa Time", "BT": "Bhutan Time", "AWST": "Australian Western Standard Time", "AKST": "Alaska Standard Time", "OEZ": "Eastern European Standard Time", "CST": "Central Standard Time", "PDT": "Pacific Daylight Time", "WAST": "West Africa Summer Time", "SGT": "Singapore Standard Time", "WIB": "Western Indonesia Time", "GMT": "Greenwich Mean Time", "GYT": "Guyana Time", "SRT": "Suriname Time", "ARST": "Argentina Summer Time", "WESZ": "Western European Summer Time", "ART": "Argentina Standard Time", "WITA": "Central Indonesia Time", "HADT": "Hawaii-Aleutian Daylight Time", "HAT": "Newfoundland Daylight Time", "LHST": "Lord Howe Standard Time", "JDT": "Japan Summer Time", "MEZ": "Central European Standard Time", "SAST": "South Africa Standard Time", "COST": "Colombia Summer Time", "CLT": "Chile Standard Time", "EDT": "Eastern Daylight Time", "WEZ": "Western European Standard Time", "ACDT": "Australian Central Daylight Time", "WART": "Western Argentina Standard Time", "CDT": "Central Daylight Time"},
}
}
diff --git a/en_AU/en_AU_test.go b/en_AU/en_AU_test.go
new file mode 100644
index 00000000..8b384f37
--- /dev/null
+++ b/en_AU/en_AU_test.go
@@ -0,0 +1,1120 @@
+package en_AU
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_AU"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_BB/en_BB.go b/en_BB/en_BB.go
index 88e8310c..caf37840 100644
--- a/en_BB/en_BB.go
+++ b/en_BB/en_BB.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"WESZ": "Western European Summer Time", "BT": "Bhutan Time", "HKT": "Hong Kong Standard Time", "ART": "Argentina Standard Time", "PDT": "Pacific Daylight Time", "SRT": "Suriname Time", "NZST": "New Zealand Standard Time", "AST": "Atlantic Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "EAT": "East Africa Time", "JDT": "Japan Daylight Time", "OESZ": "Eastern European Summer Time", "HAT": "Newfoundland Daylight Time", "MST": "Macau Standard Time", "CST": "Central Standard Time", "BOT": "Bolivia Time", "CLST": "Chile Summer Time", "ACWST": "Australian Central Western Standard Time", "AEDT": "Australian Eastern Daylight Time", "TMST": "Turkmenistan Summer Time", "AKST": "Alaska Standard Time", "VET": "Venezuela Time", "WIB": "Western Indonesia Time", "LHST": "Lord Howe Standard Time", "NZDT": "New Zealand Daylight Time", "UYT": "Uruguay Standard Time", "CHADT": "Chatham Daylight Time", "CLT": "Chile Standard Time", "AEST": "Australian Eastern Standard Time", "ECT": "Ecuador Time", "SAST": "South Africa Standard Time", "ACST": "Australian Central Standard Time", "LHDT": "Lord Howe Daylight Time", "PST": "Pacific Standard Time", "AWST": "Australian Western Standard Time", "EDT": "Eastern Daylight Time", "ARST": "Argentina Summer Time", "JST": "Japan Standard Time", "AWDT": "Australian Western Daylight Time", "WEZ": "Western European Standard Time", "COST": "Colombia Summer Time", "OEZ": "Eastern European Standard Time", "TMT": "Turkmenistan Standard Time", "AKDT": "Alaska Daylight Time", "WARST": "Western Argentina Summer Time", "GMT": "Greenwich Mean Time", "ACWDT": "Australian Central Western Daylight Time", "SGT": "Singapore Standard Time", "MYT": "Malaysia Time", "MESZ": "Central European Summer Time", "∅∅∅": "Amazon Summer Time", "ACDT": "Australian Central Daylight Time", "WAT": "West Africa Standard Time", "GFT": "French Guiana Time", "HAST": "Hawaii-Aleutian Standard Time", "WAST": "West Africa Summer Time", "WITA": "Central Indonesia Time", "HNT": "Newfoundland Standard Time", "UYST": "Uruguay Summer Time", "ChST": "Chamorro Standard Time", "WIT": "Eastern Indonesia Time", "IST": "India Standard Time", "MDT": "Macau Summer Time", "WART": "Western Argentina Standard Time", "MEZ": "Central European Standard Time", "CAT": "Central Africa Time", "GYT": "Guyana Time", "CDT": "Central Daylight Time", "HKST": "Hong Kong Summer Time", "COT": "Colombia Standard Time", "ADT": "Atlantic Daylight Time", "CHAST": "Chatham Standard Time", "EST": "Eastern Standard Time"},
+ timezones: map[string]string{"∅∅∅": "Peru Summer Time", "CST": "Central Standard Time", "HKST": "Hong Kong Summer Time", "GYT": "Guyana Time", "MYT": "Malaysia Time", "HKT": "Hong Kong Standard Time", "ECT": "Ecuador Time", "JST": "Japan Standard Time", "HAT": "Newfoundland Daylight Time", "UYT": "Uruguay Standard Time", "WIT": "Eastern Indonesia Time", "EAT": "East Africa Time", "AST": "Atlantic Standard Time", "ACWDT": "Australian Central Western Daylight Time", "AKDT": "Alaska Daylight Time", "MEZ": "Central European Standard Time", "UYST": "Uruguay Summer Time", "AWDT": "Australian Western Daylight Time", "BOT": "Bolivia Time", "COST": "Colombia Summer Time", "TMST": "Turkmenistan Summer Time", "BT": "Bhutan Time", "ChST": "Chamorro Standard Time", "CHAST": "Chatham Standard Time", "ARST": "Argentina Summer Time", "SGT": "Singapore Standard Time", "AEST": "Australian Eastern Standard Time", "ACWST": "Australian Central Western Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "GMT": "Greenwich Mean Time", "OEZ": "Eastern European Standard Time", "MDT": "Mountain Daylight Time", "GFT": "French Guiana Time", "VET": "Venezuela Time", "WEZ": "Western European Standard Time", "WARST": "Western Argentina Summer Time", "AKST": "Alaska Standard Time", "PST": "Pacific Standard Time", "WAST": "West Africa Summer Time", "SRT": "Suriname Time", "MESZ": "Central European Summer Time", "WESZ": "Western European Summer Time", "AWST": "Australian Western Standard Time", "WITA": "Central Indonesia Time", "JDT": "Japan Daylight Time", "IST": "India Standard Time", "EDT": "Eastern Daylight Time", "CLST": "Chile Summer Time", "ACDT": "Australian Central Daylight Time", "ADT": "Atlantic Daylight Time", "OESZ": "Eastern European Summer Time", "ACST": "Australian Central Standard Time", "PDT": "Pacific Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "CAT": "Central Africa Time", "WIB": "Western Indonesia Time", "MST": "Mountain Standard Time", "CLT": "Chile Standard Time", "WART": "Western Argentina Standard Time", "CDT": "Central Daylight Time", "ART": "Argentina Standard Time", "SAST": "South Africa Standard Time", "HNT": "Newfoundland Standard Time", "LHST": "Lord Howe Standard Time", "CHADT": "Chatham Daylight Time", "NZDT": "New Zealand Daylight Time", "WAT": "West Africa Standard Time", "COT": "Colombia Standard Time", "TMT": "Turkmenistan Standard Time", "AEDT": "Australian Eastern Daylight Time", "LHDT": "Lord Howe Daylight Time", "EST": "Eastern Standard Time", "NZST": "New Zealand Standard Time"},
}
}
@@ -112,8 +112,8 @@ func (en *en_BB) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
func (en *en_BB) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
n := math.Abs(num)
- nMod100 := math.Mod(n, 100)
nMod10 := math.Mod(n, 10)
+ nMod100 := math.Mod(n, 100)
if nMod10 == 1 && nMod100 != 11 {
return locales.PluralRuleOne
diff --git a/en_BB/en_BB_test.go b/en_BB/en_BB_test.go
new file mode 100644
index 00000000..98f325b6
--- /dev/null
+++ b/en_BB/en_BB_test.go
@@ -0,0 +1,1120 @@
+package en_BB
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_BB"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_BE/en_BE.go b/en_BE/en_BE.go
index b726653b..b9c480bf 100644
--- a/en_BE/en_BE.go
+++ b/en_BE/en_BE.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"GYT": "Guyana Time", "NZDT": "New Zealand Daylight Time", "GMT": "Greenwich Mean Time", "ART": "Argentina Standard Time", "WESZ": "Western European Summer Time", "ECT": "Ecuador Time", "EAT": "East Africa Time", "WARST": "Western Argentina Summer Time", "AKST": "Alaska Standard Time", "AKDT": "Alaska Daylight Time", "LHDT": "Lord Howe Daylight Time", "MST": "Mountain Standard Time", "COT": "Colombia Standard Time", "COST": "Colombia Summer Time", "MESZ": "Central European Summer Time", "UYT": "Uruguay Standard Time", "SAST": "South Africa Standard Time", "MEZ": "Central European Standard Time", "AEDT": "Australian Eastern Daylight Time", "MDT": "Mountain Daylight Time", "HNT": "Newfoundland Standard Time", "TMST": "Turkmenistan Summer Time", "AWST": "Australian Western Standard Time", "BOT": "Bolivia Time", "ChST": "Chamorro Standard Time", "EDT": "Eastern Daylight Time", "SGT": "Singapore Standard Time", "HKT": "Hong Kong Standard Time", "CHADT": "Chatham Daylight Time", "CLT": "Chile Standard Time", "WAST": "West Africa Summer Time", "WEZ": "Western European Standard Time", "BT": "Bhutan Time", "OEZ": "Eastern European Standard Time", "PST": "Pacific Standard Time", "MYT": "Malaysia Time", "CHAST": "Chatham Standard Time", "VET": "Venezuela Time", "ACDT": "Australian Central Daylight Time", "JST": "Japan Standard Time", "CDT": "Central Daylight Time", "ACWDT": "Australian Central Western Daylight Time", "WAT": "West Africa Standard Time", "ARST": "Argentina Summer Time", "TMT": "Turkmenistan Standard Time", "LHST": "Lord Howe Standard Time", "UYST": "Uruguay Summer Time", "AST": "Atlantic Standard Time", "IST": "India Standard Time", "GFT": "French Guiana Time", "ACST": "Australian Central Standard Time", "∅∅∅": "Azores Summer Time", "CST": "Central Standard Time", "ADT": "Atlantic Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "WIT": "Eastern Indonesia Time", "CAT": "Central Africa Time", "HAT": "Newfoundland Daylight Time", "WITA": "Central Indonesia Time", "AWDT": "Australian Western Daylight Time", "SRT": "Suriname Time", "ACWST": "Australian Central Western Standard Time", "CLST": "Chile Summer Time", "EST": "Eastern Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "OESZ": "Eastern European Summer Time", "WIB": "Western Indonesia Time", "PDT": "Pacific Daylight Time", "JDT": "Japan Daylight Time", "NZST": "New Zealand Standard Time", "AEST": "Australian Eastern Standard Time", "HKST": "Hong Kong Summer Time", "WART": "Western Argentina Standard Time"},
+ timezones: map[string]string{"HAST": "Hawaii-Aleutian Standard Time", "EST": "Eastern Standard Time", "HKT": "Hong Kong Standard Time", "CHAST": "Chatham Standard Time", "AWDT": "Australian Western Daylight Time", "SRT": "Suriname Time", "VET": "Venezuela Time", "AKDT": "Alaska Daylight Time", "BOT": "Bolivia Time", "WAT": "West Africa Standard Time", "CDT": "Central Daylight Time", "COT": "Colombia Standard Time", "AEST": "Australian Eastern Standard Time", "ECT": "Ecuador Time", "ACWST": "Australian Central Western Standard Time", "IST": "India Standard Time", "ChST": "Chamorro Standard Time", "ACST": "Australian Central Standard Time", "ART": "Argentina Standard Time", "WIB": "Western Indonesia Time", "HNT": "Newfoundland Standard Time", "WART": "Western Argentina Standard Time", "MESZ": "Central European Summer Time", "UYT": "Uruguay Standard Time", "LHDT": "Lord Howe Daylight Time", "ARST": "Argentina Summer Time", "∅∅∅": "Amazon Summer Time", "OESZ": "Eastern European Summer Time", "EDT": "Eastern Daylight Time", "WEZ": "Western European Standard Time", "EAT": "East Africa Time", "CST": "Central Standard Time", "MDT": "Macau Summer Time", "AKST": "Alaska Standard Time", "ADT": "Atlantic Daylight Time", "TMST": "Turkmenistan Summer Time", "WIT": "Eastern Indonesia Time", "ACDT": "Australian Central Daylight Time", "MST": "Macau Standard Time", "WITA": "Central Indonesia Time", "HADT": "Hawaii-Aleutian Daylight Time", "CLT": "Chile Standard Time", "CLST": "Chile Summer Time", "MYT": "Malaysia Time", "NZDT": "New Zealand Daylight Time", "MEZ": "Central European Standard Time", "TMT": "Turkmenistan Standard Time", "BT": "Bhutan Time", "PDT": "Pacific Daylight Time", "CAT": "Central Africa Time", "WAST": "West Africa Summer Time", "SGT": "Singapore Standard Time", "GYT": "Guyana Time", "AWST": "Australian Western Standard Time", "NZST": "New Zealand Standard Time", "SAST": "South Africa Standard Time", "CHADT": "Chatham Daylight Time", "LHST": "Lord Howe Standard Time", "WARST": "Western Argentina Summer Time", "OEZ": "Eastern European Standard Time", "AEDT": "Australian Eastern Daylight Time", "HKST": "Hong Kong Summer Time", "COST": "Colombia Summer Time", "WESZ": "Western European Summer Time", "UYST": "Uruguay Summer Time", "GFT": "French Guiana Time", "JDT": "Japan Daylight Time", "AST": "Atlantic Standard Time", "GMT": "Greenwich Mean Time", "HAT": "Newfoundland Daylight Time", "JST": "Japan Standard Time", "ACWDT": "Australian Central Western Daylight Time", "PST": "Pacific Standard Time"},
}
}
diff --git a/en_BE/en_BE_test.go b/en_BE/en_BE_test.go
new file mode 100644
index 00000000..1ac06277
--- /dev/null
+++ b/en_BE/en_BE_test.go
@@ -0,0 +1,1120 @@
+package en_BE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_BE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_BI/en_BI.go b/en_BI/en_BI.go
index ec18ee72..3cb407a7 100644
--- a/en_BI/en_BI.go
+++ b/en_BI/en_BI.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"GFT": "French Guiana Time", "MYT": "Malaysia Time", "SRT": "Suriname Time", "CST": "Central Standard Time", "AEST": "Australian Eastern Standard Time", "WAST": "West Africa Summer Time", "HKST": "Hong Kong Summer Time", "WIB": "Western Indonesia Time", "MST": "Macau Standard Time", "GYT": "Guyana Time", "WEZ": "Western European Standard Time", "∅∅∅": "Acre Summer Time", "EAT": "East Africa Time", "MDT": "Macau Summer Time", "ACWST": "Australian Central Western Standard Time", "ARST": "Argentina Summer Time", "AWDT": "Australian Western Daylight Time", "UYT": "Uruguay Standard Time", "UYST": "Uruguay Summer Time", "ECT": "Ecuador Time", "OEZ": "Eastern European Standard Time", "TMT": "Turkmenistan Standard Time", "JST": "Japan Standard Time", "NZDT": "New Zealand Daylight Time", "ACWDT": "Australian Central Western Daylight Time", "WIT": "Eastern Indonesia Time", "ART": "Argentina Standard Time", "ChST": "Chamorro Standard Time", "BT": "Bhutan Time", "WART": "Western Argentina Standard Time", "JDT": "Japan Daylight Time", "MESZ": "Central European Summer Time", "CAT": "Central Africa Time", "COST": "Colombia Summer Time", "AST": "Atlantic Standard Time", "WARST": "Western Argentina Summer Time", "GMT": "Greenwich Mean Time", "ACST": "Australian Central Standard Time", "VET": "Venezuela Time", "CHAST": "Chatham Standard Time", "HAT": "Newfoundland Daylight Time", "WITA": "Central Indonesia Time", "PST": "Pacific Standard Time", "LHDT": "Lord Howe Daylight Time", "MEZ": "Central European Standard Time", "CLST": "Chile Summer Time", "HKT": "Hong Kong Standard Time", "HNT": "Newfoundland Standard Time", "LHST": "Lord Howe Standard Time", "COT": "Colombia Standard Time", "TMST": "Turkmenistan Summer Time", "AKST": "Alaska Standard Time", "PDT": "Pacific Daylight Time", "BOT": "Bolivia Time", "EST": "Eastern Standard Time", "ADT": "Atlantic Daylight Time", "SAST": "South Africa Standard Time", "CHADT": "Chatham Daylight Time", "EDT": "Eastern Daylight Time", "CLT": "Chile Standard Time", "AEDT": "Australian Eastern Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "SGT": "Singapore Standard Time", "ACDT": "Australian Central Daylight Time", "AKDT": "Alaska Daylight Time", "AWST": "Australian Western Standard Time", "CDT": "Central Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "WAT": "West Africa Standard Time", "IST": "India Standard Time", "OESZ": "Eastern European Summer Time", "NZST": "New Zealand Standard Time", "WESZ": "Western European Summer Time"},
+ timezones: map[string]string{"CLST": "Chile Summer Time", "UYT": "Uruguay Standard Time", "ARST": "Argentina Summer Time", "EST": "Eastern Standard Time", "CAT": "Central Africa Time", "MYT": "Malaysia Time", "WITA": "Central Indonesia Time", "OEZ": "Eastern European Standard Time", "COT": "Colombia Standard Time", "EAT": "East Africa Time", "WART": "Western Argentina Standard Time", "MDT": "Macau Summer Time", "TMT": "Turkmenistan Standard Time", "GMT": "Greenwich Mean Time", "ChST": "Chamorro Standard Time", "IST": "India Standard Time", "LHDT": "Lord Howe Daylight Time", "CDT": "Central Daylight Time", "ACWDT": "Australian Central Western Daylight Time", "AWDT": "Australian Western Daylight Time", "NZST": "New Zealand Standard Time", "BOT": "Bolivia Time", "AEDT": "Australian Eastern Daylight Time", "ADT": "Atlantic Daylight Time", "MESZ": "Central European Summer Time", "WAST": "West Africa Summer Time", "HNT": "Newfoundland Standard Time", "∅∅∅": "Azores Summer Time", "AKST": "Alaska Standard Time", "NZDT": "New Zealand Daylight Time", "ACST": "Australian Central Standard Time", "AKDT": "Alaska Daylight Time", "SGT": "Singapore Standard Time", "COST": "Colombia Summer Time", "WEZ": "Western European Standard Time", "GFT": "French Guiana Time", "MST": "Macau Standard Time", "HKT": "Hong Kong Standard Time", "CHAST": "Chatham Standard Time", "HAT": "Newfoundland Daylight Time", "OESZ": "Eastern European Summer Time", "ACDT": "Australian Central Daylight Time", "SRT": "Suriname Time", "HADT": "Hawaii-Aleutian Daylight Time", "GYT": "Guyana Time", "JDT": "Japan Daylight Time", "AWST": "Australian Western Standard Time", "PDT": "Pacific Daylight Time", "LHST": "Lord Howe Standard Time", "VET": "Venezuela Time", "AST": "Atlantic Standard Time", "WIT": "Eastern Indonesia Time", "UYST": "Uruguay Summer Time", "BT": "Bhutan Time", "WARST": "Western Argentina Summer Time", "HKST": "Hong Kong Summer Time", "WIB": "Western Indonesia Time", "TMST": "Turkmenistan Summer Time", "AEST": "Australian Eastern Standard Time", "SAST": "South Africa Standard Time", "PST": "Pacific Standard Time", "WAT": "West Africa Standard Time", "CST": "Central Standard Time", "CHADT": "Chatham Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "CLT": "Chile Standard Time", "EDT": "Eastern Daylight Time", "ART": "Argentina Standard Time", "JST": "Japan Standard Time", "ACWST": "Australian Central Western Standard Time", "MEZ": "Central European Standard Time", "ECT": "Ecuador Time", "WESZ": "Western European Summer Time"},
}
}
diff --git a/en_BI/en_BI_test.go b/en_BI/en_BI_test.go
new file mode 100644
index 00000000..0598ee69
--- /dev/null
+++ b/en_BI/en_BI_test.go
@@ -0,0 +1,1120 @@
+package en_BI
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_BI"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_BM/en_BM.go b/en_BM/en_BM.go
index d6695ffe..b6c34e7f 100644
--- a/en_BM/en_BM.go
+++ b/en_BM/en_BM.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"TMT": "Turkmenistan Standard Time", "WESZ": "Western European Summer Time", "ChST": "Chamorro Standard Time", "ADT": "Atlantic Daylight Time", "HKT": "Hong Kong Standard Time", "HAT": "Newfoundland Daylight Time", "UYT": "Uruguay Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "IST": "India Standard Time", "MST": "Macau Standard Time", "WEZ": "Western European Standard Time", "CLST": "Chile Summer Time", "MDT": "Macau Summer Time", "UYST": "Uruguay Summer Time", "GFT": "French Guiana Time", "ACWDT": "Australian Central Western Daylight Time", "AEST": "Australian Eastern Standard Time", "VET": "Venezuela Time", "EST": "Eastern Standard Time", "AST": "Atlantic Standard Time", "SGT": "Singapore Standard Time", "∅∅∅": "Amazon Summer Time", "LHST": "Lord Howe Standard Time", "AEDT": "Australian Eastern Daylight Time", "CHADT": "Chatham Daylight Time", "WAST": "West Africa Summer Time", "EAT": "East Africa Time", "WITA": "Central Indonesia Time", "ACST": "Australian Central Standard Time", "AWST": "Australian Western Standard Time", "JST": "Japan Standard Time", "BOT": "Bolivia Time", "WARST": "Western Argentina Summer Time", "OEZ": "Eastern European Standard Time", "ART": "Argentina Standard Time", "AKST": "Alaska Standard Time", "PST": "Pacific Standard Time", "GYT": "Guyana Time", "EDT": "Eastern Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "WIB": "Western Indonesia Time", "HNT": "Newfoundland Standard Time", "ACDT": "Australian Central Daylight Time", "MEZ": "Central European Standard Time", "MESZ": "Central European Summer Time", "CLT": "Chile Standard Time", "ECT": "Ecuador Time", "WART": "Western Argentina Standard Time", "WAT": "West Africa Standard Time", "JDT": "Japan Daylight Time", "SRT": "Suriname Time", "CST": "Central Standard Time", "NZST": "New Zealand Standard Time", "COST": "Colombia Summer Time", "SAST": "South Africa Standard Time", "ARST": "Argentina Summer Time", "ACWST": "Australian Central Western Standard Time", "CHAST": "Chatham Standard Time", "BT": "Bhutan Time", "GMT": "Greenwich Mean Time", "WIT": "Eastern Indonesia Time", "AKDT": "Alaska Daylight Time", "PDT": "Pacific Daylight Time", "AWDT": "Australian Western Daylight Time", "CDT": "Central Daylight Time", "CAT": "Central Africa Time", "COT": "Colombia Standard Time", "TMST": "Turkmenistan Summer Time", "MYT": "Malaysia Time", "NZDT": "New Zealand Daylight Time", "HKST": "Hong Kong Summer Time", "LHDT": "Lord Howe Daylight Time", "OESZ": "Eastern European Summer Time"},
+ timezones: map[string]string{"CST": "Central Standard Time", "ACDT": "Australian Central Daylight Time", "WART": "Western Argentina Standard Time", "ACWST": "Australian Central Western Standard Time", "CAT": "Central Africa Time", "UYST": "Uruguay Summer Time", "WESZ": "Western European Summer Time", "WIB": "Western Indonesia Time", "WITA": "Central Indonesia Time", "EAT": "East Africa Time", "CHAST": "Chatham Standard Time", "VET": "Venezuela Time", "BOT": "Bolivia Time", "MESZ": "Central European Summer Time", "AEST": "Australian Eastern Standard Time", "AEDT": "Australian Eastern Daylight Time", "CLST": "Chile Summer Time", "SRT": "Suriname Time", "HKT": "Hong Kong Standard Time", "ARST": "Argentina Summer Time", "WAST": "West Africa Summer Time", "WEZ": "Western European Standard Time", "COST": "Colombia Summer Time", "ChST": "Chamorro Standard Time", "MYT": "Malaysia Time", "UYT": "Uruguay Standard Time", "AWST": "Australian Western Standard Time", "ART": "Argentina Standard Time", "EDT": "Eastern Daylight Time", "NZDT": "New Zealand Daylight Time", "COT": "Colombia Standard Time", "PDT": "Pacific Daylight Time", "WIT": "Eastern Indonesia Time", "LHDT": "Lord Howe Daylight Time", "MST": "Mountain Standard Time", "MDT": "Mountain Daylight Time", "∅∅∅": "Brasilia Summer Time", "WARST": "Western Argentina Summer Time", "AKDT": "Alaska Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "NZST": "New Zealand Standard Time", "TMST": "Turkmenistan Summer Time", "WAT": "West Africa Standard Time", "ADT": "Atlantic Daylight Time", "IST": "India Standard Time", "HAT": "Newfoundland Daylight Time", "GMT": "Greenwich Mean Time", "GFT": "French Guiana Time", "ECT": "Ecuador Time", "GYT": "Guyana Time", "BT": "Bhutan Time", "AST": "Atlantic Standard Time", "OESZ": "Eastern European Summer Time", "ACST": "Australian Central Standard Time", "HKST": "Hong Kong Summer Time", "TMT": "Turkmenistan Standard Time", "CLT": "Chile Standard Time", "AWDT": "Australian Western Daylight Time", "SAST": "South Africa Standard Time", "LHST": "Lord Howe Standard Time", "MEZ": "Central European Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "CDT": "Central Daylight Time", "AKST": "Alaska Standard Time", "JDT": "Japan Daylight Time", "EST": "Eastern Standard Time", "PST": "Pacific Standard Time", "SGT": "Singapore Standard Time", "OEZ": "Eastern European Standard Time", "CHADT": "Chatham Daylight Time", "ACWDT": "Australian Central Western Daylight Time", "JST": "Japan Standard Time", "HNT": "Newfoundland Standard Time"},
}
}
diff --git a/en_BM/en_BM_test.go b/en_BM/en_BM_test.go
new file mode 100644
index 00000000..780cd0bc
--- /dev/null
+++ b/en_BM/en_BM_test.go
@@ -0,0 +1,1120 @@
+package en_BM
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_BM"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_BS/en_BS.go b/en_BS/en_BS.go
index 5acc4282..0542233d 100644
--- a/en_BS/en_BS.go
+++ b/en_BS/en_BS.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"MEZ": "Central European Standard Time", "CLT": "Chile Standard Time", "ART": "Argentina Standard Time", "MESZ": "Central European Summer Time", "WEZ": "Western European Standard Time", "JST": "Japan Standard Time", "JDT": "Japan Daylight Time", "PDT": "Pacific Daylight Time", "AWST": "Australian Western Standard Time", "CHADT": "Chatham Daylight Time", "TMST": "Turkmenistan Summer Time", "PST": "Pacific Standard Time", "VET": "Venezuela Time", "ECT": "Ecuador Time", "GYT": "Guyana Time", "ACWDT": "Australian Central Western Daylight Time", "AEST": "Australian Eastern Standard Time", "AEDT": "Australian Eastern Daylight Time", "WAST": "West Africa Summer Time", "GFT": "French Guiana Time", "ARST": "Argentina Summer Time", "LHST": "Lord Howe Standard Time", "AST": "Atlantic Standard Time", "BT": "Bhutan Time", "MDT": "Macau Summer Time", "SRT": "Suriname Time", "UYST": "Uruguay Summer Time", "EST": "Eastern Standard Time", "ADT": "Atlantic Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "HAT": "Newfoundland Daylight Time", "MST": "Macau Standard Time", "WESZ": "Western European Summer Time", "ChST": "Chamorro Standard Time", "CAT": "Central Africa Time", "WAT": "West Africa Standard Time", "HKT": "Hong Kong Standard Time", "HKST": "Hong Kong Summer Time", "NZDT": "New Zealand Daylight Time", "WIT": "Eastern Indonesia Time", "WIB": "Western Indonesia Time", "EAT": "East Africa Time", "TMT": "Turkmenistan Standard Time", "EDT": "Eastern Daylight Time", "LHDT": "Lord Howe Daylight Time", "NZST": "New Zealand Standard Time", "BOT": "Bolivia Time", "COST": "Colombia Summer Time", "SGT": "Singapore Standard Time", "SAST": "South Africa Standard Time", "WARST": "Western Argentina Summer Time", "OEZ": "Eastern European Standard Time", "GMT": "Greenwich Mean Time", "AKDT": "Alaska Daylight Time", "AWDT": "Australian Western Daylight Time", "CLST": "Chile Summer Time", "COT": "Colombia Standard Time", "∅∅∅": "Amazon Summer Time", "CHAST": "Chatham Standard Time", "IST": "India Standard Time", "ACDT": "Australian Central Daylight Time", "MYT": "Malaysia Time", "CST": "Central Standard Time", "ACWST": "Australian Central Western Standard Time", "WART": "Western Argentina Standard Time", "OESZ": "Eastern European Summer Time", "WITA": "Central Indonesia Time", "ACST": "Australian Central Standard Time", "AKST": "Alaska Standard Time", "CDT": "Central Daylight Time", "UYT": "Uruguay Standard Time", "HNT": "Newfoundland Standard Time"},
+ timezones: map[string]string{"AEST": "Australian Eastern Standard Time", "EAT": "East Africa Time", "ACST": "Australian Central Standard Time", "CHAST": "Chatham Standard Time", "COT": "Colombia Standard Time", "BOT": "Bolivia Time", "TMST": "Turkmenistan Summer Time", "OEZ": "Eastern European Standard Time", "MDT": "Mountain Daylight Time", "JST": "Japan Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "WEZ": "Western European Standard Time", "HAT": "Newfoundland Daylight Time", "UYST": "Uruguay Summer Time", "WART": "Western Argentina Standard Time", "AWDT": "Australian Western Daylight Time", "NZST": "New Zealand Standard Time", "MESZ": "Central European Summer Time", "CLT": "Chile Standard Time", "HKST": "Hong Kong Summer Time", "PST": "Pacific Standard Time", "HNT": "Newfoundland Standard Time", "ECT": "Ecuador Time", "AWST": "Australian Western Standard Time", "WESZ": "Western European Summer Time", "CAT": "Central Africa Time", "WARST": "Western Argentina Summer Time", "WAT": "West Africa Standard Time", "CHADT": "Chatham Daylight Time", "WITA": "Central Indonesia Time", "SRT": "Suriname Time", "EDT": "Eastern Daylight Time", "∅∅∅": "Amazon Summer Time", "LHST": "Lord Howe Standard Time", "VET": "Venezuela Time", "ACWDT": "Australian Central Western Daylight Time", "ARST": "Argentina Summer Time", "IST": "India Standard Time", "HKT": "Hong Kong Standard Time", "AST": "Atlantic Standard Time", "WIT": "Eastern Indonesia Time", "GYT": "Guyana Time", "MYT": "Malaysia Time", "UYT": "Uruguay Standard Time", "GFT": "French Guiana Time", "NZDT": "New Zealand Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "GMT": "Greenwich Mean Time", "MST": "Mountain Standard Time", "ART": "Argentina Standard Time", "PDT": "Pacific Daylight Time", "WAST": "West Africa Summer Time", "WIB": "Western Indonesia Time", "AEDT": "Australian Eastern Daylight Time", "ChST": "Chamorro Standard Time", "BT": "Bhutan Time", "ADT": "Atlantic Daylight Time", "JDT": "Japan Daylight Time", "SAST": "South Africa Standard Time", "AKST": "Alaska Standard Time", "TMT": "Turkmenistan Standard Time", "OESZ": "Eastern European Summer Time", "CLST": "Chile Summer Time", "CDT": "Central Daylight Time", "MEZ": "Central European Standard Time", "LHDT": "Lord Howe Daylight Time", "EST": "Eastern Standard Time", "COST": "Colombia Summer Time", "ACDT": "Australian Central Daylight Time", "CST": "Central Standard Time", "ACWST": "Australian Central Western Standard Time", "AKDT": "Alaska Daylight Time", "SGT": "Singapore Standard Time"},
}
}
diff --git a/en_BS/en_BS_test.go b/en_BS/en_BS_test.go
new file mode 100644
index 00000000..08053d11
--- /dev/null
+++ b/en_BS/en_BS_test.go
@@ -0,0 +1,1120 @@
+package en_BS
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_BS"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_BW/en_BW.go b/en_BW/en_BW.go
index eeff3ca9..949ae575 100644
--- a/en_BW/en_BW.go
+++ b/en_BW/en_BW.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"MDT": "Macau Summer Time", "NZDT": "New Zealand Daylight Time", "CHAST": "Chatham Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "WAT": "West Africa Standard Time", "IST": "India Standard Time", "OEZ": "Eastern European Standard Time", "GFT": "French Guiana Time", "EAT": "East Africa Time", "ARST": "Argentina Summer Time", "AWST": "Australian Western Standard Time", "EDT": "Eastern Daylight Time", "COT": "Colombia Standard Time", "TMST": "Turkmenistan Summer Time", "JST": "Japan Standard Time", "CLST": "Chile Summer Time", "SGT": "Singapore Standard Time", "BT": "Bhutan Time", "HKT": "Hong Kong Standard Time", "CLT": "Chile Standard Time", "HAT": "Newfoundland Daylight Time", "AKDT": "Alaska Daylight Time", "ChST": "Chamorro Standard Time", "CAT": "Central Africa Time", "WARST": "Western Argentina Summer Time", "GMT": "Greenwich Mean Time", "AEST": "Australian Eastern Standard Time", "CHADT": "Chatham Daylight Time", "COST": "Colombia Summer Time", "AST": "Atlantic Standard Time", "WART": "Western Argentina Standard Time", "LHDT": "Lord Howe Daylight Time", "AEDT": "Australian Eastern Daylight Time", "HNT": "Newfoundland Standard Time", "ACST": "Australian Central Standard Time", "SRT": "Suriname Time", "PST": "Pacific Standard Time", "ADT": "Atlantic Daylight Time", "WIB": "Western Indonesia Time", "WITA": "Central Indonesia Time", "ACDT": "Australian Central Daylight Time", "JDT": "Japan Daylight Time", "LHST": "Lord Howe Standard Time", "CST": "Central Standard Time", "WESZ": "Western European Summer Time", "WIT": "Eastern Indonesia Time", "MESZ": "Central European Summer Time", "BOT": "Bolivia Time", "VET": "Venezuela Time", "ACWDT": "Australian Central Western Daylight Time", "SAST": "South Africa Standard Time", "WAST": "West Africa Summer Time", "∅∅∅": "Amazon Summer Time", "AKST": "Alaska Standard Time", "AWDT": "Australian Western Daylight Time", "UYST": "Uruguay Summer Time", "HADT": "Hawaii-Aleutian Daylight Time", "HKST": "Hong Kong Summer Time", "MST": "Macau Standard Time", "GYT": "Guyana Time", "NZST": "New Zealand Standard Time", "UYT": "Uruguay Standard Time", "ACWST": "Australian Central Western Standard Time", "EST": "Eastern Standard Time", "ECT": "Ecuador Time", "OESZ": "Eastern European Summer Time", "MYT": "Malaysia Time", "MEZ": "Central European Standard Time", "ART": "Argentina Standard Time", "TMT": "Turkmenistan Standard Time", "PDT": "Pacific Daylight Time", "CDT": "Central Daylight Time", "WEZ": "Western European Standard Time"},
+ timezones: map[string]string{"ADT": "Atlantic Daylight Time", "ARST": "Argentina Summer Time", "TMT": "Turkmenistan Standard Time", "ACST": "Australian Central Standard Time", "EST": "Eastern Standard Time", "WAT": "West Africa Standard Time", "WEZ": "Western European Standard Time", "LHST": "Lord Howe Standard Time", "MYT": "Malaysia Time", "CST": "Central Standard Time", "HKT": "Hong Kong Standard Time", "AWDT": "Australian Western Daylight Time", "COST": "Colombia Summer Time", "CLT": "Chile Standard Time", "OEZ": "Eastern European Standard Time", "AEST": "Australian Eastern Standard Time", "HKST": "Hong Kong Summer Time", "VET": "Venezuela Time", "ACWST": "Australian Central Western Standard Time", "JST": "Japan Standard Time", "COT": "Colombia Standard Time", "WIB": "Western Indonesia Time", "AEDT": "Australian Eastern Daylight Time", "GYT": "Guyana Time", "MDT": "Macau Summer Time", "MESZ": "Central European Summer Time", "NZDT": "New Zealand Daylight Time", "GMT": "Greenwich Mean Time", "ACDT": "Australian Central Daylight Time", "AKDT": "Alaska Daylight Time", "CAT": "Central Africa Time", "BT": "Bhutan Time", "WART": "Western Argentina Standard Time", "∅∅∅": "Azores Summer Time", "HAST": "Hawaii-Aleutian Standard Time", "BOT": "Bolivia Time", "UYST": "Uruguay Summer Time", "WARST": "Western Argentina Summer Time", "CHADT": "Chatham Daylight Time", "AWST": "Australian Western Standard Time", "WITA": "Central Indonesia Time", "PDT": "Pacific Daylight Time", "ACWDT": "Australian Central Western Daylight Time", "JDT": "Japan Daylight Time", "ChST": "Chamorro Standard Time", "CLST": "Chile Summer Time", "CDT": "Central Daylight Time", "ART": "Argentina Standard Time", "IST": "India Standard Time", "WAST": "West Africa Summer Time", "TMST": "Turkmenistan Summer Time", "ECT": "Ecuador Time", "LHDT": "Lord Howe Daylight Time", "WIT": "Eastern Indonesia Time", "AKST": "Alaska Standard Time", "MEZ": "Central European Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "HNT": "Newfoundland Standard Time", "MST": "Macau Standard Time", "WESZ": "Western European Summer Time", "OESZ": "Eastern European Summer Time", "EAT": "East Africa Time", "GFT": "French Guiana Time", "SAST": "South Africa Standard Time", "EDT": "Eastern Daylight Time", "PST": "Pacific Standard Time", "HAT": "Newfoundland Daylight Time", "SGT": "Singapore Standard Time", "CHAST": "Chatham Standard Time", "AST": "Atlantic Standard Time", "NZST": "New Zealand Standard Time", "UYT": "Uruguay Standard Time", "SRT": "Suriname Time"},
}
}
@@ -112,8 +112,8 @@ func (en *en_BW) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
func (en *en_BW) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
n := math.Abs(num)
- nMod100 := math.Mod(n, 100)
nMod10 := math.Mod(n, 10)
+ nMod100 := math.Mod(n, 100)
if nMod10 == 1 && nMod100 != 11 {
return locales.PluralRuleOne
diff --git a/en_BW/en_BW_test.go b/en_BW/en_BW_test.go
new file mode 100644
index 00000000..8aaeb04b
--- /dev/null
+++ b/en_BW/en_BW_test.go
@@ -0,0 +1,1120 @@
+package en_BW
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_BW"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_BZ/en_BZ.go b/en_BZ/en_BZ.go
index 50072cfa..2a3c2fd4 100644
--- a/en_BZ/en_BZ.go
+++ b/en_BZ/en_BZ.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"UYT": "Uruguay Standard Time", "CST": "Central Standard Time", "BOT": "Bolivia Time", "CLST": "Chile Summer Time", "HAST": "Hawaii-Aleutian Standard Time", "WIB": "Western Indonesia Time", "ART": "Argentina Standard Time", "WESZ": "Western European Summer Time", "WART": "Western Argentina Standard Time", "HNT": "Newfoundland Standard Time", "AKDT": "Alaska Daylight Time", "JDT": "Japan Daylight Time", "MDT": "Mountain Daylight Time", "ACWDT": "Australian Central Western Daylight Time", "GMT": "Greenwich Mean Time", "ARST": "Argentina Summer Time", "AEST": "Australian Eastern Standard Time", "EDT": "Eastern Daylight Time", "BT": "Bhutan Time", "JST": "Japan Standard Time", "WEZ": "Western European Standard Time", "WITA": "Central Indonesia Time", "AKST": "Alaska Standard Time", "PDT": "Pacific Daylight Time", "COT": "Colombia Standard Time", "ADT": "Atlantic Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "MYT": "Malaysia Time", "SGT": "Singapore Standard Time", "AWDT": "Australian Western Daylight Time", "OESZ": "Eastern European Summer Time", "ACST": "Australian Central Standard Time", "NZST": "New Zealand Standard Time", "NZDT": "New Zealand Daylight Time", "ACWST": "Australian Central Western Standard Time", "SAST": "South Africa Standard Time", "WAT": "West Africa Standard Time", "IST": "India Standard Time", "CHAST": "Chatham Standard Time", "TMT": "Turkmenistan Standard Time", "MEZ": "Central European Standard Time", "LHDT": "Lord Howe Daylight Time", "CAT": "Central Africa Time", "COST": "Colombia Summer Time", "WAST": "West Africa Summer Time", "HAT": "Newfoundland Daylight Time", "WIT": "Eastern Indonesia Time", "ACDT": "Australian Central Daylight Time", "SRT": "Suriname Time", "CHADT": "Chatham Daylight Time", "EST": "Eastern Standard Time", "WARST": "Western Argentina Summer Time", "HKST": "Hong Kong Summer Time", "MESZ": "Central European Summer Time", "∅∅∅": "Brasilia Summer Time", "TMST": "Turkmenistan Summer Time", "UYST": "Uruguay Summer Time", "CDT": "Central Daylight Time", "ECT": "Ecuador Time", "AWST": "Australian Western Standard Time", "LHST": "Lord Howe Standard Time", "ChST": "Chamorro Standard Time", "GFT": "French Guiana Time", "OEZ": "Eastern European Standard Time", "GYT": "Guyana Time", "PST": "Pacific Standard Time", "MST": "Mountain Standard Time", "VET": "Venezuela Time", "AEDT": "Australian Eastern Daylight Time", "HKT": "Hong Kong Standard Time", "CLT": "Chile Standard Time", "AST": "Atlantic Standard Time", "EAT": "East Africa Time"},
+ timezones: map[string]string{"NZDT": "New Zealand Daylight Time", "COT": "Colombia Standard Time", "WARST": "Western Argentina Summer Time", "EST": "Eastern Standard Time", "SAST": "South Africa Standard Time", "EDT": "Eastern Daylight Time", "JST": "Japan Standard Time", "BOT": "Bolivia Time", "HNT": "Newfoundland Standard Time", "MST": "Mountain Standard Time", "UYT": "Uruguay Standard Time", "LHDT": "Lord Howe Daylight Time", "WART": "Western Argentina Standard Time", "ECT": "Ecuador Time", "ART": "Argentina Standard Time", "IST": "India Standard Time", "SGT": "Singapore Standard Time", "TMST": "Turkmenistan Summer Time", "CAT": "Central Africa Time", "CLST": "Chile Summer Time", "AKDT": "Alaska Daylight Time", "ACWST": "Australian Central Western Standard Time", "CHAST": "Chatham Standard Time", "NZST": "New Zealand Standard Time", "OESZ": "Eastern European Summer Time", "WIT": "Eastern Indonesia Time", "LHST": "Lord Howe Standard Time", "SRT": "Suriname Time", "WAST": "West Africa Summer Time", "WESZ": "Western European Summer Time", "JDT": "Japan Daylight Time", "PST": "Pacific Standard Time", "MDT": "Mountain Daylight Time", "ADT": "Atlantic Daylight Time", "UYST": "Uruguay Summer Time", "VET": "Venezuela Time", "HAT": "Newfoundland Daylight Time", "CDT": "Central Daylight Time", "ACDT": "Australian Central Daylight Time", "AWDT": "Australian Western Daylight Time", "ACWDT": "Australian Central Western Daylight Time", "CST": "Central Standard Time", "MESZ": "Central European Summer Time", "COST": "Colombia Summer Time", "WEZ": "Western European Standard Time", "MYT": "Malaysia Time", "EAT": "East Africa Time", "CHADT": "Chatham Daylight Time", "WITA": "Central Indonesia Time", "MEZ": "Central European Standard Time", "WIB": "Western Indonesia Time", "TMT": "Turkmenistan Standard Time", "ACST": "Australian Central Standard Time", "HKT": "Hong Kong Standard Time", "CLT": "Chile Standard Time", "BT": "Bhutan Time", "GFT": "French Guiana Time", "HADT": "Hawaii-Aleutian Daylight Time", "∅∅∅": "Amazon Summer Time", "GYT": "Guyana Time", "OEZ": "Eastern European Standard Time", "AEST": "Australian Eastern Standard Time", "AKST": "Alaska Standard Time", "ChST": "Chamorro Standard Time", "HKST": "Hong Kong Summer Time", "PDT": "Pacific Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "WAT": "West Africa Standard Time", "ARST": "Argentina Summer Time", "AST": "Atlantic Standard Time", "GMT": "Greenwich Mean Time", "AEDT": "Australian Eastern Daylight Time", "AWST": "Australian Western Standard Time"},
}
}
diff --git a/en_BZ/en_BZ_test.go b/en_BZ/en_BZ_test.go
new file mode 100644
index 00000000..45c73c6b
--- /dev/null
+++ b/en_BZ/en_BZ_test.go
@@ -0,0 +1,1120 @@
+package en_BZ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_BZ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_CA/en_CA.go b/en_CA/en_CA.go
index 279ce366..1204b3bd 100644
--- a/en_CA/en_CA.go
+++ b/en_CA/en_CA.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"OEZ": "Eastern European Standard Time", "ARST": "Argentina Summer Time", "TMT": "Turkmenistan Standard Time", "CLT": "Chile Standard Time", "EDT": "Eastern Daylight Time", "WART": "Western Argentina Standard Time", "ART": "Argentina Standard Time", "AEST": "Australian Eastern Standard Time", "CAT": "Central Africa Time", "OESZ": "Eastern European Summer Time", "GMT": "Greenwich Mean Time", "EAT": "East Africa Time", "JST": "Japan Standard Time", "NZST": "New Zealand Standard Time", "AST": "Atlantic Standard Time", "SGT": "Singapore Standard Time", "COST": "Colombia Summer Time", "BT": "Bhutan Time", "CDT": "Central Daylight Time", "NZDT": "New Zealand Daylight Time", "UYT": "Uruguay Standard Time", "WEZ": "Western European Standard Time", "AEDT": "Australian Eastern Daylight Time", "GFT": "French Guiana Time", "LHDT": "Lord Howe Daylight Time", "HKT": "Hong Kong Standard Time", "VET": "Venezuela Time", "AWDT": "Australian Western Daylight Time", "MEZ": "Central European Standard Time", "MESZ": "Central European Summer Time", "ACWST": "Australian Central Western Standard Time", "HKST": "Hong Kong Summer Time", "WITA": "Central Indonesia Time", "SRT": "Suriname Time", "COT": "Colombia Standard Time", "WAT": "West Africa Standard Time", "PDT": "Pacific Daylight Time", "AWST": "Australian Western Standard Time", "BOT": "Bolivia Time", "WESZ": "Western European Summer Time", "CHAST": "Chatham Standard Time", "HAT": "Newfoundland Daylight Time", "MST": "Macau Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "MYT": "Malaysia Time", "WIB": "Western Indonesia Time", "IST": "India Standard Time", "HNT": "Newfoundland Standard Time", "JDT": "Japan Daylight Time", "UYST": "Uruguay Summer Time", "CLST": "Chile Summer Time", "SAST": "South Africa Standard Time", "WARST": "Western Argentina Summer Time", "WIT": "Eastern Indonesia Time", "MDT": "Macau Summer Time", "AKST": "Alaska Standard Time", "PST": "Pacific Standard Time", "CST": "Central Standard Time", "ACWDT": "Australian Central Western Daylight Time", "ChST": "Chamorro Standard Time", "CHADT": "Chatham Daylight Time", "EST": "Eastern Standard Time", "ECT": "Ecuador Time", "ACDT": "Australian Central Daylight Time", "TMST": "Turkmenistan Summer Time", "GYT": "Guyana Time", "∅∅∅": "Brasilia Summer Time", "ADT": "Atlantic Daylight Time", "WAST": "West Africa Summer Time", "ACST": "Australian Central Standard Time", "AKDT": "Alaska Daylight Time", "LHST": "Lord Howe Standard Time"},
+ timezones: map[string]string{"CAT": "Central Africa Time", "CLST": "Chile Summer Time", "LHDT": "Lord Howe Daylight Time", "ACDT": "Australian Central Daylight Time", "WARST": "Western Argentina Summer Time", "COST": "Colombia Summer Time", "CDT": "Central Daylight Time", "HKT": "Hong Kong Standard Time", "CLT": "Chile Standard Time", "JDT": "Japan Daylight Time", "COT": "Colombia Standard Time", "AEDT": "Australian Eastern Daylight Time", "HAT": "Newfoundland Daylight Time", "OEZ": "Eastern European Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "NZDT": "New Zealand Daylight Time", "PST": "Pacific Standard Time", "GYT": "Guyana Time", "MYT": "Malaysia Time", "ACST": "Australian Central Standard Time", "MST": "Macau Standard Time", "AKDT": "Alaska Daylight Time", "EST": "Eastern Standard Time", "EAT": "East Africa Time", "CST": "Central Standard Time", "WIB": "Western Indonesia Time", "UYST": "Uruguay Summer Time", "BOT": "Bolivia Time", "PDT": "Pacific Daylight Time", "TMT": "Turkmenistan Standard Time", "OESZ": "Eastern European Summer Time", "GMT": "Greenwich Mean Time", "SRT": "Suriname Time", "HKST": "Hong Kong Summer Time", "AWST": "Australian Western Standard Time", "UYT": "Uruguay Standard Time", "AWDT": "Australian Western Daylight Time", "SAST": "South Africa Standard Time", "WAT": "West Africa Standard Time", "WEZ": "Western European Standard Time", "WART": "Western Argentina Standard Time", "AKST": "Alaska Standard Time", "AST": "Atlantic Standard Time", "ChST": "Chamorro Standard Time", "WIT": "Eastern Indonesia Time", "LHST": "Lord Howe Standard Time", "ARST": "Argentina Summer Time", "TMST": "Turkmenistan Summer Time", "SGT": "Singapore Standard Time", "WAST": "West Africa Summer Time", "ADT": "Atlantic Daylight Time", "ACWST": "Australian Central Western Standard Time", "IST": "India Standard Time", "∅∅∅": "Azores Summer Time", "ECT": "Ecuador Time", "NZST": "New Zealand Standard Time", "VET": "Venezuela Time", "WESZ": "Western European Summer Time", "HNT": "Newfoundland Standard Time", "MESZ": "Central European Summer Time", "GFT": "French Guiana Time", "MDT": "Macau Summer Time", "ART": "Argentina Standard Time", "AEST": "Australian Eastern Standard Time", "BT": "Bhutan Time", "CHAST": "Chatham Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "MEZ": "Central European Standard Time", "ACWDT": "Australian Central Western Daylight Time", "EDT": "Eastern Daylight Time", "CHADT": "Chatham Daylight Time", "WITA": "Central Indonesia Time", "JST": "Japan Standard Time"},
}
}
diff --git a/en_CA/en_CA_test.go b/en_CA/en_CA_test.go
new file mode 100644
index 00000000..e09ef02c
--- /dev/null
+++ b/en_CA/en_CA_test.go
@@ -0,0 +1,1120 @@
+package en_CA
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_CA"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_CC/en_CC.go b/en_CC/en_CC.go
index 3fec34e0..0298e967 100644
--- a/en_CC/en_CC.go
+++ b/en_CC/en_CC.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"AWST": "Australian Western Standard Time", "AEST": "Australian Eastern Standard Time", "ECT": "Ecuador Time", "CAT": "Central Africa Time", "HAST": "Hawaii-Aleutian Standard Time", "LHDT": "Lord Howe Daylight Time", "AKST": "Alaska Standard Time", "COT": "Colombia Standard Time", "COST": "Colombia Summer Time", "HKST": "Hong Kong Summer Time", "HNT": "Newfoundland Standard Time", "JST": "Japan Standard Time", "EDT": "Eastern Daylight Time", "ADT": "Atlantic Daylight Time", "SRT": "Suriname Time", "EST": "Eastern Standard Time", "WAST": "West Africa Summer Time", "MESZ": "Central European Summer Time", "HADT": "Hawaii-Aleutian Daylight Time", "IST": "India Standard Time", "TMST": "Turkmenistan Summer Time", "PDT": "Pacific Daylight Time", "AWDT": "Australian Western Daylight Time", "UYT": "Uruguay Standard Time", "CHADT": "Chatham Daylight Time", "AEDT": "Australian Eastern Daylight Time", "OESZ": "Eastern European Summer Time", "ACDT": "Australian Central Daylight Time", "GYT": "Guyana Time", "MYT": "Malaysia Time", "AKDT": "Alaska Daylight Time", "UYST": "Uruguay Summer Time", "MEZ": "Central European Standard Time", "CHAST": "Chatham Standard Time", "WARST": "Western Argentina Summer Time", "GMT": "Greenwich Mean Time", "MST": "Macau Standard Time", "SAST": "South Africa Standard Time", "CST": "Central Standard Time", "NZST": "New Zealand Standard Time", "CLT": "Chile Standard Time", "WITA": "Central Indonesia Time", "LHST": "Lord Howe Standard Time", "JDT": "Japan Daylight Time", "GFT": "French Guiana Time", "CDT": "Central Daylight Time", "NZDT": "New Zealand Daylight Time", "ChST": "Chamorro Standard Time", "∅∅∅": "Acre Summer Time", "AST": "Atlantic Standard Time", "BT": "Bhutan Time", "OEZ": "Eastern European Standard Time", "ARST": "Argentina Summer Time", "ACWST": "Australian Central Western Standard Time", "TMT": "Turkmenistan Standard Time", "MDT": "Macau Summer Time", "WEZ": "Western European Standard Time", "WART": "Western Argentina Standard Time", "WAT": "West Africa Standard Time", "WIB": "Western Indonesia Time", "EAT": "East Africa Time", "ACWDT": "Australian Central Western Daylight Time", "HKT": "Hong Kong Standard Time", "ACST": "Australian Central Standard Time", "VET": "Venezuela Time", "HAT": "Newfoundland Daylight Time", "ART": "Argentina Standard Time", "WESZ": "Western European Summer Time", "BOT": "Bolivia Time", "CLST": "Chile Summer Time", "SGT": "Singapore Standard Time", "WIT": "Eastern Indonesia Time", "PST": "Pacific Standard Time"},
+ timezones: map[string]string{"VET": "Venezuela Time", "AKST": "Alaska Standard Time", "CDT": "Central Daylight Time", "PDT": "Pacific Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "TMT": "Turkmenistan Standard Time", "OEZ": "Eastern European Standard Time", "CLT": "Chile Standard Time", "NZST": "New Zealand Standard Time", "EDT": "Eastern Daylight Time", "WESZ": "Western European Summer Time", "UYST": "Uruguay Summer Time", "MST": "Macau Standard Time", "AEST": "Australian Eastern Standard Time", "IST": "India Standard Time", "MESZ": "Central European Summer Time", "BT": "Bhutan Time", "WARST": "Western Argentina Summer Time", "CHADT": "Chatham Daylight Time", "ARST": "Argentina Summer Time", "NZDT": "New Zealand Daylight Time", "BOT": "Bolivia Time", "SAST": "South Africa Standard Time", "MEZ": "Central European Standard Time", "COT": "Colombia Standard Time", "WIT": "Eastern Indonesia Time", "WART": "Western Argentina Standard Time", "AWST": "Australian Western Standard Time", "PST": "Pacific Standard Time", "WAT": "West Africa Standard Time", "COST": "Colombia Summer Time", "ChST": "Chamorro Standard Time", "ACST": "Australian Central Standard Time", "WITA": "Central Indonesia Time", "EST": "Eastern Standard Time", "OESZ": "Eastern European Summer Time", "MYT": "Malaysia Time", "ACWDT": "Australian Central Western Daylight Time", "CST": "Central Standard Time", "HKT": "Hong Kong Standard Time", "WAST": "West Africa Summer Time", "GMT": "Greenwich Mean Time", "JDT": "Japan Daylight Time", "AKDT": "Alaska Daylight Time", "WEZ": "Western European Standard Time", "HAT": "Newfoundland Daylight Time", "AEDT": "Australian Eastern Daylight Time", "LHST": "Lord Howe Standard Time", "CHAST": "Chatham Standard Time", "JST": "Japan Standard Time", "ADT": "Atlantic Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "WIB": "Western Indonesia Time", "CLST": "Chile Summer Time", "ACDT": "Australian Central Daylight Time", "HKST": "Hong Kong Summer Time", "ECT": "Ecuador Time", "HNT": "Newfoundland Standard Time", "UYT": "Uruguay Standard Time", "AWDT": "Australian Western Daylight Time", "CAT": "Central Africa Time", "GYT": "Guyana Time", "GFT": "French Guiana Time", "∅∅∅": "Azores Summer Time", "MDT": "Macau Summer Time", "AST": "Atlantic Standard Time", "ART": "Argentina Standard Time", "SGT": "Singapore Standard Time", "LHDT": "Lord Howe Daylight Time", "SRT": "Suriname Time", "ACWST": "Australian Central Western Standard Time", "TMST": "Turkmenistan Summer Time", "EAT": "East Africa Time"},
}
}
diff --git a/en_CC/en_CC_test.go b/en_CC/en_CC_test.go
new file mode 100644
index 00000000..edf216cd
--- /dev/null
+++ b/en_CC/en_CC_test.go
@@ -0,0 +1,1120 @@
+package en_CC
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_CC"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_CH/en_CH.go b/en_CH/en_CH.go
index 520446a1..157002a4 100644
--- a/en_CH/en_CH.go
+++ b/en_CH/en_CH.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"PDT": "Pacific Daylight Time", "AEDT": "Australian Eastern Daylight Time", "EST": "Eastern Standard Time", "ACDT": "Australian Central Daylight Time", "∅∅∅": "Amazon Summer Time", "AWDT": "Australian Western Daylight Time", "CDT": "Central Daylight Time", "MDT": "Macau Summer Time", "LHDT": "Lord Howe Daylight Time", "SRT": "Suriname Time", "IST": "India Standard Time", "HNT": "Newfoundland Standard Time", "WESZ": "Western European Summer Time", "ARST": "Argentina Summer Time", "MST": "Macau Standard Time", "CHADT": "Chatham Daylight Time", "CLST": "Chile Summer Time", "ADT": "Atlantic Daylight Time", "WIT": "Eastern Indonesia Time", "TMT": "Turkmenistan Standard Time", "PST": "Pacific Standard Time", "CLT": "Chile Standard Time", "CAT": "Central Africa Time", "COT": "Colombia Standard Time", "OESZ": "Eastern European Summer Time", "LHST": "Lord Howe Standard Time", "GYT": "Guyana Time", "JST": "Japan Standard Time", "JDT": "Japan Daylight Time", "MESZ": "Central European Summer Time", "NZDT": "New Zealand Daylight Time", "ChST": "Chamorro Standard Time", "WAT": "West Africa Standard Time", "WAST": "West Africa Summer Time", "UYST": "Uruguay Summer Time", "CHAST": "Chatham Standard Time", "AST": "Atlantic Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "WARST": "Western Argentina Summer Time", "GFT": "French Guiana Time", "ACST": "Australian Central Standard Time", "VET": "Venezuela Time", "COST": "Colombia Summer Time", "HAST": "Hawaii-Aleutian Standard Time", "SGT": "Singapore Standard Time", "SAST": "South Africa Standard Time", "BT": "Bhutan Time", "HKT": "Hong Kong Standard Time", "WART": "Western Argentina Standard Time", "GMT": "Greenwich Mean Time", "ART": "Argentina Standard Time", "AKDT": "Alaska Daylight Time", "CST": "Central Standard Time", "MEZ": "Central European Standard Time", "NZST": "New Zealand Standard Time", "BOT": "Bolivia Time", "WEZ": "Western European Standard Time", "ACWST": "Australian Central Western Standard Time", "ACWDT": "Australian Central Western Daylight Time", "HKST": "Hong Kong Summer Time", "AWST": "Australian Western Standard Time", "AEST": "Australian Eastern Standard Time", "EDT": "Eastern Daylight Time", "WIB": "Western Indonesia Time", "ECT": "Ecuador Time", "UYT": "Uruguay Standard Time", "WITA": "Central Indonesia Time", "EAT": "East Africa Time", "TMST": "Turkmenistan Summer Time", "AKST": "Alaska Standard Time", "MYT": "Malaysia Time", "OEZ": "Eastern European Standard Time", "HAT": "Newfoundland Daylight Time"},
+ timezones: map[string]string{"NZST": "New Zealand Standard Time", "WITA": "Central Indonesia Time", "JST": "Japan Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "HNT": "Newfoundland Standard Time", "CST": "Central Standard Time", "CDT": "Central Daylight Time", "ECT": "Ecuador Time", "∅∅∅": "Brasilia Summer Time", "HAST": "Hawaii-Aleutian Standard Time", "EST": "Eastern Standard Time", "TMT": "Turkmenistan Standard Time", "TMST": "Turkmenistan Summer Time", "ChST": "Chamorro Standard Time", "LHST": "Lord Howe Standard Time", "LHDT": "Lord Howe Daylight Time", "WIB": "Western Indonesia Time", "WIT": "Eastern Indonesia Time", "SRT": "Suriname Time", "ARST": "Argentina Summer Time", "ADT": "Atlantic Daylight Time", "AWDT": "Australian Western Daylight Time", "BOT": "Bolivia Time", "CAT": "Central Africa Time", "AEST": "Australian Eastern Standard Time", "AKDT": "Alaska Daylight Time", "AST": "Atlantic Standard Time", "EAT": "East Africa Time", "WART": "Western Argentina Standard Time", "WEZ": "Western European Standard Time", "ART": "Argentina Standard Time", "PST": "Pacific Standard Time", "WAT": "West Africa Standard Time", "GMT": "Greenwich Mean Time", "CLST": "Chile Summer Time", "MDT": "Mountain Daylight Time", "HKST": "Hong Kong Summer Time", "VET": "Venezuela Time", "IST": "India Standard Time", "WARST": "Western Argentina Summer Time", "CHAST": "Chatham Standard Time", "GFT": "French Guiana Time", "CHADT": "Chatham Daylight Time", "JDT": "Japan Daylight Time", "ACWDT": "Australian Central Western Daylight Time", "AWST": "Australian Western Standard Time", "WAST": "West Africa Summer Time", "AEDT": "Australian Eastern Daylight Time", "GYT": "Guyana Time", "MST": "Mountain Standard Time", "MYT": "Malaysia Time", "MEZ": "Central European Standard Time", "OEZ": "Eastern European Standard Time", "CLT": "Chile Standard Time", "BT": "Bhutan Time", "COT": "Colombia Standard Time", "COST": "Colombia Summer Time", "HAT": "Newfoundland Daylight Time", "HKT": "Hong Kong Standard Time", "SAST": "South Africa Standard Time", "EDT": "Eastern Daylight Time", "AKST": "Alaska Standard Time", "MESZ": "Central European Summer Time", "WESZ": "Western European Summer Time", "OESZ": "Eastern European Summer Time", "UYT": "Uruguay Standard Time", "UYST": "Uruguay Summer Time", "NZDT": "New Zealand Daylight Time", "PDT": "Pacific Daylight Time", "SGT": "Singapore Standard Time", "ACST": "Australian Central Standard Time", "ACDT": "Australian Central Daylight Time", "ACWST": "Australian Central Western Standard Time"},
}
}
diff --git a/en_CH/en_CH_test.go b/en_CH/en_CH_test.go
new file mode 100644
index 00000000..2c06a739
--- /dev/null
+++ b/en_CH/en_CH_test.go
@@ -0,0 +1,1120 @@
+package en_CH
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_CH"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_CK/en_CK.go b/en_CK/en_CK.go
index 6d7d6f8b..af4be12b 100644
--- a/en_CK/en_CK.go
+++ b/en_CK/en_CK.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"UYT": "Uruguay Standard Time", "WARST": "Western Argentina Summer Time", "HNT": "Newfoundland Standard Time", "ACST": "Australian Central Standard Time", "LHST": "Lord Howe Standard Time", "JDT": "Japan Daylight Time", "CST": "Central Standard Time", "NZST": "New Zealand Standard Time", "WEZ": "Western European Standard Time", "WAT": "West Africa Standard Time", "ChST": "Chamorro Standard Time", "HAT": "Newfoundland Daylight Time", "BOT": "Bolivia Time", "CLT": "Chile Standard Time", "CAT": "Central Africa Time", "AST": "Atlantic Standard Time", "HKT": "Hong Kong Standard Time", "ACDT": "Australian Central Daylight Time", "CLST": "Chile Summer Time", "GFT": "French Guiana Time", "WIT": "Eastern Indonesia Time", "PST": "Pacific Standard Time", "LHDT": "Lord Howe Daylight Time", "ACWST": "Australian Central Western Standard Time", "BT": "Bhutan Time", "COT": "Colombia Standard Time", "GMT": "Greenwich Mean Time", "ART": "Argentina Standard Time", "CHADT": "Chatham Daylight Time", "IST": "India Standard Time", "ARST": "Argentina Summer Time", "TMT": "Turkmenistan Standard Time", "TMST": "Turkmenistan Summer Time", "JST": "Japan Standard Time", "AEDT": "Australian Eastern Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "WART": "Western Argentina Standard Time", "OESZ": "Eastern European Summer Time", "EAT": "East Africa Time", "GYT": "Guyana Time", "CDT": "Central Daylight Time", "SAST": "South Africa Standard Time", "AKST": "Alaska Standard Time", "MESZ": "Central European Summer Time", "COST": "Colombia Summer Time", "ADT": "Atlantic Daylight Time", "SGT": "Singapore Standard Time", "OEZ": "Eastern European Standard Time", "WESZ": "Western European Summer Time", "AEST": "Australian Eastern Standard Time", "AKDT": "Alaska Daylight Time", "PDT": "Pacific Daylight Time", "NZDT": "New Zealand Daylight Time", "VET": "Venezuela Time", "ACWDT": "Australian Central Western Daylight Time", "EST": "Eastern Standard Time", "ECT": "Ecuador Time", "∅∅∅": "Amazon Summer Time", "MYT": "Malaysia Time", "MEZ": "Central European Standard Time", "WAST": "West Africa Summer Time", "HKST": "Hong Kong Summer Time", "WIB": "Western Indonesia Time", "WITA": "Central Indonesia Time", "MST": "Macau Standard Time", "MDT": "Macau Summer Time", "AWDT": "Australian Western Daylight Time", "CHAST": "Chatham Standard Time", "EDT": "Eastern Daylight Time", "SRT": "Suriname Time", "AWST": "Australian Western Standard Time", "UYST": "Uruguay Summer Time"},
+ timezones: map[string]string{"OESZ": "Eastern European Summer Time", "MST": "Mountain Standard Time", "CLT": "Chile Standard Time", "ACDT": "Australian Central Daylight Time", "AWDT": "Australian Western Daylight Time", "NZDT": "New Zealand Daylight Time", "CAT": "Central Africa Time", "LHST": "Lord Howe Standard Time", "LHDT": "Lord Howe Daylight Time", "AST": "Atlantic Standard Time", "PDT": "Pacific Daylight Time", "MEZ": "Central European Standard Time", "WIB": "Western Indonesia Time", "WESZ": "Western European Summer Time", "HAT": "Newfoundland Daylight Time", "MESZ": "Central European Summer Time", "TMT": "Turkmenistan Standard Time", "OEZ": "Eastern European Standard Time", "AEDT": "Australian Eastern Daylight Time", "CST": "Central Standard Time", "CDT": "Central Daylight Time", "AKST": "Alaska Standard Time", "AEST": "Australian Eastern Standard Time", "GYT": "Guyana Time", "CLST": "Chile Summer Time", "HKST": "Hong Kong Summer Time", "JST": "Japan Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "HNT": "Newfoundland Standard Time", "WIT": "Eastern Indonesia Time", "CHADT": "Chatham Daylight Time", "BT": "Bhutan Time", "ECT": "Ecuador Time", "ADT": "Atlantic Daylight Time", "NZST": "New Zealand Standard Time", "EDT": "Eastern Daylight Time", "MDT": "Mountain Daylight Time", "ACST": "Australian Central Standard Time", "GFT": "French Guiana Time", "BOT": "Bolivia Time", "HKT": "Hong Kong Standard Time", "VET": "Venezuela Time", "PST": "Pacific Standard Time", "WEZ": "Western European Standard Time", "JDT": "Japan Daylight Time", "ARST": "Argentina Summer Time", "WITA": "Central Indonesia Time", "WAST": "West Africa Summer Time", "EAT": "East Africa Time", "WAT": "West Africa Standard Time", "UYST": "Uruguay Summer Time", "WART": "Western Argentina Standard Time", "CHAST": "Chatham Standard Time", "TMST": "Turkmenistan Summer Time", "COT": "Colombia Standard Time", "GMT": "Greenwich Mean Time", "UYT": "Uruguay Standard Time", "WARST": "Western Argentina Summer Time", "SRT": "Suriname Time", "ART": "Argentina Standard Time", "IST": "India Standard Time", "COST": "Colombia Summer Time", "AWST": "Australian Western Standard Time", "SAST": "South Africa Standard Time", "ChST": "Chamorro Standard Time", "MYT": "Malaysia Time", "SGT": "Singapore Standard Time", "AKDT": "Alaska Daylight Time", "ACWST": "Australian Central Western Standard Time", "ACWDT": "Australian Central Western Daylight Time", "EST": "Eastern Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "∅∅∅": "Amazon Summer Time"},
}
}
diff --git a/en_CK/en_CK_test.go b/en_CK/en_CK_test.go
new file mode 100644
index 00000000..8e2abab4
--- /dev/null
+++ b/en_CK/en_CK_test.go
@@ -0,0 +1,1120 @@
+package en_CK
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_CK"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_CM/en_CM.go b/en_CM/en_CM.go
index 12f55cab..47ddf8fd 100644
--- a/en_CM/en_CM.go
+++ b/en_CM/en_CM.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"BT": "Bhutan Time", "GMT": "Greenwich Mean Time", "GFT": "French Guiana Time", "ADT": "Atlantic Daylight Time", "WITA": "Central Indonesia Time", "EAT": "East Africa Time", "NZDT": "New Zealand Daylight Time", "WAT": "West Africa Standard Time", "WIB": "Western Indonesia Time", "BOT": "Bolivia Time", "SGT": "Singapore Standard Time", "ChST": "Chamorro Standard Time", "CHAST": "Chatham Standard Time", "CLT": "Chile Standard Time", "ART": "Argentina Standard Time", "SRT": "Suriname Time", "AEST": "Australian Eastern Standard Time", "IST": "India Standard Time", "TMST": "Turkmenistan Summer Time", "LHDT": "Lord Howe Daylight Time", "HKST": "Hong Kong Summer Time", "VET": "Venezuela Time", "MST": "Mountain Standard Time", "CHADT": "Chatham Daylight Time", "WAST": "West Africa Summer Time", "OEZ": "Eastern European Standard Time", "ACDT": "Australian Central Daylight Time", "ARST": "Argentina Summer Time", "UYST": "Uruguay Summer Time", "PST": "Pacific Standard Time", "AKDT": "Alaska Daylight Time", "MEZ": "Central European Standard Time", "EDT": "Eastern Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "SAST": "South Africa Standard Time", "WARST": "Western Argentina Summer Time", "HNT": "Newfoundland Standard Time", "WIT": "Eastern Indonesia Time", "CDT": "Central Daylight Time", "GYT": "Guyana Time", "JST": "Japan Standard Time", "TMT": "Turkmenistan Standard Time", "CLST": "Chile Summer Time", "ECT": "Ecuador Time", "AKST": "Alaska Standard Time", "MDT": "Mountain Daylight Time", "WEZ": "Western European Standard Time", "ACWST": "Australian Central Western Standard Time", "AST": "Atlantic Standard Time", "HKT": "Hong Kong Standard Time", "LHST": "Lord Howe Standard Time", "NZST": "New Zealand Standard Time", "MESZ": "Central European Summer Time", "WESZ": "Western European Summer Time", "CST": "Central Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "ACST": "Australian Central Standard Time", "CAT": "Central Africa Time", "WART": "Western Argentina Standard Time", "AWST": "Australian Western Standard Time", "UYT": "Uruguay Standard Time", "MYT": "Malaysia Time", "PDT": "Pacific Daylight Time", "AEDT": "Australian Eastern Daylight Time", "COST": "Colombia Summer Time", "OESZ": "Eastern European Summer Time", "HAT": "Newfoundland Daylight Time", "AWDT": "Australian Western Daylight Time", "JDT": "Japan Daylight Time", "ACWDT": "Australian Central Western Daylight Time", "COT": "Colombia Standard Time", "∅∅∅": "Brasilia Summer Time", "EST": "Eastern Standard Time"},
+ timezones: map[string]string{"LHST": "Lord Howe Standard Time", "AWST": "Australian Western Standard Time", "JDT": "Japan Daylight Time", "ADT": "Atlantic Daylight Time", "OESZ": "Eastern European Summer Time", "∅∅∅": "Brasilia Summer Time", "CST": "Central Standard Time", "COT": "Colombia Standard Time", "CAT": "Central Africa Time", "ECT": "Ecuador Time", "HKST": "Hong Kong Summer Time", "AST": "Atlantic Standard Time", "AEDT": "Australian Eastern Daylight Time", "MYT": "Malaysia Time", "BT": "Bhutan Time", "NZDT": "New Zealand Daylight Time", "WEZ": "Western European Standard Time", "MEZ": "Central European Standard Time", "WESZ": "Western European Summer Time", "TMT": "Turkmenistan Standard Time", "OEZ": "Eastern European Standard Time", "MST": "Mountain Standard Time", "HKT": "Hong Kong Standard Time", "PST": "Pacific Standard Time", "GMT": "Greenwich Mean Time", "HAT": "Newfoundland Daylight Time", "SRT": "Suriname Time", "ART": "Argentina Standard Time", "JST": "Japan Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "UYST": "Uruguay Summer Time", "AKDT": "Alaska Daylight Time", "SAST": "South Africa Standard Time", "MDT": "Mountain Daylight Time", "WARST": "Western Argentina Summer Time", "ACWST": "Australian Central Western Standard Time", "ACWDT": "Australian Central Western Daylight Time", "AWDT": "Australian Western Daylight Time", "AKST": "Alaska Standard Time", "HNT": "Newfoundland Standard Time", "SGT": "Singapore Standard Time", "CDT": "Central Daylight Time", "EDT": "Eastern Daylight Time", "WAT": "West Africa Standard Time", "AEST": "Australian Eastern Standard Time", "WIT": "Eastern Indonesia Time", "GFT": "French Guiana Time", "MESZ": "Central European Summer Time", "WIB": "Western Indonesia Time", "BOT": "Bolivia Time", "LHDT": "Lord Howe Daylight Time", "CLST": "Chile Summer Time", "ACST": "Australian Central Standard Time", "ACDT": "Australian Central Daylight Time", "VET": "Venezuela Time", "EST": "Eastern Standard Time", "IST": "India Standard Time", "COST": "Colombia Summer Time", "CLT": "Chile Standard Time", "UYT": "Uruguay Standard Time", "WART": "Western Argentina Standard Time", "CHAST": "Chatham Standard Time", "WAST": "West Africa Summer Time", "ChST": "Chamorro Standard Time", "NZST": "New Zealand Standard Time", "GYT": "Guyana Time", "PDT": "Pacific Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "TMST": "Turkmenistan Summer Time", "EAT": "East Africa Time", "CHADT": "Chatham Daylight Time", "ARST": "Argentina Summer Time", "WITA": "Central Indonesia Time"},
}
}
diff --git a/en_CM/en_CM_test.go b/en_CM/en_CM_test.go
new file mode 100644
index 00000000..8fd33a6d
--- /dev/null
+++ b/en_CM/en_CM_test.go
@@ -0,0 +1,1120 @@
+package en_CM
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_CM"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_CX/en_CX.go b/en_CX/en_CX.go
index 3bc0e739..ad3c9670 100644
--- a/en_CX/en_CX.go
+++ b/en_CX/en_CX.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"HAST": "Hawaii-Aleutian Standard Time", "OEZ": "Eastern European Standard Time", "AWST": "Australian Western Standard Time", "LHDT": "Lord Howe Daylight Time", "COT": "Colombia Standard Time", "COST": "Colombia Summer Time", "HKST": "Hong Kong Summer Time", "WARST": "Western Argentina Summer Time", "MEZ": "Central European Standard Time", "MST": "Mountain Standard Time", "CHAST": "Chatham Standard Time", "GMT": "Greenwich Mean Time", "TMT": "Turkmenistan Standard Time", "WESZ": "Western European Summer Time", "IST": "India Standard Time", "CLST": "Chile Summer Time", "∅∅∅": "Brasilia Summer Time", "CAT": "Central Africa Time", "WAST": "West Africa Summer Time", "HAT": "Newfoundland Daylight Time", "TMST": "Turkmenistan Summer Time", "ChST": "Chamorro Standard Time", "SGT": "Singapore Standard Time", "PDT": "Pacific Daylight Time", "AKST": "Alaska Standard Time", "MESZ": "Central European Summer Time", "UYST": "Uruguay Summer Time", "WITA": "Central Indonesia Time", "ACWST": "Australian Central Western Standard Time", "ACWDT": "Australian Central Western Daylight Time", "SAST": "South Africa Standard Time", "EAT": "East Africa Time", "PST": "Pacific Standard Time", "MYT": "Malaysia Time", "CDT": "Central Daylight Time", "WEZ": "Western European Standard Time", "OESZ": "Eastern European Summer Time", "ART": "Argentina Standard Time", "GYT": "Guyana Time", "BOT": "Bolivia Time", "UYT": "Uruguay Standard Time", "AEDT": "Australian Eastern Daylight Time", "MDT": "Mountain Daylight Time", "SRT": "Suriname Time", "AKDT": "Alaska Daylight Time", "NZDT": "New Zealand Daylight Time", "CHADT": "Chatham Daylight Time", "ECT": "Ecuador Time", "WAT": "West Africa Standard Time", "HKT": "Hong Kong Standard Time", "WART": "Western Argentina Standard Time", "ACST": "Australian Central Standard Time", "EDT": "Eastern Daylight Time", "ADT": "Atlantic Daylight Time", "GFT": "French Guiana Time", "LHST": "Lord Howe Standard Time", "HNT": "Newfoundland Standard Time", "WIB": "Western Indonesia Time", "JDT": "Japan Daylight Time", "WIT": "Eastern Indonesia Time", "JST": "Japan Standard Time", "NZST": "New Zealand Standard Time", "CST": "Central Standard Time", "CLT": "Chile Standard Time", "EST": "Eastern Standard Time", "BT": "Bhutan Time", "ACDT": "Australian Central Daylight Time", "ARST": "Argentina Summer Time", "AEST": "Australian Eastern Standard Time", "VET": "Venezuela Time", "HADT": "Hawaii-Aleutian Daylight Time", "AST": "Atlantic Standard Time", "AWDT": "Australian Western Daylight Time"},
+ timezones: map[string]string{"GFT": "French Guiana Time", "CHAST": "Chatham Standard Time", "ART": "Argentina Standard Time", "SGT": "Singapore Standard Time", "OESZ": "Eastern European Summer Time", "MST": "Mountain Standard Time", "ACDT": "Australian Central Daylight Time", "MEZ": "Central European Standard Time", "EDT": "Eastern Daylight Time", "ChST": "Chamorro Standard Time", "VET": "Venezuela Time", "AST": "Atlantic Standard Time", "ECT": "Ecuador Time", "AKDT": "Alaska Daylight Time", "JST": "Japan Standard Time", "NZST": "New Zealand Standard Time", "TMT": "Turkmenistan Standard Time", "OEZ": "Eastern European Standard Time", "WIT": "Eastern Indonesia Time", "WITA": "Central Indonesia Time", "COST": "Colombia Summer Time", "BT": "Bhutan Time", "CDT": "Central Daylight Time", "COT": "Colombia Standard Time", "HKT": "Hong Kong Standard Time", "GYT": "Guyana Time", "LHDT": "Lord Howe Daylight Time", "SRT": "Suriname Time", "HADT": "Hawaii-Aleutian Daylight Time", "SAST": "South Africa Standard Time", "IST": "India Standard Time", "MYT": "Malaysia Time", "WARST": "Western Argentina Summer Time", "ADT": "Atlantic Daylight Time", "LHST": "Lord Howe Standard Time", "CHADT": "Chatham Daylight Time", "PDT": "Pacific Daylight Time", "NZDT": "New Zealand Daylight Time", "AEST": "Australian Eastern Standard Time", "UYT": "Uruguay Standard Time", "EAT": "East Africa Time", "WIB": "Western Indonesia Time", "HAT": "Newfoundland Daylight Time", "WAT": "West Africa Standard Time", "WESZ": "Western European Summer Time", "MDT": "Mountain Daylight Time", "ACWST": "Australian Central Western Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "AEDT": "Australian Eastern Daylight Time", "CLST": "Chile Summer Time", "TMST": "Turkmenistan Summer Time", "WAST": "West Africa Summer Time", "WEZ": "Western European Standard Time", "∅∅∅": "Brasilia Summer Time", "AKST": "Alaska Standard Time", "CAT": "Central Africa Time", "EST": "Eastern Standard Time", "HNT": "Newfoundland Standard Time", "HKST": "Hong Kong Summer Time", "MESZ": "Central European Summer Time", "BOT": "Bolivia Time", "PST": "Pacific Standard Time", "CST": "Central Standard Time", "AWST": "Australian Western Standard Time", "ACWDT": "Australian Central Western Daylight Time", "ACST": "Australian Central Standard Time", "WART": "Western Argentina Standard Time", "AWDT": "Australian Western Daylight Time", "ARST": "Argentina Summer Time", "JDT": "Japan Daylight Time", "GMT": "Greenwich Mean Time", "CLT": "Chile Standard Time", "UYST": "Uruguay Summer Time"},
}
}
diff --git a/en_CX/en_CX_test.go b/en_CX/en_CX_test.go
new file mode 100644
index 00000000..aa018e75
--- /dev/null
+++ b/en_CX/en_CX_test.go
@@ -0,0 +1,1120 @@
+package en_CX
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_CX"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_CY/en_CY.go b/en_CY/en_CY.go
index c01030d8..4de89220 100644
--- a/en_CY/en_CY.go
+++ b/en_CY/en_CY.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"CHADT": "Chatham Daylight Time", "ACWST": "Australian Central Western Standard Time", "∅∅∅": "Brasilia Summer Time", "HKT": "Hong Kong Standard Time", "OESZ": "Eastern European Summer Time", "UYST": "Uruguay Summer Time", "NZST": "New Zealand Standard Time", "TMT": "Turkmenistan Standard Time", "JDT": "Japan Daylight Time", "AWDT": "Australian Western Daylight Time", "COST": "Colombia Summer Time", "HNT": "Newfoundland Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "HKST": "Hong Kong Summer Time", "ACST": "Australian Central Standard Time", "CLST": "Chile Summer Time", "WESZ": "Western European Summer Time", "COT": "Colombia Standard Time", "TMST": "Turkmenistan Summer Time", "EAT": "East Africa Time", "GYT": "Guyana Time", "AWST": "Australian Western Standard Time", "ACWDT": "Australian Central Western Daylight Time", "ChST": "Chamorro Standard Time", "GFT": "French Guiana Time", "OEZ": "Eastern European Standard Time", "MESZ": "Central European Summer Time", "AST": "Atlantic Standard Time", "WIB": "Western Indonesia Time", "MYT": "Malaysia Time", "CAT": "Central Africa Time", "WARST": "Western Argentina Summer Time", "BT": "Bhutan Time", "CHAST": "Chatham Standard Time", "AEST": "Australian Eastern Standard Time", "EDT": "Eastern Daylight Time", "SGT": "Singapore Standard Time", "WAT": "West Africa Standard Time", "WAST": "West Africa Summer Time", "IST": "India Standard Time", "AKDT": "Alaska Daylight Time", "NZDT": "New Zealand Daylight Time", "MST": "Mountain Standard Time", "ECT": "Ecuador Time", "HAST": "Hawaii-Aleutian Standard Time", "SAST": "South Africa Standard Time", "ART": "Argentina Standard Time", "BOT": "Bolivia Time", "EST": "Eastern Standard Time", "VET": "Venezuela Time", "CDT": "Central Daylight Time", "MEZ": "Central European Standard Time", "AKST": "Alaska Standard Time", "PST": "Pacific Standard Time", "PDT": "Pacific Daylight Time", "LHDT": "Lord Howe Daylight Time", "UYT": "Uruguay Standard Time", "WITA": "Central Indonesia Time", "AEDT": "Australian Eastern Daylight Time", "ACDT": "Australian Central Daylight Time", "ARST": "Argentina Summer Time", "MDT": "Mountain Daylight Time", "CLT": "Chile Standard Time", "JST": "Japan Standard Time", "SRT": "Suriname Time", "LHST": "Lord Howe Standard Time", "WEZ": "Western European Standard Time", "WIT": "Eastern Indonesia Time", "WART": "Western Argentina Standard Time", "GMT": "Greenwich Mean Time", "CST": "Central Standard Time", "ADT": "Atlantic Daylight Time", "HAT": "Newfoundland Daylight Time"},
+ timezones: map[string]string{"ACDT": "Australian Central Daylight Time", "AKST": "Alaska Standard Time", "NZST": "New Zealand Standard Time", "SAST": "South Africa Standard Time", "LHDT": "Lord Howe Daylight Time", "GYT": "Guyana Time", "OESZ": "Eastern European Summer Time", "WITA": "Central Indonesia Time", "EDT": "Eastern Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "HNT": "Newfoundland Standard Time", "ChST": "Chamorro Standard Time", "EST": "Eastern Standard Time", "OEZ": "Eastern European Standard Time", "∅∅∅": "Peru Summer Time", "WART": "Western Argentina Standard Time", "SRT": "Suriname Time", "ADT": "Atlantic Daylight Time", "AKDT": "Alaska Daylight Time", "UYST": "Uruguay Summer Time", "AST": "Atlantic Standard Time", "JST": "Japan Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "COT": "Colombia Standard Time", "WIB": "Western Indonesia Time", "CDT": "Central Daylight Time", "LHST": "Lord Howe Standard Time", "WARST": "Western Argentina Summer Time", "WAT": "West Africa Standard Time", "SGT": "Singapore Standard Time", "AEDT": "Australian Eastern Daylight Time", "UYT": "Uruguay Standard Time", "CST": "Central Standard Time", "ACWST": "Australian Central Western Standard Time", "TMT": "Turkmenistan Standard Time", "CLT": "Chile Standard Time", "EAT": "East Africa Time", "HKT": "Hong Kong Standard Time", "CHAST": "Chatham Standard Time", "ECT": "Ecuador Time", "AWST": "Australian Western Standard Time", "MYT": "Malaysia Time", "COST": "Colombia Summer Time", "WAST": "West Africa Summer Time", "IST": "India Standard Time", "WESZ": "Western European Summer Time", "GFT": "French Guiana Time", "AWDT": "Australian Western Daylight Time", "PDT": "Pacific Daylight Time", "CAT": "Central Africa Time", "GMT": "Greenwich Mean Time", "ART": "Argentina Standard Time", "MEZ": "Central European Standard Time", "HAT": "Newfoundland Daylight Time", "CLST": "Chile Summer Time", "VET": "Venezuela Time", "ACWDT": "Australian Central Western Daylight Time", "NZDT": "New Zealand Daylight Time", "BOT": "Bolivia Time", "HKST": "Hong Kong Summer Time", "MST": "Mountain Standard Time", "JDT": "Japan Daylight Time", "PST": "Pacific Standard Time", "MESZ": "Central European Summer Time", "WEZ": "Western European Standard Time", "AEST": "Australian Eastern Standard Time", "TMST": "Turkmenistan Summer Time", "BT": "Bhutan Time", "WIT": "Eastern Indonesia Time", "ACST": "Australian Central Standard Time", "CHADT": "Chatham Daylight Time", "ARST": "Argentina Summer Time", "MDT": "Mountain Daylight Time"},
}
}
diff --git a/en_CY/en_CY_test.go b/en_CY/en_CY_test.go
new file mode 100644
index 00000000..ad9b9681
--- /dev/null
+++ b/en_CY/en_CY_test.go
@@ -0,0 +1,1120 @@
+package en_CY
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_CY"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_DE/en_DE.go b/en_DE/en_DE.go
index 065035c0..97e1082c 100644
--- a/en_DE/en_DE.go
+++ b/en_DE/en_DE.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"TMST": "Turkmenistan Summer Time", "AKDT": "Alaska Daylight Time", "WEZ": "Western European Standard Time", "WITA": "Central Indonesia Time", "GYT": "Guyana Time", "NZDT": "New Zealand Daylight Time", "COT": "Colombia Standard Time", "GMT": "Greenwich Mean Time", "WIB": "Western Indonesia Time", "ACDT": "Australian Central Daylight Time", "AKST": "Alaska Standard Time", "PST": "Pacific Standard Time", "EST": "Eastern Standard Time", "MDT": "Macau Summer Time", "PDT": "Pacific Daylight Time", "AWDT": "Australian Western Daylight Time", "MESZ": "Central European Summer Time", "BOT": "Bolivia Time", "UYT": "Uruguay Standard Time", "ChST": "Chamorro Standard Time", "LHDT": "Lord Howe Daylight Time", "WESZ": "Western European Summer Time", "AEST": "Australian Eastern Standard Time", "AEDT": "Australian Eastern Daylight Time", "CAT": "Central Africa Time", "EDT": "Eastern Daylight Time", "WART": "Western Argentina Standard Time", "OESZ": "Eastern European Summer Time", "HAT": "Newfoundland Daylight Time", "EAT": "East Africa Time", "ARST": "Argentina Summer Time", "ACST": "Australian Central Standard Time", "SRT": "Suriname Time", "HADT": "Hawaii-Aleutian Daylight Time", "∅∅∅": "Amazon Summer Time", "UYST": "Uruguay Summer Time", "ACWDT": "Australian Central Western Daylight Time", "CHADT": "Chatham Daylight Time", "AST": "Atlantic Standard Time", "ADT": "Atlantic Daylight Time", "SGT": "Singapore Standard Time", "GFT": "French Guiana Time", "ART": "Argentina Standard Time", "JST": "Japan Standard Time", "CHAST": "Chatham Standard Time", "VET": "Venezuela Time", "HKST": "Hong Kong Summer Time", "WARST": "Western Argentina Summer Time", "CLST": "Chile Summer Time", "COST": "Colombia Summer Time", "SAST": "South Africa Standard Time", "WIT": "Eastern Indonesia Time", "MYT": "Malaysia Time", "IST": "India Standard Time", "AWST": "Australian Western Standard Time", "CST": "Central Standard Time", "CLT": "Chile Standard Time", "ECT": "Ecuador Time", "MST": "Macau Standard Time", "TMT": "Turkmenistan Standard Time", "CDT": "Central Daylight Time", "NZST": "New Zealand Standard Time", "ACWST": "Australian Central Western Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "WAST": "West Africa Summer Time", "HNT": "Newfoundland Standard Time", "LHST": "Lord Howe Standard Time", "JDT": "Japan Daylight Time", "MEZ": "Central European Standard Time", "WAT": "West Africa Standard Time", "BT": "Bhutan Time", "HKT": "Hong Kong Standard Time", "OEZ": "Eastern European Standard Time"},
+ timezones: map[string]string{"ADT": "Atlantic Daylight Time", "ARST": "Argentina Summer Time", "WAST": "West Africa Summer Time", "CHADT": "Chatham Daylight Time", "AWST": "Australian Western Standard Time", "ART": "Argentina Standard Time", "PDT": "Pacific Daylight Time", "TMST": "Turkmenistan Summer Time", "MDT": "Mountain Daylight Time", "ACWST": "Australian Central Western Standard Time", "ACWDT": "Australian Central Western Daylight Time", "MST": "Mountain Standard Time", "GFT": "French Guiana Time", "ACST": "Australian Central Standard Time", "UYT": "Uruguay Standard Time", "EAT": "East Africa Time", "WARST": "Western Argentina Summer Time", "AKDT": "Alaska Daylight Time", "AEST": "Australian Eastern Standard Time", "LHST": "Lord Howe Standard Time", "LHDT": "Lord Howe Daylight Time", "CDT": "Central Daylight Time", "HKST": "Hong Kong Summer Time", "JDT": "Japan Daylight Time", "WEZ": "Western European Standard Time", "GYT": "Guyana Time", "VET": "Venezuela Time", "OESZ": "Eastern European Summer Time", "BT": "Bhutan Time", "MYT": "Malaysia Time", "WIT": "Eastern Indonesia Time", "ACDT": "Australian Central Daylight Time", "AST": "Atlantic Standard Time", "MESZ": "Central European Summer Time", "OEZ": "Eastern European Standard Time", "CHAST": "Chatham Standard Time", "WITA": "Central Indonesia Time", "EST": "Eastern Standard Time", "WAT": "West Africa Standard Time", "CLST": "Chile Summer Time", "AWDT": "Australian Western Daylight Time", "IST": "India Standard Time", "NZDT": "New Zealand Daylight Time", "WESZ": "Western European Summer Time", "TMT": "Turkmenistan Standard Time", "AEDT": "Australian Eastern Daylight Time", "COST": "Colombia Summer Time", "HADT": "Hawaii-Aleutian Daylight Time", "PST": "Pacific Standard Time", "MEZ": "Central European Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "ECT": "Ecuador Time", "WART": "Western Argentina Standard Time", "HKT": "Hong Kong Standard Time", "EDT": "Eastern Daylight Time", "CAT": "Central Africa Time", "GMT": "Greenwich Mean Time", "UYST": "Uruguay Summer Time", "JST": "Japan Standard Time", "AKST": "Alaska Standard Time", "COT": "Colombia Standard Time", "WIB": "Western Indonesia Time", "CLT": "Chile Standard Time", "NZST": "New Zealand Standard Time", "BOT": "Bolivia Time", "SAST": "South Africa Standard Time", "HNT": "Newfoundland Standard Time", "HAT": "Newfoundland Daylight Time", "ChST": "Chamorro Standard Time", "SRT": "Suriname Time", "CST": "Central Standard Time", "SGT": "Singapore Standard Time", "∅∅∅": "Peru Summer Time"},
}
}
@@ -114,8 +114,8 @@ func (en *en_DE) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
func (en *en_DE) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
n := math.Abs(num)
- nMod100 := math.Mod(n, 100)
nMod10 := math.Mod(n, 10)
+ nMod100 := math.Mod(n, 100)
if nMod10 == 1 && nMod100 != 11 {
return locales.PluralRuleOne
diff --git a/en_DE/en_DE_test.go b/en_DE/en_DE_test.go
new file mode 100644
index 00000000..f5ff5b4b
--- /dev/null
+++ b/en_DE/en_DE_test.go
@@ -0,0 +1,1120 @@
+package en_DE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_DE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_DG/en_DG.go b/en_DG/en_DG.go
index 1315a811..20abbc92 100644
--- a/en_DG/en_DG.go
+++ b/en_DG/en_DG.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"WARST": "Western Argentina Summer Time", "∅∅∅": "Amazon Summer Time", "TMST": "Turkmenistan Summer Time", "PST": "Pacific Standard Time", "BOT": "Bolivia Time", "ChST": "Chamorro Standard Time", "CAT": "Central Africa Time", "WITA": "Central Indonesia Time", "TMT": "Turkmenistan Standard Time", "IST": "India Standard Time", "EAT": "East Africa Time", "SAST": "South Africa Standard Time", "JDT": "Japan Daylight Time", "CLT": "Chile Standard Time", "GMT": "Greenwich Mean Time", "SRT": "Suriname Time", "ACWST": "Australian Central Western Standard Time", "HKT": "Hong Kong Standard Time", "HNT": "Newfoundland Standard Time", "GFT": "French Guiana Time", "MST": "Macau Standard Time", "LHST": "Lord Howe Standard Time", "COT": "Colombia Standard Time", "WAST": "West Africa Summer Time", "WIT": "Eastern Indonesia Time", "ACDT": "Australian Central Daylight Time", "ARST": "Argentina Summer Time", "VET": "Venezuela Time", "HAST": "Hawaii-Aleutian Standard Time", "WART": "Western Argentina Standard Time", "WIB": "Western Indonesia Time", "MDT": "Macau Summer Time", "PDT": "Pacific Daylight Time", "NZDT": "New Zealand Daylight Time", "WESZ": "Western European Summer Time", "ACWDT": "Australian Central Western Daylight Time", "CLST": "Chile Summer Time", "AWST": "Australian Western Standard Time", "UYT": "Uruguay Standard Time", "OESZ": "Eastern European Summer Time", "AKDT": "Alaska Daylight Time", "GYT": "Guyana Time", "NZST": "New Zealand Standard Time", "CHAST": "Chatham Standard Time", "CHADT": "Chatham Daylight Time", "EST": "Eastern Standard Time", "ECT": "Ecuador Time", "ADT": "Atlantic Daylight Time", "ART": "Argentina Standard Time", "AKST": "Alaska Standard Time", "CST": "Central Standard Time", "UYST": "Uruguay Summer Time", "AWDT": "Australian Western Daylight Time", "CDT": "Central Daylight Time", "EDT": "Eastern Daylight Time", "COST": "Colombia Summer Time", "BT": "Bhutan Time", "ACST": "Australian Central Standard Time", "LHDT": "Lord Howe Daylight Time", "AST": "Atlantic Standard Time", "HKST": "Hong Kong Summer Time", "OEZ": "Eastern European Standard Time", "HAT": "Newfoundland Daylight Time", "JST": "Japan Standard Time", "MEZ": "Central European Standard Time", "MESZ": "Central European Summer Time", "AEST": "Australian Eastern Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "WAT": "West Africa Standard Time", "MYT": "Malaysia Time", "WEZ": "Western European Standard Time", "AEDT": "Australian Eastern Daylight Time", "SGT": "Singapore Standard Time"},
+ timezones: map[string]string{"WART": "Western Argentina Standard Time", "ACWDT": "Australian Central Western Daylight Time", "ChST": "Chamorro Standard Time", "CDT": "Central Daylight Time", "CLST": "Chile Summer Time", "UYST": "Uruguay Summer Time", "VET": "Venezuela Time", "JST": "Japan Standard Time", "MESZ": "Central European Summer Time", "HADT": "Hawaii-Aleutian Daylight Time", "LHST": "Lord Howe Standard Time", "MEZ": "Central European Standard Time", "GYT": "Guyana Time", "BT": "Bhutan Time", "ACST": "Australian Central Standard Time", "MDT": "Mountain Daylight Time", "HKT": "Hong Kong Standard Time", "ADT": "Atlantic Daylight Time", "SGT": "Singapore Standard Time", "CAT": "Central Africa Time", "OEZ": "Eastern European Standard Time", "AEDT": "Australian Eastern Daylight Time", "UYT": "Uruguay Standard Time", "WARST": "Western Argentina Summer Time", "AST": "Atlantic Standard Time", "ACWST": "Australian Central Western Standard Time", "PST": "Pacific Standard Time", "AEST": "Australian Eastern Standard Time", "HNT": "Newfoundland Standard Time", "OESZ": "Eastern European Summer Time", "CST": "Central Standard Time", "CHADT": "Chatham Daylight Time", "ARST": "Argentina Summer Time", "AWDT": "Australian Western Daylight Time", "NZST": "New Zealand Standard Time", "WAT": "West Africa Standard Time", "∅∅∅": "Amazon Summer Time", "LHDT": "Lord Howe Daylight Time", "MST": "Mountain Standard Time", "CHAST": "Chatham Standard Time", "HAT": "Newfoundland Daylight Time", "GMT": "Greenwich Mean Time", "HKST": "Hong Kong Summer Time", "AKDT": "Alaska Daylight Time", "AWST": "Australian Western Standard Time", "SAST": "South Africa Standard Time", "EST": "Eastern Standard Time", "WEZ": "Western European Standard Time", "ECT": "Ecuador Time", "IST": "India Standard Time", "EDT": "Eastern Daylight Time", "COST": "Colombia Summer Time", "TMT": "Turkmenistan Standard Time", "ACDT": "Australian Central Daylight Time", "ART": "Argentina Standard Time", "JDT": "Japan Daylight Time", "WAST": "West Africa Summer Time", "WESZ": "Western European Summer Time", "WIB": "Western Indonesia Time", "TMST": "Turkmenistan Summer Time", "WIT": "Eastern Indonesia Time", "EAT": "East Africa Time", "MYT": "Malaysia Time", "WITA": "Central Indonesia Time", "AKST": "Alaska Standard Time", "BOT": "Bolivia Time", "COT": "Colombia Standard Time", "SRT": "Suriname Time", "GFT": "French Guiana Time", "HAST": "Hawaii-Aleutian Standard Time", "NZDT": "New Zealand Daylight Time", "PDT": "Pacific Daylight Time", "CLT": "Chile Standard Time"},
}
}
diff --git a/en_DG/en_DG_test.go b/en_DG/en_DG_test.go
new file mode 100644
index 00000000..d9548ef8
--- /dev/null
+++ b/en_DG/en_DG_test.go
@@ -0,0 +1,1120 @@
+package en_DG
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_DG"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_DK/en_DK.go b/en_DK/en_DK.go
index 79daafac..d5f44677 100644
--- a/en_DK/en_DK.go
+++ b/en_DK/en_DK.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"ECT": "Ecuador Time", "JDT": "Japan Daylight Time", "UYT": "Uruguay Standard Time", "CDT": "Central Daylight Time", "COT": "Colombia Standard Time", "GMT": "Greenwich Mean Time", "ARST": "Argentina Summer Time", "NZDT": "New Zealand Daylight Time", "AWST": "Australian Western Standard Time", "AEDT": "Australian Eastern Daylight Time", "HKST": "Hong Kong Summer Time", "BT": "Bhutan Time", "HNT": "Newfoundland Standard Time", "WITA": "Central Indonesia Time", "AKST": "Alaska Standard Time", "GYT": "Guyana Time", "NZST": "New Zealand Standard Time", "WEZ": "Western European Standard Time", "SRT": "Suriname Time", "AKDT": "Alaska Daylight Time", "PST": "Pacific Standard Time", "TMT": "Turkmenistan Standard Time", "EST": "Eastern Standard Time", "HKT": "Hong Kong Standard Time", "TMST": "Turkmenistan Summer Time", "LHST": "Lord Howe Standard Time", "AEST": "Australian Eastern Standard Time", "EDT": "Eastern Daylight Time", "SGT": "Singapore Standard Time", "WIT": "Eastern Indonesia Time", "OEZ": "Eastern European Standard Time", "∅∅∅": "Amazon Summer Time", "COST": "Colombia Summer Time", "HAST": "Hawaii-Aleutian Standard Time", "WAT": "West Africa Standard Time", "MST": "Macau Standard Time", "MEZ": "Central European Standard Time", "CHADT": "Chatham Daylight Time", "AST": "Atlantic Standard Time", "WART": "Western Argentina Standard Time", "GFT": "French Guiana Time", "CLT": "Chile Standard Time", "ACWST": "Australian Central Western Standard Time", "WESZ": "Western European Summer Time", "WAST": "West Africa Summer Time", "WIB": "Western Indonesia Time", "EAT": "East Africa Time", "MESZ": "Central European Summer Time", "CHAST": "Chatham Standard Time", "HAT": "Newfoundland Daylight Time", "OESZ": "Eastern European Summer Time", "ACST": "Australian Central Standard Time", "AWDT": "Australian Western Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "LHDT": "Lord Howe Daylight Time", "MYT": "Malaysia Time", "JST": "Japan Standard Time", "WARST": "Western Argentina Summer Time", "PDT": "Pacific Daylight Time", "BOT": "Bolivia Time", "CLST": "Chile Summer Time", "ChST": "Chamorro Standard Time", "ACWDT": "Australian Central Western Daylight Time", "CAT": "Central Africa Time", "ADT": "Atlantic Daylight Time", "SAST": "South Africa Standard Time", "ART": "Argentina Standard Time", "ACDT": "Australian Central Daylight Time", "UYST": "Uruguay Summer Time", "VET": "Venezuela Time", "IST": "India Standard Time", "MDT": "Macau Summer Time", "CST": "Central Standard Time"},
+ timezones: map[string]string{"HNT": "Newfoundland Standard Time", "OESZ": "Eastern European Summer Time", "ChST": "Chamorro Standard Time", "ACWDT": "Australian Central Western Daylight Time", "AWDT": "Australian Western Daylight Time", "ADT": "Atlantic Daylight Time", "EST": "Eastern Standard Time", "PDT": "Pacific Daylight Time", "COST": "Colombia Summer Time", "UYT": "Uruguay Standard Time", "VET": "Venezuela Time", "AKDT": "Alaska Daylight Time", "OEZ": "Eastern European Standard Time", "AEDT": "Australian Eastern Daylight Time", "LHST": "Lord Howe Standard Time", "MST": "Mountain Standard Time", "AKST": "Alaska Standard Time", "SAST": "South Africa Standard Time", "TMST": "Turkmenistan Summer Time", "GYT": "Guyana Time", "LHDT": "Lord Howe Daylight Time", "NZST": "New Zealand Standard Time", "MESZ": "Central European Summer Time", "HADT": "Hawaii-Aleutian Daylight Time", "WESZ": "Western European Summer Time", "SRT": "Suriname Time", "PST": "Pacific Standard Time", "WAST": "West Africa Summer Time", "WEZ": "Western European Standard Time", "CLT": "Chile Standard Time", "ACDT": "Australian Central Daylight Time", "BOT": "Bolivia Time", "MEZ": "Central European Standard Time", "SGT": "Singapore Standard Time", "WARST": "Western Argentina Summer Time", "WIB": "Western Indonesia Time", "CHAST": "Chatham Standard Time", "NZDT": "New Zealand Daylight Time", "CAT": "Central Africa Time", "COT": "Colombia Standard Time", "CHADT": "Chatham Daylight Time", "JST": "Japan Standard Time", "ACWST": "Australian Central Western Standard Time", "GMT": "Greenwich Mean Time", "AEST": "Australian Eastern Standard Time", "CST": "Central Standard Time", "ACST": "Australian Central Standard Time", "ARST": "Argentina Summer Time", "ECT": "Ecuador Time", "∅∅∅": "Amazon Summer Time", "TMT": "Turkmenistan Standard Time", "HAT": "Newfoundland Daylight Time", "UYST": "Uruguay Summer Time", "WIT": "Eastern Indonesia Time", "MDT": "Mountain Daylight Time", "WITA": "Central Indonesia Time", "EDT": "Eastern Daylight Time", "CLST": "Chile Summer Time", "GFT": "French Guiana Time", "HKT": "Hong Kong Standard Time", "JDT": "Japan Daylight Time", "ART": "Argentina Standard Time", "IST": "India Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "MYT": "Malaysia Time", "AST": "Atlantic Standard Time", "CDT": "Central Daylight Time", "WART": "Western Argentina Standard Time", "WAT": "West Africa Standard Time", "EAT": "East Africa Time", "BT": "Bhutan Time", "HKST": "Hong Kong Summer Time", "AWST": "Australian Western Standard Time"},
}
}
diff --git a/en_DK/en_DK_test.go b/en_DK/en_DK_test.go
new file mode 100644
index 00000000..225b1f69
--- /dev/null
+++ b/en_DK/en_DK_test.go
@@ -0,0 +1,1120 @@
+package en_DK
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_DK"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_DM/en_DM.go b/en_DM/en_DM.go
index bacb4b77..79941fb9 100644
--- a/en_DM/en_DM.go
+++ b/en_DM/en_DM.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"EST": "Eastern Standard Time", "SGT": "Singapore Standard Time", "LHDT": "Lord Howe Daylight Time", "ACWST": "Australian Central Western Standard Time", "OESZ": "Eastern European Summer Time", "GMT": "Greenwich Mean Time", "GFT": "French Guiana Time", "CST": "Central Standard Time", "MEZ": "Central European Standard Time", "WESZ": "Western European Summer Time", "AEST": "Australian Eastern Standard Time", "CLST": "Chile Summer Time", "HNT": "Newfoundland Standard Time", "AKST": "Alaska Standard Time", "GYT": "Guyana Time", "WEZ": "Western European Standard Time", "VET": "Venezuela Time", "HKT": "Hong Kong Standard Time", "ART": "Argentina Standard Time", "CAT": "Central Africa Time", "WARST": "Western Argentina Summer Time", "WIB": "Western Indonesia Time", "TMT": "Turkmenistan Standard Time", "JDT": "Japan Daylight Time", "CHADT": "Chatham Daylight Time", "COT": "Colombia Standard Time", "MESZ": "Central European Summer Time", "UYST": "Uruguay Summer Time", "MYT": "Malaysia Time", "SRT": "Suriname Time", "MDT": "Mountain Daylight Time", "CLT": "Chile Standard Time", "∅∅∅": "Brasilia Summer Time", "BT": "Bhutan Time", "ACDT": "Australian Central Daylight Time", "AKDT": "Alaska Daylight Time", "COST": "Colombia Summer Time", "WAT": "West Africa Standard Time", "IST": "India Standard Time", "JST": "Japan Standard Time", "NZST": "New Zealand Standard Time", "ChST": "Chamorro Standard Time", "CHAST": "Chatham Standard Time", "EDT": "Eastern Daylight Time", "ECT": "Ecuador Time", "HADT": "Hawaii-Aleutian Daylight Time", "HKST": "Hong Kong Summer Time", "ACWDT": "Australian Central Western Daylight Time", "AST": "Atlantic Standard Time", "ARST": "Argentina Summer Time", "AWDT": "Australian Western Daylight Time", "LHST": "Lord Howe Standard Time", "AEDT": "Australian Eastern Daylight Time", "PST": "Pacific Standard Time", "AWST": "Australian Western Standard Time", "WAST": "West Africa Summer Time", "OEZ": "Eastern European Standard Time", "EAT": "East Africa Time", "ACST": "Australian Central Standard Time", "ADT": "Atlantic Daylight Time", "WIT": "Eastern Indonesia Time", "BOT": "Bolivia Time", "HAST": "Hawaii-Aleutian Standard Time", "SAST": "South Africa Standard Time", "WART": "Western Argentina Standard Time", "WITA": "Central Indonesia Time", "CDT": "Central Daylight Time", "NZDT": "New Zealand Daylight Time", "MST": "Mountain Standard Time", "HAT": "Newfoundland Daylight Time", "TMST": "Turkmenistan Summer Time", "PDT": "Pacific Daylight Time", "UYT": "Uruguay Standard Time"},
+ timezones: map[string]string{"AKST": "Alaska Standard Time", "ADT": "Atlantic Daylight Time", "ARST": "Argentina Summer Time", "ChST": "Chamorro Standard Time", "WART": "Western Argentina Standard Time", "CHADT": "Chatham Daylight Time", "WEZ": "Western European Standard Time", "HAT": "Newfoundland Daylight Time", "LHDT": "Lord Howe Daylight Time", "MDT": "Mountain Daylight Time", "CHAST": "Chatham Standard Time", "CAT": "Central Africa Time", "SGT": "Singapore Standard Time", "UYT": "Uruguay Standard Time", "UYST": "Uruguay Summer Time", "WAT": "West Africa Standard Time", "OEZ": "Eastern European Standard Time", "AEDT": "Australian Eastern Daylight Time", "CLST": "Chile Summer Time", "JDT": "Japan Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "HNT": "Newfoundland Standard Time", "LHST": "Lord Howe Standard Time", "CDT": "Central Daylight Time", "PST": "Pacific Standard Time", "MYT": "Malaysia Time", "HKST": "Hong Kong Summer Time", "ART": "Argentina Standard Time", "JST": "Japan Standard Time", "WITA": "Central Indonesia Time", "BOT": "Bolivia Time", "BT": "Bhutan Time", "CST": "Central Standard Time", "ACST": "Australian Central Standard Time", "∅∅∅": "Amazon Summer Time", "WIB": "Western Indonesia Time", "GYT": "Guyana Time", "AWST": "Australian Western Standard Time", "IST": "India Standard Time", "EST": "Eastern Standard Time", "EDT": "Eastern Daylight Time", "PDT": "Pacific Daylight Time", "MESZ": "Central European Summer Time", "COT": "Colombia Standard Time", "SRT": "Suriname Time", "AKDT": "Alaska Daylight Time", "ACWST": "Australian Central Western Standard Time", "SAST": "South Africa Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "WAST": "West Africa Summer Time", "WESZ": "Western European Summer Time", "NZDT": "New Zealand Daylight Time", "GFT": "French Guiana Time", "ACWDT": "Australian Central Western Daylight Time", "HKT": "Hong Kong Standard Time", "VET": "Venezuela Time", "AST": "Atlantic Standard Time", "NZST": "New Zealand Standard Time", "MEZ": "Central European Standard Time", "COST": "Colombia Summer Time", "OESZ": "Eastern European Summer Time", "WIT": "Eastern Indonesia Time", "ACDT": "Australian Central Daylight Time", "AWDT": "Australian Western Daylight Time", "WARST": "Western Argentina Summer Time", "TMT": "Turkmenistan Standard Time", "AEST": "Australian Eastern Standard Time", "EAT": "East Africa Time", "MST": "Mountain Standard Time", "TMST": "Turkmenistan Summer Time", "GMT": "Greenwich Mean Time", "CLT": "Chile Standard Time", "ECT": "Ecuador Time"},
}
}
diff --git a/en_DM/en_DM_test.go b/en_DM/en_DM_test.go
new file mode 100644
index 00000000..b48f1654
--- /dev/null
+++ b/en_DM/en_DM_test.go
@@ -0,0 +1,1120 @@
+package en_DM
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_DM"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_ER/en_ER.go b/en_ER/en_ER.go
index c5e4a910..00d668e6 100644
--- a/en_ER/en_ER.go
+++ b/en_ER/en_ER.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"GMT": "Greenwich Mean Time", "GFT": "French Guiana Time", "AWDT": "Australian Western Daylight Time", "NZST": "New Zealand Standard Time", "SGT": "Singapore Standard Time", "MDT": "Macau Summer Time", "ART": "Argentina Standard Time", "TMT": "Turkmenistan Standard Time", "AEDT": "Australian Eastern Daylight Time", "BT": "Bhutan Time", "WAST": "West Africa Summer Time", "OESZ": "Eastern European Summer Time", "MYT": "Malaysia Time", "CLST": "Chile Summer Time", "∅∅∅": "Brasilia Summer Time", "NZDT": "New Zealand Daylight Time", "ACWDT": "Australian Central Western Daylight Time", "SRT": "Suriname Time", "GYT": "Guyana Time", "MEZ": "Central European Standard Time", "CLT": "Chile Standard Time", "ACST": "Australian Central Standard Time", "OEZ": "Eastern European Standard Time", "MESZ": "Central European Summer Time", "UYT": "Uruguay Standard Time", "WART": "Western Argentina Standard Time", "SAST": "South Africa Standard Time", "IST": "India Standard Time", "ARST": "Argentina Summer Time", "AKST": "Alaska Standard Time", "PST": "Pacific Standard Time", "CHAST": "Chatham Standard Time", "ADT": "Atlantic Daylight Time", "ACDT": "Australian Central Daylight Time", "AKDT": "Alaska Daylight Time", "BOT": "Bolivia Time", "ECT": "Ecuador Time", "JDT": "Japan Daylight Time", "WEZ": "Western European Standard Time", "AST": "Atlantic Standard Time", "CDT": "Central Daylight Time", "JST": "Japan Standard Time", "HNT": "Newfoundland Standard Time", "WIT": "Eastern Indonesia Time", "PDT": "Pacific Daylight Time", "LHST": "Lord Howe Standard Time", "LHDT": "Lord Howe Daylight Time", "VET": "Venezuela Time", "WARST": "Western Argentina Summer Time", "COT": "Colombia Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "HKST": "Hong Kong Summer Time", "MST": "Macau Standard Time", "WESZ": "Western European Summer Time", "ACWST": "Australian Central Western Standard Time", "EST": "Eastern Standard Time", "CHADT": "Chatham Daylight Time", "AWST": "Australian Western Standard Time", "HKT": "Hong Kong Standard Time", "WIB": "Western Indonesia Time", "EAT": "East Africa Time", "TMST": "Turkmenistan Summer Time", "CST": "Central Standard Time", "UYST": "Uruguay Summer Time", "AEST": "Australian Eastern Standard Time", "CAT": "Central Africa Time", "ChST": "Chamorro Standard Time", "HAT": "Newfoundland Daylight Time", "WITA": "Central Indonesia Time", "COST": "Colombia Summer Time", "HADT": "Hawaii-Aleutian Daylight Time", "WAT": "West Africa Standard Time", "EDT": "Eastern Daylight Time"},
+ timezones: map[string]string{"AST": "Atlantic Standard Time", "ART": "Argentina Standard Time", "AKDT": "Alaska Daylight Time", "MYT": "Malaysia Time", "WIT": "Eastern Indonesia Time", "BT": "Bhutan Time", "WARST": "Western Argentina Summer Time", "SRT": "Suriname Time", "AWDT": "Australian Western Daylight Time", "GMT": "Greenwich Mean Time", "BOT": "Bolivia Time", "SGT": "Singapore Standard Time", "OEZ": "Eastern European Standard Time", "ACST": "Australian Central Standard Time", "AKST": "Alaska Standard Time", "NZDT": "New Zealand Daylight Time", "COT": "Colombia Standard Time", "CAT": "Central Africa Time", "GYT": "Guyana Time", "MESZ": "Central European Summer Time", "IST": "India Standard Time", "WAT": "West Africa Standard Time", "ADT": "Atlantic Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "OESZ": "Eastern European Summer Time", "LHST": "Lord Howe Standard Time", "MDT": "Mountain Daylight Time", "GFT": "French Guiana Time", "WIB": "Western Indonesia Time", "HAT": "Newfoundland Daylight Time", "NZST": "New Zealand Standard Time", "∅∅∅": "Amazon Summer Time", "ACDT": "Australian Central Daylight Time", "ECT": "Ecuador Time", "JST": "Japan Standard Time", "ACWST": "Australian Central Western Standard Time", "UYST": "Uruguay Summer Time", "CST": "Central Standard Time", "CDT": "Central Daylight Time", "PST": "Pacific Standard Time", "CLST": "Chile Summer Time", "MEZ": "Central European Standard Time", "AEST": "Australian Eastern Standard Time", "AEDT": "Australian Eastern Daylight Time", "CLT": "Chile Standard Time", "EAT": "East Africa Time", "ARST": "Argentina Summer Time", "WITA": "Central Indonesia Time", "TMT": "Turkmenistan Standard Time", "TMST": "Turkmenistan Summer Time", "EDT": "Eastern Daylight Time", "UYT": "Uruguay Standard Time", "CHAST": "Chatham Standard Time", "SAST": "South Africa Standard Time", "EST": "Eastern Standard Time", "HNT": "Newfoundland Standard Time", "LHDT": "Lord Howe Daylight Time", "WART": "Western Argentina Standard Time", "CHADT": "Chatham Daylight Time", "PDT": "Pacific Daylight Time", "WESZ": "Western European Summer Time", "HKT": "Hong Kong Standard Time", "JDT": "Japan Daylight Time", "ACWDT": "Australian Central Western Daylight Time", "COST": "Colombia Summer Time", "VET": "Venezuela Time", "AWST": "Australian Western Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "ChST": "Chamorro Standard Time", "MST": "Mountain Standard Time", "HKST": "Hong Kong Summer Time", "WAST": "West Africa Summer Time", "WEZ": "Western European Standard Time"},
}
}
diff --git a/en_ER/en_ER_test.go b/en_ER/en_ER_test.go
new file mode 100644
index 00000000..f56a74aa
--- /dev/null
+++ b/en_ER/en_ER_test.go
@@ -0,0 +1,1120 @@
+package en_ER
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_ER"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_FI/en_FI.go b/en_FI/en_FI.go
index b2d1326c..f734b34e 100644
--- a/en_FI/en_FI.go
+++ b/en_FI/en_FI.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"IST": "India Standard Time", "MDT": "Macau Summer Time", "TMST": "Turkmenistan Summer Time", "CDT": "Central Daylight Time", "UYT": "Uruguay Standard Time", "VET": "Venezuela Time", "COT": "Colombia Standard Time", "HKT": "Hong Kong Standard Time", "OESZ": "Eastern European Summer Time", "ACDT": "Australian Central Daylight Time", "LHDT": "Lord Howe Daylight Time", "NZDT": "New Zealand Daylight Time", "WART": "Western Argentina Standard Time", "AKST": "Alaska Standard Time", "AKDT": "Alaska Daylight Time", "AWDT": "Australian Western Daylight Time", "MESZ": "Central European Summer Time", "CLST": "Chile Summer Time", "ADT": "Atlantic Daylight Time", "MST": "Macau Standard Time", "WARST": "Western Argentina Summer Time", "HNT": "Newfoundland Standard Time", "HAT": "Newfoundland Daylight Time", "WIT": "Eastern Indonesia Time", "PDT": "Pacific Daylight Time", "CST": "Central Standard Time", "CHAST": "Chatham Standard Time", "BT": "Bhutan Time", "HAST": "Hawaii-Aleutian Standard Time", "CLT": "Chile Standard Time", "MEZ": "Central European Standard Time", "SGT": "Singapore Standard Time", "AWST": "Australian Western Standard Time", "HKST": "Hong Kong Summer Time", "GMT": "Greenwich Mean Time", "EAT": "East Africa Time", "NZST": "New Zealand Standard Time", "CAT": "Central Africa Time", "WAST": "West Africa Summer Time", "AEST": "Australian Eastern Standard Time", "ECT": "Ecuador Time", "MYT": "Malaysia Time", "ChST": "Chamorro Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "ART": "Argentina Standard Time", "SRT": "Suriname Time", "COST": "Colombia Summer Time", "ARST": "Argentina Summer Time", "WITA": "Central Indonesia Time", "AST": "Atlantic Standard Time", "GYT": "Guyana Time", "JDT": "Japan Daylight Time", "UYST": "Uruguay Summer Time", "OEZ": "Eastern European Standard Time", "WAT": "West Africa Standard Time", "WIB": "Western Indonesia Time", "SAST": "South Africa Standard Time", "WEZ": "Western European Standard Time", "GFT": "French Guiana Time", "∅∅∅": "Amazon Summer Time", "PST": "Pacific Standard Time", "LHST": "Lord Howe Standard Time", "BOT": "Bolivia Time", "ACWST": "Australian Central Western Standard Time", "CHADT": "Chatham Daylight Time", "EDT": "Eastern Daylight Time", "ACST": "Australian Central Standard Time", "JST": "Japan Standard Time", "WESZ": "Western European Summer Time", "ACWDT": "Australian Central Western Daylight Time", "AEDT": "Australian Eastern Daylight Time", "EST": "Eastern Standard Time", "TMT": "Turkmenistan Standard Time"},
+ timezones: map[string]string{"WARST": "Western Argentina Summer Time", "ECT": "Ecuador Time", "SAST": "South Africa Standard Time", "SGT": "Singapore Standard Time", "WAT": "West Africa Standard Time", "EAT": "East Africa Time", "ARST": "Argentina Summer Time", "OEZ": "Eastern European Standard Time", "AWDT": "Australian Western Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "TMST": "Turkmenistan Summer Time", "AEST": "Australian Eastern Standard Time", "SRT": "Suriname Time", "MST": "Macau Standard Time", "HKT": "Hong Kong Standard Time", "CAT": "Central Africa Time", "AEDT": "Australian Eastern Daylight Time", "CLST": "Chile Summer Time", "HNT": "Newfoundland Standard Time", "GMT": "Greenwich Mean Time", "UYT": "Uruguay Standard Time", "BT": "Bhutan Time", "ACWST": "Australian Central Western Standard Time", "ACWDT": "Australian Central Western Daylight Time", "TMT": "Turkmenistan Standard Time", "GYT": "Guyana Time", "WIT": "Eastern Indonesia Time", "MEZ": "Central European Standard Time", "BOT": "Bolivia Time", "COT": "Colombia Standard Time", "OESZ": "Eastern European Summer Time", "JDT": "Japan Daylight Time", "EDT": "Eastern Daylight Time", "CLT": "Chile Standard Time", "VET": "Venezuela Time", "MDT": "Macau Summer Time", "ADT": "Atlantic Daylight Time", "WESZ": "Western European Summer Time", "MYT": "Malaysia Time", "IST": "India Standard Time", "CST": "Central Standard Time", "NZST": "New Zealand Standard Time", "NZDT": "New Zealand Daylight Time", "EST": "Eastern Standard Time", "WAST": "West Africa Summer Time", "HAT": "Newfoundland Daylight Time", "ChST": "Chamorro Standard Time", "LHDT": "Lord Howe Daylight Time", "CDT": "Central Daylight Time", "WART": "Western Argentina Standard Time", "COST": "Colombia Summer Time", "ACST": "Australian Central Standard Time", "HKST": "Hong Kong Summer Time", "CHAST": "Chatham Standard Time", "ART": "Argentina Standard Time", "WITA": "Central Indonesia Time", "AST": "Atlantic Standard Time", "AWST": "Australian Western Standard Time", "PDT": "Pacific Daylight Time", "WIB": "Western Indonesia Time", "GFT": "French Guiana Time", "CHADT": "Chatham Daylight Time", "JST": "Japan Standard Time", "PST": "Pacific Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "UYST": "Uruguay Summer Time", "LHST": "Lord Howe Standard Time", "ACDT": "Australian Central Daylight Time", "∅∅∅": "Azores Summer Time", "AKST": "Alaska Standard Time", "AKDT": "Alaska Daylight Time", "MESZ": "Central European Summer Time", "WEZ": "Western European Standard Time"},
}
}
@@ -114,8 +114,8 @@ func (en *en_FI) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
func (en *en_FI) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
n := math.Abs(num)
- nMod10 := math.Mod(n, 10)
nMod100 := math.Mod(n, 100)
+ nMod10 := math.Mod(n, 10)
if nMod10 == 1 && nMod100 != 11 {
return locales.PluralRuleOne
diff --git a/en_FI/en_FI_test.go b/en_FI/en_FI_test.go
new file mode 100644
index 00000000..97767454
--- /dev/null
+++ b/en_FI/en_FI_test.go
@@ -0,0 +1,1120 @@
+package en_FI
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_FI"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_FJ/en_FJ.go b/en_FJ/en_FJ.go
index 3396a308..728b08ec 100644
--- a/en_FJ/en_FJ.go
+++ b/en_FJ/en_FJ.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"∅∅∅": "Amazon Summer Time", "COT": "Colombia Standard Time", "BT": "Bhutan Time", "HAT": "Newfoundland Daylight Time", "ACST": "Australian Central Standard Time", "ARST": "Argentina Summer Time", "JST": "Japan Standard Time", "JDT": "Japan Daylight Time", "AKDT": "Alaska Daylight Time", "UYST": "Uruguay Summer Time", "CHADT": "Chatham Daylight Time", "WITA": "Central Indonesia Time", "MYT": "Malaysia Time", "WAST": "West Africa Summer Time", "IST": "India Standard Time", "GMT": "Greenwich Mean Time", "EAT": "East Africa Time", "ART": "Argentina Standard Time", "PDT": "Pacific Daylight Time", "GYT": "Guyana Time", "CST": "Central Standard Time", "CLT": "Chile Standard Time", "AEDT": "Australian Eastern Daylight Time", "ECT": "Ecuador Time", "AST": "Atlantic Standard Time", "SGT": "Singapore Standard Time", "WARST": "Western Argentina Summer Time", "WIB": "Western Indonesia Time", "WESZ": "Western European Summer Time", "SAST": "South Africa Standard Time", "MST": "Macau Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "AKST": "Alaska Standard Time", "NZDT": "New Zealand Daylight Time", "VET": "Venezuela Time", "ADT": "Atlantic Daylight Time", "PST": "Pacific Standard Time", "WEZ": "Western European Standard Time", "COST": "Colombia Summer Time", "HNT": "Newfoundland Standard Time", "ACDT": "Australian Central Daylight Time", "AWST": "Australian Western Standard Time", "AWDT": "Australian Western Daylight Time", "MESZ": "Central European Summer Time", "UYT": "Uruguay Standard Time", "CLST": "Chile Summer Time", "ACWDT": "Australian Central Western Daylight Time", "HKST": "Hong Kong Summer Time", "SRT": "Suriname Time", "CDT": "Central Daylight Time", "NZST": "New Zealand Standard Time", "ACWST": "Australian Central Western Standard Time", "OEZ": "Eastern European Standard Time", "EDT": "Eastern Daylight Time", "MDT": "Macau Summer Time", "BOT": "Bolivia Time", "ChST": "Chamorro Standard Time", "CHAST": "Chatham Standard Time", "WAT": "West Africa Standard Time", "WIT": "Eastern Indonesia Time", "GFT": "French Guiana Time", "TMT": "Turkmenistan Standard Time", "TMST": "Turkmenistan Summer Time", "LHST": "Lord Howe Standard Time", "LHDT": "Lord Howe Daylight Time", "MEZ": "Central European Standard Time", "EST": "Eastern Standard Time", "OESZ": "Eastern European Summer Time", "AEST": "Australian Eastern Standard Time", "CAT": "Central Africa Time", "HADT": "Hawaii-Aleutian Daylight Time", "HKT": "Hong Kong Standard Time", "WART": "Western Argentina Standard Time"},
+ timezones: map[string]string{"ART": "Argentina Standard Time", "NZDT": "New Zealand Daylight Time", "HKT": "Hong Kong Standard Time", "PDT": "Pacific Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "WIB": "Western Indonesia Time", "CDT": "Central Daylight Time", "UYST": "Uruguay Summer Time", "WART": "Western Argentina Standard Time", "ACWST": "Australian Central Western Standard Time", "SAST": "South Africa Standard Time", "WAST": "West Africa Summer Time", "GYT": "Guyana Time", "CHAST": "Chatham Standard Time", "MDT": "Mountain Daylight Time", "SRT": "Suriname Time", "JDT": "Japan Daylight Time", "IST": "India Standard Time", "HNT": "Newfoundland Standard Time", "BT": "Bhutan Time", "WARST": "Western Argentina Summer Time", "CHADT": "Chatham Daylight Time", "BOT": "Bolivia Time", "COT": "Colombia Standard Time", "ACDT": "Australian Central Daylight Time", "ECT": "Ecuador Time", "AKST": "Alaska Standard Time", "WITA": "Central Indonesia Time", "JST": "Japan Standard Time", "EST": "Eastern Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "TMT": "Turkmenistan Standard Time", "CLST": "Chile Summer Time", "WAT": "West Africa Standard Time", "HAT": "Newfoundland Daylight Time", "ACST": "Australian Central Standard Time", "CLT": "Chile Standard Time", "GFT": "French Guiana Time", "AKDT": "Alaska Daylight Time", "ADT": "Atlantic Daylight Time", "OEZ": "Eastern European Standard Time", "PST": "Pacific Standard Time", "MESZ": "Central European Summer Time", "UYT": "Uruguay Standard Time", "CST": "Central Standard Time", "AST": "Atlantic Standard Time", "OESZ": "Eastern European Summer Time", "LHST": "Lord Howe Standard Time", "ACWDT": "Australian Central Western Daylight Time", "TMST": "Turkmenistan Summer Time", "CAT": "Central Africa Time", "WEZ": "Western European Standard Time", "SGT": "Singapore Standard Time", "WIT": "Eastern Indonesia Time", "LHDT": "Lord Howe Daylight Time", "MYT": "Malaysia Time", "HKST": "Hong Kong Summer Time", "AWST": "Australian Western Standard Time", "AWDT": "Australian Western Daylight Time", "EAT": "East Africa Time", "AEDT": "Australian Eastern Daylight Time", "MEZ": "Central European Standard Time", "AEST": "Australian Eastern Standard Time", "VET": "Venezuela Time", "WESZ": "Western European Summer Time", "COST": "Colombia Summer Time", "ChST": "Chamorro Standard Time", "MST": "Mountain Standard Time", "∅∅∅": "Brasilia Summer Time", "ARST": "Argentina Summer Time", "EDT": "Eastern Daylight Time", "NZST": "New Zealand Standard Time", "GMT": "Greenwich Mean Time"},
}
}
diff --git a/en_FJ/en_FJ_test.go b/en_FJ/en_FJ_test.go
new file mode 100644
index 00000000..40df4e7d
--- /dev/null
+++ b/en_FJ/en_FJ_test.go
@@ -0,0 +1,1120 @@
+package en_FJ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_FJ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_FK/en_FK.go b/en_FK/en_FK.go
index 3fa412d2..d0778629 100644
--- a/en_FK/en_FK.go
+++ b/en_FK/en_FK.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"WART": "Western Argentina Standard Time", "VET": "Venezuela Time", "LHDT": "Lord Howe Daylight Time", "ECT": "Ecuador Time", "HKT": "Hong Kong Standard Time", "MST": "Macau Standard Time", "UYT": "Uruguay Standard Time", "OEZ": "Eastern European Standard Time", "∅∅∅": "Amazon Summer Time", "PST": "Pacific Standard Time", "AEST": "Australian Eastern Standard Time", "WAT": "West Africa Standard Time", "MDT": "Macau Summer Time", "EST": "Eastern Standard Time", "ART": "Argentina Standard Time", "ARST": "Argentina Summer Time", "AWDT": "Australian Western Daylight Time", "JST": "Japan Standard Time", "BOT": "Bolivia Time", "ChST": "Chamorro Standard Time", "CHADT": "Chatham Daylight Time", "EAT": "East Africa Time", "CLST": "Chile Summer Time", "NZDT": "New Zealand Daylight Time", "LHST": "Lord Howe Standard Time", "MESZ": "Central European Summer Time", "WEZ": "Western European Standard Time", "COT": "Colombia Standard Time", "WAST": "West Africa Summer Time", "TMT": "Turkmenistan Standard Time", "JDT": "Japan Daylight Time", "UYST": "Uruguay Summer Time", "IST": "India Standard Time", "GFT": "French Guiana Time", "WIT": "Eastern Indonesia Time", "TMST": "Turkmenistan Summer Time", "GYT": "Guyana Time", "CST": "Central Standard Time", "CHAST": "Chatham Standard Time", "AST": "Atlantic Standard Time", "ADT": "Atlantic Daylight Time", "HNT": "Newfoundland Standard Time", "PDT": "Pacific Daylight Time", "ACST": "Australian Central Standard Time", "ACWST": "Australian Central Western Standard Time", "OESZ": "Eastern European Summer Time", "GMT": "Greenwich Mean Time", "HAT": "Newfoundland Daylight Time", "AKST": "Alaska Standard Time", "MYT": "Malaysia Time", "NZST": "New Zealand Standard Time", "WESZ": "Western European Summer Time", "AEDT": "Australian Eastern Daylight Time", "CAT": "Central Africa Time", "COST": "Colombia Summer Time", "SGT": "Singapore Standard Time", "SRT": "Suriname Time", "BT": "Bhutan Time", "EDT": "Eastern Daylight Time", "WARST": "Western Argentina Summer Time", "WIB": "Western Indonesia Time", "WITA": "Central Indonesia Time", "CLT": "Chile Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "SAST": "South Africa Standard Time", "ACWDT": "Australian Central Western Daylight Time", "AKDT": "Alaska Daylight Time", "AWST": "Australian Western Standard Time", "CDT": "Central Daylight Time", "MEZ": "Central European Standard Time", "HKST": "Hong Kong Summer Time", "ACDT": "Australian Central Daylight Time"},
+ timezones: map[string]string{"ADT": "Atlantic Daylight Time", "WEZ": "Western European Standard Time", "MST": "Mountain Standard Time", "HAT": "Newfoundland Daylight Time", "WAST": "West Africa Summer Time", "MYT": "Malaysia Time", "HKT": "Hong Kong Standard Time", "CHADT": "Chatham Daylight Time", "BOT": "Bolivia Time", "WAT": "West Africa Standard Time", "GYT": "Guyana Time", "MDT": "Mountain Daylight Time", "VET": "Venezuela Time", "UYST": "Uruguay Summer Time", "CHAST": "Chatham Standard Time", "ACWST": "Australian Central Western Standard Time", "PDT": "Pacific Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "NZDT": "New Zealand Daylight Time", "WIB": "Western Indonesia Time", "HNT": "Newfoundland Standard Time", "GFT": "French Guiana Time", "JDT": "Japan Daylight Time", "OEZ": "Eastern European Standard Time", "ARST": "Argentina Summer Time", "IST": "India Standard Time", "TMST": "Turkmenistan Summer Time", "UYT": "Uruguay Standard Time", "LHDT": "Lord Howe Daylight Time", "ChST": "Chamorro Standard Time", "AWST": "Australian Western Standard Time", "ART": "Argentina Standard Time", "WITA": "Central Indonesia Time", "∅∅∅": "Amazon Summer Time", "COT": "Colombia Standard Time", "EDT": "Eastern Daylight Time", "AEST": "Australian Eastern Standard Time", "WIT": "Eastern Indonesia Time", "ACDT": "Australian Central Daylight Time", "HKST": "Hong Kong Summer Time", "CLST": "Chile Summer Time", "ACST": "Australian Central Standard Time", "WART": "Western Argentina Standard Time", "NZST": "New Zealand Standard Time", "EST": "Eastern Standard Time", "SGT": "Singapore Standard Time", "WESZ": "Western European Summer Time", "CLT": "Chile Standard Time", "WARST": "Western Argentina Summer Time", "AKDT": "Alaska Daylight Time", "PST": "Pacific Standard Time", "MESZ": "Central European Summer Time", "GMT": "Greenwich Mean Time", "SRT": "Suriname Time", "LHST": "Lord Howe Standard Time", "AWDT": "Australian Western Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "COST": "Colombia Summer Time", "AEDT": "Australian Eastern Daylight Time", "EAT": "East Africa Time", "AST": "Atlantic Standard Time", "MEZ": "Central European Standard Time", "ECT": "Ecuador Time", "SAST": "South Africa Standard Time", "CAT": "Central Africa Time", "BT": "Bhutan Time", "CST": "Central Standard Time", "CDT": "Central Daylight Time", "JST": "Japan Standard Time", "AKST": "Alaska Standard Time", "ACWDT": "Australian Central Western Daylight Time", "TMT": "Turkmenistan Standard Time", "OESZ": "Eastern European Summer Time"},
}
}
diff --git a/en_FK/en_FK_test.go b/en_FK/en_FK_test.go
new file mode 100644
index 00000000..95de997a
--- /dev/null
+++ b/en_FK/en_FK_test.go
@@ -0,0 +1,1120 @@
+package en_FK
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_FK"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_FM/en_FM.go b/en_FM/en_FM.go
index 079926b6..f32bc56d 100644
--- a/en_FM/en_FM.go
+++ b/en_FM/en_FM.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"JST": "Japan Standard Time", "AKST": "Alaska Standard Time", "HKT": "Hong Kong Standard Time", "TMT": "Turkmenistan Standard Time", "LHST": "Lord Howe Standard Time", "CAT": "Central Africa Time", "SGT": "Singapore Standard Time", "WART": "Western Argentina Standard Time", "WIT": "Eastern Indonesia Time", "CST": "Central Standard Time", "EDT": "Eastern Daylight Time", "HKST": "Hong Kong Summer Time", "ACDT": "Australian Central Daylight Time", "MYT": "Malaysia Time", "PST": "Pacific Standard Time", "MESZ": "Central European Summer Time", "WESZ": "Western European Summer Time", "ACWST": "Australian Central Western Standard Time", "GYT": "Guyana Time", "AKDT": "Alaska Daylight Time", "UYT": "Uruguay Standard Time", "CHADT": "Chatham Daylight Time", "ACST": "Australian Central Standard Time", "GFT": "French Guiana Time", "TMST": "Turkmenistan Summer Time", "MST": "Mountain Standard Time", "WEZ": "Western European Standard Time", "WARST": "Western Argentina Summer Time", "WAST": "West Africa Summer Time", "HAT": "Newfoundland Daylight Time", "WIB": "Western Indonesia Time", "OEZ": "Eastern European Standard Time", "PDT": "Pacific Daylight Time", "AWST": "Australian Western Standard Time", "NZST": "New Zealand Standard Time", "ACWDT": "Australian Central Western Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "AWDT": "Australian Western Daylight Time", "∅∅∅": "Azores Summer Time", "ChST": "Chamorro Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "BT": "Bhutan Time", "VET": "Venezuela Time", "AEST": "Australian Eastern Standard Time", "EAT": "East Africa Time", "LHDT": "Lord Howe Daylight Time", "MDT": "Mountain Daylight Time", "HNT": "Newfoundland Standard Time", "OESZ": "Eastern European Summer Time", "BOT": "Bolivia Time", "UYST": "Uruguay Summer Time", "IST": "India Standard Time", "ART": "Argentina Standard Time", "COST": "Colombia Summer Time", "SRT": "Suriname Time", "NZDT": "New Zealand Daylight Time", "CLT": "Chile Standard Time", "CLST": "Chile Summer Time", "EST": "Eastern Standard Time", "CDT": "Central Daylight Time", "ECT": "Ecuador Time", "GMT": "Greenwich Mean Time", "MEZ": "Central European Standard Time", "CHAST": "Chatham Standard Time", "AEDT": "Australian Eastern Daylight Time", "COT": "Colombia Standard Time", "WAT": "West Africa Standard Time", "AST": "Atlantic Standard Time", "JDT": "Japan Daylight Time", "ADT": "Atlantic Daylight Time", "SAST": "South Africa Standard Time", "WITA": "Central Indonesia Time", "ARST": "Argentina Summer Time"},
+ timezones: map[string]string{"SAST": "South Africa Standard Time", "LHDT": "Lord Howe Daylight Time", "CDT": "Central Daylight Time", "MST": "Macau Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "BOT": "Bolivia Time", "UYT": "Uruguay Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "NZDT": "New Zealand Daylight Time", "SGT": "Singapore Standard Time", "GMT": "Greenwich Mean Time", "CAT": "Central Africa Time", "ART": "Argentina Standard Time", "JDT": "Japan Daylight Time", "AWDT": "Australian Western Daylight Time", "WIB": "Western Indonesia Time", "WAST": "West Africa Summer Time", "CLT": "Chile Standard Time", "ACDT": "Australian Central Daylight Time", "SRT": "Suriname Time", "GFT": "French Guiana Time", "MEZ": "Central European Standard Time", "∅∅∅": "Azores Summer Time", "AST": "Atlantic Standard Time", "TMST": "Turkmenistan Summer Time", "WEZ": "Western European Standard Time", "ACWDT": "Australian Central Western Daylight Time", "PDT": "Pacific Daylight Time", "OEZ": "Eastern European Standard Time", "ChST": "Chamorro Standard Time", "EAT": "East Africa Time", "PST": "Pacific Standard Time", "TMT": "Turkmenistan Standard Time", "WAT": "West Africa Standard Time", "CST": "Central Standard Time", "ECT": "Ecuador Time", "WITA": "Central Indonesia Time", "AKST": "Alaska Standard Time", "AWST": "Australian Western Standard Time", "NZST": "New Zealand Standard Time", "IST": "India Standard Time", "OESZ": "Eastern European Summer Time", "VET": "Venezuela Time", "HKT": "Hong Kong Standard Time", "CHAST": "Chatham Standard Time", "ACWST": "Australian Central Western Standard Time", "UYST": "Uruguay Summer Time", "WART": "Western Argentina Standard Time", "MESZ": "Central European Summer Time", "EDT": "Eastern Daylight Time", "CLST": "Chile Summer Time", "LHST": "Lord Howe Standard Time", "WARST": "Western Argentina Summer Time", "CHADT": "Chatham Daylight Time", "COT": "Colombia Standard Time", "AEDT": "Australian Eastern Daylight Time", "AKDT": "Alaska Daylight Time", "HNT": "Newfoundland Standard Time", "AEST": "Australian Eastern Standard Time", "MYT": "Malaysia Time", "WIT": "Eastern Indonesia Time", "HKST": "Hong Kong Summer Time", "JST": "Japan Standard Time", "EST": "Eastern Standard Time", "WESZ": "Western European Summer Time", "GYT": "Guyana Time", "ACST": "Australian Central Standard Time", "ARST": "Argentina Summer Time", "COST": "Colombia Summer Time", "HAT": "Newfoundland Daylight Time", "MDT": "Macau Summer Time", "ADT": "Atlantic Daylight Time", "BT": "Bhutan Time"},
}
}
diff --git a/en_FM/en_FM_test.go b/en_FM/en_FM_test.go
new file mode 100644
index 00000000..104bdb1e
--- /dev/null
+++ b/en_FM/en_FM_test.go
@@ -0,0 +1,1120 @@
+package en_FM
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_FM"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_GB/en_GB.go b/en_GB/en_GB.go
index dffbf499..4be0945a 100644
--- a/en_GB/en_GB.go
+++ b/en_GB/en_GB.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"SGT": "Singapore Standard Time", "AWST": "Australian Western Standard Time", "LHST": "Lord Howe Standard Time", "ACWST": "Australian Central Western Standard Time", "CHADT": "Chatham Daylight Time", "COST": "Colombia Summer Time", "ECT": "Ecuador Time", "HKT": "Hong Kong Standard Time", "OESZ": "Eastern European Summer Time", "WITA": "Central Indonesia Time", "ARST": "Argentina Summer Time", "NZST": "New Zealand Standard Time", "EDT": "Eastern Daylight Time", "MDT": "Macau Summer Time", "BOT": "Bolivia Time", "WEZ": "Western European Standard Time", "CLST": "Chile Summer Time", "CAT": "Central Africa Time", "ADT": "Atlantic Daylight Time", "HNT": "Newfoundland Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "WAT": "West Africa Standard Time", "AKDT": "Alaska Daylight Time", "LHDT": "Lord Howe Daylight Time", "GYT": "Guyana Time", "JDT": "Japan Daylight Time", "WIT": "Eastern Indonesia Time", "MST": "Macau Standard Time", "CDT": "Central Daylight Time", "MESZ": "Central European Summer Time", "VET": "Venezuela Time", "SAST": "South Africa Standard Time", "BT": "Bhutan Time", "WART": "Western Argentina Standard Time", "CST": "Central Standard Time", "EST": "Eastern Standard Time", "COT": "Colombia Standard Time", "AST": "Atlantic Standard Time", "∅∅∅": "Acre Summer Time", "WAST": "West Africa Summer Time", "TMT": "Turkmenistan Standard Time", "AEST": "Australian Eastern Standard Time", "OEZ": "Eastern European Standard Time", "WESZ": "Western European Summer Time", "CLT": "Chile Standard Time", "GFT": "French Guiana Time", "PST": "Pacific Standard Time", "MEZ": "Central European Standard Time", "AEDT": "Australian Eastern Daylight Time", "ChST": "Chamorro Standard Time", "JST": "Japan Standard Time", "ACWDT": "Australian Central Western Daylight Time", "SRT": "Suriname Time", "AKST": "Alaska Standard Time", "PDT": "Pacific Daylight Time", "AWDT": "Australian Western Daylight Time", "IST": "India Standard Time", "ACDT": "Australian Central Daylight Time", "UYT": "Uruguay Standard Time", "CHAST": "Chatham Standard Time", "GMT": "Greenwich Mean Time", "HAT": "Newfoundland Daylight Time", "EAT": "East Africa Time", "ACST": "Australian Central Standard Time", "ART": "Argentina Standard Time", "NZDT": "New Zealand Daylight Time", "UYST": "Uruguay Summer Time", "WIB": "Western Indonesia Time", "TMST": "Turkmenistan Summer Time", "HKST": "Hong Kong Summer Time", "WARST": "Western Argentina Summer Time", "MYT": "Malaysia Time"},
+ timezones: map[string]string{"GYT": "Guyana Time", "ADT": "Atlantic Daylight Time", "EST": "Eastern Standard Time", "WESZ": "Western European Summer Time", "NZST": "New Zealand Standard Time", "SGT": "Singapore Standard Time", "ACDT": "Australian Central Daylight Time", "WART": "Western Argentina Standard Time", "GFT": "French Guiana Time", "MDT": "Macau Summer Time", "PST": "Pacific Standard Time", "MEZ": "Central European Standard Time", "LHDT": "Lord Howe Daylight Time", "MST": "Macau Standard Time", "AEDT": "Australian Eastern Daylight Time", "CLT": "Chile Standard Time", "WIB": "Western Indonesia Time", "EAT": "East Africa Time", "CST": "Central Standard Time", "MESZ": "Central European Summer Time", "HAST": "Hawaii-Aleutian Standard Time", "NZDT": "New Zealand Daylight Time", "CLST": "Chile Summer Time", "AKST": "Alaska Standard Time", "∅∅∅": "Amazon Summer Time", "TMT": "Turkmenistan Standard Time", "BT": "Bhutan Time", "LHST": "Lord Howe Standard Time", "CHAST": "Chatham Standard Time", "HAT": "Newfoundland Daylight Time", "OESZ": "Eastern European Summer Time", "HNT": "Newfoundland Standard Time", "VET": "Venezuela Time", "AWDT": "Australian Western Daylight Time", "JDT": "Japan Daylight Time", "BOT": "Bolivia Time", "COT": "Colombia Standard Time", "COST": "Colombia Summer Time", "TMST": "Turkmenistan Summer Time", "MYT": "Malaysia Time", "ECT": "Ecuador Time", "AST": "Atlantic Standard Time", "ACWDT": "Australian Central Western Daylight Time", "SRT": "Suriname Time", "ACST": "Australian Central Standard Time", "AWST": "Australian Western Standard Time", "ARST": "Argentina Summer Time", "OEZ": "Eastern European Standard Time", "IST": "India Standard Time", "UYST": "Uruguay Summer Time", "WIT": "Eastern Indonesia Time", "ART": "Argentina Standard Time", "WITA": "Central Indonesia Time", "HADT": "Hawaii-Aleutian Daylight Time", "WAST": "West Africa Summer Time", "ACWST": "Australian Central Western Standard Time", "EDT": "Eastern Daylight Time", "CAT": "Central Africa Time", "HKT": "Hong Kong Standard Time", "SAST": "South Africa Standard Time", "WEZ": "Western European Standard Time", "AKDT": "Alaska Daylight Time", "UYT": "Uruguay Standard Time", "HKST": "Hong Kong Summer Time", "CHADT": "Chatham Daylight Time", "JST": "Japan Standard Time", "WARST": "Western Argentina Summer Time", "WAT": "West Africa Standard Time", "ChST": "Chamorro Standard Time", "AEST": "Australian Eastern Standard Time", "PDT": "Pacific Daylight Time", "GMT": "Greenwich Mean Time", "CDT": "Central Daylight Time"},
}
}
diff --git a/en_GB/en_GB_test.go b/en_GB/en_GB_test.go
new file mode 100644
index 00000000..cb8359b3
--- /dev/null
+++ b/en_GB/en_GB_test.go
@@ -0,0 +1,1120 @@
+package en_GB
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_GB"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_GD/en_GD.go b/en_GD/en_GD.go
index 385586e9..42f3dff2 100644
--- a/en_GD/en_GD.go
+++ b/en_GD/en_GD.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"SRT": "Suriname Time", "HKT": "Hong Kong Standard Time", "CHADT": "Chatham Daylight Time", "CLT": "Chile Standard Time", "CAT": "Central Africa Time", "ACDT": "Australian Central Daylight Time", "TMT": "Turkmenistan Standard Time", "AWST": "Australian Western Standard Time", "GYT": "Guyana Time", "AEDT": "Australian Eastern Daylight Time", "MEZ": "Central European Standard Time", "AEST": "Australian Eastern Standard Time", "COST": "Colombia Summer Time", "BOT": "Bolivia Time", "WESZ": "Western European Summer Time", "AKST": "Alaska Standard Time", "CST": "Central Standard Time", "GFT": "French Guiana Time", "HADT": "Hawaii-Aleutian Daylight Time", "WAST": "West Africa Summer Time", "WARST": "Western Argentina Summer Time", "OEZ": "Eastern European Standard Time", "HNT": "Newfoundland Standard Time", "CDT": "Central Daylight Time", "WEZ": "Western European Standard Time", "AST": "Atlantic Standard Time", "IST": "India Standard Time", "OESZ": "Eastern European Summer Time", "CLST": "Chile Summer Time", "ECT": "Ecuador Time", "ADT": "Atlantic Daylight Time", "SAST": "South Africa Standard Time", "ART": "Argentina Standard Time", "PDT": "Pacific Daylight Time", "ACWDT": "Australian Central Western Daylight Time", "SGT": "Singapore Standard Time", "WAT": "West Africa Standard Time", "HAT": "Newfoundland Daylight Time", "MYT": "Malaysia Time", "NZST": "New Zealand Standard Time", "NZDT": "New Zealand Daylight Time", "UYST": "Uruguay Summer Time", "EDT": "Eastern Daylight Time", "WIB": "Western Indonesia Time", "GMT": "Greenwich Mean Time", "TMST": "Turkmenistan Summer Time", "AKDT": "Alaska Daylight Time", "JST": "Japan Standard Time", "MST": "Mountain Standard Time", "ACWST": "Australian Central Western Standard Time", "BT": "Bhutan Time", "AWDT": "Australian Western Daylight Time", "LHDT": "Lord Howe Daylight Time", "UYT": "Uruguay Standard Time", "VET": "Venezuela Time", "WART": "Western Argentina Standard Time", "EAT": "East Africa Time", "WIT": "Eastern Indonesia Time", "ACST": "Australian Central Standard Time", "JDT": "Japan Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "COT": "Colombia Standard Time", "PST": "Pacific Standard Time", "LHST": "Lord Howe Standard Time", "EST": "Eastern Standard Time", "CHAST": "Chatham Standard Time", "ChST": "Chamorro Standard Time", "∅∅∅": "Brasilia Summer Time", "HKST": "Hong Kong Summer Time", "WITA": "Central Indonesia Time", "ARST": "Argentina Summer Time", "MESZ": "Central European Summer Time", "MDT": "Mountain Daylight Time"},
+ timezones: map[string]string{"GFT": "French Guiana Time", "VET": "Venezuela Time", "MEZ": "Central European Standard Time", "LHDT": "Lord Howe Daylight Time", "BOT": "Bolivia Time", "EST": "Eastern Standard Time", "CDT": "Central Daylight Time", "ACST": "Australian Central Standard Time", "GYT": "Guyana Time", "CLT": "Chile Standard Time", "LHST": "Lord Howe Standard Time", "ART": "Argentina Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "PST": "Pacific Standard Time", "PDT": "Pacific Daylight Time", "GMT": "Greenwich Mean Time", "ADT": "Atlantic Daylight Time", "CAT": "Central Africa Time", "EAT": "East Africa Time", "WITA": "Central Indonesia Time", "JST": "Japan Standard Time", "ACWDT": "Australian Central Western Daylight Time", "ACDT": "Australian Central Daylight Time", "JDT": "Japan Daylight Time", "AST": "Atlantic Standard Time", "HAT": "Newfoundland Daylight Time", "SRT": "Suriname Time", "CST": "Central Standard Time", "UYST": "Uruguay Summer Time", "MDT": "Macau Summer Time", "NZST": "New Zealand Standard Time", "IST": "India Standard Time", "WIB": "Western Indonesia Time", "WAT": "West Africa Standard Time", "OEZ": "Eastern European Standard Time", "WIT": "Eastern Indonesia Time", "HKT": "Hong Kong Standard Time", "ACWST": "Australian Central Western Standard Time", "SAST": "South Africa Standard Time", "MESZ": "Central European Summer Time", "TMST": "Turkmenistan Summer Time", "ARST": "Argentina Summer Time", "COST": "Colombia Summer Time", "CHAST": "Chatham Standard Time", "NZDT": "New Zealand Daylight Time", "EDT": "Eastern Daylight Time", "HNT": "Newfoundland Standard Time", "AEDT": "Australian Eastern Daylight Time", "ChST": "Chamorro Standard Time", "MYT": "Malaysia Time", "MST": "Macau Standard Time", "HKST": "Hong Kong Summer Time", "ECT": "Ecuador Time", "WAST": "West Africa Summer Time", "AEST": "Australian Eastern Standard Time", "COT": "Colombia Standard Time", "SGT": "Singapore Standard Time", "CLST": "Chile Summer Time", "UYT": "Uruguay Standard Time", "AWST": "Australian Western Standard Time", "AWDT": "Australian Western Daylight Time", "TMT": "Turkmenistan Standard Time", "WEZ": "Western European Standard Time", "OESZ": "Eastern European Summer Time", "AKDT": "Alaska Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "WESZ": "Western European Summer Time", "WARST": "Western Argentina Summer Time", "∅∅∅": "Azores Summer Time", "CHADT": "Chatham Daylight Time", "AKST": "Alaska Standard Time", "BT": "Bhutan Time", "WART": "Western Argentina Standard Time"},
}
}
diff --git a/en_GD/en_GD_test.go b/en_GD/en_GD_test.go
new file mode 100644
index 00000000..6b92f468
--- /dev/null
+++ b/en_GD/en_GD_test.go
@@ -0,0 +1,1120 @@
+package en_GD
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_GD"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_GG/en_GG.go b/en_GG/en_GG.go
index fde4fe56..4dbc443b 100644
--- a/en_GG/en_GG.go
+++ b/en_GG/en_GG.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"ACWDT": "Australian Central Western Daylight Time", "WIB": "Western Indonesia Time", "ARST": "Argentina Summer Time", "UYT": "Uruguay Standard Time", "WEZ": "Western European Standard Time", "WESZ": "Western European Summer Time", "CAT": "Central Africa Time", "TMST": "Turkmenistan Summer Time", "AKDT": "Alaska Daylight Time", "AWDT": "Australian Western Daylight Time", "AEDT": "Australian Eastern Daylight Time", "EDT": "Eastern Daylight Time", "∅∅∅": "Brasilia Summer Time", "HADT": "Hawaii-Aleutian Daylight Time", "AWST": "Australian Western Standard Time", "CDT": "Central Daylight Time", "NZDT": "New Zealand Daylight Time", "CLST": "Chile Summer Time", "COT": "Colombia Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "WAST": "West Africa Summer Time", "GMT": "Greenwich Mean Time", "ART": "Argentina Standard Time", "TMT": "Turkmenistan Standard Time", "AKST": "Alaska Standard Time", "JDT": "Japan Daylight Time", "CST": "Central Standard Time", "CHADT": "Chatham Daylight Time", "EST": "Eastern Standard Time", "SAST": "South Africa Standard Time", "LHST": "Lord Howe Standard Time", "NZST": "New Zealand Standard Time", "JST": "Japan Standard Time", "MDT": "Mountain Daylight Time", "SGT": "Singapore Standard Time", "IST": "India Standard Time", "CLT": "Chile Standard Time", "VET": "Venezuela Time", "WITA": "Central Indonesia Time", "PDT": "Pacific Daylight Time", "MST": "Mountain Standard Time", "HNT": "Newfoundland Standard Time", "GFT": "French Guiana Time", "ACST": "Australian Central Standard Time", "LHDT": "Lord Howe Daylight Time", "GYT": "Guyana Time", "MYT": "Malaysia Time", "AST": "Atlantic Standard Time", "WIT": "Eastern Indonesia Time", "ACDT": "Australian Central Daylight Time", "PST": "Pacific Standard Time", "ACWST": "Australian Central Western Standard Time", "COST": "Colombia Summer Time", "ECT": "Ecuador Time", "HKT": "Hong Kong Standard Time", "HKST": "Hong Kong Summer Time", "OESZ": "Eastern European Summer Time", "EAT": "East Africa Time", "SRT": "Suriname Time", "UYST": "Uruguay Summer Time", "WAT": "West Africa Standard Time", "BT": "Bhutan Time", "OEZ": "Eastern European Standard Time", "HAT": "Newfoundland Daylight Time", "BOT": "Bolivia Time", "CHAST": "Chatham Standard Time", "MEZ": "Central European Standard Time", "MESZ": "Central European Summer Time", "AEST": "Australian Eastern Standard Time", "WART": "Western Argentina Standard Time", "ChST": "Chamorro Standard Time", "ADT": "Atlantic Daylight Time", "WARST": "Western Argentina Summer Time"},
+ timezones: map[string]string{"ACWDT": "Australian Central Western Daylight Time", "JST": "Japan Standard Time", "ChST": "Chamorro Standard Time", "WARST": "Western Argentina Summer Time", "SRT": "Suriname Time", "CDT": "Central Daylight Time", "ACWST": "Australian Central Western Standard Time", "MDT": "Mountain Daylight Time", "UYST": "Uruguay Summer Time", "CST": "Central Standard Time", "ARST": "Argentina Summer Time", "BOT": "Bolivia Time", "GMT": "Greenwich Mean Time", "LHDT": "Lord Howe Daylight Time", "WIT": "Eastern Indonesia Time", "GFT": "French Guiana Time", "CHADT": "Chatham Daylight Time", "COT": "Colombia Standard Time", "TMT": "Turkmenistan Standard Time", "CLST": "Chile Summer Time", "UYT": "Uruguay Standard Time", "JDT": "Japan Daylight Time", "HAT": "Newfoundland Daylight Time", "ACDT": "Australian Central Daylight Time", "HKT": "Hong Kong Standard Time", "NZDT": "New Zealand Daylight Time", "MESZ": "Central European Summer Time", "HAST": "Hawaii-Aleutian Standard Time", "PST": "Pacific Standard Time", "PDT": "Pacific Daylight Time", "NZST": "New Zealand Standard Time", "WESZ": "Western European Summer Time", "MYT": "Malaysia Time", "WART": "Western Argentina Standard Time", "AKDT": "Alaska Daylight Time", "EST": "Eastern Standard Time", "SAST": "South Africa Standard Time", "AEST": "Australian Eastern Standard Time", "LHST": "Lord Howe Standard Time", "CHAST": "Chatham Standard Time", "VET": "Venezuela Time", "AWST": "Australian Western Standard Time", "∅∅∅": "Brasilia Summer Time", "EDT": "Eastern Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "WAST": "West Africa Summer Time", "MST": "Mountain Standard Time", "ECT": "Ecuador Time", "AWDT": "Australian Western Daylight Time", "MEZ": "Central European Standard Time", "HNT": "Newfoundland Standard Time", "OESZ": "Eastern European Summer Time", "WITA": "Central Indonesia Time", "AST": "Atlantic Standard Time", "ADT": "Atlantic Daylight Time", "TMST": "Turkmenistan Summer Time", "IST": "India Standard Time", "CAT": "Central Africa Time", "WAT": "West Africa Standard Time", "EAT": "East Africa Time", "ACST": "Australian Central Standard Time", "ART": "Argentina Standard Time", "WEZ": "Western European Standard Time", "WIB": "Western Indonesia Time", "AEDT": "Australian Eastern Daylight Time", "OEZ": "Eastern European Standard Time", "CLT": "Chile Standard Time", "BT": "Bhutan Time", "HKST": "Hong Kong Summer Time", "AKST": "Alaska Standard Time", "SGT": "Singapore Standard Time", "COST": "Colombia Summer Time", "GYT": "Guyana Time"},
}
}
diff --git a/en_GG/en_GG_test.go b/en_GG/en_GG_test.go
new file mode 100644
index 00000000..66b83cbc
--- /dev/null
+++ b/en_GG/en_GG_test.go
@@ -0,0 +1,1120 @@
+package en_GG
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_GG"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_GH/en_GH.go b/en_GH/en_GH.go
index a7700a16..1ae0f5d8 100644
--- a/en_GH/en_GH.go
+++ b/en_GH/en_GH.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"HKT": "Hong Kong Standard Time", "CDT": "Central Daylight Time", "∅∅∅": "Acre Summer Time", "WIB": "Western Indonesia Time", "GYT": "Guyana Time", "MEZ": "Central European Standard Time", "VET": "Venezuela Time", "WARST": "Western Argentina Summer Time", "MST": "Macau Standard Time", "TMST": "Turkmenistan Summer Time", "JST": "Japan Standard Time", "WEZ": "Western European Standard Time", "WAT": "West Africa Standard Time", "BT": "Bhutan Time", "UYT": "Uruguay Standard Time", "AEST": "Australian Eastern Standard Time", "CHADT": "Chatham Daylight Time", "COST": "Colombia Summer Time", "HADT": "Hawaii-Aleutian Daylight Time", "WITA": "Central Indonesia Time", "AWST": "Australian Western Standard Time", "LHDT": "Lord Howe Daylight Time", "NZST": "New Zealand Standard Time", "GMT": "Greenwich Mean Time", "CHAST": "Chatham Standard Time", "CLT": "Chile Standard Time", "GFT": "French Guiana Time", "AKST": "Alaska Standard Time", "PST": "Pacific Standard Time", "JDT": "Japan Daylight Time", "NZDT": "New Zealand Daylight Time", "ChST": "Chamorro Standard Time", "COT": "Colombia Standard Time", "WART": "Western Argentina Standard Time", "OEZ": "Eastern European Standard Time", "MDT": "Macau Summer Time", "ARST": "Argentina Summer Time", "AKDT": "Alaska Daylight Time", "UYST": "Uruguay Summer Time", "CLST": "Chile Summer Time", "SGT": "Singapore Standard Time", "PDT": "Pacific Daylight Time", "LHST": "Lord Howe Standard Time", "ACWDT": "Australian Central Western Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "MESZ": "Central European Summer Time", "HKST": "Hong Kong Summer Time", "ACWST": "Australian Central Western Standard Time", "AEDT": "Australian Eastern Daylight Time", "CAT": "Central Africa Time", "EST": "Eastern Standard Time", "ACST": "Australian Central Standard Time", "ART": "Argentina Standard Time", "TMT": "Turkmenistan Standard Time", "IST": "India Standard Time", "HNT": "Newfoundland Standard Time", "EDT": "Eastern Daylight Time", "WIT": "Eastern Indonesia Time", "ACDT": "Australian Central Daylight Time", "AWDT": "Australian Western Daylight Time", "MYT": "Malaysia Time", "CST": "Central Standard Time", "BOT": "Bolivia Time", "WESZ": "Western European Summer Time", "AST": "Atlantic Standard Time", "ADT": "Atlantic Daylight Time", "EAT": "East Africa Time", "SAST": "South Africa Standard Time", "WAST": "West Africa Summer Time", "OESZ": "Eastern European Summer Time", "HAT": "Newfoundland Daylight Time", "SRT": "Suriname Time", "ECT": "Ecuador Time"},
+ timezones: map[string]string{"MESZ": "Central European Summer Time", "OESZ": "Eastern European Summer Time", "CLST": "Chile Summer Time", "WARST": "Western Argentina Summer Time", "CDT": "Central Daylight Time", "IST": "India Standard Time", "ARST": "Argentina Summer Time", "WITA": "Central Indonesia Time", "PDT": "Pacific Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "WART": "Western Argentina Standard Time", "MDT": "Macau Summer Time", "MEZ": "Central European Standard Time", "UYT": "Uruguay Standard Time", "EAT": "East Africa Time", "ACDT": "Australian Central Daylight Time", "ECT": "Ecuador Time", "WESZ": "Western European Summer Time", "WIB": "Western Indonesia Time", "CAT": "Central Africa Time", "BOT": "Bolivia Time", "ADT": "Atlantic Daylight Time", "JDT": "Japan Daylight Time", "AKST": "Alaska Standard Time", "PST": "Pacific Standard Time", "GMT": "Greenwich Mean Time", "LHST": "Lord Howe Standard Time", "LHDT": "Lord Howe Daylight Time", "HKT": "Hong Kong Standard Time", "CST": "Central Standard Time", "UYST": "Uruguay Summer Time", "COST": "Colombia Summer Time", "WAST": "West Africa Summer Time", "WEZ": "Western European Standard Time", "COT": "Colombia Standard Time", "GYT": "Guyana Time", "ACWDT": "Australian Central Western Daylight Time", "CHAST": "Chatham Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "SAST": "South Africa Standard Time", "MYT": "Malaysia Time", "GFT": "French Guiana Time", "HNT": "Newfoundland Standard Time", "CLT": "Chile Standard Time", "NZDT": "New Zealand Daylight Time", "AKDT": "Alaska Daylight Time", "SGT": "Singapore Standard Time", "AEST": "Australian Eastern Standard Time", "AEDT": "Australian Eastern Daylight Time", "OEZ": "Eastern European Standard Time", "ACST": "Australian Central Standard Time", "VET": "Venezuela Time", "MST": "Macau Standard Time", "AST": "Atlantic Standard Time", "AWDT": "Australian Western Daylight Time", "JST": "Japan Standard Time", "TMST": "Turkmenistan Summer Time", "∅∅∅": "Azores Summer Time", "EST": "Eastern Standard Time", "BT": "Bhutan Time", "WIT": "Eastern Indonesia Time", "CHADT": "Chatham Daylight Time", "HAT": "Newfoundland Daylight Time", "SRT": "Suriname Time", "NZST": "New Zealand Standard Time", "ACWST": "Australian Central Western Standard Time", "EDT": "Eastern Daylight Time", "WAT": "West Africa Standard Time", "HKST": "Hong Kong Summer Time", "TMT": "Turkmenistan Standard Time", "ART": "Argentina Standard Time", "ChST": "Chamorro Standard Time", "AWST": "Australian Western Standard Time"},
}
}
diff --git a/en_GH/en_GH_test.go b/en_GH/en_GH_test.go
new file mode 100644
index 00000000..96704200
--- /dev/null
+++ b/en_GH/en_GH_test.go
@@ -0,0 +1,1120 @@
+package en_GH
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_GH"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_GI/en_GI.go b/en_GI/en_GI.go
index 76a8df8a..b6dcd40e 100644
--- a/en_GI/en_GI.go
+++ b/en_GI/en_GI.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"ECT": "Ecuador Time", "ADT": "Atlantic Daylight Time", "AKST": "Alaska Standard Time", "WITA": "Central Indonesia Time", "WIT": "Eastern Indonesia Time", "OESZ": "Eastern European Summer Time", "MEZ": "Central European Standard Time", "NZDT": "New Zealand Daylight Time", "CHADT": "Chatham Daylight Time", "MST": "Mountain Standard Time", "WAT": "West Africa Standard Time", "GMT": "Greenwich Mean Time", "ART": "Argentina Standard Time", "SRT": "Suriname Time", "EDT": "Eastern Daylight Time", "MYT": "Malaysia Time", "LHDT": "Lord Howe Daylight Time", "PDT": "Pacific Daylight Time", "LHST": "Lord Howe Standard Time", "NZST": "New Zealand Standard Time", "COT": "Colombia Standard Time", "WIB": "Western Indonesia Time", "TMT": "Turkmenistan Standard Time", "ACST": "Australian Central Standard Time", "AEST": "Australian Eastern Standard Time", "BT": "Bhutan Time", "TMST": "Turkmenistan Summer Time", "PST": "Pacific Standard Time", "GYT": "Guyana Time", "HAST": "Hawaii-Aleutian Standard Time", "SGT": "Singapore Standard Time", "OEZ": "Eastern European Standard Time", "EAT": "East Africa Time", "HADT": "Hawaii-Aleutian Daylight Time", "WART": "Western Argentina Standard Time", "ARST": "Argentina Summer Time", "HKST": "Hong Kong Summer Time", "WARST": "Western Argentina Summer Time", "IST": "India Standard Time", "UYT": "Uruguay Standard Time", "MESZ": "Central European Summer Time", "ChST": "Chamorro Standard Time", "EST": "Eastern Standard Time", "HAT": "Newfoundland Daylight Time", "JDT": "Japan Daylight Time", "HKT": "Hong Kong Standard Time", "ACDT": "Australian Central Daylight Time", "CLST": "Chile Summer Time", "VET": "Venezuela Time", "WEZ": "Western European Standard Time", "AEDT": "Australian Eastern Daylight Time", "SAST": "South Africa Standard Time", "WESZ": "Western European Summer Time", "GFT": "French Guiana Time", "BOT": "Bolivia Time", "AST": "Atlantic Standard Time", "WAST": "West Africa Summer Time", "AWDT": "Australian Western Daylight Time", "AKDT": "Alaska Daylight Time", "AWST": "Australian Western Standard Time", "CST": "Central Standard Time", "CDT": "Central Daylight Time", "UYST": "Uruguay Summer Time", "ACWDT": "Australian Central Western Daylight Time", "JST": "Japan Standard Time", "∅∅∅": "Brasilia Summer Time", "CAT": "Central Africa Time", "HNT": "Newfoundland Standard Time", "CHAST": "Chatham Standard Time", "CLT": "Chile Standard Time", "ACWST": "Australian Central Western Standard Time", "MDT": "Mountain Daylight Time", "COST": "Colombia Summer Time"},
+ timezones: map[string]string{"ChST": "Chamorro Standard Time", "LHST": "Lord Howe Standard Time", "ACDT": "Australian Central Daylight Time", "VET": "Venezuela Time", "GMT": "Greenwich Mean Time", "HKT": "Hong Kong Standard Time", "GYT": "Guyana Time", "CLT": "Chile Standard Time", "LHDT": "Lord Howe Daylight Time", "JDT": "Japan Daylight Time", "EDT": "Eastern Daylight Time", "ART": "Argentina Standard Time", "NZST": "New Zealand Standard Time", "NZDT": "New Zealand Daylight Time", "BOT": "Bolivia Time", "SGT": "Singapore Standard Time", "HNT": "Newfoundland Standard Time", "HKST": "Hong Kong Summer Time", "CHADT": "Chatham Daylight Time", "OEZ": "Eastern European Standard Time", "CAT": "Central Africa Time", "WAST": "West Africa Summer Time", "ADT": "Atlantic Daylight Time", "MESZ": "Central European Summer Time", "AWST": "Australian Western Standard Time", "SAST": "South Africa Standard Time", "EST": "Eastern Standard Time", "TMT": "Turkmenistan Standard Time", "ARST": "Argentina Summer Time", "AST": "Atlantic Standard Time", "ACWDT": "Australian Central Western Daylight Time", "MEZ": "Central European Standard Time", "OESZ": "Eastern European Summer Time", "UYST": "Uruguay Summer Time", "WIT": "Eastern Indonesia Time", "BT": "Bhutan Time", "MDT": "Macau Summer Time", "AKDT": "Alaska Daylight Time", "COST": "Colombia Summer Time", "MYT": "Malaysia Time", "IST": "India Standard Time", "COT": "Colombia Standard Time", "WARST": "Western Argentina Summer Time", "GFT": "French Guiana Time", "MST": "Macau Standard Time", "WIB": "Western Indonesia Time", "WEZ": "Western European Standard Time", "AEST": "Australian Eastern Standard Time", "CST": "Central Standard Time", "WART": "Western Argentina Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "CLST": "Chile Summer Time", "UYT": "Uruguay Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "PDT": "Pacific Daylight Time", "CHAST": "Chatham Standard Time", "WITA": "Central Indonesia Time", "AWDT": "Australian Western Daylight Time", "PST": "Pacific Standard Time", "HAT": "Newfoundland Daylight Time", "ACST": "Australian Central Standard Time", "∅∅∅": "Azores Summer Time", "ACWST": "Australian Central Western Standard Time", "CDT": "Central Daylight Time", "SRT": "Suriname Time", "WESZ": "Western European Summer Time", "AEDT": "Australian Eastern Daylight Time", "EAT": "East Africa Time", "JST": "Japan Standard Time", "TMST": "Turkmenistan Summer Time", "WAT": "West Africa Standard Time", "ECT": "Ecuador Time", "AKST": "Alaska Standard Time"},
}
}
diff --git a/en_GI/en_GI_test.go b/en_GI/en_GI_test.go
new file mode 100644
index 00000000..9d7d3c36
--- /dev/null
+++ b/en_GI/en_GI_test.go
@@ -0,0 +1,1120 @@
+package en_GI
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_GI"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_GM/en_GM.go b/en_GM/en_GM.go
index d01785c7..06b6003e 100644
--- a/en_GM/en_GM.go
+++ b/en_GM/en_GM.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"LHDT": "Lord Howe Daylight Time", "MEZ": "Central European Standard Time", "NZDT": "New Zealand Daylight Time", "WESZ": "Western European Summer Time", "COT": "Colombia Standard Time", "OESZ": "Eastern European Summer Time", "GFT": "French Guiana Time", "WIT": "Eastern Indonesia Time", "GYT": "Guyana Time", "COST": "Colombia Summer Time", "∅∅∅": "Brasilia Summer Time", "WAT": "West Africa Standard Time", "CST": "Central Standard Time", "UYT": "Uruguay Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "ADT": "Atlantic Daylight Time", "WART": "Western Argentina Standard Time", "SAST": "South Africa Standard Time", "MST": "Macau Standard Time", "AKST": "Alaska Standard Time", "AEST": "Australian Eastern Standard Time", "CAT": "Central Africa Time", "IST": "India Standard Time", "UYST": "Uruguay Summer Time", "ACWDT": "Australian Central Western Daylight Time", "CLT": "Chile Standard Time", "WEZ": "Western European Standard Time", "EST": "Eastern Standard Time", "HKT": "Hong Kong Standard Time", "ACST": "Australian Central Standard Time", "ARST": "Argentina Summer Time", "EAT": "East Africa Time", "AWST": "Australian Western Standard Time", "SRT": "Suriname Time", "BT": "Bhutan Time", "OEZ": "Eastern European Standard Time", "ART": "Argentina Standard Time", "NZST": "New Zealand Standard Time", "ACWST": "Australian Central Western Standard Time", "HKST": "Hong Kong Summer Time", "GMT": "Greenwich Mean Time", "HAT": "Newfoundland Daylight Time", "JST": "Japan Standard Time", "JDT": "Japan Daylight Time", "AEDT": "Australian Eastern Daylight Time", "VET": "Venezuela Time", "CHAST": "Chatham Standard Time", "ECT": "Ecuador Time", "WAST": "West Africa Summer Time", "HNT": "Newfoundland Standard Time", "ACDT": "Australian Central Daylight Time", "PST": "Pacific Standard Time", "MESZ": "Central European Summer Time", "BOT": "Bolivia Time", "WITA": "Central Indonesia Time", "TMST": "Turkmenistan Summer Time", "LHST": "Lord Howe Standard Time", "MYT": "Malaysia Time", "SGT": "Singapore Standard Time", "WARST": "Western Argentina Summer Time", "WIB": "Western Indonesia Time", "EDT": "Eastern Daylight Time", "MDT": "Macau Summer Time", "AKDT": "Alaska Daylight Time", "CDT": "Central Daylight Time", "CLST": "Chile Summer Time", "AWDT": "Australian Western Daylight Time", "ChST": "Chamorro Standard Time", "AST": "Atlantic Standard Time", "TMT": "Turkmenistan Standard Time", "PDT": "Pacific Daylight Time", "CHADT": "Chatham Daylight Time"},
+ timezones: map[string]string{"∅∅∅": "Azores Summer Time", "CHAST": "Chatham Standard Time", "AKDT": "Alaska Daylight Time", "AWST": "Australian Western Standard Time", "TMT": "Turkmenistan Standard Time", "WESZ": "Western European Summer Time", "CDT": "Central Daylight Time", "VET": "Venezuela Time", "AWDT": "Australian Western Daylight Time", "CAT": "Central Africa Time", "ACST": "Australian Central Standard Time", "COT": "Colombia Standard Time", "COST": "Colombia Summer Time", "SGT": "Singapore Standard Time", "WAST": "West Africa Summer Time", "OESZ": "Eastern European Summer Time", "ChST": "Chamorro Standard Time", "BT": "Bhutan Time", "CLT": "Chile Standard Time", "AKST": "Alaska Standard Time", "TMST": "Turkmenistan Summer Time", "GMT": "Greenwich Mean Time", "NZST": "New Zealand Standard Time", "MST": "Macau Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "NZDT": "New Zealand Daylight Time", "AEST": "Australian Eastern Standard Time", "CST": "Central Standard Time", "ADT": "Atlantic Daylight Time", "JST": "Japan Standard Time", "EST": "Eastern Standard Time", "MYT": "Malaysia Time", "UYST": "Uruguay Summer Time", "CHADT": "Chatham Daylight Time", "JDT": "Japan Daylight Time", "PST": "Pacific Standard Time", "HNT": "Newfoundland Standard Time", "CLST": "Chile Summer Time", "WITA": "Central Indonesia Time", "EDT": "Eastern Daylight Time", "HAT": "Newfoundland Daylight Time", "WIT": "Eastern Indonesia Time", "AST": "Atlantic Standard Time", "LHST": "Lord Howe Standard Time", "LHDT": "Lord Howe Daylight Time", "ARST": "Argentina Summer Time", "OEZ": "Eastern European Standard Time", "SAST": "South Africa Standard Time", "MDT": "Macau Summer Time", "HKT": "Hong Kong Standard Time", "ACWDT": "Australian Central Western Daylight Time", "WIB": "Western Indonesia Time", "UYT": "Uruguay Standard Time", "WART": "Western Argentina Standard Time", "WAT": "West Africa Standard Time", "GYT": "Guyana Time", "ART": "Argentina Standard Time", "MEZ": "Central European Standard Time", "WEZ": "Western European Standard Time", "WARST": "Western Argentina Summer Time", "HKST": "Hong Kong Summer Time", "ECT": "Ecuador Time", "ACWST": "Australian Central Western Standard Time", "IST": "India Standard Time", "PDT": "Pacific Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "AEDT": "Australian Eastern Daylight Time", "ACDT": "Australian Central Daylight Time", "EAT": "East Africa Time", "GFT": "French Guiana Time", "BOT": "Bolivia Time", "MESZ": "Central European Summer Time", "SRT": "Suriname Time"},
}
}
diff --git a/en_GM/en_GM_test.go b/en_GM/en_GM_test.go
new file mode 100644
index 00000000..ef80595f
--- /dev/null
+++ b/en_GM/en_GM_test.go
@@ -0,0 +1,1120 @@
+package en_GM
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_GM"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_GU/en_GU.go b/en_GU/en_GU.go
index ab582b68..0feadb42 100644
--- a/en_GU/en_GU.go
+++ b/en_GU/en_GU.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"HKT": "Hong Kong Standard Time", "OEZ": "Eastern European Standard Time", "AWDT": "Australian Western Daylight Time", "JST": "Japan Standard Time", "CHADT": "Chatham Daylight Time", "COT": "Colombia Standard Time", "ACST": "Australian Central Standard Time", "MDT": "Mountain Daylight Time", "BT": "Bhutan Time", "WART": "Western Argentina Standard Time", "OESZ": "Eastern European Summer Time", "WIB": "Western Indonesia Time", "TMT": "Turkmenistan Standard Time", "GYT": "Guyana Time", "CST": "Central Standard Time", "AEDT": "Australian Eastern Daylight Time", "MST": "Mountain Standard Time", "CLST": "Chile Summer Time", "WAST": "West Africa Summer Time", "WIT": "Eastern Indonesia Time", "CDT": "Central Daylight Time", "WEZ": "Western European Standard Time", "WARST": "Western Argentina Summer Time", "IST": "India Standard Time", "TMST": "Turkmenistan Summer Time", "AWST": "Australian Western Standard Time", "EDT": "Eastern Daylight Time", "∅∅∅": "Brasilia Summer Time", "SAST": "South Africa Standard Time", "AKDT": "Alaska Daylight Time", "LHST": "Lord Howe Standard Time", "MYT": "Malaysia Time", "EST": "Eastern Standard Time", "AST": "Atlantic Standard Time", "HNT": "Newfoundland Standard Time", "GFT": "French Guiana Time", "EAT": "East Africa Time", "JDT": "Japan Daylight Time", "BOT": "Bolivia Time", "ECT": "Ecuador Time", "HAST": "Hawaii-Aleutian Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "WITA": "Central Indonesia Time", "NZST": "New Zealand Standard Time", "WESZ": "Western European Summer Time", "AEST": "Australian Eastern Standard Time", "CAT": "Central Africa Time", "HKST": "Hong Kong Summer Time", "GMT": "Greenwich Mean Time", "ACDT": "Australian Central Daylight Time", "ART": "Argentina Standard Time", "VET": "Venezuela Time", "SRT": "Suriname Time", "PDT": "Pacific Daylight Time", "CHAST": "Chatham Standard Time", "COST": "Colombia Summer Time", "ADT": "Atlantic Daylight Time", "MEZ": "Central European Standard Time", "MESZ": "Central European Summer Time", "UYST": "Uruguay Summer Time", "AKST": "Alaska Standard Time", "ACWDT": "Australian Central Western Daylight Time", "CLT": "Chile Standard Time", "WAT": "West Africa Standard Time", "ARST": "Argentina Summer Time", "PST": "Pacific Standard Time", "LHDT": "Lord Howe Daylight Time", "UYT": "Uruguay Standard Time", "ACWST": "Australian Central Western Standard Time", "ChST": "Chamorro Standard Time", "SGT": "Singapore Standard Time", "HAT": "Newfoundland Daylight Time", "NZDT": "New Zealand Daylight Time"},
+ timezones: map[string]string{"MEZ": "Central European Standard Time", "WAT": "West Africa Standard Time", "ChST": "Chamorro Standard Time", "AKST": "Alaska Standard Time", "OEZ": "Eastern European Standard Time", "EAT": "East Africa Time", "BT": "Bhutan Time", "CLT": "Chile Standard Time", "WIT": "Eastern Indonesia Time", "SRT": "Suriname Time", "HAST": "Hawaii-Aleutian Standard Time", "BOT": "Bolivia Time", "WEZ": "Western European Standard Time", "WESZ": "Western European Summer Time", "HAT": "Newfoundland Daylight Time", "AEDT": "Australian Eastern Daylight Time", "LHDT": "Lord Howe Daylight Time", "MYT": "Malaysia Time", "WART": "Western Argentina Standard Time", "ART": "Argentina Standard Time", "JDT": "Japan Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "TMT": "Turkmenistan Standard Time", "GMT": "Greenwich Mean Time", "ACST": "Australian Central Standard Time", "∅∅∅": "Azores Summer Time", "AWST": "Australian Western Standard Time", "CLST": "Chile Summer Time", "ACDT": "Australian Central Daylight Time", "CHAST": "Chatham Standard Time", "VET": "Venezuela Time", "LHST": "Lord Howe Standard Time", "UYST": "Uruguay Summer Time", "CDT": "Central Daylight Time", "WARST": "Western Argentina Summer Time", "CHADT": "Chatham Daylight Time", "AWDT": "Australian Western Daylight Time", "NZDT": "New Zealand Daylight Time", "COT": "Colombia Standard Time", "EDT": "Eastern Daylight Time", "GYT": "Guyana Time", "AST": "Atlantic Standard Time", "JST": "Japan Standard Time", "MDT": "Macau Summer Time", "MESZ": "Central European Summer Time", "COST": "Colombia Summer Time", "AEST": "Australian Eastern Standard Time", "CST": "Central Standard Time", "ARST": "Argentina Summer Time", "EST": "Eastern Standard Time", "PST": "Pacific Standard Time", "NZST": "New Zealand Standard Time", "HNT": "Newfoundland Standard Time", "TMST": "Turkmenistan Summer Time", "HKT": "Hong Kong Standard Time", "WITA": "Central Indonesia Time", "SAST": "South Africa Standard Time", "CAT": "Central Africa Time", "SGT": "Singapore Standard Time", "OESZ": "Eastern European Summer Time", "MST": "Macau Standard Time", "ACWST": "Australian Central Western Standard Time", "ACWDT": "Australian Central Western Daylight Time", "WIB": "Western Indonesia Time", "GFT": "French Guiana Time", "HKST": "Hong Kong Summer Time", "ECT": "Ecuador Time", "AKDT": "Alaska Daylight Time", "PDT": "Pacific Daylight Time", "ADT": "Atlantic Daylight Time", "IST": "India Standard Time", "WAST": "West Africa Summer Time", "UYT": "Uruguay Standard Time"},
}
}
diff --git a/en_GU/en_GU_test.go b/en_GU/en_GU_test.go
new file mode 100644
index 00000000..a4873a64
--- /dev/null
+++ b/en_GU/en_GU_test.go
@@ -0,0 +1,1120 @@
+package en_GU
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_GU"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_GY/en_GY.go b/en_GY/en_GY.go
index 4f6b242e..f569884c 100644
--- a/en_GY/en_GY.go
+++ b/en_GY/en_GY.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"GYT": "Guyana Time", "MEZ": "Central European Standard Time", "CHADT": "Chatham Daylight Time", "CAT": "Central Africa Time", "ECT": "Ecuador Time", "AST": "Atlantic Standard Time", "WART": "Western Argentina Standard Time", "JST": "Japan Standard Time", "VET": "Venezuela Time", "HADT": "Hawaii-Aleutian Daylight Time", "OESZ": "Eastern European Summer Time", "UYST": "Uruguay Summer Time", "COST": "Colombia Summer Time", "GFT": "French Guiana Time", "BT": "Bhutan Time", "HAT": "Newfoundland Daylight Time", "LHDT": "Lord Howe Daylight Time", "CDT": "Central Daylight Time", "AEDT": "Australian Eastern Daylight Time", "ADT": "Atlantic Daylight Time", "WARST": "Western Argentina Summer Time", "IST": "India Standard Time", "WITA": "Central Indonesia Time", "TMST": "Turkmenistan Summer Time", "PDT": "Pacific Daylight Time", "CST": "Central Standard Time", "CLT": "Chile Standard Time", "CLST": "Chile Summer Time", "ChST": "Chamorro Standard Time", "EDT": "Eastern Daylight Time", "SRT": "Suriname Time", "LHST": "Lord Howe Standard Time", "AEST": "Australian Eastern Standard Time", "HNT": "Newfoundland Standard Time", "ACST": "Australian Central Standard Time", "ARST": "Argentina Summer Time", "MYT": "Malaysia Time", "MESZ": "Central European Summer Time", "BOT": "Bolivia Time", "WAST": "West Africa Summer Time", "TMT": "Turkmenistan Standard Time", "UYT": "Uruguay Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "WAT": "West Africa Standard Time", "AKST": "Alaska Standard Time", "NZST": "New Zealand Standard Time", "NZDT": "New Zealand Daylight Time", "WEZ": "Western European Standard Time", "EST": "Eastern Standard Time", "EAT": "East Africa Time", "HKT": "Hong Kong Standard Time", "ART": "Argentina Standard Time", "AWST": "Australian Western Standard Time", "COT": "Colombia Standard Time", "HKST": "Hong Kong Summer Time", "ACDT": "Australian Central Daylight Time", "AKDT": "Alaska Daylight Time", "ACWST": "Australian Central Western Standard Time", "ACWDT": "Australian Central Western Daylight Time", "SAST": "South Africa Standard Time", "WIB": "Western Indonesia Time", "PST": "Pacific Standard Time", "SGT": "Singapore Standard Time", "WIT": "Eastern Indonesia Time", "GMT": "Greenwich Mean Time", "JDT": "Japan Daylight Time", "AWDT": "Australian Western Daylight Time", "WESZ": "Western European Summer Time", "CHAST": "Chatham Standard Time", "OEZ": "Eastern European Standard Time", "MST": "Macau Standard Time", "MDT": "Macau Summer Time", "∅∅∅": "Amazon Summer Time"},
+ timezones: map[string]string{"JDT": "Japan Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "TMT": "Turkmenistan Standard Time", "AEST": "Australian Eastern Standard Time", "GYT": "Guyana Time", "GFT": "French Guiana Time", "AKST": "Alaska Standard Time", "∅∅∅": "Amazon Summer Time", "WEZ": "Western European Standard Time", "HNT": "Newfoundland Standard Time", "SGT": "Singapore Standard Time", "TMST": "Turkmenistan Summer Time", "AST": "Atlantic Standard Time", "AWST": "Australian Western Standard Time", "PDT": "Pacific Daylight Time", "HAT": "Newfoundland Daylight Time", "ACST": "Australian Central Standard Time", "HKT": "Hong Kong Standard Time", "LHST": "Lord Howe Standard Time", "SRT": "Suriname Time", "AKDT": "Alaska Daylight Time", "ADT": "Atlantic Daylight Time", "JST": "Japan Standard Time", "MEZ": "Central European Standard Time", "BOT": "Bolivia Time", "GMT": "Greenwich Mean Time", "WAST": "West Africa Summer Time", "WARST": "Western Argentina Summer Time", "ECT": "Ecuador Time", "ART": "Argentina Standard Time", "COT": "Colombia Standard Time", "ChST": "Chamorro Standard Time", "CLST": "Chile Summer Time", "HAST": "Hawaii-Aleutian Standard Time", "WESZ": "Western European Summer Time", "MYT": "Malaysia Time", "HKST": "Hong Kong Summer Time", "COST": "Colombia Summer Time", "OEZ": "Eastern European Standard Time", "BT": "Bhutan Time", "WIT": "Eastern Indonesia Time", "VET": "Venezuela Time", "IST": "India Standard Time", "EDT": "Eastern Daylight Time", "NZST": "New Zealand Standard Time", "WIB": "Western Indonesia Time", "MDT": "Mountain Daylight Time", "CHAST": "Chatham Standard Time", "LHDT": "Lord Howe Daylight Time", "ACWST": "Australian Central Western Standard Time", "PST": "Pacific Standard Time", "CAT": "Central Africa Time", "WART": "Western Argentina Standard Time", "ARST": "Argentina Summer Time", "EST": "Eastern Standard Time", "OESZ": "Eastern European Summer Time", "EAT": "East Africa Time", "UYT": "Uruguay Standard Time", "CST": "Central Standard Time", "MST": "Mountain Standard Time", "CLT": "Chile Standard Time", "ACDT": "Australian Central Daylight Time", "ACWDT": "Australian Central Western Daylight Time", "WITA": "Central Indonesia Time", "NZDT": "New Zealand Daylight Time", "AWDT": "Australian Western Daylight Time", "SAST": "South Africa Standard Time", "WAT": "West Africa Standard Time", "CDT": "Central Daylight Time", "CHADT": "Chatham Daylight Time", "MESZ": "Central European Summer Time", "AEDT": "Australian Eastern Daylight Time", "UYST": "Uruguay Summer Time"},
}
}
diff --git a/en_GY/en_GY_test.go b/en_GY/en_GY_test.go
new file mode 100644
index 00000000..be496665
--- /dev/null
+++ b/en_GY/en_GY_test.go
@@ -0,0 +1,1120 @@
+package en_GY
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_GY"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_HK/en_HK.go b/en_HK/en_HK.go
index d79f829e..ba719eed 100644
--- a/en_HK/en_HK.go
+++ b/en_HK/en_HK.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"WEZ": "Western European Standard Time", "WESZ": "Western European Summer Time", "CAT": "Central Africa Time", "GMT": "Greenwich Mean Time", "HAST": "Hawaii-Aleutian Standard Time", "IST": "India Standard Time", "GYT": "Guyana Time", "MEZ": "Central European Standard Time", "CST": "Central Standard Time", "COST": "Colombia Summer Time", "WIT": "Eastern Indonesia Time", "MYT": "Malaysia Time", "UYST": "Uruguay Summer Time", "GFT": "French Guiana Time", "ACDT": "Australian Central Daylight Time", "AEST": "Australian Eastern Standard Time", "COT": "Colombia Standard Time", "WARST": "Western Argentina Summer Time", "HNT": "Newfoundland Standard Time", "TMT": "Turkmenistan Standard Time", "TMST": "Turkmenistan Summer Time", "JDT": "Japan Daylight Time", "CDT": "Central Daylight Time", "AEDT": "Australian Eastern Daylight Time", "VET": "Venezuela Time", "HKT": "Hong Kong Standard Time", "LHDT": "Lord Howe Daylight Time", "ACWST": "Australian Central Western Standard Time", "EDT": "Eastern Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "HAT": "Newfoundland Daylight Time", "ACST": "Australian Central Standard Time", "ECT": "Ecuador Time", "OEZ": "Eastern European Standard Time", "WITA": "Central Indonesia Time", "NZST": "New Zealand Standard Time", "CHADT": "Chatham Daylight Time", "AST": "Atlantic Standard Time", "WAT": "West Africa Standard Time", "PST": "Pacific Standard Time", "ART": "Argentina Standard Time", "EAT": "East Africa Time", "LHST": "Lord Howe Standard Time", "UYT": "Uruguay Standard Time", "ChST": "Chamorro Standard Time", "CLT": "Chile Standard Time", "BT": "Bhutan Time", "OESZ": "Eastern European Summer Time", "ARST": "Argentina Summer Time", "AKST": "Alaska Standard Time", "NZDT": "New Zealand Daylight Time", "ACWDT": "Australian Central Western Daylight Time", "WAST": "West Africa Summer Time", "WIB": "Western Indonesia Time", "AWST": "Australian Western Standard Time", "JST": "Japan Standard Time", "SRT": "Suriname Time", "SGT": "Singapore Standard Time", "PDT": "Pacific Daylight Time", "∅∅∅": "Azores Summer Time", "BOT": "Bolivia Time", "MDT": "Mountain Daylight Time", "CLST": "Chile Summer Time", "HKST": "Hong Kong Summer Time", "SAST": "South Africa Standard Time", "AKDT": "Alaska Daylight Time", "CHAST": "Chatham Standard Time", "EST": "Eastern Standard Time", "AWDT": "Australian Western Daylight Time", "MESZ": "Central European Summer Time", "MST": "Mountain Standard Time", "ADT": "Atlantic Daylight Time", "WART": "Western Argentina Standard Time"},
+ timezones: map[string]string{"CHAST": "Chatham Standard Time", "AST": "Atlantic Standard Time", "LHDT": "Lord Howe Daylight Time", "JST": "Japan Standard Time", "AEDT": "Australian Eastern Daylight Time", "MDT": "Mountain Daylight Time", "ECT": "Ecuador Time", "JDT": "Japan Daylight Time", "IST": "India Standard Time", "PST": "Pacific Standard Time", "HAT": "Newfoundland Daylight Time", "MYT": "Malaysia Time", "CST": "Central Standard Time", "NZDT": "New Zealand Daylight Time", "MEZ": "Central European Standard Time", "WESZ": "Western European Summer Time", "UYST": "Uruguay Summer Time", "ACDT": "Australian Central Daylight Time", "HKST": "Hong Kong Summer Time", "ACWST": "Australian Central Western Standard Time", "SAST": "South Africa Standard Time", "MESZ": "Central European Summer Time", "WEZ": "Western European Standard Time", "MST": "Mountain Standard Time", "∅∅∅": "Brasilia Summer Time", "WARST": "Western Argentina Summer Time", "ARST": "Argentina Summer Time", "WITA": "Central Indonesia Time", "BOT": "Bolivia Time", "UYT": "Uruguay Standard Time", "WAT": "West Africa Standard Time", "ChST": "Chamorro Standard Time", "LHST": "Lord Howe Standard Time", "CLT": "Chile Standard Time", "AWDT": "Australian Western Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "SGT": "Singapore Standard Time", "GYT": "Guyana Time", "ACST": "Australian Central Standard Time", "EDT": "Eastern Daylight Time", "PDT": "Pacific Daylight Time", "WART": "Western Argentina Standard Time", "GFT": "French Guiana Time", "AKST": "Alaska Standard Time", "TMST": "Turkmenistan Summer Time", "OESZ": "Eastern European Summer Time", "EAT": "East Africa Time", "SRT": "Suriname Time", "HKT": "Hong Kong Standard Time", "VET": "Venezuela Time", "NZST": "New Zealand Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "CDT": "Central Daylight Time", "AWST": "Australian Western Standard Time", "WAST": "West Africa Summer Time", "OEZ": "Eastern European Standard Time", "BT": "Bhutan Time", "TMT": "Turkmenistan Standard Time", "HNT": "Newfoundland Standard Time", "GMT": "Greenwich Mean Time", "AKDT": "Alaska Daylight Time", "ADT": "Atlantic Daylight Time", "ART": "Argentina Standard Time", "EST": "Eastern Standard Time", "CAT": "Central Africa Time", "COST": "Colombia Summer Time", "WIT": "Eastern Indonesia Time", "CLST": "Chile Summer Time", "CHADT": "Chatham Daylight Time", "ACWDT": "Australian Central Western Daylight Time", "WIB": "Western Indonesia Time", "COT": "Colombia Standard Time", "AEST": "Australian Eastern Standard Time"},
}
}
diff --git a/en_HK/en_HK_test.go b/en_HK/en_HK_test.go
new file mode 100644
index 00000000..c25ded2a
--- /dev/null
+++ b/en_HK/en_HK_test.go
@@ -0,0 +1,1120 @@
+package en_HK
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_HK"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_IE/en_IE.go b/en_IE/en_IE.go
index dbfc469c..ae5b2f36 100644
--- a/en_IE/en_IE.go
+++ b/en_IE/en_IE.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"CAT": "Central Africa Time", "WAT": "West Africa Standard Time", "JST": "Japan Standard Time", "CLT": "Chile Standard Time", "EST": "Eastern Standard Time", "SGT": "Singapore Standard Time", "HNT": "Newfoundland Standard Time", "GFT": "French Guiana Time", "JDT": "Japan Daylight Time", "UYST": "Uruguay Summer Time", "EAT": "East Africa Time", "ACWST": "Australian Central Western Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "OEZ": "Eastern European Standard Time", "BOT": "Bolivia Time", "WESZ": "Western European Summer Time", "MYT": "Malaysia Time", "MST": "Mountain Standard Time", "COT": "Colombia Standard Time", "WART": "Western Argentina Standard Time", "AWST": "Australian Western Standard Time", "CLST": "Chile Summer Time", "ChST": "Chamorro Standard Time", "ECT": "Ecuador Time", "HKST": "Hong Kong Summer Time", "ACDT": "Australian Central Daylight Time", "ARST": "Argentina Summer Time", "PST": "Pacific Standard Time", "CST": "Central Standard Time", "MEZ": "Central European Standard Time", "WIB": "Western Indonesia Time", "ART": "Argentina Standard Time", "AKST": "Alaska Standard Time", "AKDT": "Alaska Daylight Time", "VET": "Venezuela Time", "COST": "Colombia Summer Time", "BT": "Bhutan Time", "OESZ": "Eastern European Summer Time", "AWDT": "Australian Western Daylight Time", "ACWDT": "Australian Central Western Daylight Time", "AST": "Atlantic Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "SAST": "South Africa Standard Time", "IST": "India Standard Time", "LHST": "Lord Howe Standard Time", "CDT": "Central Daylight Time", "AEDT": "Australian Eastern Daylight Time", "HKT": "Hong Kong Standard Time", "UYT": "Uruguay Standard Time", "∅∅∅": "Brasilia Summer Time", "HAT": "Newfoundland Daylight Time", "GYT": "Guyana Time", "MESZ": "Central European Summer Time", "NZDT": "New Zealand Daylight Time", "MDT": "Mountain Daylight Time", "CHADT": "Chatham Daylight Time", "PDT": "Pacific Daylight Time", "NZST": "New Zealand Standard Time", "AEST": "Australian Eastern Standard Time", "CHAST": "Chatham Standard Time", "ADT": "Atlantic Daylight Time", "WAST": "West Africa Summer Time", "WIT": "Eastern Indonesia Time", "WEZ": "Western European Standard Time", "GMT": "Greenwich Mean Time", "SRT": "Suriname Time", "LHDT": "Lord Howe Daylight Time", "EDT": "Eastern Daylight Time", "WARST": "Western Argentina Summer Time", "WITA": "Central Indonesia Time", "ACST": "Australian Central Standard Time", "TMT": "Turkmenistan Standard Time", "TMST": "Turkmenistan Summer Time"},
+ timezones: map[string]string{"COT": "Colombia Standard Time", "MYT": "Malaysia Time", "CST": "Central Standard Time", "ACWDT": "Australian Central Western Daylight Time", "WAT": "West Africa Standard Time", "WESZ": "Western European Summer Time", "EAT": "East Africa Time", "BT": "Bhutan Time", "CLT": "Chile Standard Time", "BOT": "Bolivia Time", "AEDT": "Australian Eastern Daylight Time", "AKST": "Alaska Standard Time", "ACWST": "Australian Central Western Standard Time", "JDT": "Japan Daylight Time", "SAST": "South Africa Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "NZST": "New Zealand Standard Time", "LHDT": "Lord Howe Daylight Time", "MDT": "Mountain Daylight Time", "MESZ": "Central European Summer Time", "WEZ": "Western European Standard Time", "SRT": "Suriname Time", "ADT": "Atlantic Daylight Time", "ARST": "Argentina Summer Time", "HAST": "Hawaii-Aleutian Standard Time", "HNT": "Newfoundland Standard Time", "TMT": "Turkmenistan Standard Time", "WIT": "Eastern Indonesia Time", "CDT": "Central Daylight Time", "AWST": "Australian Western Standard Time", "AWDT": "Australian Western Daylight Time", "WITA": "Central Indonesia Time", "JST": "Japan Standard Time", "WIB": "Western Indonesia Time", "UYT": "Uruguay Standard Time", "∅∅∅": "Amazon Summer Time", "AEST": "Australian Eastern Standard Time", "CHADT": "Chatham Daylight Time", "ART": "Argentina Standard Time", "CAT": "Central Africa Time", "VET": "Venezuela Time", "AKDT": "Alaska Daylight Time", "MEZ": "Central European Standard Time", "WAST": "West Africa Summer Time", "LHST": "Lord Howe Standard Time", "WART": "Western Argentina Standard Time", "COST": "Colombia Summer Time", "OEZ": "Eastern European Standard Time", "PDT": "Pacific Daylight Time", "GMT": "Greenwich Mean Time", "GYT": "Guyana Time", "UYST": "Uruguay Summer Time", "ECT": "Ecuador Time", "NZDT": "New Zealand Daylight Time", "ChST": "Chamorro Standard Time", "MST": "Mountain Standard Time", "ACST": "Australian Central Standard Time", "ACDT": "Australian Central Daylight Time", "HKT": "Hong Kong Standard Time", "EST": "Eastern Standard Time", "TMST": "Turkmenistan Summer Time", "OESZ": "Eastern European Summer Time", "CLST": "Chile Summer Time", "WARST": "Western Argentina Summer Time", "EDT": "Eastern Daylight Time", "GFT": "French Guiana Time", "CHAST": "Chatham Standard Time", "AST": "Atlantic Standard Time", "IST": "India Standard Time", "PST": "Pacific Standard Time", "HAT": "Newfoundland Daylight Time", "SGT": "Singapore Standard Time", "HKST": "Hong Kong Summer Time"},
}
}
@@ -112,8 +112,8 @@ func (en *en_IE) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
func (en *en_IE) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
n := math.Abs(num)
- nMod10 := math.Mod(n, 10)
nMod100 := math.Mod(n, 100)
+ nMod10 := math.Mod(n, 10)
if nMod10 == 1 && nMod100 != 11 {
return locales.PluralRuleOne
diff --git a/en_IE/en_IE_test.go b/en_IE/en_IE_test.go
new file mode 100644
index 00000000..3953406a
--- /dev/null
+++ b/en_IE/en_IE_test.go
@@ -0,0 +1,1120 @@
+package en_IE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_IE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_IL/en_IL.go b/en_IL/en_IL.go
index eca3fe68..bad46664 100644
--- a/en_IL/en_IL.go
+++ b/en_IL/en_IL.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"∅∅∅": "Azores Summer Time", "WART": "Western Argentina Standard Time", "LHDT": "Lord Howe Daylight Time", "MST": "Mountain Standard Time", "CHADT": "Chatham Daylight Time", "OESZ": "Eastern European Summer Time", "TMST": "Turkmenistan Summer Time", "NZDT": "New Zealand Daylight Time", "CLT": "Chile Standard Time", "ACST": "Australian Central Standard Time", "SRT": "Suriname Time", "UYT": "Uruguay Standard Time", "ChST": "Chamorro Standard Time", "MDT": "Mountain Daylight Time", "OEZ": "Eastern European Standard Time", "LHST": "Lord Howe Standard Time", "HKST": "Hong Kong Summer Time", "IST": "India Standard Time", "TMT": "Turkmenistan Standard Time", "WAT": "West Africa Standard Time", "WITA": "Central Indonesia Time", "CDT": "Central Daylight Time", "AEDT": "Australian Eastern Daylight Time", "VET": "Venezuela Time", "WEZ": "Western European Standard Time", "COST": "Colombia Summer Time", "SGT": "Singapore Standard Time", "ADT": "Atlantic Daylight Time", "SAST": "South Africa Standard Time", "JDT": "Japan Daylight Time", "ARST": "Argentina Summer Time", "CHAST": "Chatham Standard Time", "CLST": "Chile Summer Time", "EDT": "Eastern Daylight Time", "BOT": "Bolivia Time", "WESZ": "Western European Summer Time", "HADT": "Hawaii-Aleutian Daylight Time", "EAT": "East Africa Time", "AEST": "Australian Eastern Standard Time", "GYT": "Guyana Time", "ART": "Argentina Standard Time", "PST": "Pacific Standard Time", "AKDT": "Alaska Daylight Time", "ACWDT": "Australian Central Western Daylight Time", "CAT": "Central Africa Time", "AST": "Atlantic Standard Time", "HNT": "Newfoundland Standard Time", "ACDT": "Australian Central Daylight Time", "PDT": "Pacific Daylight Time", "MESZ": "Central European Summer Time", "NZST": "New Zealand Standard Time", "COT": "Colombia Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "WARST": "Western Argentina Summer Time", "MYT": "Malaysia Time", "ACWST": "Australian Central Western Standard Time", "BT": "Bhutan Time", "GMT": "Greenwich Mean Time", "HAT": "Newfoundland Daylight Time", "AWDT": "Australian Western Daylight Time", "JST": "Japan Standard Time", "UYST": "Uruguay Summer Time", "GFT": "French Guiana Time", "AWST": "Australian Western Standard Time", "ECT": "Ecuador Time", "WAST": "West Africa Summer Time", "HKT": "Hong Kong Standard Time", "WIT": "Eastern Indonesia Time", "CST": "Central Standard Time", "MEZ": "Central European Standard Time", "EST": "Eastern Standard Time", "WIB": "Western Indonesia Time", "AKST": "Alaska Standard Time"},
+ timezones: map[string]string{"MESZ": "Central European Summer Time", "ACDT": "Australian Central Daylight Time", "JST": "Japan Standard Time", "BOT": "Bolivia Time", "WIB": "Western Indonesia Time", "OESZ": "Eastern European Summer Time", "CDT": "Central Daylight Time", "ECT": "Ecuador Time", "JDT": "Japan Daylight Time", "SAST": "South Africa Standard Time", "WESZ": "Western European Summer Time", "UYST": "Uruguay Summer Time", "CST": "Central Standard Time", "AKST": "Alaska Standard Time", "TMST": "Turkmenistan Summer Time", "HAT": "Newfoundland Daylight Time", "AEST": "Australian Eastern Standard Time", "AEDT": "Australian Eastern Daylight Time", "HKST": "Hong Kong Summer Time", "AKDT": "Alaska Daylight Time", "ACWDT": "Australian Central Western Daylight Time", "NZDT": "New Zealand Daylight Time", "CAT": "Central Africa Time", "WAST": "West Africa Summer Time", "IST": "India Standard Time", "EST": "Eastern Standard Time", "MEZ": "Central European Standard Time", "∅∅∅": "Amazon Summer Time", "WEZ": "Western European Standard Time", "OEZ": "Eastern European Standard Time", "UYT": "Uruguay Standard Time", "VET": "Venezuela Time", "AWDT": "Australian Western Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "HNT": "Newfoundland Standard Time", "GMT": "Greenwich Mean Time", "LHST": "Lord Howe Standard Time", "NZST": "New Zealand Standard Time", "TMT": "Turkmenistan Standard Time", "CLT": "Chile Standard Time", "AST": "Atlantic Standard Time", "WIT": "Eastern Indonesia Time", "WITA": "Central Indonesia Time", "BT": "Bhutan Time", "CHAST": "Chatham Standard Time", "ADT": "Atlantic Daylight Time", "ChST": "Chamorro Standard Time", "EDT": "Eastern Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "SGT": "Singapore Standard Time", "COST": "Colombia Summer Time", "EAT": "East Africa Time", "MYT": "Malaysia Time", "HKT": "Hong Kong Standard Time", "ARST": "Argentina Summer Time", "GYT": "Guyana Time", "ACST": "Australian Central Standard Time", "ACWST": "Australian Central Western Standard Time", "AWST": "Australian Western Standard Time", "PST": "Pacific Standard Time", "LHDT": "Lord Howe Daylight Time", "CLST": "Chile Summer Time", "WARST": "Western Argentina Summer Time", "MST": "Macau Standard Time", "MDT": "Macau Summer Time", "CHADT": "Chatham Daylight Time", "ART": "Argentina Standard Time", "PDT": "Pacific Daylight Time", "COT": "Colombia Standard Time", "WART": "Western Argentina Standard Time", "WAT": "West Africa Standard Time", "SRT": "Suriname Time", "GFT": "French Guiana Time"},
}
}
diff --git a/en_IL/en_IL_test.go b/en_IL/en_IL_test.go
new file mode 100644
index 00000000..2718a2a3
--- /dev/null
+++ b/en_IL/en_IL_test.go
@@ -0,0 +1,1120 @@
+package en_IL
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_IL"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_IM/en_IM.go b/en_IM/en_IM.go
index 814cc69c..126c6773 100644
--- a/en_IM/en_IM.go
+++ b/en_IM/en_IM.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"AEST": "Australian Eastern Standard Time", "CHAST": "Chatham Standard Time", "ECT": "Ecuador Time", "AST": "Atlantic Standard Time", "SGT": "Singapore Standard Time", "HKT": "Hong Kong Standard Time", "ACST": "Australian Central Standard Time", "AWST": "Australian Western Standard Time", "GYT": "Guyana Time", "∅∅∅": "Brasilia Summer Time", "WART": "Western Argentina Standard Time", "HNT": "Newfoundland Standard Time", "AWDT": "Australian Western Daylight Time", "NZDT": "New Zealand Daylight Time", "EDT": "Eastern Daylight Time", "MEZ": "Central European Standard Time", "COT": "Colombia Standard Time", "WAST": "West Africa Summer Time", "WIT": "Eastern Indonesia Time", "ARST": "Argentina Summer Time", "LHDT": "Lord Howe Daylight Time", "BOT": "Bolivia Time", "HAST": "Hawaii-Aleutian Standard Time", "ADT": "Atlantic Daylight Time", "LHST": "Lord Howe Standard Time", "MESZ": "Central European Summer Time", "MST": "Mountain Standard Time", "WAT": "West Africa Standard Time", "HKST": "Hong Kong Summer Time", "IST": "India Standard Time", "GMT": "Greenwich Mean Time", "ART": "Argentina Standard Time", "SRT": "Suriname Time", "AKDT": "Alaska Daylight Time", "MYT": "Malaysia Time", "EST": "Eastern Standard Time", "EAT": "East Africa Time", "AKST": "Alaska Standard Time", "CLT": "Chile Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "WIB": "Western Indonesia Time", "OEZ": "Eastern European Standard Time", "CDT": "Central Daylight Time", "UYT": "Uruguay Standard Time", "WEZ": "Western European Standard Time", "ACWDT": "Australian Central Western Daylight Time", "TMT": "Turkmenistan Standard Time", "PST": "Pacific Standard Time", "CST": "Central Standard Time", "CHADT": "Chatham Daylight Time", "CAT": "Central Africa Time", "BT": "Bhutan Time", "ACWST": "Australian Central Western Standard Time", "ChST": "Chamorro Standard Time", "CLST": "Chile Summer Time", "AEDT": "Australian Eastern Daylight Time", "ACDT": "Australian Central Daylight Time", "JDT": "Japan Daylight Time", "NZST": "New Zealand Standard Time", "WARST": "Western Argentina Summer Time", "JST": "Japan Standard Time", "PDT": "Pacific Daylight Time", "UYST": "Uruguay Summer Time", "WESZ": "Western European Summer Time", "COST": "Colombia Summer Time", "SAST": "South Africa Standard Time", "OESZ": "Eastern European Summer Time", "GFT": "French Guiana Time", "TMST": "Turkmenistan Summer Time", "VET": "Venezuela Time", "MDT": "Mountain Daylight Time", "HAT": "Newfoundland Daylight Time", "WITA": "Central Indonesia Time"},
+ timezones: map[string]string{"EST": "Eastern Standard Time", "WESZ": "Western European Summer Time", "JDT": "Japan Daylight Time", "ACWDT": "Australian Central Western Daylight Time", "PDT": "Pacific Daylight Time", "ChST": "Chamorro Standard Time", "CDT": "Central Daylight Time", "WITA": "Central Indonesia Time", "MEZ": "Central European Standard Time", "AWST": "Australian Western Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "EAT": "East Africa Time", "CLT": "Chile Standard Time", "ACWST": "Australian Central Western Standard Time", "WARST": "Western Argentina Summer Time", "HKT": "Hong Kong Standard Time", "OESZ": "Eastern European Summer Time", "MYT": "Malaysia Time", "WART": "Western Argentina Standard Time", "MESZ": "Central European Summer Time", "WAT": "West Africa Standard Time", "WIB": "Western Indonesia Time", "OEZ": "Eastern European Standard Time", "GYT": "Guyana Time", "ART": "Argentina Standard Time", "HAT": "Newfoundland Daylight Time", "CLST": "Chile Summer Time", "UYST": "Uruguay Summer Time", "SRT": "Suriname Time", "MDT": "Macau Summer Time", "CHAST": "Chatham Standard Time", "ARST": "Argentina Summer Time", "TMT": "Turkmenistan Standard Time", "TMST": "Turkmenistan Summer Time", "∅∅∅": "Azores Summer Time", "IST": "India Standard Time", "BT": "Bhutan Time", "LHDT": "Lord Howe Daylight Time", "CST": "Central Standard Time", "VET": "Venezuela Time", "AWDT": "Australian Western Daylight Time", "COST": "Colombia Summer Time", "GMT": "Greenwich Mean Time", "CHADT": "Chatham Daylight Time", "ECT": "Ecuador Time", "ADT": "Atlantic Daylight Time", "NZST": "New Zealand Standard Time", "NZDT": "New Zealand Daylight Time", "GFT": "French Guiana Time", "EDT": "Eastern Daylight Time", "WAST": "West Africa Summer Time", "UYT": "Uruguay Standard Time", "MST": "Macau Standard Time", "AKST": "Alaska Standard Time", "JST": "Japan Standard Time", "HNT": "Newfoundland Standard Time", "SGT": "Singapore Standard Time", "AEST": "Australian Eastern Standard Time", "WIT": "Eastern Indonesia Time", "ACDT": "Australian Central Daylight Time", "HKST": "Hong Kong Summer Time", "AST": "Atlantic Standard Time", "SAST": "South Africa Standard Time", "CAT": "Central Africa Time", "LHST": "Lord Howe Standard Time", "AKDT": "Alaska Daylight Time", "BOT": "Bolivia Time", "PST": "Pacific Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "WEZ": "Western European Standard Time", "COT": "Colombia Standard Time", "AEDT": "Australian Eastern Daylight Time", "ACST": "Australian Central Standard Time"},
}
}
diff --git a/en_IM/en_IM_test.go b/en_IM/en_IM_test.go
new file mode 100644
index 00000000..4143a8a6
--- /dev/null
+++ b/en_IM/en_IM_test.go
@@ -0,0 +1,1120 @@
+package en_IM
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_IM"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_IN/en_IN.go b/en_IN/en_IN.go
index 8b86e39b..f6aba494 100644
--- a/en_IN/en_IN.go
+++ b/en_IN/en_IN.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"WITA": "Central Indonesia Time", "OESZ": "Eastern European Summer Time", "BOT": "Bolivia Time", "WAT": "West Africa Standard Time", "GFT": "French Guiana Time", "VET": "Venezuela Time", "AEST": "Australian Eastern Standard Time", "EST": "Eastern Standard Time", "AKDT": "Alaska Daylight Time", "CHAST": "Chatham Standard Time", "CHADT": "Chatham Daylight Time", "ChST": "Chamorro Standard Time", "CLT": "Chile Standard Time", "ECT": "Ecuador Time", "COST": "Colombia Summer Time", "HAST": "Hawaii-Aleutian Standard Time", "∅∅∅": "Amazon Summer Time", "GYT": "Guyana Time", "PST": "Pacific Standard Time", "WART": "Western Argentina Standard Time", "OEZ": "Eastern European Standard Time", "SRT": "Suriname Time", "HAT": "Newfoundland Daylight Time", "MST": "Macau Standard Time", "AWST": "Australian Western Standard Time", "UYT": "Uruguay Standard Time", "CDT": "Central Daylight Time", "HKST": "Hong Kong Summer Time", "ACST": "Australian Central Standard Time", "LHST": "Lord Howe Standard Time", "PDT": "Pacific Daylight Time", "UYST": "Uruguay Summer Time", "NZDT": "New Zealand Daylight Time", "ACWDT": "Australian Central Western Daylight Time", "SAST": "South Africa Standard Time", "WIT": "Eastern Indonesia Time", "CAT": "Central Africa Time", "EDT": "Eastern Daylight Time", "ADT": "Atlantic Daylight Time", "IST": "India Standard Time", "LHDT": "Lord Howe Daylight Time", "JDT": "Japan Daylight Time", "AWDT": "Australian Western Daylight Time", "GMT": "Greenwich Mean Time", "EAT": "East Africa Time", "AKST": "Alaska Standard Time", "WAST": "West Africa Summer Time", "NZST": "New Zealand Standard Time", "ACWST": "Australian Central Western Standard Time", "AST": "Atlantic Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "HKT": "Hong Kong Standard Time", "ARST": "Argentina Summer Time", "MEZ": "Central European Standard Time", "MESZ": "Central European Summer Time", "HNT": "Newfoundland Standard Time", "BT": "Bhutan Time", "TMT": "Turkmenistan Standard Time", "JST": "Japan Standard Time", "SGT": "Singapore Standard Time", "CST": "Central Standard Time", "AEDT": "Australian Eastern Daylight Time", "COT": "Colombia Standard Time", "WIB": "Western Indonesia Time", "ART": "Argentina Standard Time", "ACDT": "Australian Central Daylight Time", "MYT": "Malaysia Time", "WARST": "Western Argentina Summer Time", "TMST": "Turkmenistan Summer Time", "CLST": "Chile Summer Time", "WESZ": "Western European Summer Time", "MDT": "Macau Summer Time", "WEZ": "Western European Standard Time"},
+ timezones: map[string]string{"CHADT": "Chatham Daylight Time", "COST": "Colombia Summer Time", "HKST": "Hong Kong Summer Time", "VET": "Venezuela Time", "AKST": "Alaska Standard Time", "AWDT": "Australian Western Daylight Time", "JDT": "Japan Daylight Time", "OEZ": "Eastern European Standard Time", "OESZ": "Eastern European Summer Time", "WIT": "Eastern Indonesia Time", "MST": "Macau Standard Time", "WART": "Western Argentina Standard Time", "MYT": "Malaysia Time", "CLT": "Chile Standard Time", "EDT": "Eastern Daylight Time", "ART": "Argentina Standard Time", "MESZ": "Central European Summer Time", "WESZ": "Western European Summer Time", "COT": "Colombia Standard Time", "ACDT": "Australian Central Daylight Time", "AKDT": "Alaska Daylight Time", "AEST": "Australian Eastern Standard Time", "TMST": "Turkmenistan Summer Time", "HNT": "Newfoundland Standard Time", "AWST": "Australian Western Standard Time", "BOT": "Bolivia Time", "TMT": "Turkmenistan Standard Time", "CAT": "Central Africa Time", "ACWST": "Australian Central Western Standard Time", "LHST": "Lord Howe Standard Time", "LHDT": "Lord Howe Daylight Time", "UYT": "Uruguay Standard Time", "CST": "Central Standard Time", "GFT": "French Guiana Time", "NZST": "New Zealand Standard Time", "BT": "Bhutan Time", "SRT": "Suriname Time", "WAT": "West Africa Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "WEZ": "Western European Standard Time", "SGT": "Singapore Standard Time", "GYT": "Guyana Time", "EST": "Eastern Standard Time", "ARST": "Argentina Summer Time", "PDT": "Pacific Daylight Time", "MEZ": "Central European Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "WAST": "West Africa Summer Time", "EAT": "East Africa Time", "MDT": "Macau Summer Time", "WITA": "Central Indonesia Time", "JST": "Japan Standard Time", "SAST": "South Africa Standard Time", "IST": "India Standard Time", "HAT": "Newfoundland Daylight Time", "CHAST": "Chatham Standard Time", "∅∅∅": "Amazon Summer Time", "AEDT": "Australian Eastern Daylight Time", "CLST": "Chile Summer Time", "UYST": "Uruguay Summer Time", "ECT": "Ecuador Time", "ADT": "Atlantic Daylight Time", "PST": "Pacific Standard Time", "WIB": "Western Indonesia Time", "ChST": "Chamorro Standard Time", "HKT": "Hong Kong Standard Time", "ACWDT": "Australian Central Western Daylight Time", "NZDT": "New Zealand Daylight Time", "GMT": "Greenwich Mean Time", "CDT": "Central Daylight Time", "ACST": "Australian Central Standard Time", "WARST": "Western Argentina Summer Time", "AST": "Atlantic Standard Time"},
}
}
diff --git a/en_IN/en_IN_test.go b/en_IN/en_IN_test.go
new file mode 100644
index 00000000..8c4abad1
--- /dev/null
+++ b/en_IN/en_IN_test.go
@@ -0,0 +1,1120 @@
+package en_IN
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_IN"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_IO/en_IO.go b/en_IO/en_IO.go
index 60199813..d2644a72 100644
--- a/en_IO/en_IO.go
+++ b/en_IO/en_IO.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"CLST": "Chile Summer Time", "COT": "Colombia Standard Time", "AST": "Atlantic Standard Time", "SAST": "South Africa Standard Time", "JDT": "Japan Daylight Time", "HKT": "Hong Kong Standard Time", "WAST": "West Africa Summer Time", "PDT": "Pacific Daylight Time", "VET": "Venezuela Time", "HAST": "Hawaii-Aleutian Standard Time", "HKST": "Hong Kong Summer Time", "EAT": "East Africa Time", "CHADT": "Chatham Daylight Time", "COST": "Colombia Summer Time", "ACDT": "Australian Central Daylight Time", "MYT": "Malaysia Time", "MEZ": "Central European Standard Time", "MDT": "Macau Summer Time", "CLT": "Chile Standard Time", "AWST": "Australian Western Standard Time", "CDT": "Central Daylight Time", "CHAST": "Chatham Standard Time", "ECT": "Ecuador Time", "GFT": "French Guiana Time", "ACWST": "Australian Central Western Standard Time", "BT": "Bhutan Time", "TMT": "Turkmenistan Standard Time", "AEST": "Australian Eastern Standard Time", "WESZ": "Western European Summer Time", "WEZ": "Western European Standard Time", "SGT": "Singapore Standard Time", "AWDT": "Australian Western Daylight Time", "LHDT": "Lord Howe Daylight Time", "UYST": "Uruguay Summer Time", "ARST": "Argentina Summer Time", "MST": "Macau Standard Time", "PST": "Pacific Standard Time", "AEDT": "Australian Eastern Daylight Time", "EST": "Eastern Standard Time", "HNT": "Newfoundland Standard Time", "WITA": "Central Indonesia Time", "WIT": "Eastern Indonesia Time", "UYT": "Uruguay Standard Time", "EDT": "Eastern Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "LHST": "Lord Howe Standard Time", "GYT": "Guyana Time", "ADT": "Atlantic Daylight Time", "SRT": "Suriname Time", "CST": "Central Standard Time", "MESZ": "Central European Summer Time", "NZDT": "New Zealand Daylight Time", "BOT": "Bolivia Time", "WARST": "Western Argentina Summer Time", "IST": "India Standard Time", "AKST": "Alaska Standard Time", "NZST": "New Zealand Standard Time", "WIB": "Western Indonesia Time", "OEZ": "Eastern European Standard Time", "AKDT": "Alaska Daylight Time", "ChST": "Chamorro Standard Time", "ACST": "Australian Central Standard Time", "ART": "Argentina Standard Time", "TMST": "Turkmenistan Summer Time", "JST": "Japan Standard Time", "∅∅∅": "Brasilia Summer Time", "CAT": "Central Africa Time", "GMT": "Greenwich Mean Time", "HAT": "Newfoundland Daylight Time", "ACWDT": "Australian Central Western Daylight Time", "WART": "Western Argentina Standard Time", "WAT": "West Africa Standard Time", "OESZ": "Eastern European Summer Time"},
+ timezones: map[string]string{"ACWDT": "Australian Central Western Daylight Time", "HAT": "Newfoundland Daylight Time", "UYT": "Uruguay Standard Time", "AWST": "Australian Western Standard Time", "ART": "Argentina Standard Time", "AKST": "Alaska Standard Time", "MDT": "Macau Summer Time", "WITA": "Central Indonesia Time", "ChST": "Chamorro Standard Time", "EST": "Eastern Standard Time", "WARST": "Western Argentina Summer Time", "ARST": "Argentina Summer Time", "HADT": "Hawaii-Aleutian Daylight Time", "CAT": "Central Africa Time", "GYT": "Guyana Time", "WIT": "Eastern Indonesia Time", "UYST": "Uruguay Summer Time", "∅∅∅": "Azores Summer Time", "MEZ": "Central European Standard Time", "NZST": "New Zealand Standard Time", "NZDT": "New Zealand Daylight Time", "HNT": "Newfoundland Standard Time", "WIB": "Western Indonesia Time", "OESZ": "Eastern European Summer Time", "CDT": "Central Daylight Time", "ACST": "Australian Central Standard Time", "AWDT": "Australian Western Daylight Time", "VET": "Venezuela Time", "AST": "Atlantic Standard Time", "PDT": "Pacific Daylight Time", "LHDT": "Lord Howe Daylight Time", "CST": "Central Standard Time", "CHADT": "Chatham Daylight Time", "JST": "Japan Standard Time", "HKST": "Hong Kong Summer Time", "AKDT": "Alaska Daylight Time", "SAST": "South Africa Standard Time", "WAT": "West Africa Standard Time", "OEZ": "Eastern European Standard Time", "GFT": "French Guiana Time", "MST": "Macau Standard Time", "HKT": "Hong Kong Standard Time", "MYT": "Malaysia Time", "ACDT": "Australian Central Daylight Time", "WAST": "West Africa Summer Time", "CLT": "Chile Standard Time", "BOT": "Bolivia Time", "CLST": "Chile Summer Time", "EAT": "East Africa Time", "ECT": "Ecuador Time", "ADT": "Atlantic Daylight Time", "ACWST": "Australian Central Western Standard Time", "BT": "Bhutan Time", "IST": "India Standard Time", "SGT": "Singapore Standard Time", "TMT": "Turkmenistan Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "WEZ": "Western European Standard Time", "GMT": "Greenwich Mean Time", "AEST": "Australian Eastern Standard Time", "SRT": "Suriname Time", "EDT": "Eastern Daylight Time", "COT": "Colombia Standard Time", "TMST": "Turkmenistan Summer Time", "WESZ": "Western European Summer Time", "AEDT": "Australian Eastern Daylight Time", "CHAST": "Chatham Standard Time", "JDT": "Japan Daylight Time", "PST": "Pacific Standard Time", "LHST": "Lord Howe Standard Time", "WART": "Western Argentina Standard Time", "MESZ": "Central European Summer Time", "COST": "Colombia Summer Time"},
}
}
diff --git a/en_IO/en_IO_test.go b/en_IO/en_IO_test.go
new file mode 100644
index 00000000..4602edc4
--- /dev/null
+++ b/en_IO/en_IO_test.go
@@ -0,0 +1,1120 @@
+package en_IO
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_IO"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_JE/en_JE.go b/en_JE/en_JE.go
index ac118d24..6a043dae 100644
--- a/en_JE/en_JE.go
+++ b/en_JE/en_JE.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"WEZ": "Western European Standard Time", "COT": "Colombia Standard Time", "EAT": "East Africa Time", "MST": "Macau Standard Time", "NZDT": "New Zealand Daylight Time", "OESZ": "Eastern European Summer Time", "ARST": "Argentina Summer Time", "LHST": "Lord Howe Standard Time", "UYST": "Uruguay Summer Time", "WESZ": "Western European Summer Time", "WAST": "West Africa Summer Time", "BT": "Bhutan Time", "HNT": "Newfoundland Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "CST": "Central Standard Time", "HKT": "Hong Kong Standard Time", "MDT": "Macau Summer Time", "PDT": "Pacific Daylight Time", "ACDT": "Australian Central Daylight Time", "MYT": "Malaysia Time", "CDT": "Central Daylight Time", "MESZ": "Central European Summer Time", "VET": "Venezuela Time", "HKST": "Hong Kong Summer Time", "WIB": "Western Indonesia Time", "PST": "Pacific Standard Time", "WITA": "Central Indonesia Time", "ACWDT": "Australian Central Western Daylight Time", "AEDT": "Australian Eastern Daylight Time", "ACWST": "Australian Central Western Standard Time", "WARST": "Western Argentina Summer Time", "TMT": "Turkmenistan Standard Time", "ACST": "Australian Central Standard Time", "HAT": "Newfoundland Daylight Time", "ART": "Argentina Standard Time", "JDT": "Japan Daylight Time", "GYT": "Guyana Time", "BOT": "Bolivia Time", "CHAST": "Chatham Standard Time", "WAT": "West Africa Standard Time", "ADT": "Atlantic Daylight Time", "CLT": "Chile Standard Time", "CLST": "Chile Summer Time", "AEST": "Australian Eastern Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "SAST": "South Africa Standard Time", "GMT": "Greenwich Mean Time", "AKST": "Alaska Standard Time", "LHDT": "Lord Howe Daylight Time", "NZST": "New Zealand Standard Time", "COST": "Colombia Summer Time", "AST": "Atlantic Standard Time", "WIT": "Eastern Indonesia Time", "OEZ": "Eastern European Standard Time", "SRT": "Suriname Time", "AWDT": "Australian Western Daylight Time", "EDT": "Eastern Daylight Time", "GFT": "French Guiana Time", "JST": "Japan Standard Time", "AKDT": "Alaska Daylight Time", "UYT": "Uruguay Standard Time", "CHADT": "Chatham Daylight Time", "SGT": "Singapore Standard Time", "TMST": "Turkmenistan Summer Time", "AWST": "Australian Western Standard Time", "MEZ": "Central European Standard Time", "ChST": "Chamorro Standard Time", "ECT": "Ecuador Time", "WART": "Western Argentina Standard Time", "IST": "India Standard Time", "∅∅∅": "Amazon Summer Time", "CAT": "Central Africa Time", "EST": "Eastern Standard Time"},
+ timezones: map[string]string{"AKST": "Alaska Standard Time", "TMST": "Turkmenistan Summer Time", "UYT": "Uruguay Standard Time", "AWST": "Australian Western Standard Time", "JST": "Japan Standard Time", "SGT": "Singapore Standard Time", "MEZ": "Central European Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "ACDT": "Australian Central Daylight Time", "ACWDT": "Australian Central Western Daylight Time", "WITA": "Central Indonesia Time", "MESZ": "Central European Summer Time", "HNT": "Newfoundland Standard Time", "GYT": "Guyana Time", "WART": "Western Argentina Standard Time", "AST": "Atlantic Standard Time", "LHDT": "Lord Howe Daylight Time", "SRT": "Suriname Time", "AKDT": "Alaska Daylight Time", "PST": "Pacific Standard Time", "WAST": "West Africa Summer Time", "∅∅∅": "Brasilia Summer Time", "CST": "Central Standard Time", "GFT": "French Guiana Time", "ACWST": "Australian Central Western Standard Time", "AWDT": "Australian Western Daylight Time", "JDT": "Japan Daylight Time", "MST": "Mountain Standard Time", "CLST": "Chile Summer Time", "ADT": "Atlantic Daylight Time", "WIB": "Western Indonesia Time", "AEST": "Australian Eastern Standard Time", "LHST": "Lord Howe Standard Time", "WIT": "Eastern Indonesia Time", "EAT": "East Africa Time", "HKST": "Hong Kong Summer Time", "HAT": "Newfoundland Daylight Time", "CLT": "Chile Standard Time", "UYST": "Uruguay Summer Time", "CDT": "Central Daylight Time", "EST": "Eastern Standard Time", "EDT": "Eastern Daylight Time", "SAST": "South Africa Standard Time", "GMT": "Greenwich Mean Time", "WARST": "Western Argentina Summer Time", "NZST": "New Zealand Standard Time", "IST": "India Standard Time", "OESZ": "Eastern European Summer Time", "HAST": "Hawaii-Aleutian Standard Time", "WESZ": "Western European Summer Time", "COT": "Colombia Standard Time", "COST": "Colombia Summer Time", "ECT": "Ecuador Time", "VET": "Venezuela Time", "CHADT": "Chatham Daylight Time", "HKT": "Hong Kong Standard Time", "NZDT": "New Zealand Daylight Time", "ChST": "Chamorro Standard Time", "BT": "Bhutan Time", "MYT": "Malaysia Time", "TMT": "Turkmenistan Standard Time", "WAT": "West Africa Standard Time", "AEDT": "Australian Eastern Daylight Time", "OEZ": "Eastern European Standard Time", "PDT": "Pacific Daylight Time", "BOT": "Bolivia Time", "ACST": "Australian Central Standard Time", "CHAST": "Chatham Standard Time", "ARST": "Argentina Summer Time", "WEZ": "Western European Standard Time", "CAT": "Central Africa Time", "MDT": "Mountain Daylight Time", "ART": "Argentina Standard Time"},
}
}
diff --git a/en_JE/en_JE_test.go b/en_JE/en_JE_test.go
new file mode 100644
index 00000000..83be533a
--- /dev/null
+++ b/en_JE/en_JE_test.go
@@ -0,0 +1,1120 @@
+package en_JE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_JE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_JM/en_JM.go b/en_JM/en_JM.go
index a0725ee4..788572d9 100644
--- a/en_JM/en_JM.go
+++ b/en_JM/en_JM.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"MST": "Macau Standard Time", "BOT": "Bolivia Time", "ECT": "Ecuador Time", "EAT": "East Africa Time", "MYT": "Malaysia Time", "WAST": "West Africa Summer Time", "WIB": "Western Indonesia Time", "TMST": "Turkmenistan Summer Time", "AEDT": "Australian Eastern Daylight Time", "COT": "Colombia Standard Time", "BT": "Bhutan Time", "AWST": "Australian Western Standard Time", "ADT": "Atlantic Daylight Time", "GFT": "French Guiana Time", "MDT": "Macau Summer Time", "MEZ": "Central European Standard Time", "ACWDT": "Australian Central Western Daylight Time", "HKT": "Hong Kong Standard Time", "WARST": "Western Argentina Summer Time", "JST": "Japan Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "WAT": "West Africa Standard Time", "AST": "Atlantic Standard Time", "JDT": "Japan Daylight Time", "CAT": "Central Africa Time", "WART": "Western Argentina Standard Time", "OEZ": "Eastern European Standard Time", "WITA": "Central Indonesia Time", "ARST": "Argentina Summer Time", "CLT": "Chile Standard Time", "SAST": "South Africa Standard Time", "HKST": "Hong Kong Summer Time", "OESZ": "Eastern European Summer Time", "LHST": "Lord Howe Standard Time", "AWDT": "Australian Western Daylight Time", "LHDT": "Lord Howe Daylight Time", "UYST": "Uruguay Summer Time", "AEST": "Australian Eastern Standard Time", "PDT": "Pacific Daylight Time", "SRT": "Suriname Time", "CDT": "Central Daylight Time", "NZST": "New Zealand Standard Time", "VET": "Venezuela Time", "ChST": "Chamorro Standard Time", "EDT": "Eastern Daylight Time", "COST": "Colombia Summer Time", "∅∅∅": "Amazon Summer Time", "SGT": "Singapore Standard Time", "GMT": "Greenwich Mean Time", "HNT": "Newfoundland Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "WEZ": "Western European Standard Time", "CHAST": "Chatham Standard Time", "ACST": "Australian Central Standard Time", "CLST": "Chile Summer Time", "IST": "India Standard Time", "CHADT": "Chatham Daylight Time", "PST": "Pacific Standard Time", "AKST": "Alaska Standard Time", "WESZ": "Western European Summer Time", "ACWST": "Australian Central Western Standard Time", "TMT": "Turkmenistan Standard Time", "MESZ": "Central European Summer Time", "EST": "Eastern Standard Time", "GYT": "Guyana Time", "ART": "Argentina Standard Time", "AKDT": "Alaska Daylight Time", "CST": "Central Standard Time", "NZDT": "New Zealand Daylight Time", "UYT": "Uruguay Standard Time", "HAT": "Newfoundland Daylight Time", "WIT": "Eastern Indonesia Time", "ACDT": "Australian Central Daylight Time"},
+ timezones: map[string]string{"HNT": "Newfoundland Standard Time", "HAT": "Newfoundland Daylight Time", "CST": "Central Standard Time", "AEST": "Australian Eastern Standard Time", "EAT": "East Africa Time", "CLT": "Chile Standard Time", "WARST": "Western Argentina Summer Time", "HKST": "Hong Kong Summer Time", "VET": "Venezuela Time", "ADT": "Atlantic Daylight Time", "NZDT": "New Zealand Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "WAST": "West Africa Summer Time", "ACDT": "Australian Central Daylight Time", "AKST": "Alaska Standard Time", "ARST": "Argentina Summer Time", "BOT": "Bolivia Time", "∅∅∅": "Amazon Summer Time", "WIB": "Western Indonesia Time", "CAT": "Central Africa Time", "SAST": "South Africa Standard Time", "GYT": "Guyana Time", "CHAST": "Chatham Standard Time", "TMST": "Turkmenistan Summer Time", "CLST": "Chile Summer Time", "SGT": "Singapore Standard Time", "COST": "Colombia Summer Time", "ACST": "Australian Central Standard Time", "HKT": "Hong Kong Standard Time", "MESZ": "Central European Summer Time", "WAT": "West Africa Standard Time", "WESZ": "Western European Summer Time", "LHST": "Lord Howe Standard Time", "MYT": "Malaysia Time", "ChST": "Chamorro Standard Time", "UYST": "Uruguay Summer Time", "PST": "Pacific Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "COT": "Colombia Standard Time", "GMT": "Greenwich Mean Time", "MST": "Macau Standard Time", "AST": "Atlantic Standard Time", "OESZ": "Eastern European Summer Time", "UYT": "Uruguay Standard Time", "JDT": "Japan Daylight Time", "AWST": "Australian Western Standard Time", "TMT": "Turkmenistan Standard Time", "WIT": "Eastern Indonesia Time", "WART": "Western Argentina Standard Time", "ECT": "Ecuador Time", "JST": "Japan Standard Time", "AWDT": "Australian Western Daylight Time", "WEZ": "Western European Standard Time", "BT": "Bhutan Time", "LHDT": "Lord Howe Daylight Time", "ACWDT": "Australian Central Western Daylight Time", "ART": "Argentina Standard Time", "WITA": "Central Indonesia Time", "EDT": "Eastern Daylight Time", "MEZ": "Central European Standard Time", "AEDT": "Australian Eastern Daylight Time", "MDT": "Macau Summer Time", "CHADT": "Chatham Daylight Time", "IST": "India Standard Time", "EST": "Eastern Standard Time", "GFT": "French Guiana Time", "SRT": "Suriname Time", "AKDT": "Alaska Daylight Time", "ACWST": "Australian Central Western Standard Time", "NZST": "New Zealand Standard Time", "PDT": "Pacific Daylight Time", "OEZ": "Eastern European Standard Time", "CDT": "Central Daylight Time"},
}
}
diff --git a/en_JM/en_JM_test.go b/en_JM/en_JM_test.go
new file mode 100644
index 00000000..3772f86a
--- /dev/null
+++ b/en_JM/en_JM_test.go
@@ -0,0 +1,1120 @@
+package en_JM
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_JM"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_KE/en_KE.go b/en_KE/en_KE.go
index 6bca6d14..63540a2b 100644
--- a/en_KE/en_KE.go
+++ b/en_KE/en_KE.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"CDT": "Central Daylight Time", "AEST": "Australian Eastern Standard Time", "CLT": "Chile Standard Time", "∅∅∅": "Brasilia Summer Time", "HADT": "Hawaii-Aleutian Daylight Time", "UYST": "Uruguay Summer Time", "VET": "Venezuela Time", "BT": "Bhutan Time", "AKDT": "Alaska Daylight Time", "JST": "Japan Standard Time", "AEDT": "Australian Eastern Daylight Time", "EDT": "Eastern Daylight Time", "ECT": "Ecuador Time", "WAST": "West Africa Summer Time", "LHST": "Lord Howe Standard Time", "UYT": "Uruguay Standard Time", "ChST": "Chamorro Standard Time", "WARST": "Western Argentina Summer Time", "HNT": "Newfoundland Standard Time", "EAT": "East Africa Time", "ACST": "Australian Central Standard Time", "CAT": "Central Africa Time", "ADT": "Atlantic Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "GFT": "French Guiana Time", "WITA": "Central Indonesia Time", "TMT": "Turkmenistan Standard Time", "ACWST": "Australian Central Western Standard Time", "COT": "Colombia Standard Time", "COST": "Colombia Summer Time", "AST": "Atlantic Standard Time", "MYT": "Malaysia Time", "SRT": "Suriname Time", "NZST": "New Zealand Standard Time", "WEZ": "Western European Standard Time", "CHAST": "Chatham Standard Time", "CST": "Central Standard Time", "IST": "India Standard Time", "WIB": "Western Indonesia Time", "ART": "Argentina Standard Time", "PDT": "Pacific Daylight Time", "MEZ": "Central European Standard Time", "OESZ": "Eastern European Summer Time", "WIT": "Eastern Indonesia Time", "AWST": "Australian Western Standard Time", "HKST": "Hong Kong Summer Time", "WART": "Western Argentina Standard Time", "GMT": "Greenwich Mean Time", "ARST": "Argentina Summer Time", "AWDT": "Australian Western Daylight Time", "MDT": "Mountain Daylight Time", "MESZ": "Central European Summer Time", "NZDT": "New Zealand Daylight Time", "WESZ": "Western European Summer Time", "ACWDT": "Australian Central Western Daylight Time", "EST": "Eastern Standard Time", "CLST": "Chile Summer Time", "LHDT": "Lord Howe Daylight Time", "GYT": "Guyana Time", "ACDT": "Australian Central Daylight Time", "BOT": "Bolivia Time", "MST": "Mountain Standard Time", "SGT": "Singapore Standard Time", "HKT": "Hong Kong Standard Time", "OEZ": "Eastern European Standard Time", "HAT": "Newfoundland Daylight Time", "PST": "Pacific Standard Time", "JDT": "Japan Daylight Time", "CHADT": "Chatham Daylight Time", "SAST": "South Africa Standard Time", "WAT": "West Africa Standard Time", "TMST": "Turkmenistan Summer Time", "AKST": "Alaska Standard Time"},
+ timezones: map[string]string{"WITA": "Central Indonesia Time", "PDT": "Pacific Daylight Time", "WESZ": "Western European Summer Time", "WIB": "Western Indonesia Time", "OEZ": "Eastern European Standard Time", "CLT": "Chile Standard Time", "CDT": "Central Daylight Time", "MEZ": "Central European Standard Time", "BOT": "Bolivia Time", "WARST": "Western Argentina Summer Time", "SRT": "Suriname Time", "HKT": "Hong Kong Standard Time", "AKDT": "Alaska Daylight Time", "ART": "Argentina Standard Time", "TMT": "Turkmenistan Standard Time", "AEST": "Australian Eastern Standard Time", "CST": "Central Standard Time", "WART": "Western Argentina Standard Time", "AKST": "Alaska Standard Time", "AWDT": "Australian Western Daylight Time", "EST": "Eastern Standard Time", "GYT": "Guyana Time", "MDT": "Mountain Daylight Time", "ACDT": "Australian Central Daylight Time", "ECT": "Ecuador Time", "CHAST": "Chatham Standard Time", "AST": "Atlantic Standard Time", "CAT": "Central Africa Time", "BT": "Bhutan Time", "UYT": "Uruguay Standard Time", "VET": "Venezuela Time", "JDT": "Japan Daylight Time", "MYT": "Malaysia Time", "WIT": "Eastern Indonesia Time", "HAST": "Hawaii-Aleutian Standard Time", "NZDT": "New Zealand Daylight Time", "∅∅∅": "Amazon Summer Time", "WAT": "West Africa Standard Time", "WEZ": "Western European Standard Time", "HNT": "Newfoundland Standard Time", "GFT": "French Guiana Time", "EDT": "Eastern Daylight Time", "COT": "Colombia Standard Time", "GMT": "Greenwich Mean Time", "MST": "Mountain Standard Time", "ACST": "Australian Central Standard Time", "TMST": "Turkmenistan Summer Time", "CLST": "Chile Summer Time", "ACWDT": "Australian Central Western Daylight Time", "IST": "India Standard Time", "LHDT": "Lord Howe Daylight Time", "SAST": "South Africa Standard Time", "PST": "Pacific Standard Time", "WAST": "West Africa Summer Time", "ACWST": "Australian Central Western Standard Time", "JST": "Japan Standard Time", "HAT": "Newfoundland Daylight Time", "CHADT": "Chatham Daylight Time", "AWST": "Australian Western Standard Time", "NZST": "New Zealand Standard Time", "ChST": "Chamorro Standard Time", "UYST": "Uruguay Summer Time", "ADT": "Atlantic Daylight Time", "MESZ": "Central European Summer Time", "HADT": "Hawaii-Aleutian Daylight Time", "OESZ": "Eastern European Summer Time", "AEDT": "Australian Eastern Daylight Time", "EAT": "East Africa Time", "LHST": "Lord Howe Standard Time", "SGT": "Singapore Standard Time", "COST": "Colombia Summer Time", "HKST": "Hong Kong Summer Time", "ARST": "Argentina Summer Time"},
}
}
diff --git a/en_KE/en_KE_test.go b/en_KE/en_KE_test.go
new file mode 100644
index 00000000..36cbdcd3
--- /dev/null
+++ b/en_KE/en_KE_test.go
@@ -0,0 +1,1120 @@
+package en_KE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_KE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_KI/en_KI.go b/en_KI/en_KI.go
index c91ed542..7dd702e0 100644
--- a/en_KI/en_KI.go
+++ b/en_KI/en_KI.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"AWST": "Australian Western Standard Time", "ACWST": "Australian Central Western Standard Time", "AEDT": "Australian Eastern Daylight Time", "WAST": "West Africa Summer Time", "WIT": "Eastern Indonesia Time", "CDT": "Central Daylight Time", "NZDT": "New Zealand Daylight Time", "MST": "Mountain Standard Time", "SGT": "Singapore Standard Time", "JDT": "Japan Daylight Time", "VET": "Venezuela Time", "EDT": "Eastern Daylight Time", "COT": "Colombia Standard Time", "COST": "Colombia Summer Time", "EAT": "East Africa Time", "WESZ": "Western European Summer Time", "SAST": "South Africa Standard Time", "IST": "India Standard Time", "LHDT": "Lord Howe Daylight Time", "NZST": "New Zealand Standard Time", "BOT": "Bolivia Time", "WEZ": "Western European Standard Time", "WARST": "Western Argentina Summer Time", "GMT": "Greenwich Mean Time", "AKST": "Alaska Standard Time", "UYT": "Uruguay Standard Time", "UYST": "Uruguay Summer Time", "EST": "Eastern Standard Time", "OESZ": "Eastern European Summer Time", "PDT": "Pacific Daylight Time", "∅∅∅": "Azores Summer Time", "CST": "Central Standard Time", "HKT": "Hong Kong Standard Time", "MEZ": "Central European Standard Time", "GFT": "French Guiana Time", "ACDT": "Australian Central Daylight Time", "MDT": "Mountain Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "WART": "Western Argentina Standard Time", "WITA": "Central Indonesia Time", "HKST": "Hong Kong Summer Time", "ART": "Argentina Standard Time", "PST": "Pacific Standard Time", "AWDT": "Australian Western Daylight Time", "CHADT": "Chatham Daylight Time", "AST": "Atlantic Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "HNT": "Newfoundland Standard Time", "ACST": "Australian Central Standard Time", "GYT": "Guyana Time", "CLST": "Chile Summer Time", "ECT": "Ecuador Time", "ADT": "Atlantic Daylight Time", "TMT": "Turkmenistan Standard Time", "TMST": "Turkmenistan Summer Time", "JST": "Japan Standard Time", "SRT": "Suriname Time", "LHST": "Lord Howe Standard Time", "AEST": "Australian Eastern Standard Time", "ChST": "Chamorro Standard Time", "CAT": "Central Africa Time", "BT": "Bhutan Time", "WIB": "Western Indonesia Time", "MYT": "Malaysia Time", "AKDT": "Alaska Daylight Time", "MESZ": "Central European Summer Time", "CHAST": "Chatham Standard Time", "CLT": "Chile Standard Time", "ACWDT": "Australian Central Western Daylight Time", "HAT": "Newfoundland Daylight Time", "ARST": "Argentina Summer Time", "WAT": "West Africa Standard Time", "OEZ": "Eastern European Standard Time"},
+ timezones: map[string]string{"ACWDT": "Australian Central Western Daylight Time", "TMT": "Turkmenistan Standard Time", "LHDT": "Lord Howe Daylight Time", "WITA": "Central Indonesia Time", "PDT": "Pacific Daylight Time", "NZDT": "New Zealand Daylight Time", "MEZ": "Central European Standard Time", "HNT": "Newfoundland Standard Time", "SGT": "Singapore Standard Time", "OEZ": "Eastern European Standard Time", "BOT": "Bolivia Time", "ACST": "Australian Central Standard Time", "ACDT": "Australian Central Daylight Time", "SRT": "Suriname Time", "JDT": "Japan Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "SAST": "South Africa Standard Time", "WEZ": "Western European Standard Time", "CDT": "Central Daylight Time", "MDT": "Macau Summer Time", "AWST": "Australian Western Standard Time", "EST": "Eastern Standard Time", "MESZ": "Central European Summer Time", "WESZ": "Western European Summer Time", "OESZ": "Eastern European Summer Time", "WART": "Western Argentina Standard Time", "CHADT": "Chatham Daylight Time", "VET": "Venezuela Time", "AWDT": "Australian Western Daylight Time", "AKDT": "Alaska Daylight Time", "WIB": "Western Indonesia Time", "TMST": "Turkmenistan Summer Time", "CAT": "Central Africa Time", "JST": "Japan Standard Time", "UYT": "Uruguay Standard Time", "ADT": "Atlantic Daylight Time", "ARST": "Argentina Summer Time", "UYST": "Uruguay Summer Time", "GFT": "French Guiana Time", "HAST": "Hawaii-Aleutian Standard Time", "HAT": "Newfoundland Daylight Time", "ChST": "Chamorro Standard Time", "LHST": "Lord Howe Standard Time", "IST": "India Standard Time", "COT": "Colombia Standard Time", "GMT": "Greenwich Mean Time", "AEDT": "Australian Eastern Daylight Time", "EAT": "East Africa Time", "MST": "Macau Standard Time", "NZST": "New Zealand Standard Time", "COST": "Colombia Summer Time", "WARST": "Western Argentina Summer Time", "HKST": "Hong Kong Summer Time", "ACWST": "Australian Central Western Standard Time", "ART": "Argentina Standard Time", "EDT": "Eastern Daylight Time", "WAT": "West Africa Standard Time", "MYT": "Malaysia Time", "CLST": "Chile Summer Time", "HKT": "Hong Kong Standard Time", "ECT": "Ecuador Time", "AST": "Atlantic Standard Time", "AKST": "Alaska Standard Time", "PST": "Pacific Standard Time", "GYT": "Guyana Time", "BT": "Bhutan Time", "CST": "Central Standard Time", "CHAST": "Chatham Standard Time", "∅∅∅": "Amazon Summer Time", "WAST": "West Africa Summer Time", "AEST": "Australian Eastern Standard Time", "WIT": "Eastern Indonesia Time", "CLT": "Chile Standard Time"},
}
}
diff --git a/en_KI/en_KI_test.go b/en_KI/en_KI_test.go
new file mode 100644
index 00000000..db2a86d7
--- /dev/null
+++ b/en_KI/en_KI_test.go
@@ -0,0 +1,1120 @@
+package en_KI
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_KI"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_KN/en_KN.go b/en_KN/en_KN.go
index 89b3e3db..ad57227e 100644
--- a/en_KN/en_KN.go
+++ b/en_KN/en_KN.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"AWDT": "Australian Western Daylight Time", "CST": "Central Standard Time", "CHADT": "Chatham Daylight Time", "SAST": "South Africa Standard Time", "ART": "Argentina Standard Time", "∅∅∅": "Amazon Summer Time", "CAT": "Central Africa Time", "WARST": "Western Argentina Summer Time", "WITA": "Central Indonesia Time", "MESZ": "Central European Summer Time", "AEDT": "Australian Eastern Daylight Time", "HKST": "Hong Kong Summer Time", "OEZ": "Eastern European Standard Time", "GFT": "French Guiana Time", "VET": "Venezuela Time", "WAT": "West Africa Standard Time", "BT": "Bhutan Time", "EAT": "East Africa Time", "AEST": "Australian Eastern Standard Time", "AST": "Atlantic Standard Time", "MST": "Macau Standard Time", "TMT": "Turkmenistan Standard Time", "NZST": "New Zealand Standard Time", "WESZ": "Western European Summer Time", "ACWDT": "Australian Central Western Daylight Time", "EDT": "Eastern Daylight Time", "WIT": "Eastern Indonesia Time", "PST": "Pacific Standard Time", "AWST": "Australian Western Standard Time", "GYT": "Guyana Time", "MYT": "Malaysia Time", "COST": "Colombia Summer Time", "TMST": "Turkmenistan Summer Time", "ACWST": "Australian Central Western Standard Time", "ADT": "Atlantic Daylight Time", "WAST": "West Africa Summer Time", "JDT": "Japan Daylight Time", "AKST": "Alaska Standard Time", "NZDT": "New Zealand Daylight Time", "ChST": "Chamorro Standard Time", "EST": "Eastern Standard Time", "HNT": "Newfoundland Standard Time", "LHDT": "Lord Howe Daylight Time", "UYST": "Uruguay Summer Time", "WIB": "Western Indonesia Time", "IST": "India Standard Time", "MDT": "Macau Summer Time", "ARST": "Argentina Summer Time", "AKDT": "Alaska Daylight Time", "WEZ": "Western European Standard Time", "HKT": "Hong Kong Standard Time", "ACST": "Australian Central Standard Time", "OESZ": "Eastern European Summer Time", "BOT": "Bolivia Time", "UYT": "Uruguay Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "JST": "Japan Standard Time", "COT": "Colombia Standard Time", "ECT": "Ecuador Time", "WART": "Western Argentina Standard Time", "ACDT": "Australian Central Daylight Time", "PDT": "Pacific Daylight Time", "CLT": "Chile Standard Time", "CLST": "Chile Summer Time", "SGT": "Singapore Standard Time", "GMT": "Greenwich Mean Time", "HAT": "Newfoundland Daylight Time", "SRT": "Suriname Time", "LHST": "Lord Howe Standard Time", "CDT": "Central Daylight Time", "MEZ": "Central European Standard Time", "CHAST": "Chatham Standard Time", "HAST": "Hawaii-Aleutian Standard Time"},
+ timezones: map[string]string{"HADT": "Hawaii-Aleutian Daylight Time", "CAT": "Central Africa Time", "COST": "Colombia Summer Time", "MST": "Macau Standard Time", "WIT": "Eastern Indonesia Time", "LHST": "Lord Howe Standard Time", "ACWDT": "Australian Central Western Daylight Time", "ART": "Argentina Standard Time", "IST": "India Standard Time", "WAST": "West Africa Summer Time", "CHAST": "Chatham Standard Time", "ECT": "Ecuador Time", "ADT": "Atlantic Daylight Time", "MEZ": "Central European Standard Time", "BT": "Bhutan Time", "CLT": "Chile Standard Time", "CLST": "Chile Summer Time", "CHADT": "Chatham Daylight Time", "EDT": "Eastern Daylight Time", "ARST": "Argentina Summer Time", "MESZ": "Central European Summer Time", "WESZ": "Western European Summer Time", "SGT": "Singapore Standard Time", "ACWST": "Australian Central Western Standard Time", "WEZ": "Western European Standard Time", "∅∅∅": "Azores Summer Time", "MDT": "Macau Summer Time", "AKST": "Alaska Standard Time", "TMT": "Turkmenistan Standard Time", "HNT": "Newfoundland Standard Time", "OESZ": "Eastern European Summer Time", "ACDT": "Australian Central Daylight Time", "AST": "Atlantic Standard Time", "AWST": "Australian Western Standard Time", "EST": "Eastern Standard Time", "PST": "Pacific Standard Time", "HAT": "Newfoundland Daylight Time", "OEZ": "Eastern European Standard Time", "HKST": "Hong Kong Summer Time", "UYST": "Uruguay Summer Time", "CST": "Central Standard Time", "ACST": "Australian Central Standard Time", "JST": "Japan Standard Time", "WITA": "Central Indonesia Time", "ChST": "Chamorro Standard Time", "EAT": "East Africa Time", "MYT": "Malaysia Time", "JDT": "Japan Daylight Time", "PDT": "Pacific Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "GYT": "Guyana Time", "CDT": "Central Daylight Time", "SRT": "Suriname Time", "NZST": "New Zealand Standard Time", "NZDT": "New Zealand Daylight Time", "WAT": "West Africa Standard Time", "AEST": "Australian Eastern Standard Time", "UYT": "Uruguay Standard Time", "GFT": "French Guiana Time", "BOT": "Bolivia Time", "SAST": "South Africa Standard Time", "TMST": "Turkmenistan Summer Time", "AEDT": "Australian Eastern Daylight Time", "LHDT": "Lord Howe Daylight Time", "WART": "Western Argentina Standard Time", "AKDT": "Alaska Daylight Time", "GMT": "Greenwich Mean Time", "WARST": "Western Argentina Summer Time", "HKT": "Hong Kong Standard Time", "VET": "Venezuela Time", "AWDT": "Australian Western Daylight Time", "WIB": "Western Indonesia Time", "COT": "Colombia Standard Time"},
}
}
diff --git a/en_KN/en_KN_test.go b/en_KN/en_KN_test.go
new file mode 100644
index 00000000..3c7d6eae
--- /dev/null
+++ b/en_KN/en_KN_test.go
@@ -0,0 +1,1120 @@
+package en_KN
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_KN"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_KY/en_KY.go b/en_KY/en_KY.go
index f21c876d..dc68a36f 100644
--- a/en_KY/en_KY.go
+++ b/en_KY/en_KY.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"HKST": "Hong Kong Summer Time", "TMST": "Turkmenistan Summer Time", "NZDT": "New Zealand Daylight Time", "COT": "Colombia Standard Time", "WART": "Western Argentina Standard Time", "AKDT": "Alaska Daylight Time", "LHDT": "Lord Howe Daylight Time", "UYST": "Uruguay Summer Time", "GMT": "Greenwich Mean Time", "CLST": "Chile Summer Time", "SAST": "South Africa Standard Time", "HKT": "Hong Kong Standard Time", "GFT": "French Guiana Time", "AWDT": "Australian Western Daylight Time", "AST": "Atlantic Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "WIB": "Western Indonesia Time", "MDT": "Macau Summer Time", "ART": "Argentina Standard Time", "ARST": "Argentina Summer Time", "WAT": "West Africa Standard Time", "JDT": "Japan Daylight Time", "CDT": "Central Daylight Time", "CHADT": "Chatham Daylight Time", "ACWST": "Australian Central Western Standard Time", "AKST": "Alaska Standard Time", "CST": "Central Standard Time", "ChST": "Chamorro Standard Time", "WARST": "Western Argentina Summer Time", "PST": "Pacific Standard Time", "NZST": "New Zealand Standard Time", "AEDT": "Australian Eastern Daylight Time", "COST": "Colombia Summer Time", "IST": "India Standard Time", "OEZ": "Eastern European Standard Time", "OESZ": "Eastern European Summer Time", "MST": "Macau Standard Time", "∅∅∅": "Amazon Summer Time", "GYT": "Guyana Time", "EDT": "Eastern Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "WESZ": "Western European Summer Time", "AEST": "Australian Eastern Standard Time", "CAT": "Central Africa Time", "ECT": "Ecuador Time", "ACST": "Australian Central Standard Time", "AWST": "Australian Western Standard Time", "BOT": "Bolivia Time", "CLT": "Chile Standard Time", "SGT": "Singapore Standard Time", "WITA": "Central Indonesia Time", "CHAST": "Chatham Standard Time", "BT": "Bhutan Time", "VET": "Venezuela Time", "WEZ": "Western European Standard Time", "ACWDT": "Australian Central Western Daylight Time", "TMT": "Turkmenistan Standard Time", "ACDT": "Australian Central Daylight Time", "JST": "Japan Standard Time", "UYT": "Uruguay Standard Time", "WAST": "West Africa Summer Time", "PDT": "Pacific Daylight Time", "MEZ": "Central European Standard Time", "MESZ": "Central European Summer Time", "WIT": "Eastern Indonesia Time", "HNT": "Newfoundland Standard Time", "EAT": "East Africa Time", "SRT": "Suriname Time", "HAT": "Newfoundland Daylight Time", "MYT": "Malaysia Time", "LHST": "Lord Howe Standard Time", "ADT": "Atlantic Daylight Time", "EST": "Eastern Standard Time"},
+ timezones: map[string]string{"∅∅∅": "Amazon Summer Time", "WIB": "Western Indonesia Time", "GMT": "Greenwich Mean Time", "MDT": "Mountain Daylight Time", "CHAST": "Chatham Standard Time", "CHADT": "Chatham Daylight Time", "AWST": "Australian Western Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "NZDT": "New Zealand Daylight Time", "CLST": "Chile Summer Time", "ACDT": "Australian Central Daylight Time", "ChST": "Chamorro Standard Time", "JDT": "Japan Daylight Time", "MEZ": "Central European Standard Time", "TMT": "Turkmenistan Standard Time", "MST": "Mountain Standard Time", "CLT": "Chile Standard Time", "HKST": "Hong Kong Summer Time", "AKDT": "Alaska Daylight Time", "AWDT": "Australian Western Daylight Time", "ART": "Argentina Standard Time", "JST": "Japan Standard Time", "HNT": "Newfoundland Standard Time", "ACST": "Australian Central Standard Time", "WART": "Western Argentina Standard Time", "AST": "Atlantic Standard Time", "ADT": "Atlantic Daylight Time", "ARST": "Argentina Summer Time", "EDT": "Eastern Daylight Time", "OESZ": "Eastern European Summer Time", "BT": "Bhutan Time", "LHDT": "Lord Howe Daylight Time", "WIT": "Eastern Indonesia Time", "SAST": "South Africa Standard Time", "PDT": "Pacific Daylight Time", "NZST": "New Zealand Standard Time", "SGT": "Singapore Standard Time", "EST": "Eastern Standard Time", "CAT": "Central Africa Time", "WESZ": "Western European Summer Time", "SRT": "Suriname Time", "GFT": "French Guiana Time", "WITA": "Central Indonesia Time", "PST": "Pacific Standard Time", "WEZ": "Western European Standard Time", "AEDT": "Australian Eastern Daylight Time", "MESZ": "Central European Summer Time", "CST": "Central Standard Time", "WARST": "Western Argentina Summer Time", "WAT": "West Africa Standard Time", "HAT": "Newfoundland Daylight Time", "COST": "Colombia Summer Time", "TMST": "Turkmenistan Summer Time", "OEZ": "Eastern European Standard Time", "LHST": "Lord Howe Standard Time", "UYT": "Uruguay Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "CDT": "Central Daylight Time", "HKT": "Hong Kong Standard Time", "ECT": "Ecuador Time", "VET": "Venezuela Time", "BOT": "Bolivia Time", "COT": "Colombia Standard Time", "EAT": "East Africa Time", "UYST": "Uruguay Summer Time", "AKST": "Alaska Standard Time", "ACWST": "Australian Central Western Standard Time", "ACWDT": "Australian Central Western Daylight Time", "WAST": "West Africa Summer Time", "GYT": "Guyana Time", "IST": "India Standard Time", "AEST": "Australian Eastern Standard Time", "MYT": "Malaysia Time"},
}
}
diff --git a/en_KY/en_KY_test.go b/en_KY/en_KY_test.go
new file mode 100644
index 00000000..708fd986
--- /dev/null
+++ b/en_KY/en_KY_test.go
@@ -0,0 +1,1120 @@
+package en_KY
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_KY"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_LC/en_LC.go b/en_LC/en_LC.go
index 8a9bc5bd..a0d4073f 100644
--- a/en_LC/en_LC.go
+++ b/en_LC/en_LC.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"BT": "Bhutan Time", "HNT": "Newfoundland Standard Time", "MDT": "Macau Summer Time", "NZST": "New Zealand Standard Time", "OESZ": "Eastern European Summer Time", "GMT": "Greenwich Mean Time", "JST": "Japan Standard Time", "MEZ": "Central European Standard Time", "ACWST": "Australian Central Western Standard Time", "OEZ": "Eastern European Standard Time", "AEST": "Australian Eastern Standard Time", "CLT": "Chile Standard Time", "GFT": "French Guiana Time", "AKST": "Alaska Standard Time", "SRT": "Suriname Time", "CHADT": "Chatham Daylight Time", "EDT": "Eastern Daylight Time", "JDT": "Japan Daylight Time", "CLST": "Chile Summer Time", "ADT": "Atlantic Daylight Time", "SAST": "South Africa Standard Time", "HKT": "Hong Kong Standard Time", "ACDT": "Australian Central Daylight Time", "ARST": "Argentina Summer Time", "BOT": "Bolivia Time", "AST": "Atlantic Standard Time", "WIB": "Western Indonesia Time", "PDT": "Pacific Daylight Time", "CST": "Central Standard Time", "AEDT": "Australian Eastern Daylight Time", "MYT": "Malaysia Time", "WESZ": "Western European Summer Time", "COT": "Colombia Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "TMST": "Turkmenistan Summer Time", "WEZ": "Western European Standard Time", "CHAST": "Chatham Standard Time", "IST": "India Standard Time", "WITA": "Central Indonesia Time", "PST": "Pacific Standard Time", "LHST": "Lord Howe Standard Time", "GYT": "Guyana Time", "CDT": "Central Daylight Time", "WARST": "Western Argentina Summer Time", "HAT": "Newfoundland Daylight Time", "ART": "Argentina Standard Time", "UYT": "Uruguay Standard Time", "AKDT": "Alaska Daylight Time", "NZDT": "New Zealand Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "EAT": "East Africa Time", "ACST": "Australian Central Standard Time", "TMT": "Turkmenistan Standard Time", "AWDT": "Australian Western Daylight Time", "CAT": "Central Africa Time", "VET": "Venezuela Time", "COST": "Colombia Summer Time", "LHDT": "Lord Howe Daylight Time", "MESZ": "Central European Summer Time", "SGT": "Singapore Standard Time", "∅∅∅": "Acre Summer Time", "WAT": "West Africa Standard Time", "WAST": "West Africa Summer Time", "WIT": "Eastern Indonesia Time", "AWST": "Australian Western Standard Time", "UYST": "Uruguay Summer Time", "ACWDT": "Australian Central Western Daylight Time", "ECT": "Ecuador Time", "HKST": "Hong Kong Summer Time", "WART": "Western Argentina Standard Time", "MST": "Macau Standard Time", "ChST": "Chamorro Standard Time", "EST": "Eastern Standard Time"},
+ timezones: map[string]string{"MST": "Mountain Standard Time", "NZDT": "New Zealand Daylight Time", "CDT": "Central Daylight Time", "ART": "Argentina Standard Time", "JST": "Japan Standard Time", "PST": "Pacific Standard Time", "OEZ": "Eastern European Standard Time", "CLT": "Chile Standard Time", "CST": "Central Standard Time", "SRT": "Suriname Time", "VET": "Venezuela Time", "HKST": "Hong Kong Summer Time", "EST": "Eastern Standard Time", "CLST": "Chile Summer Time", "UYT": "Uruguay Standard Time", "WIT": "Eastern Indonesia Time", "AST": "Atlantic Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "WEZ": "Western European Standard Time", "SGT": "Singapore Standard Time", "WESZ": "Western European Summer Time", "GMT": "Greenwich Mean Time", "GFT": "French Guiana Time", "MESZ": "Central European Summer Time", "HNT": "Newfoundland Standard Time", "COT": "Colombia Standard Time", "∅∅∅": "Brasilia Summer Time", "ADT": "Atlantic Daylight Time", "SAST": "South Africa Standard Time", "EDT": "Eastern Daylight Time", "ECT": "Ecuador Time", "ARST": "Argentina Summer Time", "ACWDT": "Australian Central Western Daylight Time", "GYT": "Guyana Time", "AWST": "Australian Western Standard Time", "HAT": "Newfoundland Daylight Time", "WIB": "Western Indonesia Time", "CAT": "Central Africa Time", "LHDT": "Lord Howe Daylight Time", "WART": "Western Argentina Standard Time", "PDT": "Pacific Daylight Time", "AKST": "Alaska Standard Time", "MEZ": "Central European Standard Time", "NZST": "New Zealand Standard Time", "BOT": "Bolivia Time", "TMT": "Turkmenistan Standard Time", "ACST": "Australian Central Standard Time", "ACDT": "Australian Central Daylight Time", "HKT": "Hong Kong Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "ACWST": "Australian Central Western Standard Time", "IST": "India Standard Time", "UYST": "Uruguay Summer Time", "WARST": "Western Argentina Summer Time", "WITA": "Central Indonesia Time", "EAT": "East Africa Time", "LHST": "Lord Howe Standard Time", "TMST": "Turkmenistan Summer Time", "AWDT": "Australian Western Daylight Time", "JDT": "Japan Daylight Time", "AKDT": "Alaska Daylight Time", "WAT": "West Africa Standard Time", "ChST": "Chamorro Standard Time", "MDT": "Mountain Daylight Time", "BT": "Bhutan Time", "CHADT": "Chatham Daylight Time", "WAST": "West Africa Summer Time", "AEDT": "Australian Eastern Daylight Time", "MYT": "Malaysia Time", "CHAST": "Chatham Standard Time", "OESZ": "Eastern European Summer Time", "AEST": "Australian Eastern Standard Time", "COST": "Colombia Summer Time"},
}
}
diff --git a/en_LC/en_LC_test.go b/en_LC/en_LC_test.go
new file mode 100644
index 00000000..b59330b6
--- /dev/null
+++ b/en_LC/en_LC_test.go
@@ -0,0 +1,1120 @@
+package en_LC
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_LC"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_LR/en_LR.go b/en_LR/en_LR.go
index 16127dcf..fd134114 100644
--- a/en_LR/en_LR.go
+++ b/en_LR/en_LR.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"∅∅∅": "Acre Summer Time", "UYT": "Uruguay Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "HAT": "Newfoundland Daylight Time", "WITA": "Central Indonesia Time", "TMT": "Turkmenistan Standard Time", "SRT": "Suriname Time", "CHAST": "Chatham Standard Time", "CAT": "Central Africa Time", "ADT": "Atlantic Daylight Time", "PDT": "Pacific Daylight Time", "GYT": "Guyana Time", "CST": "Central Standard Time", "CLST": "Chile Summer Time", "WIB": "Western Indonesia Time", "AKST": "Alaska Standard Time", "AKDT": "Alaska Daylight Time", "CHADT": "Chatham Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "OEZ": "Eastern European Standard Time", "EAT": "East Africa Time", "MST": "Macau Standard Time", "MEZ": "Central European Standard Time", "EDT": "Eastern Daylight Time", "COST": "Colombia Summer Time", "WARST": "Western Argentina Summer Time", "AWDT": "Australian Western Daylight Time", "NZDT": "New Zealand Daylight Time", "ACWST": "Australian Central Western Standard Time", "ACWDT": "Australian Central Western Daylight Time", "AEST": "Australian Eastern Standard Time", "AEDT": "Australian Eastern Daylight Time", "SAST": "South Africa Standard Time", "WEZ": "Western European Standard Time", "ARST": "Argentina Summer Time", "WAST": "West Africa Summer Time", "HKST": "Hong Kong Summer Time", "WART": "Western Argentina Standard Time", "WIT": "Eastern Indonesia Time", "JST": "Japan Standard Time", "JDT": "Japan Daylight Time", "WESZ": "Western European Summer Time", "WAT": "West Africa Standard Time", "ChST": "Chamorro Standard Time", "CLT": "Chile Standard Time", "BT": "Bhutan Time", "ACST": "Australian Central Standard Time", "AWST": "Australian Western Standard Time", "NZST": "New Zealand Standard Time", "BOT": "Bolivia Time", "EST": "Eastern Standard Time", "IST": "India Standard Time", "ART": "Argentina Standard Time", "LHDT": "Lord Howe Daylight Time", "ECT": "Ecuador Time", "GFT": "French Guiana Time", "MESZ": "Central European Summer Time", "PST": "Pacific Standard Time", "MYT": "Malaysia Time", "COT": "Colombia Standard Time", "OESZ": "Eastern European Summer Time", "TMST": "Turkmenistan Summer Time", "VET": "Venezuela Time", "GMT": "Greenwich Mean Time", "HKT": "Hong Kong Standard Time", "HNT": "Newfoundland Standard Time", "LHST": "Lord Howe Standard Time", "UYST": "Uruguay Summer Time", "SGT": "Singapore Standard Time", "MDT": "Macau Summer Time", "ACDT": "Australian Central Daylight Time", "CDT": "Central Daylight Time", "AST": "Atlantic Standard Time"},
+ timezones: map[string]string{"OEZ": "Eastern European Standard Time", "OESZ": "Eastern European Summer Time", "MST": "Mountain Standard Time", "CHAST": "Chatham Standard Time", "AWST": "Australian Western Standard Time", "TMT": "Turkmenistan Standard Time", "UYST": "Uruguay Summer Time", "HKST": "Hong Kong Summer Time", "ACWST": "Australian Central Western Standard Time", "ADT": "Atlantic Daylight Time", "WAST": "West Africa Summer Time", "HAT": "Newfoundland Daylight Time", "HKT": "Hong Kong Standard Time", "WITA": "Central Indonesia Time", "SAST": "South Africa Standard Time", "EDT": "Eastern Daylight Time", "PST": "Pacific Standard Time", "AEST": "Australian Eastern Standard Time", "GFT": "French Guiana Time", "HAST": "Hawaii-Aleutian Standard Time", "NZST": "New Zealand Standard Time", "CAT": "Central Africa Time", "LHST": "Lord Howe Standard Time", "GYT": "Guyana Time", "BT": "Bhutan Time", "MDT": "Mountain Daylight Time", "ART": "Argentina Standard Time", "CLST": "Chile Summer Time", "UYT": "Uruguay Standard Time", "CST": "Central Standard Time", "WART": "Western Argentina Standard Time", "WESZ": "Western European Summer Time", "HNT": "Newfoundland Standard Time", "AEDT": "Australian Eastern Daylight Time", "CLT": "Chile Standard Time", "SRT": "Suriname Time", "CHADT": "Chatham Daylight Time", "JDT": "Japan Daylight Time", "PDT": "Pacific Daylight Time", "COT": "Colombia Standard Time", "MYT": "Malaysia Time", "WIT": "Eastern Indonesia Time", "∅∅∅": "Brasilia Summer Time", "JST": "Japan Standard Time", "AKST": "Alaska Standard Time", "WIB": "Western Indonesia Time", "EAT": "East Africa Time", "LHDT": "Lord Howe Daylight Time", "CDT": "Central Daylight Time", "VET": "Venezuela Time", "AST": "Atlantic Standard Time", "MEZ": "Central European Standard Time", "GMT": "Greenwich Mean Time", "ACST": "Australian Central Standard Time", "WARST": "Western Argentina Summer Time", "AKDT": "Alaska Daylight Time", "COST": "Colombia Summer Time", "ACWDT": "Australian Central Western Daylight Time", "EST": "Eastern Standard Time", "WEZ": "Western European Standard Time", "ACDT": "Australian Central Daylight Time", "ARST": "Argentina Summer Time", "IST": "India Standard Time", "BOT": "Bolivia Time", "SGT": "Singapore Standard Time", "TMST": "Turkmenistan Summer Time", "ChST": "Chamorro Standard Time", "MESZ": "Central European Summer Time", "ECT": "Ecuador Time", "HADT": "Hawaii-Aleutian Daylight Time", "NZDT": "New Zealand Daylight Time", "WAT": "West Africa Standard Time", "AWDT": "Australian Western Daylight Time"},
}
}
@@ -112,8 +112,8 @@ func (en *en_LR) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
func (en *en_LR) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
n := math.Abs(num)
- nMod100 := math.Mod(n, 100)
nMod10 := math.Mod(n, 10)
+ nMod100 := math.Mod(n, 100)
if nMod10 == 1 && nMod100 != 11 {
return locales.PluralRuleOne
diff --git a/en_LR/en_LR_test.go b/en_LR/en_LR_test.go
new file mode 100644
index 00000000..face3848
--- /dev/null
+++ b/en_LR/en_LR_test.go
@@ -0,0 +1,1120 @@
+package en_LR
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_LR"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_LS/en_LS.go b/en_LS/en_LS.go
index c0806e74..edc0824f 100644
--- a/en_LS/en_LS.go
+++ b/en_LS/en_LS.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"TMST": "Turkmenistan Summer Time", "EDT": "Eastern Daylight Time", "WAT": "West Africa Standard Time", "GFT": "French Guiana Time", "MST": "Macau Standard Time", "LHST": "Lord Howe Standard Time", "MEZ": "Central European Standard Time", "MESZ": "Central European Summer Time", "COST": "Colombia Summer Time", "ECT": "Ecuador Time", "PDT": "Pacific Daylight Time", "VET": "Venezuela Time", "EST": "Eastern Standard Time", "SGT": "Singapore Standard Time", "BT": "Bhutan Time", "WITA": "Central Indonesia Time", "ARST": "Argentina Summer Time", "TMT": "Turkmenistan Standard Time", "AKST": "Alaska Standard Time", "PST": "Pacific Standard Time", "CHAST": "Chatham Standard Time", "HNT": "Newfoundland Standard Time", "UYT": "Uruguay Standard Time", "CLT": "Chile Standard Time", "CAT": "Central Africa Time", "UYST": "Uruguay Summer Time", "WIT": "Eastern Indonesia Time", "JDT": "Japan Daylight Time", "WART": "Western Argentina Standard Time", "GMT": "Greenwich Mean Time", "ACDT": "Australian Central Daylight Time", "JST": "Japan Standard Time", "CDT": "Central Daylight Time", "BOT": "Bolivia Time", "ChST": "Chamorro Standard Time", "HKST": "Hong Kong Summer Time", "WARST": "Western Argentina Summer Time", "ACST": "Australian Central Standard Time", "AWST": "Australian Western Standard Time", "NZDT": "New Zealand Daylight Time", "OEZ": "Eastern European Standard Time", "EAT": "East Africa Time", "SAST": "South Africa Standard Time", "SRT": "Suriname Time", "LHDT": "Lord Howe Daylight Time", "GYT": "Guyana Time", "WEZ": "Western European Standard Time", "ACWST": "Australian Central Western Standard Time", "WAST": "West Africa Summer Time", "WESZ": "Western European Summer Time", "WIB": "Western Indonesia Time", "MDT": "Macau Summer Time", "NZST": "New Zealand Standard Time", "CLST": "Chile Summer Time", "AST": "Atlantic Standard Time", "HKT": "Hong Kong Standard Time", "IST": "India Standard Time", "ART": "Argentina Standard Time", "AWDT": "Australian Western Daylight Time", "ACWDT": "Australian Central Western Daylight Time", "AEDT": "Australian Eastern Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "OESZ": "Eastern European Summer Time", "AKDT": "Alaska Daylight Time", "MYT": "Malaysia Time", "AEST": "Australian Eastern Standard Time", "ADT": "Atlantic Daylight Time", "∅∅∅": "Amazon Summer Time", "CST": "Central Standard Time", "CHADT": "Chatham Daylight Time", "COT": "Colombia Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "HAT": "Newfoundland Daylight Time"},
+ timezones: map[string]string{"UYST": "Uruguay Summer Time", "OEZ": "Eastern European Standard Time", "WITA": "Central Indonesia Time", "EDT": "Eastern Daylight Time", "CHADT": "Chatham Daylight Time", "WESZ": "Western European Summer Time", "OESZ": "Eastern European Summer Time", "ChST": "Chamorro Standard Time", "EAT": "East Africa Time", "MESZ": "Central European Summer Time", "HADT": "Hawaii-Aleutian Daylight Time", "NZDT": "New Zealand Daylight Time", "TMST": "Turkmenistan Summer Time", "∅∅∅": "Brasilia Summer Time", "ACDT": "Australian Central Daylight Time", "HKST": "Hong Kong Summer Time", "VET": "Venezuela Time", "CLT": "Chile Standard Time", "AKST": "Alaska Standard Time", "ACWDT": "Australian Central Western Daylight Time", "AWST": "Australian Western Standard Time", "SAST": "South Africa Standard Time", "WIT": "Eastern Indonesia Time", "SGT": "Singapore Standard Time", "GYT": "Guyana Time", "CLST": "Chile Summer Time", "HKT": "Hong Kong Standard Time", "AST": "Atlantic Standard Time", "PST": "Pacific Standard Time", "HAT": "Newfoundland Daylight Time", "SRT": "Suriname Time", "AWDT": "Australian Western Daylight Time", "ART": "Argentina Standard Time", "MEZ": "Central European Standard Time", "BT": "Bhutan Time", "WIB": "Western Indonesia Time", "CHAST": "Chatham Standard Time", "PDT": "Pacific Daylight Time", "WAT": "West Africa Standard Time", "WEZ": "Western European Standard Time", "GMT": "Greenwich Mean Time", "UYT": "Uruguay Standard Time", "WAST": "West Africa Summer Time", "MYT": "Malaysia Time", "WARST": "Western Argentina Summer Time", "MST": "Mountain Standard Time", "LHST": "Lord Howe Standard Time", "CST": "Central Standard Time", "EST": "Eastern Standard Time", "CAT": "Central Africa Time", "LHDT": "Lord Howe Daylight Time", "ACST": "Australian Central Standard Time", "ECT": "Ecuador Time", "JDT": "Japan Daylight Time", "BOT": "Bolivia Time", "AEST": "Australian Eastern Standard Time", "AKDT": "Alaska Daylight Time", "ARST": "Argentina Summer Time", "JST": "Japan Standard Time", "IST": "India Standard Time", "NZST": "New Zealand Standard Time", "WART": "Western Argentina Standard Time", "COT": "Colombia Standard Time", "COST": "Colombia Summer Time", "AEDT": "Australian Eastern Daylight Time", "CDT": "Central Daylight Time", "ADT": "Atlantic Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "HNT": "Newfoundland Standard Time", "MDT": "Mountain Daylight Time", "GFT": "French Guiana Time", "ACWST": "Australian Central Western Standard Time", "TMT": "Turkmenistan Standard Time"},
}
}
@@ -112,8 +112,8 @@ func (en *en_LS) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
func (en *en_LS) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
n := math.Abs(num)
- nMod10 := math.Mod(n, 10)
nMod100 := math.Mod(n, 100)
+ nMod10 := math.Mod(n, 10)
if nMod10 == 1 && nMod100 != 11 {
return locales.PluralRuleOne
diff --git a/en_LS/en_LS_test.go b/en_LS/en_LS_test.go
new file mode 100644
index 00000000..0fbbb47f
--- /dev/null
+++ b/en_LS/en_LS_test.go
@@ -0,0 +1,1120 @@
+package en_LS
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_LS"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_MG/en_MG.go b/en_MG/en_MG.go
index f1f086c7..95bf4bec 100644
--- a/en_MG/en_MG.go
+++ b/en_MG/en_MG.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"AEDT": "Australian Eastern Daylight Time", "AKST": "Alaska Standard Time", "IST": "India Standard Time", "UYST": "Uruguay Summer Time", "CHADT": "Chatham Daylight Time", "WEZ": "Western European Standard Time", "ACWST": "Australian Central Western Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "MST": "Macau Standard Time", "AWST": "Australian Western Standard Time", "MEZ": "Central European Standard Time", "SGT": "Singapore Standard Time", "MDT": "Macau Summer Time", "ART": "Argentina Standard Time", "COST": "Colombia Summer Time", "LHST": "Lord Howe Standard Time", "MESZ": "Central European Summer Time", "BT": "Bhutan Time", "WARST": "Western Argentina Summer Time", "GFT": "French Guiana Time", "TMST": "Turkmenistan Summer Time", "MYT": "Malaysia Time", "PDT": "Pacific Daylight Time", "WIT": "Eastern Indonesia Time", "EDT": "Eastern Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "WITA": "Central Indonesia Time", "CHAST": "Chatham Standard Time", "ACWDT": "Australian Central Western Daylight Time", "WAST": "West Africa Summer Time", "HKT": "Hong Kong Standard Time", "WIB": "Western Indonesia Time", "EAT": "East Africa Time", "ACDT": "Australian Central Daylight Time", "LHDT": "Lord Howe Daylight Time", "GYT": "Guyana Time", "OEZ": "Eastern European Standard Time", "GMT": "Greenwich Mean Time", "HAT": "Newfoundland Daylight Time", "TMT": "Turkmenistan Standard Time", "CLT": "Chile Standard Time", "VET": "Venezuela Time", "AKDT": "Alaska Daylight Time", "CLST": "Chile Summer Time", "WESZ": "Western European Summer Time", "AST": "Atlantic Standard Time", "HNT": "Newfoundland Standard Time", "∅∅∅": "Amazon Summer Time", "JST": "Japan Standard Time", "SRT": "Suriname Time", "COT": "Colombia Standard Time", "ACST": "Australian Central Standard Time", "EST": "Eastern Standard Time", "UYT": "Uruguay Standard Time", "ChST": "Chamorro Standard Time", "WAT": "West Africa Standard Time", "PST": "Pacific Standard Time", "CST": "Central Standard Time", "NZDT": "New Zealand Daylight Time", "HKST": "Hong Kong Summer Time", "OESZ": "Eastern European Summer Time", "AWDT": "Australian Western Daylight Time", "ECT": "Ecuador Time", "ADT": "Atlantic Daylight Time", "SAST": "South Africa Standard Time", "CDT": "Central Daylight Time", "AEST": "Australian Eastern Standard Time", "CAT": "Central Africa Time", "BOT": "Bolivia Time", "WART": "Western Argentina Standard Time", "ARST": "Argentina Summer Time", "JDT": "Japan Daylight Time", "NZST": "New Zealand Standard Time"},
+ timezones: map[string]string{"PST": "Pacific Standard Time", "HAT": "Newfoundland Daylight Time", "WIT": "Eastern Indonesia Time", "ACDT": "Australian Central Daylight Time", "AKST": "Alaska Standard Time", "TMT": "Turkmenistan Standard Time", "MDT": "Mountain Daylight Time", "CST": "Central Standard Time", "ACST": "Australian Central Standard Time", "MEZ": "Central European Standard Time", "MESZ": "Central European Summer Time", "WEZ": "Western European Standard Time", "WARST": "Western Argentina Summer Time", "ACWDT": "Australian Central Western Daylight Time", "ART": "Argentina Standard Time", "HKT": "Hong Kong Standard Time", "CHAST": "Chatham Standard Time", "CHADT": "Chatham Daylight Time", "EDT": "Eastern Daylight Time", "HNT": "Newfoundland Standard Time", "CLST": "Chile Summer Time", "WART": "Western Argentina Standard Time", "SRT": "Suriname Time", "HADT": "Hawaii-Aleutian Daylight Time", "TMST": "Turkmenistan Summer Time", "OEZ": "Eastern European Standard Time", "∅∅∅": "Brasilia Summer Time", "AWDT": "Australian Western Daylight Time", "WAT": "West Africa Standard Time", "MYT": "Malaysia Time", "NZDT": "New Zealand Daylight Time", "PDT": "Pacific Daylight Time", "SGT": "Singapore Standard Time", "UYT": "Uruguay Standard Time", "COST": "Colombia Summer Time", "WIB": "Western Indonesia Time", "VET": "Venezuela Time", "ARST": "Argentina Summer Time", "WESZ": "Western European Summer Time", "OESZ": "Eastern European Summer Time", "AEST": "Australian Eastern Standard Time", "MST": "Mountain Standard Time", "AWST": "Australian Western Standard Time", "NZST": "New Zealand Standard Time", "GFT": "French Guiana Time", "ECT": "Ecuador Time", "ACWST": "Australian Central Western Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "BOT": "Bolivia Time", "ChST": "Chamorro Standard Time", "GYT": "Guyana Time", "JDT": "Japan Daylight Time", "CAT": "Central Africa Time", "UYST": "Uruguay Summer Time", "JST": "Japan Standard Time", "AST": "Atlantic Standard Time", "WITA": "Central Indonesia Time", "SAST": "South Africa Standard Time", "EST": "Eastern Standard Time", "GMT": "Greenwich Mean Time", "BT": "Bhutan Time", "LHST": "Lord Howe Standard Time", "AEDT": "Australian Eastern Daylight Time", "AKDT": "Alaska Daylight Time", "IST": "India Standard Time", "ADT": "Atlantic Daylight Time", "COT": "Colombia Standard Time", "WAST": "West Africa Summer Time", "EAT": "East Africa Time", "CDT": "Central Daylight Time", "HKST": "Hong Kong Summer Time", "CLT": "Chile Standard Time", "LHDT": "Lord Howe Daylight Time"},
}
}
diff --git a/en_MG/en_MG_test.go b/en_MG/en_MG_test.go
new file mode 100644
index 00000000..36b91f78
--- /dev/null
+++ b/en_MG/en_MG_test.go
@@ -0,0 +1,1120 @@
+package en_MG
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_MG"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_MH/en_MH.go b/en_MH/en_MH.go
index d50ba76e..c722b676 100644
--- a/en_MH/en_MH.go
+++ b/en_MH/en_MH.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"WAST": "West Africa Summer Time", "HAT": "Newfoundland Daylight Time", "ARST": "Argentina Summer Time", "MDT": "Macau Summer Time", "UYT": "Uruguay Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "SAST": "South Africa Standard Time", "NZDT": "New Zealand Daylight Time", "BOT": "Bolivia Time", "ADT": "Atlantic Daylight Time", "ACST": "Australian Central Standard Time", "GYT": "Guyana Time", "SRT": "Suriname Time", "CHADT": "Chatham Daylight Time", "CLT": "Chile Standard Time", "MST": "Macau Standard Time", "LHST": "Lord Howe Standard Time", "WARST": "Western Argentina Summer Time", "WITA": "Central Indonesia Time", "TMST": "Turkmenistan Summer Time", "EAT": "East Africa Time", "MYT": "Malaysia Time", "ECT": "Ecuador Time", "SGT": "Singapore Standard Time", "ART": "Argentina Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "AWDT": "Australian Western Daylight Time", "LHDT": "Lord Howe Daylight Time", "∅∅∅": "Brasilia Summer Time", "OEZ": "Eastern European Standard Time", "WART": "Western Argentina Standard Time", "GFT": "French Guiana Time", "AWST": "Australian Western Standard Time", "CST": "Central Standard Time", "MESZ": "Central European Summer Time", "WEZ": "Western European Standard Time", "COT": "Colombia Standard Time", "IST": "India Standard Time", "JST": "Japan Standard Time", "CDT": "Central Daylight Time", "VET": "Venezuela Time", "WIT": "Eastern Indonesia Time", "ACDT": "Australian Central Daylight Time", "PDT": "Pacific Daylight Time", "UYST": "Uruguay Summer Time", "AEST": "Australian Eastern Standard Time", "ACWST": "Australian Central Western Standard Time", "ACWDT": "Australian Central Western Daylight Time", "EDT": "Eastern Daylight Time", "BT": "Bhutan Time", "JDT": "Japan Daylight Time", "AST": "Atlantic Standard Time", "HKT": "Hong Kong Standard Time", "OESZ": "Eastern European Summer Time", "PST": "Pacific Standard Time", "AEDT": "Australian Eastern Daylight Time", "CLST": "Chile Summer Time", "WAT": "West Africa Standard Time", "GMT": "Greenwich Mean Time", "HKST": "Hong Kong Summer Time", "WIB": "Western Indonesia Time", "AKST": "Alaska Standard Time", "ChST": "Chamorro Standard Time", "CHAST": "Chatham Standard Time", "WESZ": "Western European Summer Time", "COST": "Colombia Summer Time", "EST": "Eastern Standard Time", "TMT": "Turkmenistan Standard Time", "AKDT": "Alaska Daylight Time", "NZST": "New Zealand Standard Time", "MEZ": "Central European Standard Time", "CAT": "Central Africa Time", "HNT": "Newfoundland Standard Time"},
+ timezones: map[string]string{"EDT": "Eastern Daylight Time", "COT": "Colombia Standard Time", "OEZ": "Eastern European Standard Time", "ADT": "Atlantic Daylight Time", "WITA": "Central Indonesia Time", "SAST": "South Africa Standard Time", "SGT": "Singapore Standard Time", "CHAST": "Chatham Standard Time", "VET": "Venezuela Time", "HKST": "Hong Kong Summer Time", "AST": "Atlantic Standard Time", "ACWDT": "Australian Central Western Daylight Time", "ARST": "Argentina Summer Time", "HNT": "Newfoundland Standard Time", "WIB": "Western Indonesia Time", "WARST": "Western Argentina Summer Time", "TMT": "Turkmenistan Standard Time", "CLT": "Chile Standard Time", "SRT": "Suriname Time", "EAT": "East Africa Time", "CDT": "Central Daylight Time", "ACWST": "Australian Central Western Standard Time", "ART": "Argentina Standard Time", "MEZ": "Central European Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "NZST": "New Zealand Standard Time", "AEDT": "Australian Eastern Daylight Time", "NZDT": "New Zealand Daylight Time", "BOT": "Bolivia Time", "WIT": "Eastern Indonesia Time", "AWDT": "Australian Western Daylight Time", "PST": "Pacific Standard Time", "COST": "Colombia Summer Time", "GMT": "Greenwich Mean Time", "ChST": "Chamorro Standard Time", "ECT": "Ecuador Time", "MESZ": "Central European Summer Time", "TMST": "Turkmenistan Summer Time", "CST": "Central Standard Time", "∅∅∅": "Amazon Summer Time", "CHADT": "Chatham Daylight Time", "IST": "India Standard Time", "BT": "Bhutan Time", "WART": "Western Argentina Standard Time", "ACDT": "Australian Central Daylight Time", "AKST": "Alaska Standard Time", "AWST": "Australian Western Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "WESZ": "Western European Summer Time", "LHST": "Lord Howe Standard Time", "ACST": "Australian Central Standard Time", "JDT": "Japan Daylight Time", "UYST": "Uruguay Summer Time", "UYT": "Uruguay Standard Time", "EST": "Eastern Standard Time", "PDT": "Pacific Daylight Time", "WAT": "West Africa Standard Time", "AEST": "Australian Eastern Standard Time", "GYT": "Guyana Time", "CLST": "Chile Summer Time", "HKT": "Hong Kong Standard Time", "AKDT": "Alaska Daylight Time", "OESZ": "Eastern European Summer Time", "MDT": "Mountain Daylight Time", "GFT": "French Guiana Time", "MST": "Mountain Standard Time", "MYT": "Malaysia Time", "JST": "Japan Standard Time", "CAT": "Central Africa Time", "WAST": "West Africa Summer Time", "WEZ": "Western European Standard Time", "HAT": "Newfoundland Daylight Time", "LHDT": "Lord Howe Daylight Time"},
}
}
diff --git a/en_MH/en_MH_test.go b/en_MH/en_MH_test.go
new file mode 100644
index 00000000..d9b2334b
--- /dev/null
+++ b/en_MH/en_MH_test.go
@@ -0,0 +1,1120 @@
+package en_MH
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_MH"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_MO/en_MO.go b/en_MO/en_MO.go
index 0ad89bfc..30cecbba 100644
--- a/en_MO/en_MO.go
+++ b/en_MO/en_MO.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"ACST": "Australian Central Standard Time", "ARST": "Argentina Summer Time", "PDT": "Pacific Daylight Time", "HKST": "Hong Kong Summer Time", "WARST": "Western Argentina Summer Time", "EST": "Eastern Standard Time", "CST": "Central Standard Time", "CHAST": "Chatham Standard Time", "AWDT": "Australian Western Daylight Time", "ChST": "Chamorro Standard Time", "COST": "Colombia Summer Time", "ADT": "Atlantic Daylight Time", "WAT": "West Africa Standard Time", "WAST": "West Africa Summer Time", "WART": "Western Argentina Standard Time", "GFT": "French Guiana Time", "WEZ": "Western European Standard Time", "∅∅∅": "Brasilia Summer Time", "SGT": "Singapore Standard Time", "GMT": "Greenwich Mean Time", "TMT": "Turkmenistan Standard Time", "LHST": "Lord Howe Standard Time", "CLST": "Chile Summer Time", "EDT": "Eastern Daylight Time", "WIB": "Western Indonesia Time", "JDT": "Japan Daylight Time", "CDT": "Central Daylight Time", "HKT": "Hong Kong Standard Time", "PST": "Pacific Standard Time", "AEDT": "Australian Eastern Daylight Time", "COT": "Colombia Standard Time", "OESZ": "Eastern European Summer Time", "WITA": "Central Indonesia Time", "SRT": "Suriname Time", "NZST": "New Zealand Standard Time", "ACWST": "Australian Central Western Standard Time", "SAST": "South Africa Standard Time", "MST": "Macau Standard Time", "MDT": "Macau Summer Time", "JST": "Japan Standard Time", "CLT": "Chile Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "OEZ": "Eastern European Standard Time", "AKST": "Alaska Standard Time", "UYT": "Uruguay Standard Time", "CHADT": "Chatham Daylight Time", "IST": "India Standard Time", "ACDT": "Australian Central Daylight Time", "UYST": "Uruguay Summer Time", "CAT": "Central Africa Time", "WIT": "Eastern Indonesia Time", "AWST": "Australian Western Standard Time", "VET": "Venezuela Time", "ACWDT": "Australian Central Western Daylight Time", "HNT": "Newfoundland Standard Time", "ART": "Argentina Standard Time", "AKDT": "Alaska Daylight Time", "MYT": "Malaysia Time", "MESZ": "Central European Summer Time", "NZDT": "New Zealand Daylight Time", "BT": "Bhutan Time", "HAT": "Newfoundland Daylight Time", "EAT": "East Africa Time", "TMST": "Turkmenistan Summer Time", "AST": "Atlantic Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "GYT": "Guyana Time", "MEZ": "Central European Standard Time", "BOT": "Bolivia Time", "WESZ": "Western European Summer Time", "ECT": "Ecuador Time", "LHDT": "Lord Howe Daylight Time", "AEST": "Australian Eastern Standard Time"},
+ timezones: map[string]string{"CLT": "Chile Standard Time", "WITA": "Central Indonesia Time", "MEZ": "Central European Standard Time", "ACDT": "Australian Central Daylight Time", "HKT": "Hong Kong Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "COT": "Colombia Standard Time", "AEST": "Australian Eastern Standard Time", "ACST": "Australian Central Standard Time", "LHDT": "Lord Howe Daylight Time", "ART": "Argentina Standard Time", "UYST": "Uruguay Summer Time", "SRT": "Suriname Time", "NZST": "New Zealand Standard Time", "NZDT": "New Zealand Daylight Time", "SAST": "South Africa Standard Time", "WESZ": "Western European Summer Time", "SGT": "Singapore Standard Time", "CLST": "Chile Summer Time", "CHADT": "Chatham Daylight Time", "CAT": "Central Africa Time", "WAST": "West Africa Summer Time", "WART": "Western Argentina Standard Time", "AST": "Atlantic Standard Time", "EAT": "East Africa Time", "BT": "Bhutan Time", "MDT": "Mountain Daylight Time", "VET": "Venezuela Time", "WIB": "Western Indonesia Time", "OEZ": "Eastern European Standard Time", "CHAST": "Chatham Standard Time", "LHST": "Lord Howe Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "BOT": "Bolivia Time", "PST": "Pacific Standard Time", "WEZ": "Western European Standard Time", "AEDT": "Australian Eastern Daylight Time", "ChST": "Chamorro Standard Time", "COST": "Colombia Summer Time", "ACWST": "Australian Central Western Standard Time", "UYT": "Uruguay Standard Time", "MYT": "Malaysia Time", "ECT": "Ecuador Time", "JST": "Japan Standard Time", "ARST": "Argentina Summer Time", "HNT": "Newfoundland Standard Time", "HAT": "Newfoundland Daylight Time", "GMT": "Greenwich Mean Time", "MESZ": "Central European Summer Time", "ACWDT": "Australian Central Western Daylight Time", "EST": "Eastern Standard Time", "HKST": "Hong Kong Summer Time", "AKST": "Alaska Standard Time", "IST": "India Standard Time", "TMST": "Turkmenistan Summer Time", "CST": "Central Standard Time", "GFT": "French Guiana Time", "AKDT": "Alaska Daylight Time", "EDT": "Eastern Daylight Time", "WAT": "West Africa Standard Time", "OESZ": "Eastern European Summer Time", "WARST": "Western Argentina Summer Time", "WIT": "Eastern Indonesia Time", "CDT": "Central Daylight Time", "ADT": "Atlantic Daylight Time", "AWDT": "Australian Western Daylight Time", "PDT": "Pacific Daylight Time", "GYT": "Guyana Time", "∅∅∅": "Brasilia Summer Time", "JDT": "Japan Daylight Time", "TMT": "Turkmenistan Standard Time", "MST": "Mountain Standard Time", "AWST": "Australian Western Standard Time"},
}
}
diff --git a/en_MO/en_MO_test.go b/en_MO/en_MO_test.go
new file mode 100644
index 00000000..26a61cae
--- /dev/null
+++ b/en_MO/en_MO_test.go
@@ -0,0 +1,1120 @@
+package en_MO
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_MO"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_MP/en_MP.go b/en_MP/en_MP.go
index a957270e..edfe278d 100644
--- a/en_MP/en_MP.go
+++ b/en_MP/en_MP.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"HKT": "Hong Kong Standard Time", "WARST": "Western Argentina Summer Time", "HADT": "Hawaii-Aleutian Daylight Time", "MDT": "Macau Summer Time", "MESZ": "Central European Summer Time", "EST": "Eastern Standard Time", "SAST": "South Africa Standard Time", "GFT": "French Guiana Time", "PST": "Pacific Standard Time", "BOT": "Bolivia Time", "WAT": "West Africa Standard Time", "SRT": "Suriname Time", "ECT": "Ecuador Time", "LHDT": "Lord Howe Daylight Time", "EDT": "Eastern Daylight Time", "WAST": "West Africa Summer Time", "WITA": "Central Indonesia Time", "TMT": "Turkmenistan Standard Time", "UYST": "Uruguay Summer Time", "AEST": "Australian Eastern Standard Time", "WART": "Western Argentina Standard Time", "ACST": "Australian Central Standard Time", "CLT": "Chile Standard Time", "ADT": "Atlantic Daylight Time", "TMST": "Turkmenistan Summer Time", "OESZ": "Eastern European Summer Time", "NZDT": "New Zealand Daylight Time", "UYT": "Uruguay Standard Time", "VET": "Venezuela Time", "AEDT": "Australian Eastern Daylight Time", "CHAST": "Chatham Standard Time", "WIB": "Western Indonesia Time", "AWDT": "Australian Western Daylight Time", "HAT": "Newfoundland Daylight Time", "MST": "Macau Standard Time", "ART": "Argentina Standard Time", "AWST": "Australian Western Standard Time", "GYT": "Guyana Time", "NZST": "New Zealand Standard Time", "ACWDT": "Australian Central Western Daylight Time", "ChST": "Chamorro Standard Time", "HNT": "Newfoundland Standard Time", "BT": "Bhutan Time", "COT": "Colombia Standard Time", "CLST": "Chile Summer Time", "CHADT": "Chatham Daylight Time", "JDT": "Japan Daylight Time", "CDT": "Central Daylight Time", "HKST": "Hong Kong Summer Time", "LHST": "Lord Howe Standard Time", "∅∅∅": "Amazon Summer Time", "AKST": "Alaska Standard Time", "COST": "Colombia Summer Time", "SGT": "Singapore Standard Time", "WIT": "Eastern Indonesia Time", "AKDT": "Alaska Daylight Time", "PDT": "Pacific Daylight Time", "JST": "Japan Standard Time", "WEZ": "Western European Standard Time", "AST": "Atlantic Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "ARST": "Argentina Summer Time", "GMT": "Greenwich Mean Time", "ACDT": "Australian Central Daylight Time", "CST": "Central Standard Time", "CAT": "Central Africa Time", "IST": "India Standard Time", "EAT": "East Africa Time", "MYT": "Malaysia Time", "MEZ": "Central European Standard Time", "WESZ": "Western European Summer Time", "ACWST": "Australian Central Western Standard Time", "OEZ": "Eastern European Standard Time"},
+ timezones: map[string]string{"HAST": "Hawaii-Aleutian Standard Time", "NZST": "New Zealand Standard Time", "TMT": "Turkmenistan Standard Time", "WEZ": "Western European Standard Time", "HNT": "Newfoundland Standard Time", "WIT": "Eastern Indonesia Time", "ACWST": "Australian Central Western Standard Time", "EST": "Eastern Standard Time", "COT": "Colombia Standard Time", "OESZ": "Eastern European Summer Time", "LHST": "Lord Howe Standard Time", "AKDT": "Alaska Daylight Time", "ART": "Argentina Standard Time", "HAT": "Newfoundland Daylight Time", "AEDT": "Australian Eastern Daylight Time", "MYT": "Malaysia Time", "HKST": "Hong Kong Summer Time", "UYST": "Uruguay Summer Time", "CHAST": "Chatham Standard Time", "AKST": "Alaska Standard Time", "PDT": "Pacific Daylight Time", "WESZ": "Western European Summer Time", "GFT": "French Guiana Time", "SAST": "South Africa Standard Time", "VET": "Venezuela Time", "JDT": "Japan Daylight Time", "WIB": "Western Indonesia Time", "TMST": "Turkmenistan Summer Time", "WAT": "West Africa Standard Time", "EAT": "East Africa Time", "MST": "Mountain Standard Time", "∅∅∅": "Brasilia Summer Time", "BOT": "Bolivia Time", "GMT": "Greenwich Mean Time", "GYT": "Guyana Time", "CLT": "Chile Standard Time", "HKT": "Hong Kong Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "WAST": "West Africa Summer Time", "SGT": "Singapore Standard Time", "NZDT": "New Zealand Daylight Time", "COST": "Colombia Summer Time", "BT": "Bhutan Time", "WART": "Western Argentina Standard Time", "AST": "Atlantic Standard Time", "IST": "India Standard Time", "CLST": "Chile Summer Time", "ACDT": "Australian Central Daylight Time", "WARST": "Western Argentina Summer Time", "WITA": "Central Indonesia Time", "PST": "Pacific Standard Time", "CAT": "Central Africa Time", "MEZ": "Central European Standard Time", "AEST": "Australian Eastern Standard Time", "LHDT": "Lord Howe Daylight Time", "CST": "Central Standard Time", "AWDT": "Australian Western Daylight Time", "JST": "Japan Standard Time", "ACWDT": "Australian Central Western Daylight Time", "EDT": "Eastern Daylight Time", "MESZ": "Central European Summer Time", "ECT": "Ecuador Time", "AWST": "Australian Western Standard Time", "ARST": "Argentina Summer Time", "ChST": "Chamorro Standard Time", "UYT": "Uruguay Standard Time", "MDT": "Mountain Daylight Time", "ACST": "Australian Central Standard Time", "CHADT": "Chatham Daylight Time", "OEZ": "Eastern European Standard Time", "CDT": "Central Daylight Time", "SRT": "Suriname Time", "ADT": "Atlantic Daylight Time"},
}
}
diff --git a/en_MP/en_MP_test.go b/en_MP/en_MP_test.go
new file mode 100644
index 00000000..15a373c8
--- /dev/null
+++ b/en_MP/en_MP_test.go
@@ -0,0 +1,1120 @@
+package en_MP
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_MP"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_MS/en_MS.go b/en_MS/en_MS.go
index b457b88f..83a985af 100644
--- a/en_MS/en_MS.go
+++ b/en_MS/en_MS.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"JDT": "Japan Daylight Time", "WAST": "West Africa Summer Time", "MST": "Macau Standard Time", "MDT": "Macau Summer Time", "OEZ": "Eastern European Standard Time", "TMST": "Turkmenistan Summer Time", "SAST": "South Africa Standard Time", "CHAST": "Chatham Standard Time", "BT": "Bhutan Time", "HAT": "Newfoundland Daylight Time", "∅∅∅": "Amazon Summer Time", "UYT": "Uruguay Standard Time", "CDT": "Central Daylight Time", "COST": "Colombia Summer Time", "ARST": "Argentina Summer Time", "GYT": "Guyana Time", "TMT": "Turkmenistan Standard Time", "AWDT": "Australian Western Daylight Time", "AKDT": "Alaska Daylight Time", "BOT": "Bolivia Time", "HAST": "Hawaii-Aleutian Standard Time", "WAT": "West Africa Standard Time", "ACDT": "Australian Central Daylight Time", "ART": "Argentina Standard Time", "SRT": "Suriname Time", "CAT": "Central Africa Time", "CHADT": "Chatham Daylight Time", "WITA": "Central Indonesia Time", "JST": "Japan Standard Time", "NZDT": "New Zealand Daylight Time", "WART": "Western Argentina Standard Time", "GMT": "Greenwich Mean Time", "ChST": "Chamorro Standard Time", "SGT": "Singapore Standard Time", "EDT": "Eastern Daylight Time", "WIT": "Eastern Indonesia Time", "WEZ": "Western European Standard Time", "ACWST": "Australian Central Western Standard Time", "CLT": "Chile Standard Time", "GFT": "French Guiana Time", "AWST": "Australian Western Standard Time", "UYST": "Uruguay Summer Time", "VET": "Venezuela Time", "COT": "Colombia Standard Time", "HKT": "Hong Kong Standard Time", "IST": "India Standard Time", "ACST": "Australian Central Standard Time", "CLST": "Chile Summer Time", "CST": "Central Standard Time", "AST": "Atlantic Standard Time", "WARST": "Western Argentina Summer Time", "MYT": "Malaysia Time", "PDT": "Pacific Daylight Time", "LHDT": "Lord Howe Daylight Time", "MESZ": "Central European Summer Time", "ACWDT": "Australian Central Western Daylight Time", "AEST": "Australian Eastern Standard Time", "EST": "Eastern Standard Time", "ADT": "Atlantic Daylight Time", "PST": "Pacific Standard Time", "LHST": "Lord Howe Standard Time", "HKST": "Hong Kong Summer Time", "HADT": "Hawaii-Aleutian Daylight Time", "WIB": "Western Indonesia Time", "HNT": "Newfoundland Standard Time", "AKST": "Alaska Standard Time", "AEDT": "Australian Eastern Daylight Time", "NZST": "New Zealand Standard Time", "WESZ": "Western European Summer Time", "ECT": "Ecuador Time", "OESZ": "Eastern European Summer Time", "EAT": "East Africa Time", "MEZ": "Central European Standard Time"},
+ timezones: map[string]string{"WAT": "West Africa Standard Time", "ECT": "Ecuador Time", "OESZ": "Eastern European Summer Time", "GMT": "Greenwich Mean Time", "UYT": "Uruguay Standard Time", "MESZ": "Central European Summer Time", "AEDT": "Australian Eastern Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "CDT": "Central Daylight Time", "AWDT": "Australian Western Daylight Time", "SGT": "Singapore Standard Time", "EAT": "East Africa Time", "CLT": "Chile Standard Time", "PST": "Pacific Standard Time", "ARST": "Argentina Summer Time", "JDT": "Japan Daylight Time", "AEST": "Australian Eastern Standard Time", "UYST": "Uruguay Summer Time", "CHAST": "Chatham Standard Time", "HKST": "Hong Kong Summer Time", "VET": "Venezuela Time", "AST": "Atlantic Standard Time", "SAST": "South Africa Standard Time", "TMT": "Turkmenistan Standard Time", "WIT": "Eastern Indonesia Time", "WART": "Western Argentina Standard Time", "∅∅∅": "Azores Summer Time", "CHADT": "Chatham Daylight Time", "ACWDT": "Australian Central Western Daylight Time", "AWST": "Australian Western Standard Time", "ART": "Argentina Standard Time", "NZDT": "New Zealand Daylight Time", "COT": "Colombia Standard Time", "LHDT": "Lord Howe Daylight Time", "MDT": "Macau Summer Time", "CLST": "Chile Summer Time", "ADT": "Atlantic Daylight Time", "BOT": "Bolivia Time", "MEZ": "Central European Standard Time", "TMST": "Turkmenistan Summer Time", "COST": "Colombia Summer Time", "MYT": "Malaysia Time", "HKT": "Hong Kong Standard Time", "WEZ": "Western European Standard Time", "OEZ": "Eastern European Standard Time", "EDT": "Eastern Daylight Time", "PDT": "Pacific Daylight Time", "WAST": "West Africa Summer Time", "BT": "Bhutan Time", "ACDT": "Australian Central Daylight Time", "SRT": "Suriname Time", "JST": "Japan Standard Time", "ChST": "Chamorro Standard Time", "NZST": "New Zealand Standard Time", "WESZ": "Western European Summer Time", "GYT": "Guyana Time", "LHST": "Lord Howe Standard Time", "CST": "Central Standard Time", "ACST": "Australian Central Standard Time", "WARST": "Western Argentina Summer Time", "HAST": "Hawaii-Aleutian Standard Time", "WIB": "Western Indonesia Time", "ACWST": "Australian Central Western Standard Time", "MST": "Macau Standard Time", "IST": "India Standard Time", "EST": "Eastern Standard Time", "HNT": "Newfoundland Standard Time", "GFT": "French Guiana Time", "AKDT": "Alaska Daylight Time", "WITA": "Central Indonesia Time", "CAT": "Central Africa Time", "HAT": "Newfoundland Daylight Time", "AKST": "Alaska Standard Time"},
}
}
diff --git a/en_MS/en_MS_test.go b/en_MS/en_MS_test.go
new file mode 100644
index 00000000..4edd78e7
--- /dev/null
+++ b/en_MS/en_MS_test.go
@@ -0,0 +1,1120 @@
+package en_MS
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_MS"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_MT/en_MT.go b/en_MT/en_MT.go
index 211d836e..25f3d03b 100644
--- a/en_MT/en_MT.go
+++ b/en_MT/en_MT.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"TMT": "Turkmenistan Standard Time", "AKST": "Alaska Standard Time", "MESZ": "Central European Summer Time", "HAST": "Hawaii-Aleutian Standard Time", "WARST": "Western Argentina Summer Time", "SRT": "Suriname Time", "AKDT": "Alaska Daylight Time", "AWST": "Australian Western Standard Time", "WAT": "West Africa Standard Time", "ECT": "Ecuador Time", "WIB": "Western Indonesia Time", "PST": "Pacific Standard Time", "LHDT": "Lord Howe Daylight Time", "AEDT": "Australian Eastern Daylight Time", "CHAST": "Chatham Standard Time", "COT": "Colombia Standard Time", "WITA": "Central Indonesia Time", "TMST": "Turkmenistan Summer Time", "CLST": "Chile Summer Time", "∅∅∅": "Amazon Summer Time", "CST": "Central Standard Time", "ACWDT": "Australian Central Western Daylight Time", "IST": "India Standard Time", "HNT": "Newfoundland Standard Time", "MEZ": "Central European Standard Time", "UYST": "Uruguay Summer Time", "WESZ": "Western European Summer Time", "ACWST": "Australian Central Western Standard Time", "CDT": "Central Daylight Time", "SAST": "South Africa Standard Time", "HKST": "Hong Kong Summer Time", "ACDT": "Australian Central Daylight Time", "ARST": "Argentina Summer Time", "WEZ": "Western European Standard Time", "CHADT": "Chatham Daylight Time", "WART": "Western Argentina Standard Time", "MST": "Macau Standard Time", "NZST": "New Zealand Standard Time", "NZDT": "New Zealand Daylight Time", "BT": "Bhutan Time", "ADT": "Atlantic Daylight Time", "GFT": "French Guiana Time", "EAT": "East Africa Time", "PDT": "Pacific Daylight Time", "EST": "Eastern Standard Time", "AST": "Atlantic Standard Time", "WIT": "Eastern Indonesia Time", "MDT": "Macau Summer Time", "JST": "Japan Standard Time", "UYT": "Uruguay Standard Time", "SGT": "Singapore Standard Time", "OEZ": "Eastern European Standard Time", "LHST": "Lord Howe Standard Time", "MYT": "Malaysia Time", "ChST": "Chamorro Standard Time", "COST": "Colombia Summer Time", "HADT": "Hawaii-Aleutian Daylight Time", "OESZ": "Eastern European Summer Time", "HAT": "Newfoundland Daylight Time", "ART": "Argentina Standard Time", "JDT": "Japan Daylight Time", "WAST": "West Africa Summer Time", "GMT": "Greenwich Mean Time", "AWDT": "Australian Western Daylight Time", "CLT": "Chile Standard Time", "AEST": "Australian Eastern Standard Time", "HKT": "Hong Kong Standard Time", "ACST": "Australian Central Standard Time", "GYT": "Guyana Time", "BOT": "Bolivia Time", "VET": "Venezuela Time", "CAT": "Central Africa Time", "EDT": "Eastern Daylight Time"},
+ timezones: map[string]string{"UYST": "Uruguay Summer Time", "LHDT": "Lord Howe Daylight Time", "GFT": "French Guiana Time", "ACWDT": "Australian Central Western Daylight Time", "COT": "Colombia Standard Time", "WIB": "Western Indonesia Time", "TMT": "Turkmenistan Standard Time", "CLT": "Chile Standard Time", "HKST": "Hong Kong Summer Time", "NZST": "New Zealand Standard Time", "MEZ": "Central European Standard Time", "GMT": "Greenwich Mean Time", "AEST": "Australian Eastern Standard Time", "HNT": "Newfoundland Standard Time", "LHST": "Lord Howe Standard Time", "CDT": "Central Daylight Time", "WART": "Western Argentina Standard Time", "HKT": "Hong Kong Standard Time", "JDT": "Japan Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "WAT": "West Africa Standard Time", "HAT": "Newfoundland Daylight Time", "ADT": "Atlantic Daylight Time", "GYT": "Guyana Time", "MDT": "Mountain Daylight Time", "AWST": "Australian Western Standard Time", "ChST": "Chamorro Standard Time", "VET": "Venezuela Time", "BOT": "Bolivia Time", "TMST": "Turkmenistan Summer Time", "AEDT": "Australian Eastern Daylight Time", "WIT": "Eastern Indonesia Time", "CHAST": "Chatham Standard Time", "ARST": "Argentina Summer Time", "CST": "Central Standard Time", "CHADT": "Chatham Daylight Time", "ACDT": "Australian Central Daylight Time", "ART": "Argentina Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "EST": "Eastern Standard Time", "COST": "Colombia Summer Time", "MST": "Mountain Standard Time", "JST": "Japan Standard Time", "∅∅∅": "Amazon Summer Time", "UYT": "Uruguay Standard Time", "MESZ": "Central European Summer Time", "WARST": "Western Argentina Summer Time", "AKST": "Alaska Standard Time", "AST": "Atlantic Standard Time", "AWDT": "Australian Western Daylight Time", "NZDT": "New Zealand Daylight Time", "SAST": "South Africa Standard Time", "CAT": "Central Africa Time", "WAST": "West Africa Summer Time", "SGT": "Singapore Standard Time", "BT": "Bhutan Time", "MYT": "Malaysia Time", "WESZ": "Western European Summer Time", "EAT": "East Africa Time", "PDT": "Pacific Daylight Time", "OESZ": "Eastern European Summer Time", "ACWST": "Australian Central Western Standard Time", "OEZ": "Eastern European Standard Time", "ECT": "Ecuador Time", "WEZ": "Western European Standard Time", "CLST": "Chile Summer Time", "ACST": "Australian Central Standard Time", "WITA": "Central Indonesia Time", "AKDT": "Alaska Daylight Time", "IST": "India Standard Time", "EDT": "Eastern Daylight Time", "PST": "Pacific Standard Time", "SRT": "Suriname Time"},
}
}
diff --git a/en_MT/en_MT_test.go b/en_MT/en_MT_test.go
new file mode 100644
index 00000000..7b4880d9
--- /dev/null
+++ b/en_MT/en_MT_test.go
@@ -0,0 +1,1120 @@
+package en_MT
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_MT"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_MU/en_MU.go b/en_MU/en_MU.go
index 1da65914..d5e0e124 100644
--- a/en_MU/en_MU.go
+++ b/en_MU/en_MU.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"WAT": "West Africa Standard Time", "BT": "Bhutan Time", "MEZ": "Central European Standard Time", "ChST": "Chamorro Standard Time", "IST": "India Standard Time", "TMST": "Turkmenistan Summer Time", "NZDT": "New Zealand Daylight Time", "ACWST": "Australian Central Western Standard Time", "JST": "Japan Standard Time", "CLT": "Chile Standard Time", "AEST": "Australian Eastern Standard Time", "EST": "Eastern Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "SGT": "Singapore Standard Time", "∅∅∅": "Acre Summer Time", "GYT": "Guyana Time", "GMT": "Greenwich Mean Time", "ART": "Argentina Standard Time", "PST": "Pacific Standard Time", "PDT": "Pacific Daylight Time", "WART": "Western Argentina Standard Time", "HKT": "Hong Kong Standard Time", "TMT": "Turkmenistan Standard Time", "EAT": "East Africa Time", "NZST": "New Zealand Standard Time", "CHAST": "Chatham Standard Time", "WAST": "West Africa Summer Time", "HKST": "Hong Kong Summer Time", "HNT": "Newfoundland Standard Time", "JDT": "Japan Daylight Time", "CST": "Central Standard Time", "WEZ": "Western European Standard Time", "ECT": "Ecuador Time", "AST": "Atlantic Standard Time", "WITA": "Central Indonesia Time", "ACDT": "Australian Central Daylight Time", "ARST": "Argentina Summer Time", "AEDT": "Australian Eastern Daylight Time", "COT": "Colombia Standard Time", "OEZ": "Eastern European Standard Time", "UYT": "Uruguay Standard Time", "VET": "Venezuela Time", "MDT": "Macau Summer Time", "GFT": "French Guiana Time", "AWDT": "Australian Western Daylight Time", "ACWDT": "Australian Central Western Daylight Time", "CAT": "Central Africa Time", "CDT": "Central Daylight Time", "CHADT": "Chatham Daylight Time", "SAST": "South Africa Standard Time", "WIB": "Western Indonesia Time", "HAT": "Newfoundland Daylight Time", "SRT": "Suriname Time", "WIT": "Eastern Indonesia Time", "LHDT": "Lord Howe Daylight Time", "CLST": "Chile Summer Time", "OESZ": "Eastern European Summer Time", "LHST": "Lord Howe Standard Time", "WESZ": "Western European Summer Time", "COST": "Colombia Summer Time", "AKDT": "Alaska Daylight Time", "AWST": "Australian Western Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "WARST": "Western Argentina Summer Time", "MST": "Macau Standard Time", "ACST": "Australian Central Standard Time", "MESZ": "Central European Summer Time", "BOT": "Bolivia Time", "EDT": "Eastern Daylight Time", "ADT": "Atlantic Daylight Time", "MYT": "Malaysia Time", "AKST": "Alaska Standard Time", "UYST": "Uruguay Summer Time"},
+ timezones: map[string]string{"NZST": "New Zealand Standard Time", "SAST": "South Africa Standard Time", "EST": "Eastern Standard Time", "HNT": "Newfoundland Standard Time", "HAT": "Newfoundland Daylight Time", "GFT": "French Guiana Time", "HKST": "Hong Kong Summer Time", "IST": "India Standard Time", "MESZ": "Central European Summer Time", "UYST": "Uruguay Summer Time", "LHST": "Lord Howe Standard Time", "MYT": "Malaysia Time", "MST": "Macau Standard Time", "WAT": "West Africa Standard Time", "WEZ": "Western European Standard Time", "SRT": "Suriname Time", "CHAST": "Chatham Standard Time", "AST": "Atlantic Standard Time", "AWDT": "Australian Western Daylight Time", "COT": "Colombia Standard Time", "EAT": "East Africa Time", "WARST": "Western Argentina Summer Time", "PST": "Pacific Standard Time", "GMT": "Greenwich Mean Time", "CST": "Central Standard Time", "ACWDT": "Australian Central Western Daylight Time", "CAT": "Central Africa Time", "AKDT": "Alaska Daylight Time", "TMT": "Turkmenistan Standard Time", "WESZ": "Western European Summer Time", "OEZ": "Eastern European Standard Time", "ACST": "Australian Central Standard Time", "BT": "Bhutan Time", "ECT": "Ecuador Time", "ADT": "Atlantic Daylight Time", "PDT": "Pacific Daylight Time", "∅∅∅": "Amazon Summer Time", "SGT": "Singapore Standard Time", "AEST": "Australian Eastern Standard Time", "HKT": "Hong Kong Standard Time", "UYT": "Uruguay Standard Time", "CLST": "Chile Summer Time", "ACDT": "Australian Central Daylight Time", "MDT": "Macau Summer Time", "ARST": "Argentina Summer Time", "WIT": "Eastern Indonesia Time", "WART": "Western Argentina Standard Time", "AWST": "Australian Western Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "WIB": "Western Indonesia Time", "CDT": "Central Daylight Time", "MEZ": "Central European Standard Time", "TMST": "Turkmenistan Summer Time", "VET": "Venezuela Time", "JDT": "Japan Daylight Time", "ACWST": "Australian Central Western Standard Time", "WITA": "Central Indonesia Time", "NZDT": "New Zealand Daylight Time", "EDT": "Eastern Daylight Time", "OESZ": "Eastern European Summer Time", "AKST": "Alaska Standard Time", "ART": "Argentina Standard Time", "CLT": "Chile Standard Time", "JST": "Japan Standard Time", "BOT": "Bolivia Time", "HAST": "Hawaii-Aleutian Standard Time", "WAST": "West Africa Summer Time", "COST": "Colombia Summer Time", "AEDT": "Australian Eastern Daylight Time", "ChST": "Chamorro Standard Time", "LHDT": "Lord Howe Daylight Time", "CHADT": "Chatham Daylight Time", "GYT": "Guyana Time"},
}
}
diff --git a/en_MU/en_MU_test.go b/en_MU/en_MU_test.go
new file mode 100644
index 00000000..a108dd0d
--- /dev/null
+++ b/en_MU/en_MU_test.go
@@ -0,0 +1,1120 @@
+package en_MU
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_MU"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_MW/en_MW.go b/en_MW/en_MW.go
index 54fa18e0..e0b221c8 100644
--- a/en_MW/en_MW.go
+++ b/en_MW/en_MW.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"MESZ": "Central European Summer Time", "AST": "Atlantic Standard Time", "HKST": "Hong Kong Summer Time", "JST": "Japan Standard Time", "AKDT": "Alaska Daylight Time", "NZST": "New Zealand Standard Time", "NZDT": "New Zealand Daylight Time", "∅∅∅": "Brasilia Summer Time", "SGT": "Singapore Standard Time", "AWDT": "Australian Western Daylight Time", "CST": "Central Standard Time", "ACWST": "Australian Central Western Standard Time", "CDT": "Central Daylight Time", "SRT": "Suriname Time", "MDT": "Mountain Daylight Time", "WAT": "West Africa Standard Time", "ECT": "Ecuador Time", "HKT": "Hong Kong Standard Time", "WART": "Western Argentina Standard Time", "WIB": "Western Indonesia Time", "UYST": "Uruguay Summer Time", "CLST": "Chile Summer Time", "MST": "Mountain Standard Time", "WIT": "Eastern Indonesia Time", "COST": "Colombia Summer Time", "EST": "Eastern Standard Time", "ACST": "Australian Central Standard Time", "LHST": "Lord Howe Standard Time", "AEDT": "Australian Eastern Daylight Time", "COT": "Colombia Standard Time", "AWST": "Australian Western Standard Time", "ChST": "Chamorro Standard Time", "TMST": "Turkmenistan Summer Time", "OEZ": "Eastern European Standard Time", "ART": "Argentina Standard Time", "CAT": "Central Africa Time", "SAST": "South Africa Standard Time", "CHAST": "Chatham Standard Time", "CHADT": "Chatham Daylight Time", "CLT": "Chile Standard Time", "EDT": "Eastern Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "HAT": "Newfoundland Daylight Time", "BOT": "Bolivia Time", "MEZ": "Central European Standard Time", "EAT": "East Africa Time", "GYT": "Guyana Time", "GFT": "French Guiana Time", "TMT": "Turkmenistan Standard Time", "ARST": "Argentina Summer Time", "LHDT": "Lord Howe Daylight Time", "WEZ": "Western European Standard Time", "WITA": "Central Indonesia Time", "HAST": "Hawaii-Aleutian Standard Time", "WAST": "West Africa Summer Time", "GMT": "Greenwich Mean Time", "ACDT": "Australian Central Daylight Time", "MYT": "Malaysia Time", "PDT": "Pacific Daylight Time", "WESZ": "Western European Summer Time", "ADT": "Atlantic Daylight Time", "VET": "Venezuela Time", "BT": "Bhutan Time", "WARST": "Western Argentina Summer Time", "HNT": "Newfoundland Standard Time", "IST": "India Standard Time", "AKST": "Alaska Standard Time", "UYT": "Uruguay Standard Time", "AEST": "Australian Eastern Standard Time", "JDT": "Japan Daylight Time", "PST": "Pacific Standard Time", "ACWDT": "Australian Central Western Daylight Time", "OESZ": "Eastern European Summer Time"},
+ timezones: map[string]string{"WART": "Western Argentina Standard Time", "SRT": "Suriname Time", "MST": "Macau Standard Time", "HKST": "Hong Kong Summer Time", "AKDT": "Alaska Daylight Time", "ART": "Argentina Standard Time", "COST": "Colombia Summer Time", "ECT": "Ecuador Time", "JST": "Japan Standard Time", "AWDT": "Australian Western Daylight Time", "AWST": "Australian Western Standard Time", "SAST": "South Africa Standard Time", "EST": "Eastern Standard Time", "LHST": "Lord Howe Standard Time", "CDT": "Central Daylight Time", "AKST": "Alaska Standard Time", "EDT": "Eastern Daylight Time", "ACDT": "Australian Central Daylight Time", "CHADT": "Chatham Daylight Time", "PDT": "Pacific Daylight Time", "MEZ": "Central European Standard Time", "WIB": "Western Indonesia Time", "MDT": "Macau Summer Time", "ADT": "Atlantic Daylight Time", "NZST": "New Zealand Standard Time", "PST": "Pacific Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "LHDT": "Lord Howe Daylight Time", "CLT": "Chile Standard Time", "ARST": "Argentina Summer Time", "CLST": "Chile Summer Time", "CST": "Central Standard Time", "MESZ": "Central European Summer Time", "HNT": "Newfoundland Standard Time", "BT": "Bhutan Time", "ACWST": "Australian Central Western Standard Time", "WESZ": "Western European Summer Time", "JDT": "Japan Daylight Time", "WITA": "Central Indonesia Time", "NZDT": "New Zealand Daylight Time", "SGT": "Singapore Standard Time", "AEST": "Australian Eastern Standard Time", "CHAST": "Chatham Standard Time", "AST": "Atlantic Standard Time", "BOT": "Bolivia Time", "TMST": "Turkmenistan Summer Time", "WAT": "West Africa Standard Time", "GYT": "Guyana Time", "EAT": "East Africa Time", "WARST": "Western Argentina Summer Time", "ACWDT": "Australian Central Western Daylight Time", "IST": "India Standard Time", "WAST": "West Africa Summer Time", "UYST": "Uruguay Summer Time", "HAT": "Newfoundland Daylight Time", "OEZ": "Eastern European Standard Time", "WIT": "Eastern Indonesia Time", "ACST": "Australian Central Standard Time", "GFT": "French Guiana Time", "HKT": "Hong Kong Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "CAT": "Central Africa Time", "OESZ": "Eastern European Summer Time", "GMT": "Greenwich Mean Time", "AEDT": "Australian Eastern Daylight Time", "∅∅∅": "Azores Summer Time", "VET": "Venezuela Time", "TMT": "Turkmenistan Standard Time", "COT": "Colombia Standard Time", "ChST": "Chamorro Standard Time", "UYT": "Uruguay Standard Time", "WEZ": "Western European Standard Time", "MYT": "Malaysia Time"},
}
}
diff --git a/en_MW/en_MW_test.go b/en_MW/en_MW_test.go
new file mode 100644
index 00000000..cf2f5e2d
--- /dev/null
+++ b/en_MW/en_MW_test.go
@@ -0,0 +1,1120 @@
+package en_MW
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_MW"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_MY/en_MY.go b/en_MY/en_MY.go
index d82373b2..b157ca32 100644
--- a/en_MY/en_MY.go
+++ b/en_MY/en_MY.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"CST": "Central Standard Time", "WEZ": "Western European Standard Time", "EST": "Eastern Standard Time", "HNT": "Newfoundland Standard Time", "AWDT": "Australian Western Daylight Time", "MST": "Mountain Standard Time", "CHAST": "Chatham Standard Time", "HAT": "Newfoundland Daylight Time", "CLST": "Chile Summer Time", "BT": "Bhutan Time", "ACST": "Australian Central Standard Time", "SRT": "Suriname Time", "AKST": "Alaska Standard Time", "AKDT": "Alaska Daylight Time", "EDT": "Eastern Daylight Time", "SAST": "South Africa Standard Time", "WAST": "West Africa Summer Time", "TMT": "Turkmenistan Standard Time", "WIT": "Eastern Indonesia Time", "PST": "Pacific Standard Time", "AWST": "Australian Western Standard Time", "CDT": "Central Daylight Time", "NZST": "New Zealand Standard Time", "ChST": "Chamorro Standard Time", "SGT": "Singapore Standard Time", "WIB": "Western Indonesia Time", "ACDT": "Australian Central Daylight Time", "JDT": "Japan Daylight Time", "MESZ": "Central European Summer Time", "BOT": "Bolivia Time", "UYST": "Uruguay Summer Time", "ACWST": "Australian Central Western Standard Time", "AEDT": "Australian Eastern Daylight Time", "PDT": "Pacific Daylight Time", "COST": "Colombia Summer Time", "HADT": "Hawaii-Aleutian Daylight Time", "∅∅∅": "Azores Summer Time", "VET": "Venezuela Time", "COT": "Colombia Standard Time", "LHDT": "Lord Howe Daylight Time", "UYT": "Uruguay Standard Time", "MDT": "Mountain Daylight Time", "WAT": "West Africa Standard Time", "CHADT": "Chatham Daylight Time", "OESZ": "Eastern European Summer Time", "ADT": "Atlantic Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "MYT": "Malaysia Time", "OEZ": "Eastern European Standard Time", "WITA": "Central Indonesia Time", "ART": "Argentina Standard Time", "GYT": "Guyana Time", "WESZ": "Western European Summer Time", "ACWDT": "Australian Central Western Daylight Time", "WART": "Western Argentina Standard Time", "IST": "India Standard Time", "GFT": "French Guiana Time", "EAT": "East Africa Time", "TMST": "Turkmenistan Summer Time", "JST": "Japan Standard Time", "AEST": "Australian Eastern Standard Time", "CAT": "Central Africa Time", "ECT": "Ecuador Time", "HKT": "Hong Kong Standard Time", "GMT": "Greenwich Mean Time", "WARST": "Western Argentina Summer Time", "ARST": "Argentina Summer Time", "LHST": "Lord Howe Standard Time", "MEZ": "Central European Standard Time", "NZDT": "New Zealand Daylight Time", "CLT": "Chile Standard Time", "AST": "Atlantic Standard Time", "HKST": "Hong Kong Summer Time"},
+ timezones: map[string]string{"JDT": "Japan Daylight Time", "AST": "Atlantic Standard Time", "LHDT": "Lord Howe Daylight Time", "UYT": "Uruguay Standard Time", "TMST": "Turkmenistan Summer Time", "OEZ": "Eastern European Standard Time", "WART": "Western Argentina Standard Time", "WITA": "Central Indonesia Time", "NZDT": "New Zealand Daylight Time", "SAST": "South Africa Standard Time", "UYST": "Uruguay Summer Time", "HKT": "Hong Kong Standard Time", "NZST": "New Zealand Standard Time", "WESZ": "Western European Summer Time", "SGT": "Singapore Standard Time", "CLT": "Chile Standard Time", "SRT": "Suriname Time", "CST": "Central Standard Time", "AWDT": "Australian Western Daylight Time", "CAT": "Central Africa Time", "MST": "Mountain Standard Time", "BT": "Bhutan Time", "JST": "Japan Standard Time", "PST": "Pacific Standard Time", "WEZ": "Western European Standard Time", "ChST": "Chamorro Standard Time", "ARST": "Argentina Summer Time", "AKST": "Alaska Standard Time", "OESZ": "Eastern European Summer Time", "CDT": "Central Daylight Time", "AEDT": "Australian Eastern Daylight Time", "TMT": "Turkmenistan Standard Time", "ACWST": "Australian Central Western Standard Time", "WIB": "Western Indonesia Time", "ECT": "Ecuador Time", "VET": "Venezuela Time", "AKDT": "Alaska Daylight Time", "LHST": "Lord Howe Standard Time", "ACDT": "Australian Central Daylight Time", "PDT": "Pacific Daylight Time", "WAST": "West Africa Summer Time", "BOT": "Bolivia Time", "COT": "Colombia Standard Time", "COST": "Colombia Summer Time", "EDT": "Eastern Daylight Time", "MESZ": "Central European Summer Time", "EAT": "East Africa Time", "GFT": "French Guiana Time", "ACWDT": "Australian Central Western Daylight Time", "EST": "Eastern Standard Time", "HAT": "Newfoundland Daylight Time", "AEST": "Australian Eastern Standard Time", "CLST": "Chile Summer Time", "ACST": "Australian Central Standard Time", "AWST": "Australian Western Standard Time", "ART": "Argentina Standard Time", "MYT": "Malaysia Time", "∅∅∅": "Brasilia Summer Time", "MEZ": "Central European Standard Time", "IST": "India Standard Time", "HNT": "Newfoundland Standard Time", "WIT": "Eastern Indonesia Time", "WARST": "Western Argentina Summer Time", "MDT": "Mountain Daylight Time", "CHAST": "Chatham Standard Time", "CHADT": "Chatham Daylight Time", "HKST": "Hong Kong Summer Time", "ADT": "Atlantic Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "GYT": "Guyana Time", "GMT": "Greenwich Mean Time", "HADT": "Hawaii-Aleutian Daylight Time", "WAT": "West Africa Standard Time"},
}
}
diff --git a/en_MY/en_MY_test.go b/en_MY/en_MY_test.go
new file mode 100644
index 00000000..6d352bdc
--- /dev/null
+++ b/en_MY/en_MY_test.go
@@ -0,0 +1,1120 @@
+package en_MY
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_MY"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_NA/en_NA.go b/en_NA/en_NA.go
index c9a7bc9f..a976b8d2 100644
--- a/en_NA/en_NA.go
+++ b/en_NA/en_NA.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"TMST": "Turkmenistan Summer Time", "GYT": "Guyana Time", "AEST": "Australian Eastern Standard Time", "CLST": "Chile Summer Time", "AST": "Atlantic Standard Time", "TMT": "Turkmenistan Standard Time", "ADT": "Atlantic Daylight Time", "AWST": "Australian Western Standard Time", "EDT": "Eastern Daylight Time", "ECT": "Ecuador Time", "HKT": "Hong Kong Standard Time", "EAT": "East Africa Time", "UYT": "Uruguay Standard Time", "WEZ": "Western European Standard Time", "CHAST": "Chatham Standard Time", "WAT": "West Africa Standard Time", "WART": "Western Argentina Standard Time", "JST": "Japan Standard Time", "∅∅∅": "Amazon Summer Time", "PST": "Pacific Standard Time", "AEDT": "Australian Eastern Daylight Time", "CHADT": "Chatham Daylight Time", "CAT": "Central Africa Time", "WARST": "Western Argentina Summer Time", "HAT": "Newfoundland Daylight Time", "NZST": "New Zealand Standard Time", "WIT": "Eastern Indonesia Time", "ACST": "Australian Central Standard Time", "LHDT": "Lord Howe Daylight Time", "WESZ": "Western European Summer Time", "ChST": "Chamorro Standard Time", "COST": "Colombia Summer Time", "BT": "Bhutan Time", "GFT": "French Guiana Time", "ARST": "Argentina Summer Time", "SRT": "Suriname Time", "AKDT": "Alaska Daylight Time", "CLT": "Chile Standard Time", "WAST": "West Africa Summer Time", "ACDT": "Australian Central Daylight Time", "COT": "Colombia Standard Time", "CST": "Central Standard Time", "CDT": "Central Daylight Time", "UYST": "Uruguay Summer Time", "ACWST": "Australian Central Western Standard Time", "WITA": "Central Indonesia Time", "HNT": "Newfoundland Standard Time", "MDT": "Macau Summer Time", "JDT": "Japan Daylight Time", "HKST": "Hong Kong Summer Time", "WIB": "Western Indonesia Time", "PDT": "Pacific Daylight Time", "MST": "Macau Standard Time", "GMT": "Greenwich Mean Time", "LHST": "Lord Howe Standard Time", "MEZ": "Central European Standard Time", "IST": "India Standard Time", "BOT": "Bolivia Time", "VET": "Venezuela Time", "ACWDT": "Australian Central Western Daylight Time", "OESZ": "Eastern European Summer Time", "AWDT": "Australian Western Daylight Time", "MYT": "Malaysia Time", "NZDT": "New Zealand Daylight Time", "EST": "Eastern Standard Time", "SGT": "Singapore Standard Time", "SAST": "South Africa Standard Time", "ART": "Argentina Standard Time", "AKST": "Alaska Standard Time", "MESZ": "Central European Summer Time", "HAST": "Hawaii-Aleutian Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "OEZ": "Eastern European Standard Time"},
+ timezones: map[string]string{"PST": "Pacific Standard Time", "MYT": "Malaysia Time", "HKST": "Hong Kong Summer Time", "AST": "Atlantic Standard Time", "ADT": "Atlantic Daylight Time", "CLT": "Chile Standard Time", "AWDT": "Australian Western Daylight Time", "CAT": "Central Africa Time", "HNT": "Newfoundland Standard Time", "UYT": "Uruguay Standard Time", "ACWDT": "Australian Central Western Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "SGT": "Singapore Standard Time", "OESZ": "Eastern European Summer Time", "GFT": "French Guiana Time", "ART": "Argentina Standard Time", "TMST": "Turkmenistan Summer Time", "WAT": "West Africa Standard Time", "OEZ": "Eastern European Standard Time", "WIT": "Eastern Indonesia Time", "EAT": "East Africa Time", "ACDT": "Australian Central Daylight Time", "ECT": "Ecuador Time", "AKST": "Alaska Standard Time", "AKDT": "Alaska Daylight Time", "AWST": "Australian Western Standard Time", "MEZ": "Central European Standard Time", "EDT": "Eastern Daylight Time", "WIB": "Western Indonesia Time", "GYT": "Guyana Time", "ChST": "Chamorro Standard Time", "VET": "Venezuela Time", "CHAST": "Chatham Standard Time", "HAT": "Newfoundland Daylight Time", "HKT": "Hong Kong Standard Time", "BOT": "Bolivia Time", "PDT": "Pacific Daylight Time", "TMT": "Turkmenistan Standard Time", "BT": "Bhutan Time", "JDT": "Japan Daylight Time", "WEZ": "Western European Standard Time", "WITA": "Central Indonesia Time", "COT": "Colombia Standard Time", "GMT": "Greenwich Mean Time", "AEST": "Australian Eastern Standard Time", "ACST": "Australian Central Standard Time", "WARST": "Western Argentina Summer Time", "WART": "Western Argentina Standard Time", "CHADT": "Chatham Daylight Time", "ACWST": "Australian Central Western Standard Time", "ARST": "Argentina Summer Time", "JST": "Japan Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "MESZ": "Central European Summer Time", "COST": "Colombia Summer Time", "WAST": "West Africa Summer Time", "NZDT": "New Zealand Daylight Time", "IST": "India Standard Time", "UYST": "Uruguay Summer Time", "LHST": "Lord Howe Standard Time", "MDT": "Mountain Daylight Time", "∅∅∅": "Brasilia Summer Time", "AEDT": "Australian Eastern Daylight Time", "CLST": "Chile Summer Time", "CST": "Central Standard Time", "EST": "Eastern Standard Time", "NZST": "New Zealand Standard Time", "SAST": "South Africa Standard Time", "WESZ": "Western European Summer Time", "LHDT": "Lord Howe Daylight Time", "MST": "Mountain Standard Time", "CDT": "Central Daylight Time", "SRT": "Suriname Time"},
}
}
diff --git a/en_NA/en_NA_test.go b/en_NA/en_NA_test.go
new file mode 100644
index 00000000..295a1851
--- /dev/null
+++ b/en_NA/en_NA_test.go
@@ -0,0 +1,1120 @@
+package en_NA
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_NA"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_NF/en_NF.go b/en_NF/en_NF.go
index e9100779..550dbf4e 100644
--- a/en_NF/en_NF.go
+++ b/en_NF/en_NF.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"AST": "Atlantic Standard Time", "HNT": "Newfoundland Standard Time", "IST": "India Standard Time", "JDT": "Japan Daylight Time", "MEZ": "Central European Standard Time", "NZDT": "New Zealand Daylight Time", "JST": "Japan Standard Time", "WART": "Western Argentina Standard Time", "WARST": "Western Argentina Summer Time", "MYT": "Malaysia Time", "PST": "Pacific Standard Time", "HKT": "Hong Kong Standard Time", "UYST": "Uruguay Summer Time", "CAT": "Central Africa Time", "AEST": "Australian Eastern Standard Time", "TMST": "Turkmenistan Summer Time", "PDT": "Pacific Daylight Time", "BOT": "Bolivia Time", "AWST": "Australian Western Standard Time", "MESZ": "Central European Summer Time", "CHAST": "Chatham Standard Time", "WEZ": "Western European Standard Time", "ECT": "Ecuador Time", "ART": "Argentina Standard Time", "∅∅∅": "Amazon Summer Time", "EAT": "East Africa Time", "ACST": "Australian Central Standard Time", "GFT": "French Guiana Time", "WIB": "Western Indonesia Time", "CST": "Central Standard Time", "ACWST": "Australian Central Western Standard Time", "EST": "Eastern Standard Time", "AEDT": "Australian Eastern Daylight Time", "EDT": "Eastern Daylight Time", "COT": "Colombia Standard Time", "ADT": "Atlantic Daylight Time", "TMT": "Turkmenistan Standard Time", "LHST": "Lord Howe Standard Time", "AKST": "Alaska Standard Time", "GYT": "Guyana Time", "SAST": "South Africa Standard Time", "OEZ": "Eastern European Standard Time", "CHADT": "Chatham Daylight Time", "SGT": "Singapore Standard Time", "ARST": "Argentina Summer Time", "MDT": "Macau Summer Time", "NZST": "New Zealand Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "SRT": "Suriname Time", "AWDT": "Australian Western Daylight Time", "ChST": "Chamorro Standard Time", "OESZ": "Eastern European Summer Time", "UYT": "Uruguay Standard Time", "WAST": "West Africa Summer Time", "WITA": "Central Indonesia Time", "VET": "Venezuela Time", "ACWDT": "Australian Central Western Daylight Time", "COST": "Colombia Summer Time", "HAST": "Hawaii-Aleutian Standard Time", "HKST": "Hong Kong Summer Time", "MST": "Macau Standard Time", "ACDT": "Australian Central Daylight Time", "CLST": "Chile Summer Time", "WAT": "West Africa Standard Time", "BT": "Bhutan Time", "GMT": "Greenwich Mean Time", "LHDT": "Lord Howe Daylight Time", "CLT": "Chile Standard Time", "HAT": "Newfoundland Daylight Time", "WIT": "Eastern Indonesia Time", "AKDT": "Alaska Daylight Time", "CDT": "Central Daylight Time", "WESZ": "Western European Summer Time"},
+ timezones: map[string]string{"CLT": "Chile Standard Time", "MDT": "Macau Summer Time", "CHADT": "Chatham Daylight Time", "AWST": "Australian Western Standard Time", "IST": "India Standard Time", "WAT": "West Africa Standard Time", "LHDT": "Lord Howe Daylight Time", "VET": "Venezuela Time", "ARST": "Argentina Summer Time", "BOT": "Bolivia Time", "EST": "Eastern Standard Time", "ACDT": "Australian Central Daylight Time", "SRT": "Suriname Time", "JDT": "Japan Daylight Time", "NZST": "New Zealand Standard Time", "COT": "Colombia Standard Time", "ChST": "Chamorro Standard Time", "CLST": "Chile Summer Time", "ACST": "Australian Central Standard Time", "HKST": "Hong Kong Summer Time", "CHAST": "Chatham Standard Time", "ECT": "Ecuador Time", "ACWDT": "Australian Central Western Daylight Time", "LHST": "Lord Howe Standard Time", "CDT": "Central Daylight Time", "EDT": "Eastern Daylight Time", "WIB": "Western Indonesia Time", "GMT": "Greenwich Mean Time", "UYST": "Uruguay Summer Time", "NZDT": "New Zealand Daylight Time", "SGT": "Singapore Standard Time", "GYT": "Guyana Time", "WEZ": "Western European Standard Time", "HNT": "Newfoundland Standard Time", "COST": "Colombia Summer Time", "AEST": "Australian Eastern Standard Time", "EAT": "East Africa Time", "JST": "Japan Standard Time", "ADT": "Atlantic Daylight Time", "AWDT": "Australian Western Daylight Time", "PST": "Pacific Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "TMT": "Turkmenistan Standard Time", "PDT": "Pacific Daylight Time", "MESZ": "Central European Summer Time", "HAT": "Newfoundland Daylight Time", "WIT": "Eastern Indonesia Time", "AST": "Atlantic Standard Time", "MEZ": "Central European Standard Time", "BT": "Bhutan Time", "ACWST": "Australian Central Western Standard Time", "WAST": "West Africa Summer Time", "OESZ": "Eastern European Summer Time", "AEDT": "Australian Eastern Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "∅∅∅": "Amazon Summer Time", "CAT": "Central Africa Time", "UYT": "Uruguay Standard Time", "CST": "Central Standard Time", "GFT": "French Guiana Time", "MST": "Macau Standard Time", "HKT": "Hong Kong Standard Time", "ART": "Argentina Standard Time", "WESZ": "Western European Summer Time", "MYT": "Malaysia Time", "WART": "Western Argentina Standard Time", "WARST": "Western Argentina Summer Time", "AKST": "Alaska Standard Time", "AKDT": "Alaska Daylight Time", "WITA": "Central Indonesia Time", "TMST": "Turkmenistan Summer Time", "SAST": "South Africa Standard Time", "OEZ": "Eastern European Standard Time"},
}
}
@@ -112,8 +112,8 @@ func (en *en_NF) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
func (en *en_NF) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
n := math.Abs(num)
- nMod100 := math.Mod(n, 100)
nMod10 := math.Mod(n, 10)
+ nMod100 := math.Mod(n, 100)
if nMod10 == 1 && nMod100 != 11 {
return locales.PluralRuleOne
diff --git a/en_NF/en_NF_test.go b/en_NF/en_NF_test.go
new file mode 100644
index 00000000..cd1026d1
--- /dev/null
+++ b/en_NF/en_NF_test.go
@@ -0,0 +1,1120 @@
+package en_NF
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_NF"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_NG/en_NG.go b/en_NG/en_NG.go
index 2a0a85b6..af2d3c6e 100644
--- a/en_NG/en_NG.go
+++ b/en_NG/en_NG.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"WART": "Western Argentina Standard Time", "HAT": "Newfoundland Daylight Time", "CLT": "Chile Standard Time", "COT": "Colombia Standard Time", "MYT": "Malaysia Time", "LHDT": "Lord Howe Daylight Time", "CDT": "Central Daylight Time", "CHADT": "Chatham Daylight Time", "SGT": "Singapore Standard Time", "GFT": "French Guiana Time", "UYT": "Uruguay Standard Time", "PST": "Pacific Standard Time", "CAT": "Central Africa Time", "EST": "Eastern Standard Time", "AST": "Atlantic Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "JST": "Japan Standard Time", "AKST": "Alaska Standard Time", "∅∅∅": "Amazon Summer Time", "GYT": "Guyana Time", "MEZ": "Central European Standard Time", "WEZ": "Western European Standard Time", "WIT": "Eastern Indonesia Time", "WIB": "Western Indonesia Time", "VET": "Venezuela Time", "ECT": "Ecuador Time", "ADT": "Atlantic Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "OEZ": "Eastern European Standard Time", "CHAST": "Chatham Standard Time", "MESZ": "Central European Summer Time", "NZDT": "New Zealand Daylight Time", "IST": "India Standard Time", "ARST": "Argentina Summer Time", "ART": "Argentina Standard Time", "WAT": "West Africa Standard Time", "JDT": "Japan Daylight Time", "PDT": "Pacific Daylight Time", "ChST": "Chamorro Standard Time", "WAST": "West Africa Summer Time", "OESZ": "Eastern European Summer Time", "ACST": "Australian Central Standard Time", "AKDT": "Alaska Daylight Time", "NZST": "New Zealand Standard Time", "MST": "Macau Standard Time", "BT": "Bhutan Time", "GMT": "Greenwich Mean Time", "EAT": "East Africa Time", "ACWDT": "Australian Central Western Daylight Time", "AEDT": "Australian Eastern Daylight Time", "AWDT": "Australian Western Daylight Time", "CLST": "Chile Summer Time", "TMST": "Turkmenistan Summer Time", "MDT": "Macau Summer Time", "LHST": "Lord Howe Standard Time", "CST": "Central Standard Time", "BOT": "Bolivia Time", "WESZ": "Western European Summer Time", "WITA": "Central Indonesia Time", "TMT": "Turkmenistan Standard Time", "AEST": "Australian Eastern Standard Time", "COST": "Colombia Summer Time", "UYST": "Uruguay Summer Time", "HKT": "Hong Kong Standard Time", "HKST": "Hong Kong Summer Time", "HNT": "Newfoundland Standard Time", "SRT": "Suriname Time", "SAST": "South Africa Standard Time", "ACWST": "Australian Central Western Standard Time", "EDT": "Eastern Daylight Time", "WARST": "Western Argentina Summer Time", "ACDT": "Australian Central Daylight Time", "AWST": "Australian Western Standard Time"},
+ timezones: map[string]string{"EAT": "East Africa Time", "UYT": "Uruguay Standard Time", "WARST": "Western Argentina Summer Time", "SRT": "Suriname Time", "BOT": "Bolivia Time", "AEDT": "Australian Eastern Daylight Time", "ACWDT": "Australian Central Western Daylight Time", "WAST": "West Africa Summer Time", "WESZ": "Western European Summer Time", "BT": "Bhutan Time", "HKT": "Hong Kong Standard Time", "WEZ": "Western European Standard Time", "OEZ": "Eastern European Standard Time", "AEST": "Australian Eastern Standard Time", "MYT": "Malaysia Time", "∅∅∅": "Brasilia Summer Time", "CDT": "Central Daylight Time", "CHADT": "Chatham Daylight Time", "NZDT": "New Zealand Daylight Time", "CST": "Central Standard Time", "PST": "Pacific Standard Time", "NZST": "New Zealand Standard Time", "CHAST": "Chatham Standard Time", "AWST": "Australian Western Standard Time", "ART": "Argentina Standard Time", "JST": "Japan Standard Time", "MEZ": "Central European Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "SGT": "Singapore Standard Time", "GYT": "Guyana Time", "LHDT": "Lord Howe Daylight Time", "CLST": "Chile Summer Time", "WART": "Western Argentina Standard Time", "ECT": "Ecuador Time", "CLT": "Chile Standard Time", "ACDT": "Australian Central Daylight Time", "GFT": "French Guiana Time", "HAST": "Hawaii-Aleutian Standard Time", "OESZ": "Eastern European Summer Time", "LHST": "Lord Howe Standard Time", "SAST": "South Africa Standard Time", "PDT": "Pacific Daylight Time", "MESZ": "Central European Summer Time", "MST": "Mountain Standard Time", "HKST": "Hong Kong Summer Time", "EST": "Eastern Standard Time", "TMST": "Turkmenistan Summer Time", "AST": "Atlantic Standard Time", "AWDT": "Australian Western Daylight Time", "JDT": "Japan Daylight Time", "WIB": "Western Indonesia Time", "GMT": "Greenwich Mean Time", "ChST": "Chamorro Standard Time", "AKST": "Alaska Standard Time", "WAT": "West Africa Standard Time", "COST": "Colombia Summer Time", "ACWST": "Australian Central Western Standard Time", "EDT": "Eastern Daylight Time", "CAT": "Central Africa Time", "HAT": "Newfoundland Daylight Time", "COT": "Colombia Standard Time", "WIT": "Eastern Indonesia Time", "MDT": "Mountain Daylight Time", "UYST": "Uruguay Summer Time", "ACST": "Australian Central Standard Time", "ARST": "Argentina Summer Time", "TMT": "Turkmenistan Standard Time", "HNT": "Newfoundland Standard Time", "VET": "Venezuela Time", "AKDT": "Alaska Daylight Time", "ADT": "Atlantic Daylight Time", "WITA": "Central Indonesia Time", "IST": "India Standard Time"},
}
}
diff --git a/en_NG/en_NG_test.go b/en_NG/en_NG_test.go
new file mode 100644
index 00000000..a638b532
--- /dev/null
+++ b/en_NG/en_NG_test.go
@@ -0,0 +1,1120 @@
+package en_NG
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_NG"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_NL/en_NL.go b/en_NL/en_NL.go
index caa06349..552c58a2 100644
--- a/en_NL/en_NL.go
+++ b/en_NL/en_NL.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"GYT": "Guyana Time", "UYT": "Uruguay Standard Time", "MDT": "Mountain Daylight Time", "TMST": "Turkmenistan Summer Time", "LHST": "Lord Howe Standard Time", "AWST": "Australian Western Standard Time", "ACWDT": "Australian Central Western Daylight Time", "EDT": "Eastern Daylight Time", "OEZ": "Eastern European Standard Time", "ECT": "Ecuador Time", "HAST": "Hawaii-Aleutian Standard Time", "WAST": "West Africa Summer Time", "HNT": "Newfoundland Standard Time", "BOT": "Bolivia Time", "CST": "Central Standard Time", "MESZ": "Central European Summer Time", "HADT": "Hawaii-Aleutian Daylight Time", "OESZ": "Eastern European Summer Time", "ACDT": "Australian Central Daylight Time", "JDT": "Japan Daylight Time", "CHADT": "Chatham Daylight Time", "CLT": "Chile Standard Time", "WIT": "Eastern Indonesia Time", "ChST": "Chamorro Standard Time", "CLST": "Chile Summer Time", "WEZ": "Western European Standard Time", "WAT": "West Africa Standard Time", "ARST": "Argentina Summer Time", "UYST": "Uruguay Summer Time", "CDT": "Central Daylight Time", "NZST": "New Zealand Standard Time", "BT": "Bhutan Time", "GFT": "French Guiana Time", "ACWST": "Australian Central Western Standard Time", "COST": "Colombia Summer Time", "WART": "Western Argentina Standard Time", "TMT": "Turkmenistan Standard Time", "AKST": "Alaska Standard Time", "NZDT": "New Zealand Daylight Time", "SGT": "Singapore Standard Time", "SAST": "South Africa Standard Time", "HKT": "Hong Kong Standard Time", "JST": "Japan Standard Time", "PST": "Pacific Standard Time", "WIB": "Western Indonesia Time", "MYT": "Malaysia Time", "MEZ": "Central European Standard Time", "∅∅∅": "Brasilia Summer Time", "CAT": "Central Africa Time", "MST": "Mountain Standard Time", "WESZ": "Western European Summer Time", "GMT": "Greenwich Mean Time", "EAT": "East Africa Time", "AWDT": "Australian Western Daylight Time", "CHAST": "Chatham Standard Time", "HAT": "Newfoundland Daylight Time", "ART": "Argentina Standard Time", "LHDT": "Lord Howe Daylight Time", "SRT": "Suriname Time", "AKDT": "Alaska Daylight Time", "AEST": "Australian Eastern Standard Time", "WARST": "Western Argentina Summer Time", "ACST": "Australian Central Standard Time", "AEDT": "Australian Eastern Daylight Time", "HKST": "Hong Kong Summer Time", "PDT": "Pacific Daylight Time", "EST": "Eastern Standard Time", "COT": "Colombia Standard Time", "IST": "India Standard Time", "WITA": "Central Indonesia Time", "VET": "Venezuela Time", "AST": "Atlantic Standard Time", "ADT": "Atlantic Daylight Time"},
+ timezones: map[string]string{"CLT": "Chile Standard Time", "CDT": "Central Daylight Time", "CHADT": "Chatham Daylight Time", "MESZ": "Central European Summer Time", "CAT": "Central Africa Time", "GYT": "Guyana Time", "JST": "Japan Standard Time", "NZST": "New Zealand Standard Time", "WESZ": "Western European Summer Time", "HNT": "Newfoundland Standard Time", "MDT": "Mountain Daylight Time", "UYST": "Uruguay Summer Time", "WARST": "Western Argentina Summer Time", "HKST": "Hong Kong Summer Time", "AKDT": "Alaska Daylight Time", "SAST": "South Africa Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "CLST": "Chile Summer Time", "AEST": "Australian Eastern Standard Time", "GFT": "French Guiana Time", "SGT": "Singapore Standard Time", "SRT": "Suriname Time", "CHAST": "Chatham Standard Time", "PST": "Pacific Standard Time", "TMT": "Turkmenistan Standard Time", "TMST": "Turkmenistan Summer Time", "ChST": "Chamorro Standard Time", "ECT": "Ecuador Time", "AKST": "Alaska Standard Time", "WAST": "West Africa Summer Time", "WEZ": "Western European Standard Time", "COT": "Colombia Standard Time", "UYT": "Uruguay Standard Time", "MEZ": "Central European Standard Time", "HAT": "Newfoundland Daylight Time", "COST": "Colombia Summer Time", "ACDT": "Australian Central Daylight Time", "ACWST": "Australian Central Western Standard Time", "JDT": "Japan Daylight Time", "WAT": "West Africa Standard Time", "OEZ": "Eastern European Standard Time", "WIT": "Eastern Indonesia Time", "∅∅∅": "Brasilia Summer Time", "HKT": "Hong Kong Standard Time", "VET": "Venezuela Time", "ACWDT": "Australian Central Western Daylight Time", "BT": "Bhutan Time", "WART": "Western Argentina Standard Time", "AWST": "Australian Western Standard Time", "ART": "Argentina Standard Time", "ARST": "Argentina Summer Time", "LHST": "Lord Howe Standard Time", "ADT": "Atlantic Daylight Time", "AWDT": "Australian Western Daylight Time", "WITA": "Central Indonesia Time", "IST": "India Standard Time", "NZDT": "New Zealand Daylight Time", "EDT": "Eastern Daylight Time", "OESZ": "Eastern European Summer Time", "AEDT": "Australian Eastern Daylight Time", "MYT": "Malaysia Time", "EST": "Eastern Standard Time", "PDT": "Pacific Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "EAT": "East Africa Time", "ACST": "Australian Central Standard Time", "BOT": "Bolivia Time", "WIB": "Western Indonesia Time", "GMT": "Greenwich Mean Time", "LHDT": "Lord Howe Daylight Time", "MST": "Mountain Standard Time", "CST": "Central Standard Time", "AST": "Atlantic Standard Time"},
}
}
diff --git a/en_NL/en_NL_test.go b/en_NL/en_NL_test.go
new file mode 100644
index 00000000..8f38259a
--- /dev/null
+++ b/en_NL/en_NL_test.go
@@ -0,0 +1,1120 @@
+package en_NL
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_NL"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_NR/en_NR.go b/en_NR/en_NR.go
index 776e550c..7adaebad 100644
--- a/en_NR/en_NR.go
+++ b/en_NR/en_NR.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"CST": "Central Standard Time", "UYST": "Uruguay Summer Time", "WESZ": "Western European Summer Time", "ACWDT": "Australian Central Western Daylight Time", "CLT": "Chile Standard Time", "COST": "Colombia Summer Time", "HADT": "Hawaii-Aleutian Daylight Time", "IST": "India Standard Time", "WIB": "Western Indonesia Time", "ACST": "Australian Central Standard Time", "ACDT": "Australian Central Daylight Time", "ART": "Argentina Standard Time", "TMT": "Turkmenistan Standard Time", "LHDT": "Lord Howe Daylight Time", "JST": "Japan Standard Time", "AEDT": "Australian Eastern Daylight Time", "MST": "Mountain Standard Time", "CHADT": "Chatham Daylight Time", "VET": "Venezuela Time", "ECT": "Ecuador Time", "HNT": "Newfoundland Standard Time", "AKST": "Alaska Standard Time", "MESZ": "Central European Summer Time", "ChST": "Chamorro Standard Time", "CAT": "Central Africa Time", "OESZ": "Eastern European Summer Time", "SRT": "Suriname Time", "CLST": "Chile Summer Time", "EDT": "Eastern Daylight Time", "SAST": "South Africa Standard Time", "GYT": "Guyana Time", "BOT": "Bolivia Time", "WIT": "Eastern Indonesia Time", "AEST": "Australian Eastern Standard Time", "MDT": "Mountain Daylight Time", "ADT": "Atlantic Daylight Time", "GMT": "Greenwich Mean Time", "AKDT": "Alaska Daylight Time", "JDT": "Japan Daylight Time", "WAST": "West Africa Summer Time", "OEZ": "Eastern European Standard Time", "MYT": "Malaysia Time", "PDT": "Pacific Daylight Time", "NZST": "New Zealand Standard Time", "ACWST": "Australian Central Western Standard Time", "BT": "Bhutan Time", "HKT": "Hong Kong Standard Time", "CHAST": "Chatham Standard Time", "WARST": "Western Argentina Summer Time", "TMST": "Turkmenistan Summer Time", "CDT": "Central Daylight Time", "MEZ": "Central European Standard Time", "WEZ": "Western European Standard Time", "WAT": "West Africa Standard Time", "WART": "Western Argentina Standard Time", "GFT": "French Guiana Time", "EAT": "East Africa Time", "PST": "Pacific Standard Time", "EST": "Eastern Standard Time", "HKST": "Hong Kong Summer Time", "WITA": "Central Indonesia Time", "ARST": "Argentina Summer Time", "LHST": "Lord Howe Standard Time", "UYT": "Uruguay Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "AWST": "Australian Western Standard Time", "COT": "Colombia Standard Time", "SGT": "Singapore Standard Time", "AWDT": "Australian Western Daylight Time", "∅∅∅": "Azores Summer Time", "NZDT": "New Zealand Daylight Time", "AST": "Atlantic Standard Time", "HAT": "Newfoundland Daylight Time"},
+ timezones: map[string]string{"MST": "Macau Standard Time", "GYT": "Guyana Time", "CLST": "Chile Summer Time", "HKT": "Hong Kong Standard Time", "HKST": "Hong Kong Summer Time", "VET": "Venezuela Time", "ARST": "Argentina Summer Time", "WITA": "Central Indonesia Time", "PDT": "Pacific Daylight Time", "ACDT": "Australian Central Daylight Time", "CHAST": "Chatham Standard Time", "AKDT": "Alaska Daylight Time", "IST": "India Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "LHST": "Lord Howe Standard Time", "CDT": "Central Daylight Time", "ACST": "Australian Central Standard Time", "BOT": "Bolivia Time", "MEZ": "Central European Standard Time", "TMT": "Turkmenistan Standard Time", "WIT": "Eastern Indonesia Time", "UYT": "Uruguay Standard Time", "AWST": "Australian Western Standard Time", "AWDT": "Australian Western Daylight Time", "EDT": "Eastern Daylight Time", "WAST": "West Africa Summer Time", "AEST": "Australian Eastern Standard Time", "MDT": "Macau Summer Time", "ECT": "Ecuador Time", "SAST": "South Africa Standard Time", "LHDT": "Lord Howe Daylight Time", "GFT": "French Guiana Time", "NZST": "New Zealand Standard Time", "AEDT": "Australian Eastern Daylight Time", "MYT": "Malaysia Time", "MESZ": "Central European Summer Time", "WAT": "West Africa Standard Time", "BT": "Bhutan Time", "GMT": "Greenwich Mean Time", "AKST": "Alaska Standard Time", "JDT": "Japan Daylight Time", "PST": "Pacific Standard Time", "HNT": "Newfoundland Standard Time", "HAT": "Newfoundland Daylight Time", "SGT": "Singapore Standard Time", "OESZ": "Eastern European Summer Time", "EAT": "East Africa Time", "CST": "Central Standard Time", "AST": "Atlantic Standard Time", "WEZ": "Western European Standard Time", "WESZ": "Western European Summer Time", "COT": "Colombia Standard Time", "ChST": "Chamorro Standard Time", "ACWST": "Australian Central Western Standard Time", "WIB": "Western Indonesia Time", "CLT": "Chile Standard Time", "TMST": "Turkmenistan Summer Time", "ADT": "Atlantic Daylight Time", "ART": "Argentina Standard Time", "EST": "Eastern Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "WARST": "Western Argentina Summer Time", "∅∅∅": "Azores Summer Time", "CHADT": "Chatham Daylight Time", "ACWDT": "Australian Central Western Daylight Time", "NZDT": "New Zealand Daylight Time", "JST": "Japan Standard Time", "CAT": "Central Africa Time", "COST": "Colombia Summer Time", "OEZ": "Eastern European Standard Time", "UYST": "Uruguay Summer Time", "WART": "Western Argentina Standard Time", "SRT": "Suriname Time"},
}
}
diff --git a/en_NR/en_NR_test.go b/en_NR/en_NR_test.go
new file mode 100644
index 00000000..061fe758
--- /dev/null
+++ b/en_NR/en_NR_test.go
@@ -0,0 +1,1120 @@
+package en_NR
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_NR"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_NU/en_NU.go b/en_NU/en_NU.go
index e145adba..56a272c1 100644
--- a/en_NU/en_NU.go
+++ b/en_NU/en_NU.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"PDT": "Pacific Daylight Time", "ACWST": "Australian Central Western Standard Time", "WART": "Western Argentina Standard Time", "WEZ": "Western European Standard Time", "ChST": "Chamorro Standard Time", "OEZ": "Eastern European Standard Time", "LHST": "Lord Howe Standard Time", "LHDT": "Lord Howe Daylight Time", "WARST": "Western Argentina Summer Time", "HAT": "Newfoundland Daylight Time", "WIB": "Western Indonesia Time", "JDT": "Japan Daylight Time", "MEZ": "Central European Standard Time", "CHAST": "Chatham Standard Time", "CLT": "Chile Standard Time", "EST": "Eastern Standard Time", "EDT": "Eastern Daylight Time", "ARST": "Argentina Summer Time", "NZST": "New Zealand Standard Time", "NZDT": "New Zealand Daylight Time", "AEDT": "Australian Eastern Daylight Time", "CLST": "Chile Summer Time", "VET": "Venezuela Time", "CAT": "Central Africa Time", "OESZ": "Eastern European Summer Time", "ACDT": "Australian Central Daylight Time", "UYT": "Uruguay Standard Time", "BT": "Bhutan Time", "ACST": "Australian Central Standard Time", "CDT": "Central Daylight Time", "AEST": "Australian Eastern Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "EAT": "East Africa Time", "ART": "Argentina Standard Time", "TMT": "Turkmenistan Standard Time", "AWST": "Australian Western Standard Time", "CST": "Central Standard Time", "COST": "Colombia Summer Time", "MDT": "Macau Summer Time", "PST": "Pacific Standard Time", "MESZ": "Central European Summer Time", "BOT": "Bolivia Time", "ACWDT": "Australian Central Western Daylight Time", "HNT": "Newfoundland Standard Time", "WITA": "Central Indonesia Time", "MYT": "Malaysia Time", "AST": "Atlantic Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "SGT": "Singapore Standard Time", "SAST": "South Africa Standard Time", "MST": "Macau Standard Time", "∅∅∅": "Amazon Summer Time", "GYT": "Guyana Time", "CHADT": "Chatham Daylight Time", "ECT": "Ecuador Time", "GFT": "French Guiana Time", "TMST": "Turkmenistan Summer Time", "AKDT": "Alaska Daylight Time", "JST": "Japan Standard Time", "SRT": "Suriname Time", "WESZ": "Western European Summer Time", "COT": "Colombia Standard Time", "ADT": "Atlantic Daylight Time", "WAT": "West Africa Standard Time", "WAST": "West Africa Summer Time", "HKST": "Hong Kong Summer Time", "GMT": "Greenwich Mean Time", "WIT": "Eastern Indonesia Time", "AKST": "Alaska Standard Time", "AWDT": "Australian Western Daylight Time", "UYST": "Uruguay Summer Time", "HKT": "Hong Kong Standard Time", "IST": "India Standard Time"},
+ timezones: map[string]string{"EDT": "Eastern Daylight Time", "WESZ": "Western European Summer Time", "WAT": "West Africa Standard Time", "BT": "Bhutan Time", "MST": "Mountain Standard Time", "MYT": "Malaysia Time", "ACDT": "Australian Central Daylight Time", "HKST": "Hong Kong Summer Time", "VET": "Venezuela Time", "MESZ": "Central European Summer Time", "COT": "Colombia Standard Time", "AEST": "Australian Eastern Standard Time", "ART": "Argentina Standard Time", "ARST": "Argentina Summer Time", "NZDT": "New Zealand Daylight Time", "WEZ": "Western European Standard Time", "WART": "Western Argentina Standard Time", "AKST": "Alaska Standard Time", "AST": "Atlantic Standard Time", "SAST": "South Africa Standard Time", "IST": "India Standard Time", "TMT": "Turkmenistan Standard Time", "AEDT": "Australian Eastern Daylight Time", "ChST": "Chamorro Standard Time", "CST": "Central Standard Time", "HKT": "Hong Kong Standard Time", "ACWDT": "Australian Central Western Daylight Time", "TMST": "Turkmenistan Summer Time", "OESZ": "Eastern European Summer Time", "WIT": "Eastern Indonesia Time", "CDT": "Central Daylight Time", "GFT": "French Guiana Time", "JST": "Japan Standard Time", "WAST": "West Africa Summer Time", "ACST": "Australian Central Standard Time", "AWST": "Australian Western Standard Time", "WARST": "Western Argentina Summer Time", "PST": "Pacific Standard Time", "LHDT": "Lord Howe Daylight Time", "CLT": "Chile Standard Time", "UYST": "Uruguay Summer Time", "ACWST": "Australian Central Western Standard Time", "AWDT": "Australian Western Daylight Time", "EST": "Eastern Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "∅∅∅": "Brasilia Summer Time", "SRT": "Suriname Time", "GYT": "Guyana Time", "MDT": "Mountain Daylight Time", "AKDT": "Alaska Daylight Time", "JDT": "Japan Daylight Time", "NZST": "New Zealand Standard Time", "HAT": "Newfoundland Daylight Time", "SGT": "Singapore Standard Time", "WIB": "Western Indonesia Time", "PDT": "Pacific Daylight Time", "OEZ": "Eastern European Standard Time", "GMT": "Greenwich Mean Time", "CHAST": "Chatham Standard Time", "CHADT": "Chatham Daylight Time", "ECT": "Ecuador Time", "ADT": "Atlantic Daylight Time", "BOT": "Bolivia Time", "LHST": "Lord Howe Standard Time", "WITA": "Central Indonesia Time", "HADT": "Hawaii-Aleutian Daylight Time", "EAT": "East Africa Time", "UYT": "Uruguay Standard Time", "MEZ": "Central European Standard Time", "CAT": "Central Africa Time", "CLST": "Chile Summer Time", "HNT": "Newfoundland Standard Time", "COST": "Colombia Summer Time"},
}
}
diff --git a/en_NU/en_NU_test.go b/en_NU/en_NU_test.go
new file mode 100644
index 00000000..c5954bc3
--- /dev/null
+++ b/en_NU/en_NU_test.go
@@ -0,0 +1,1120 @@
+package en_NU
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_NU"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_NZ/en_NZ.go b/en_NZ/en_NZ.go
index b93a8410..a1746fd1 100644
--- a/en_NZ/en_NZ.go
+++ b/en_NZ/en_NZ.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"HKT": "Hong Kong Standard Time", "HKST": "Hong Kong Summer Time", "ARST": "Argentina Summer Time", "GFT": "French Guiana Time", "AWST": "Australian Western Standard Time", "EST": "Eastern Standard Time", "WARST": "Western Argentina Summer Time", "HAT": "Newfoundland Daylight Time", "TMST": "Turkmenistan Summer Time", "JDT": "Japan Daylight Time", "AWDT": "Australian Western Daylight Time", "CDT": "Central Daylight Time", "UYT": "Uruguay Standard Time", "CHAST": "Chatham Standard Time", "WAT": "West Africa Standard Time", "GMT": "Greenwich Mean Time", "AST": "Atlantic Standard Time", "SAST": "South Africa Standard Time", "IST": "India Standard Time", "ECT": "Ecuador Time", "WAST": "West Africa Summer Time", "WITA": "Central Indonesia Time", "OEZ": "Eastern European Standard Time", "ACST": "Australian Central Standard Time", "WEZ": "Western European Standard Time", "COT": "Colombia Standard Time", "COST": "Colombia Summer Time", "ART": "Argentina Standard Time", "JST": "Japan Standard Time", "AKST": "Alaska Standard Time", "LHST": "Lord Howe Standard Time", "NZST": "New Zealand Standard Time", "CHADT": "Chatham Daylight Time", "MDT": "Mountain Daylight Time", "ACDT": "Australian Central Daylight Time", "VET": "Venezuela Time", "CST": "Central Standard Time", "MESZ": "Central European Summer Time", "OESZ": "Eastern European Summer Time", "HADT": "Hawaii-Aleutian Daylight Time", "BT": "Bhutan Time", "WIT": "Eastern Indonesia Time", "AKDT": "Alaska Daylight Time", "ACWST": "Australian Central Western Standard Time", "ADT": "Atlantic Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "HNT": "Newfoundland Standard Time", "MYT": "Malaysia Time", "PST": "Pacific Standard Time", "ChST": "Chamorro Standard Time", "TMT": "Turkmenistan Standard Time", "GYT": "Guyana Time", "∅∅∅": "Brasilia Summer Time", "SGT": "Singapore Standard Time", "BOT": "Bolivia Time", "WESZ": "Western European Summer Time", "LHDT": "Lord Howe Daylight Time", "MST": "Mountain Standard Time", "AEST": "Australian Eastern Standard Time", "AEDT": "Australian Eastern Daylight Time", "CAT": "Central Africa Time", "WIB": "Western Indonesia Time", "PDT": "Pacific Daylight Time", "CLT": "Chile Standard Time", "CLST": "Chile Summer Time", "ACWDT": "Australian Central Western Daylight Time", "SRT": "Suriname Time", "MEZ": "Central European Standard Time", "NZDT": "New Zealand Daylight Time", "UYST": "Uruguay Summer Time", "EDT": "Eastern Daylight Time", "WART": "Western Argentina Standard Time", "EAT": "East Africa Time"},
+ timezones: map[string]string{"VET": "Venezuela Time", "IST": "India Standard Time", "NZDT": "New Zealand Daylight Time", "CHAST": "Chatham Standard Time", "ADT": "Atlantic Daylight Time", "WESZ": "Western European Summer Time", "TMST": "Turkmenistan Summer Time", "GYT": "Guyana Time", "MDT": "Macau Summer Time", "MESZ": "Central European Summer Time", "HAST": "Hawaii-Aleutian Standard Time", "CDT": "Central Daylight Time", "WART": "Western Argentina Standard Time", "HKST": "Hong Kong Summer Time", "SAST": "South Africa Standard Time", "ART": "Argentina Standard Time", "COST": "Colombia Summer Time", "WIB": "Western Indonesia Time", "EAT": "East Africa Time", "COT": "Colombia Standard Time", "UYST": "Uruguay Summer Time", "ACDT": "Australian Central Daylight Time", "WARST": "Western Argentina Summer Time", "JST": "Japan Standard Time", "PST": "Pacific Standard Time", "BOT": "Bolivia Time", "HAT": "Newfoundland Daylight Time", "MEZ": "Central European Standard Time", "GMT": "Greenwich Mean Time", "ACWST": "Australian Central Western Standard Time", "SRT": "Suriname Time", "ACWDT": "Australian Central Western Daylight Time", "AWDT": "Australian Western Daylight Time", "OESZ": "Eastern European Summer Time", "CST": "Central Standard Time", "ChST": "Chamorro Standard Time", "WITA": "Central Indonesia Time", "EST": "Eastern Standard Time", "HNT": "Newfoundland Standard Time", "MYT": "Malaysia Time", "GFT": "French Guiana Time", "EDT": "Eastern Daylight Time", "OEZ": "Eastern European Standard Time", "CLT": "Chile Standard Time", "CHADT": "Chatham Daylight Time", "ARST": "Argentina Summer Time", "WAT": "West Africa Standard Time", "TMT": "Turkmenistan Standard Time", "AEST": "Australian Eastern Standard Time", "BT": "Bhutan Time", "CAT": "Central Africa Time", "WEZ": "Western European Standard Time", "∅∅∅": "Azores Summer Time", "AKST": "Alaska Standard Time", "AKDT": "Alaska Daylight Time", "AST": "Atlantic Standard Time", "AWST": "Australian Western Standard Time", "NZST": "New Zealand Standard Time", "SGT": "Singapore Standard Time", "AEDT": "Australian Eastern Daylight Time", "HKT": "Hong Kong Standard Time", "WAST": "West Africa Summer Time", "CLST": "Chile Summer Time", "LHST": "Lord Howe Standard Time", "LHDT": "Lord Howe Daylight Time", "ACST": "Australian Central Standard Time", "MST": "Macau Standard Time", "ECT": "Ecuador Time", "JDT": "Japan Daylight Time", "PDT": "Pacific Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "UYT": "Uruguay Standard Time", "WIT": "Eastern Indonesia Time"},
}
}
diff --git a/en_NZ/en_NZ_test.go b/en_NZ/en_NZ_test.go
new file mode 100644
index 00000000..9a9b0ef3
--- /dev/null
+++ b/en_NZ/en_NZ_test.go
@@ -0,0 +1,1120 @@
+package en_NZ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_NZ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_PG/en_PG.go b/en_PG/en_PG.go
index c3c0081a..23670ef7 100644
--- a/en_PG/en_PG.go
+++ b/en_PG/en_PG.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"GMT": "Greenwich Mean Time", "UYST": "Uruguay Summer Time", "WAST": "West Africa Summer Time", "CLST": "Chile Summer Time", "VET": "Venezuela Time", "GFT": "French Guiana Time", "TMT": "Turkmenistan Standard Time", "JDT": "Japan Daylight Time", "PDT": "Pacific Daylight Time", "AWDT": "Australian Western Daylight Time", "LHST": "Lord Howe Standard Time", "WEZ": "Western European Standard Time", "ACWST": "Australian Central Western Standard Time", "SAST": "South Africa Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "WART": "Western Argentina Standard Time", "ART": "Argentina Standard Time", "AKST": "Alaska Standard Time", "CST": "Central Standard Time", "BOT": "Bolivia Time", "UYT": "Uruguay Standard Time", "AST": "Atlantic Standard Time", "OEZ": "Eastern European Standard Time", "ACWDT": "Australian Central Western Daylight Time", "EST": "Eastern Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "HKT": "Hong Kong Standard Time", "WIB": "Western Indonesia Time", "∅∅∅": "Amazon Summer Time", "WESZ": "Western European Summer Time", "COT": "Colombia Standard Time", "WAT": "West Africa Standard Time", "WARST": "Western Argentina Summer Time", "HAT": "Newfoundland Daylight Time", "MDT": "Macau Summer Time", "AEDT": "Australian Eastern Daylight Time", "ACST": "Australian Central Standard Time", "MYT": "Malaysia Time", "NZST": "New Zealand Standard Time", "SGT": "Singapore Standard Time", "EAT": "East Africa Time", "AKDT": "Alaska Daylight Time", "HNT": "Newfoundland Standard Time", "SRT": "Suriname Time", "MESZ": "Central European Summer Time", "NZDT": "New Zealand Daylight Time", "HKST": "Hong Kong Summer Time", "WIT": "Eastern Indonesia Time", "JST": "Japan Standard Time", "CHAST": "Chatham Standard Time", "EDT": "Eastern Daylight Time", "OESZ": "Eastern European Summer Time", "WITA": "Central Indonesia Time", "LHDT": "Lord Howe Daylight Time", "TMST": "Turkmenistan Summer Time", "PST": "Pacific Standard Time", "AWST": "Australian Western Standard Time", "CDT": "Central Daylight Time", "AEST": "Australian Eastern Standard Time", "ChST": "Chamorro Standard Time", "CAT": "Central Africa Time", "ECT": "Ecuador Time", "ACDT": "Australian Central Daylight Time", "ARST": "Argentina Summer Time", "CHADT": "Chatham Daylight Time", "IST": "India Standard Time", "ADT": "Atlantic Daylight Time", "MST": "Macau Standard Time", "GYT": "Guyana Time", "MEZ": "Central European Standard Time", "CLT": "Chile Standard Time", "COST": "Colombia Summer Time", "BT": "Bhutan Time"},
+ timezones: map[string]string{"HKT": "Hong Kong Standard Time", "PDT": "Pacific Daylight Time", "SAST": "South Africa Standard Time", "CAT": "Central Africa Time", "CLT": "Chile Standard Time", "CLST": "Chile Summer Time", "EDT": "Eastern Daylight Time", "HAT": "Newfoundland Daylight Time", "UYT": "Uruguay Standard Time", "WITA": "Central Indonesia Time", "GFT": "French Guiana Time", "AST": "Atlantic Standard Time", "ACWDT": "Australian Central Western Daylight Time", "BOT": "Bolivia Time", "AEDT": "Australian Eastern Daylight Time", "LHDT": "Lord Howe Daylight Time", "CST": "Central Standard Time", "OESZ": "Eastern European Summer Time", "EST": "Eastern Standard Time", "AEST": "Australian Eastern Standard Time", "MEZ": "Central European Standard Time", "COST": "Colombia Summer Time", "WEZ": "Western European Standard Time", "WIT": "Eastern Indonesia Time", "SRT": "Suriname Time", "WART": "Western Argentina Standard Time", "HKST": "Hong Kong Summer Time", "AKST": "Alaska Standard Time", "SGT": "Singapore Standard Time", "TMST": "Turkmenistan Summer Time", "MST": "Mountain Standard Time", "IST": "India Standard Time", "BT": "Bhutan Time", "AWDT": "Australian Western Daylight Time", "JDT": "Japan Daylight Time", "HNT": "Newfoundland Standard Time", "WESZ": "Western European Summer Time", "GMT": "Greenwich Mean Time", "∅∅∅": "Brasilia Summer Time", "CHAST": "Chatham Standard Time", "AWST": "Australian Western Standard Time", "JST": "Japan Standard Time", "UYST": "Uruguay Summer Time", "EAT": "East Africa Time", "LHST": "Lord Howe Standard Time", "ACST": "Australian Central Standard Time", "ACDT": "Australian Central Daylight Time", "WARST": "Western Argentina Summer Time", "VET": "Venezuela Time", "ACWST": "Australian Central Western Standard Time", "WIB": "Western Indonesia Time", "ChST": "Chamorro Standard Time", "MYT": "Malaysia Time", "NZST": "New Zealand Standard Time", "NZDT": "New Zealand Daylight Time", "COT": "Colombia Standard Time", "WAST": "West Africa Summer Time", "MESZ": "Central European Summer Time", "HADT": "Hawaii-Aleutian Daylight Time", "TMT": "Turkmenistan Standard Time", "GYT": "Guyana Time", "MDT": "Mountain Daylight Time", "AKDT": "Alaska Daylight Time", "ADT": "Atlantic Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "WAT": "West Africa Standard Time", "CDT": "Central Daylight Time", "ARST": "Argentina Summer Time", "ECT": "Ecuador Time", "PST": "Pacific Standard Time", "OEZ": "Eastern European Standard Time", "CHADT": "Chatham Daylight Time", "ART": "Argentina Standard Time"},
}
}
@@ -112,8 +112,8 @@ func (en *en_PG) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
func (en *en_PG) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
n := math.Abs(num)
- nMod10 := math.Mod(n, 10)
nMod100 := math.Mod(n, 100)
+ nMod10 := math.Mod(n, 10)
if nMod10 == 1 && nMod100 != 11 {
return locales.PluralRuleOne
diff --git a/en_PG/en_PG_test.go b/en_PG/en_PG_test.go
new file mode 100644
index 00000000..6b6a1b94
--- /dev/null
+++ b/en_PG/en_PG_test.go
@@ -0,0 +1,1120 @@
+package en_PG
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_PG"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_PH/en_PH.go b/en_PH/en_PH.go
index 1ae13102..e4fa9c88 100644
--- a/en_PH/en_PH.go
+++ b/en_PH/en_PH.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"WIB": "Western Indonesia Time", "AWST": "Australian Western Standard Time", "LHDT": "Lord Howe Daylight Time", "NZDT": "New Zealand Daylight Time", "CDT": "Central Daylight Time", "COT": "Colombia Standard Time", "WAT": "West Africa Standard Time", "GFT": "French Guiana Time", "AKDT": "Alaska Daylight Time", "UYST": "Uruguay Summer Time", "EST": "Eastern Standard Time", "TMT": "Turkmenistan Standard Time", "EDT": "Eastern Daylight Time", "CHAST": "Chatham Standard Time", "GYT": "Guyana Time", "AKST": "Alaska Standard Time", "MEZ": "Central European Standard Time", "ACWST": "Australian Central Western Standard Time", "ACST": "Australian Central Standard Time", "ARST": "Argentina Summer Time", "TMST": "Turkmenistan Summer Time", "ECT": "Ecuador Time", "HAST": "Hawaii-Aleutian Standard Time", "OESZ": "Eastern European Summer Time", "JST": "Japan Standard Time", "UYT": "Uruguay Standard Time", "HKST": "Hong Kong Summer Time", "MDT": "Macau Summer Time", "PDT": "Pacific Daylight Time", "ACWDT": "Australian Central Western Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "AST": "Atlantic Standard Time", "GMT": "Greenwich Mean Time", "MST": "Macau Standard Time", "EAT": "East Africa Time", "WIT": "Eastern Indonesia Time", "ChST": "Chamorro Standard Time", "CLST": "Chile Summer Time", "HNT": "Newfoundland Standard Time", "MESZ": "Central European Summer Time", "CST": "Central Standard Time", "COST": "Colombia Summer Time", "CAT": "Central Africa Time", "ADT": "Atlantic Daylight Time", "WAST": "West Africa Summer Time", "BT": "Bhutan Time", "JDT": "Japan Daylight Time", "∅∅∅": "Amazon Summer Time", "PST": "Pacific Standard Time", "AEDT": "Australian Eastern Daylight Time", "VET": "Venezuela Time", "SGT": "Singapore Standard Time", "ART": "Argentina Standard Time", "AWDT": "Australian Western Daylight Time", "NZST": "New Zealand Standard Time", "WART": "Western Argentina Standard Time", "SAST": "South Africa Standard Time", "IST": "India Standard Time", "MYT": "Malaysia Time", "CHADT": "Chatham Daylight Time", "WARST": "Western Argentina Summer Time", "ACDT": "Australian Central Daylight Time", "SRT": "Suriname Time", "BOT": "Bolivia Time", "AEST": "Australian Eastern Standard Time", "WESZ": "Western European Summer Time", "WITA": "Central Indonesia Time", "HAT": "Newfoundland Daylight Time", "LHST": "Lord Howe Standard Time", "CLT": "Chile Standard Time", "WEZ": "Western European Standard Time", "HKT": "Hong Kong Standard Time", "OEZ": "Eastern European Standard Time"},
+ timezones: map[string]string{"MEZ": "Central European Standard Time", "BT": "Bhutan Time", "MDT": "Mountain Daylight Time", "JDT": "Japan Daylight Time", "EST": "Eastern Standard Time", "MESZ": "Central European Summer Time", "OEZ": "Eastern European Standard Time", "CAT": "Central Africa Time", "COST": "Colombia Summer Time", "ACDT": "Australian Central Daylight Time", "AKST": "Alaska Standard Time", "JST": "Japan Standard Time", "ChST": "Chamorro Standard Time", "VET": "Venezuela Time", "NZST": "New Zealand Standard Time", "SRT": "Suriname Time", "CLT": "Chile Standard Time", "CLST": "Chile Summer Time", "TMT": "Turkmenistan Standard Time", "HNT": "Newfoundland Standard Time", "WIB": "Western Indonesia Time", "CHADT": "Chatham Daylight Time", "AST": "Atlantic Standard Time", "PDT": "Pacific Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "TMST": "Turkmenistan Summer Time", "WAT": "West Africa Standard Time", "GMT": "Greenwich Mean Time", "∅∅∅": "Brasilia Summer Time", "HKT": "Hong Kong Standard Time", "ADT": "Atlantic Daylight Time", "BOT": "Bolivia Time", "HAST": "Hawaii-Aleutian Standard Time", "HAT": "Newfoundland Daylight Time", "AEDT": "Australian Eastern Daylight Time", "LHDT": "Lord Howe Daylight Time", "WART": "Western Argentina Standard Time", "ACWDT": "Australian Central Western Daylight Time", "ARST": "Argentina Summer Time", "SGT": "Singapore Standard Time", "COT": "Colombia Standard Time", "ECT": "Ecuador Time", "ART": "Argentina Standard Time", "PST": "Pacific Standard Time", "NZDT": "New Zealand Daylight Time", "WAST": "West Africa Summer Time", "AWDT": "Australian Western Daylight Time", "OESZ": "Eastern European Summer Time", "LHST": "Lord Howe Standard Time", "CST": "Central Standard Time", "CDT": "Central Daylight Time", "WARST": "Western Argentina Summer Time", "GFT": "French Guiana Time", "AKDT": "Alaska Daylight Time", "WESZ": "Western European Summer Time", "MST": "Mountain Standard Time", "WITA": "Central Indonesia Time", "IST": "India Standard Time", "WIT": "Eastern Indonesia Time", "UYST": "Uruguay Summer Time", "EDT": "Eastern Daylight Time", "GYT": "Guyana Time", "MYT": "Malaysia Time", "UYT": "Uruguay Standard Time", "ACST": "Australian Central Standard Time", "HKST": "Hong Kong Summer Time", "CHAST": "Chatham Standard Time", "AEST": "Australian Eastern Standard Time", "EAT": "East Africa Time", "ACWST": "Australian Central Western Standard Time", "AWST": "Australian Western Standard Time", "SAST": "South Africa Standard Time", "WEZ": "Western European Standard Time"},
}
}
diff --git a/en_PH/en_PH_test.go b/en_PH/en_PH_test.go
new file mode 100644
index 00000000..5e4927a4
--- /dev/null
+++ b/en_PH/en_PH_test.go
@@ -0,0 +1,1120 @@
+package en_PH
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_PH"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_PK/en_PK.go b/en_PK/en_PK.go
index 99a8fb8a..7bfc8c3a 100644
--- a/en_PK/en_PK.go
+++ b/en_PK/en_PK.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"WIB": "Western Indonesia Time", "MEZ": "Central European Standard Time", "CLT": "Chile Standard Time", "COT": "Colombia Standard Time", "COST": "Colombia Summer Time", "WART": "Western Argentina Standard Time", "ART": "Argentina Standard Time", "LHST": "Lord Howe Standard Time", "ACWST": "Australian Central Western Standard Time", "ECT": "Ecuador Time", "HKST": "Hong Kong Summer Time", "MESZ": "Central European Summer Time", "UYT": "Uruguay Standard Time", "CLST": "Chile Summer Time", "BT": "Bhutan Time", "JST": "Japan Standard Time", "GYT": "Guyana Time", "ChST": "Chamorro Standard Time", "ADT": "Atlantic Daylight Time", "∅∅∅": "Amazon Summer Time", "AEST": "Australian Eastern Standard Time", "PST": "Pacific Standard Time", "PDT": "Pacific Daylight Time", "AWDT": "Australian Western Daylight Time", "WESZ": "Western European Summer Time", "AEDT": "Australian Eastern Daylight Time", "OEZ": "Eastern European Standard Time", "EAT": "East Africa Time", "CHADT": "Chatham Daylight Time", "HKT": "Hong Kong Standard Time", "MST": "Macau Standard Time", "ACDT": "Australian Central Daylight Time", "TMST": "Turkmenistan Summer Time", "CAT": "Central Africa Time", "SAST": "South Africa Standard Time", "NZST": "New Zealand Standard Time", "GMT": "Greenwich Mean Time", "WITA": "Central Indonesia Time", "MDT": "Macau Summer Time", "MYT": "Malaysia Time", "NZDT": "New Zealand Daylight Time", "EST": "Eastern Standard Time", "SGT": "Singapore Standard Time", "WARST": "Western Argentina Summer Time", "BOT": "Bolivia Time", "UYST": "Uruguay Summer Time", "ACWDT": "Australian Central Western Daylight Time", "HAT": "Newfoundland Daylight Time", "ACST": "Australian Central Standard Time", "ARST": "Argentina Summer Time", "SRT": "Suriname Time", "CHAST": "Chatham Standard Time", "IST": "India Standard Time", "AKST": "Alaska Standard Time", "AWST": "Australian Western Standard Time", "LHDT": "Lord Howe Daylight Time", "CDT": "Central Daylight Time", "EDT": "Eastern Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "AKDT": "Alaska Daylight Time", "CST": "Central Standard Time", "AST": "Atlantic Standard Time", "WAT": "West Africa Standard Time", "WIT": "Eastern Indonesia Time", "OESZ": "Eastern European Summer Time", "HNT": "Newfoundland Standard Time", "TMT": "Turkmenistan Standard Time", "JDT": "Japan Daylight Time", "WEZ": "Western European Standard Time", "WAST": "West Africa Summer Time", "GFT": "French Guiana Time", "VET": "Venezuela Time", "HADT": "Hawaii-Aleutian Daylight Time"},
+ timezones: map[string]string{"EDT": "Eastern Daylight Time", "CAT": "Central Africa Time", "WESZ": "Western European Summer Time", "OEZ": "Eastern European Standard Time", "CDT": "Central Daylight Time", "HKST": "Hong Kong Summer Time", "WAT": "West Africa Standard Time", "CLT": "Chile Standard Time", "UYST": "Uruguay Summer Time", "AWDT": "Australian Western Daylight Time", "HNT": "Newfoundland Standard Time", "SGT": "Singapore Standard Time", "TMT": "Turkmenistan Standard Time", "TMST": "Turkmenistan Summer Time", "SRT": "Suriname Time", "CHADT": "Chatham Daylight Time", "WEZ": "Western European Standard Time", "ADT": "Atlantic Daylight Time", "WARST": "Western Argentina Summer Time", "EST": "Eastern Standard Time", "WAST": "West Africa Summer Time", "MDT": "Mountain Daylight Time", "BT": "Bhutan Time", "WART": "Western Argentina Standard Time", "NZST": "New Zealand Standard Time", "ECT": "Ecuador Time", "ARST": "Argentina Summer Time", "GMT": "Greenwich Mean Time", "MST": "Mountain Standard Time", "ACDT": "Australian Central Daylight Time", "HKT": "Hong Kong Standard Time", "AEST": "Australian Eastern Standard Time", "CLST": "Chile Summer Time", "LHDT": "Lord Howe Daylight Time", "AWST": "Australian Western Standard Time", "AKST": "Alaska Standard Time", "ACWST": "Australian Central Western Standard Time", "MESZ": "Central European Summer Time", "COST": "Colombia Summer Time", "CHAST": "Chatham Standard Time", "WITA": "Central Indonesia Time", "NZDT": "New Zealand Daylight Time", "BOT": "Bolivia Time", "GYT": "Guyana Time", "VET": "Venezuela Time", "CST": "Central Standard Time", "GFT": "French Guiana Time", "JST": "Japan Standard Time", "MEZ": "Central European Standard Time", "COT": "Colombia Standard Time", "UYT": "Uruguay Standard Time", "EAT": "East Africa Time", "AKDT": "Alaska Daylight Time", "PST": "Pacific Standard Time", "HAT": "Newfoundland Daylight Time", "ChST": "Chamorro Standard Time", "LHST": "Lord Howe Standard Time", "OESZ": "Eastern European Summer Time", "JDT": "Japan Daylight Time", "SAST": "South Africa Standard Time", "∅∅∅": "Amazon Summer Time", "AEDT": "Australian Eastern Daylight Time", "MYT": "Malaysia Time", "ACST": "Australian Central Standard Time", "ART": "Argentina Standard Time", "AST": "Atlantic Standard Time", "ACWDT": "Australian Central Western Daylight Time", "PDT": "Pacific Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "IST": "India Standard Time", "WIB": "Western Indonesia Time", "WIT": "Eastern Indonesia Time"},
}
}
diff --git a/en_PK/en_PK_test.go b/en_PK/en_PK_test.go
new file mode 100644
index 00000000..e397e1f4
--- /dev/null
+++ b/en_PK/en_PK_test.go
@@ -0,0 +1,1120 @@
+package en_PK
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_PK"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_PN/en_PN.go b/en_PN/en_PN.go
index a3b0caa6..0f2c3908 100644
--- a/en_PN/en_PN.go
+++ b/en_PN/en_PN.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"WAST": "West Africa Summer Time", "WITA": "Central Indonesia Time", "HAT": "Newfoundland Daylight Time", "GFT": "French Guiana Time", "NZDT": "New Zealand Daylight Time", "PDT": "Pacific Daylight Time", "AWDT": "Australian Western Daylight Time", "GYT": "Guyana Time", "UYST": "Uruguay Summer Time", "HAST": "Hawaii-Aleutian Standard Time", "CLT": "Chile Standard Time", "WESZ": "Western European Summer Time", "COST": "Colombia Summer Time", "WARST": "Western Argentina Summer Time", "OESZ": "Eastern European Summer Time", "ACDT": "Australian Central Daylight Time", "∅∅∅": "Amazon Summer Time", "JST": "Japan Standard Time", "MST": "Macau Standard Time", "ART": "Argentina Standard Time", "CLST": "Chile Summer Time", "WIT": "Eastern Indonesia Time", "EAT": "East Africa Time", "LHDT": "Lord Howe Daylight Time", "UYT": "Uruguay Standard Time", "AEDT": "Australian Eastern Daylight Time", "WART": "Western Argentina Standard Time", "CHAST": "Chatham Standard Time", "AEST": "Australian Eastern Standard Time", "ChST": "Chamorro Standard Time", "SAST": "South Africa Standard Time", "AWST": "Australian Western Standard Time", "WIB": "Western Indonesia Time", "GMT": "Greenwich Mean Time", "WEZ": "Western European Standard Time", "EDT": "Eastern Daylight Time", "AST": "Atlantic Standard Time", "BT": "Bhutan Time", "OEZ": "Eastern European Standard Time", "AKDT": "Alaska Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "SGT": "Singapore Standard Time", "ARST": "Argentina Summer Time", "NZST": "New Zealand Standard Time", "WAT": "West Africa Standard Time", "HKT": "Hong Kong Standard Time", "CDT": "Central Daylight Time", "MEZ": "Central European Standard Time", "HKST": "Hong Kong Summer Time", "IST": "India Standard Time", "TMST": "Turkmenistan Summer Time", "MYT": "Malaysia Time", "VET": "Venezuela Time", "EST": "Eastern Standard Time", "ECT": "Ecuador Time", "ACST": "Australian Central Standard Time", "JDT": "Japan Daylight Time", "LHST": "Lord Howe Standard Time", "BOT": "Bolivia Time", "CHADT": "Chatham Daylight Time", "COT": "Colombia Standard Time", "ACWDT": "Australian Central Western Daylight Time", "CAT": "Central Africa Time", "TMT": "Turkmenistan Standard Time", "AKST": "Alaska Standard Time", "PST": "Pacific Standard Time", "CST": "Central Standard Time", "MESZ": "Central European Summer Time", "HNT": "Newfoundland Standard Time", "MDT": "Macau Summer Time", "SRT": "Suriname Time", "ACWST": "Australian Central Western Standard Time", "ADT": "Atlantic Daylight Time"},
+ timezones: map[string]string{"NZST": "New Zealand Standard Time", "WEZ": "Western European Standard Time", "WESZ": "Western European Summer Time", "ACWDT": "Australian Central Western Daylight Time", "∅∅∅": "Amazon Summer Time", "CLT": "Chile Standard Time", "GFT": "French Guiana Time", "JST": "Japan Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "CHAST": "Chatham Standard Time", "WITA": "Central Indonesia Time", "AKST": "Alaska Standard Time", "MYT": "Malaysia Time", "UYT": "Uruguay Standard Time", "ART": "Argentina Standard Time", "ADT": "Atlantic Daylight Time", "MESZ": "Central European Summer Time", "SAST": "South Africa Standard Time", "EST": "Eastern Standard Time", "HAT": "Newfoundland Daylight Time", "AWST": "Australian Western Standard Time", "MEZ": "Central European Standard Time", "WAT": "West Africa Standard Time", "WART": "Western Argentina Standard Time", "WARST": "Western Argentina Summer Time", "ACWST": "Australian Central Western Standard Time", "NZDT": "New Zealand Daylight Time", "TMT": "Turkmenistan Standard Time", "CLST": "Chile Summer Time", "CST": "Central Standard Time", "IST": "India Standard Time", "PDT": "Pacific Daylight Time", "LHDT": "Lord Howe Daylight Time", "WIB": "Western Indonesia Time", "UYST": "Uruguay Summer Time", "ACDT": "Australian Central Daylight Time", "PST": "Pacific Standard Time", "COST": "Colombia Summer Time", "AEST": "Australian Eastern Standard Time", "HKST": "Hong Kong Summer Time", "COT": "Colombia Standard Time", "BT": "Bhutan Time", "MST": "Mountain Standard Time", "GMT": "Greenwich Mean Time", "ChST": "Chamorro Standard Time", "VET": "Venezuela Time", "CHADT": "Chatham Daylight Time", "BOT": "Bolivia Time", "WAST": "West Africa Summer Time", "GYT": "Guyana Time", "OEZ": "Eastern European Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "OESZ": "Eastern European Summer Time", "WIT": "Eastern Indonesia Time", "AST": "Atlantic Standard Time", "AEDT": "Australian Eastern Daylight Time", "JDT": "Japan Daylight Time", "AKDT": "Alaska Daylight Time", "AWDT": "Australian Western Daylight Time", "CAT": "Central Africa Time", "HNT": "Newfoundland Standard Time", "EAT": "East Africa Time", "ECT": "Ecuador Time", "HKT": "Hong Kong Standard Time", "EDT": "Eastern Daylight Time", "TMST": "Turkmenistan Summer Time", "LHST": "Lord Howe Standard Time", "CDT": "Central Daylight Time", "ARST": "Argentina Summer Time", "SGT": "Singapore Standard Time", "MDT": "Mountain Daylight Time", "ACST": "Australian Central Standard Time", "SRT": "Suriname Time"},
}
}
diff --git a/en_PN/en_PN_test.go b/en_PN/en_PN_test.go
new file mode 100644
index 00000000..72e1ed62
--- /dev/null
+++ b/en_PN/en_PN_test.go
@@ -0,0 +1,1120 @@
+package en_PN
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_PN"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_PR/en_PR.go b/en_PR/en_PR.go
index 1ed53285..f3d13dba 100644
--- a/en_PR/en_PR.go
+++ b/en_PR/en_PR.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"BT": "Bhutan Time", "TMT": "Turkmenistan Standard Time", "UYST": "Uruguay Summer Time", "SRT": "Suriname Time", "PDT": "Pacific Daylight Time", "BOT": "Bolivia Time", "AEST": "Australian Eastern Standard Time", "ACST": "Australian Central Standard Time", "ART": "Argentina Standard Time", "ARST": "Argentina Summer Time", "HAST": "Hawaii-Aleutian Standard Time", "OESZ": "Eastern European Summer Time", "VET": "Venezuela Time", "LHST": "Lord Howe Standard Time", "JDT": "Japan Daylight Time", "CHADT": "Chatham Daylight Time", "AST": "Atlantic Standard Time", "HAT": "Newfoundland Daylight Time", "WIT": "Eastern Indonesia Time", "HNT": "Newfoundland Standard Time", "MST": "Macau Standard Time", "NZST": "New Zealand Standard Time", "WEZ": "Western European Standard Time", "ACWST": "Australian Central Western Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "HKST": "Hong Kong Summer Time", "WAST": "West Africa Summer Time", "ACWDT": "Australian Central Western Daylight Time", "OEZ": "Eastern European Standard Time", "CDT": "Central Daylight Time", "CLT": "Chile Standard Time", "CLST": "Chile Summer Time", "WESZ": "Western European Summer Time", "EDT": "Eastern Daylight Time", "WAT": "West Africa Standard Time", "WIB": "Western Indonesia Time", "MYT": "Malaysia Time", "IST": "India Standard Time", "TMST": "Turkmenistan Summer Time", "EAT": "East Africa Time", "JST": "Japan Standard Time", "CAT": "Central Africa Time", "SAST": "South Africa Standard Time", "AWDT": "Australian Western Daylight Time", "WART": "Western Argentina Standard Time", "MDT": "Macau Summer Time", "LHDT": "Lord Howe Daylight Time", "AKST": "Alaska Standard Time", "AKDT": "Alaska Daylight Time", "ECT": "Ecuador Time", "∅∅∅": "Brasilia Summer Time", "ADT": "Atlantic Daylight Time", "UYT": "Uruguay Standard Time", "GMT": "Greenwich Mean Time", "NZDT": "New Zealand Daylight Time", "CHAST": "Chatham Standard Time", "EST": "Eastern Standard Time", "ACDT": "Australian Central Daylight Time", "GFT": "French Guiana Time", "WITA": "Central Indonesia Time", "CST": "Central Standard Time", "SGT": "Singapore Standard Time", "GYT": "Guyana Time", "PST": "Pacific Standard Time", "WARST": "Western Argentina Summer Time", "ChST": "Chamorro Standard Time", "COST": "Colombia Summer Time", "AWST": "Australian Western Standard Time", "AEDT": "Australian Eastern Daylight Time", "MESZ": "Central European Summer Time", "COT": "Colombia Standard Time", "HKT": "Hong Kong Standard Time", "MEZ": "Central European Standard Time"},
+ timezones: map[string]string{"ACWDT": "Australian Central Western Daylight Time", "SAST": "South Africa Standard Time", "EDT": "Eastern Daylight Time", "EAT": "East Africa Time", "CLST": "Chile Summer Time", "ART": "Argentina Standard Time", "MEZ": "Central European Standard Time", "OESZ": "Eastern European Summer Time", "ACST": "Australian Central Standard Time", "JDT": "Japan Daylight Time", "MESZ": "Central European Summer Time", "HNT": "Newfoundland Standard Time", "ARST": "Argentina Summer Time", "WEZ": "Western European Standard Time", "TMST": "Turkmenistan Summer Time", "GMT": "Greenwich Mean Time", "ChST": "Chamorro Standard Time", "MDT": "Mountain Daylight Time", "ACDT": "Australian Central Daylight Time", "AEST": "Australian Eastern Standard Time", "MST": "Mountain Standard Time", "HKST": "Hong Kong Summer Time", "CHADT": "Chatham Daylight Time", "NZDT": "New Zealand Daylight Time", "COST": "Colombia Summer Time", "LHST": "Lord Howe Standard Time", "MYT": "Malaysia Time", "UYST": "Uruguay Summer Time", "WARST": "Western Argentina Summer Time", "HKT": "Hong Kong Standard Time", "AKDT": "Alaska Daylight Time", "WAT": "West Africa Standard Time", "CLT": "Chile Standard Time", "CDT": "Central Daylight Time", "SRT": "Suriname Time", "CHAST": "Chatham Standard Time", "AKST": "Alaska Standard Time", "AWDT": "Australian Western Daylight Time", "JST": "Japan Standard Time", "PDT": "Pacific Daylight Time", "TMT": "Turkmenistan Standard Time", "LHDT": "Lord Howe Daylight Time", "UYT": "Uruguay Standard Time", "PST": "Pacific Standard Time", "AEDT": "Australian Eastern Daylight Time", "BT": "Bhutan Time", "HAST": "Hawaii-Aleutian Standard Time", "BOT": "Bolivia Time", "∅∅∅": "Amazon Summer Time", "WESZ": "Western European Summer Time", "WIB": "Western Indonesia Time", "WART": "Western Argentina Standard Time", "GFT": "French Guiana Time", "AWST": "Australian Western Standard Time", "HAT": "Newfoundland Daylight Time", "SGT": "Singapore Standard Time", "WIT": "Eastern Indonesia Time", "ACWST": "Australian Central Western Standard Time", "IST": "India Standard Time", "COT": "Colombia Standard Time", "OEZ": "Eastern European Standard Time", "GYT": "Guyana Time", "VET": "Venezuela Time", "WITA": "Central Indonesia Time", "EST": "Eastern Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "NZST": "New Zealand Standard Time", "ECT": "Ecuador Time", "AST": "Atlantic Standard Time", "CAT": "Central Africa Time", "WAST": "West Africa Summer Time", "ADT": "Atlantic Daylight Time", "CST": "Central Standard Time"},
}
}
diff --git a/en_PR/en_PR_test.go b/en_PR/en_PR_test.go
new file mode 100644
index 00000000..f0baaf4e
--- /dev/null
+++ b/en_PR/en_PR_test.go
@@ -0,0 +1,1120 @@
+package en_PR
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_PR"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_PW/en_PW.go b/en_PW/en_PW.go
index f3b541c6..97d2a440 100644
--- a/en_PW/en_PW.go
+++ b/en_PW/en_PW.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"COST": "Colombia Summer Time", "MST": "Macau Standard Time", "LHST": "Lord Howe Standard Time", "MYT": "Malaysia Time", "HADT": "Hawaii-Aleutian Daylight Time", "ART": "Argentina Standard Time", "AWDT": "Australian Western Daylight Time", "SRT": "Suriname Time", "UYT": "Uruguay Standard Time", "OESZ": "Eastern European Summer Time", "GMT": "Greenwich Mean Time", "TMT": "Turkmenistan Standard Time", "CST": "Central Standard Time", "∅∅∅": "Acre Summer Time", "WIB": "Western Indonesia Time", "AKST": "Alaska Standard Time", "BT": "Bhutan Time", "NZDT": "New Zealand Daylight Time", "CLT": "Chile Standard Time", "ADT": "Atlantic Daylight Time", "WART": "Western Argentina Standard Time", "WARST": "Western Argentina Summer Time", "ACWDT": "Australian Central Western Daylight Time", "ECT": "Ecuador Time", "HKT": "Hong Kong Standard Time", "WITA": "Central Indonesia Time", "BOT": "Bolivia Time", "WIT": "Eastern Indonesia Time", "JST": "Japan Standard Time", "NZST": "New Zealand Standard Time", "CHADT": "Chatham Daylight Time", "WAT": "West Africa Standard Time", "HNT": "Newfoundland Standard Time", "GFT": "French Guiana Time", "ACST": "Australian Central Standard Time", "AWST": "Australian Western Standard Time", "MDT": "Macau Summer Time", "LHDT": "Lord Howe Daylight Time", "CDT": "Central Daylight Time", "WEZ": "Western European Standard Time", "ACWST": "Australian Central Western Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "WAST": "West Africa Summer Time", "TMST": "Turkmenistan Summer Time", "AEST": "Australian Eastern Standard Time", "EDT": "Eastern Daylight Time", "PST": "Pacific Standard Time", "UYST": "Uruguay Summer Time", "WESZ": "Western European Summer Time", "AST": "Atlantic Standard Time", "SGT": "Singapore Standard Time", "JDT": "Japan Daylight Time", "HKST": "Hong Kong Summer Time", "IST": "India Standard Time", "ARST": "Argentina Summer Time", "CHAST": "Chatham Standard Time", "EST": "Eastern Standard Time", "OEZ": "Eastern European Standard Time", "MEZ": "Central European Standard Time", "ChST": "Chamorro Standard Time", "PDT": "Pacific Daylight Time", "CLST": "Chile Summer Time", "HAT": "Newfoundland Daylight Time", "EAT": "East Africa Time", "ACDT": "Australian Central Daylight Time", "AEDT": "Australian Eastern Daylight Time", "CAT": "Central Africa Time", "SAST": "South Africa Standard Time", "MESZ": "Central European Summer Time", "VET": "Venezuela Time", "GYT": "Guyana Time", "AKDT": "Alaska Daylight Time", "COT": "Colombia Standard Time"},
+ timezones: map[string]string{"ChST": "Chamorro Standard Time", "LHST": "Lord Howe Standard Time", "CLT": "Chile Standard Time", "CLST": "Chile Summer Time", "SAST": "South Africa Standard Time", "PDT": "Pacific Daylight Time", "WEZ": "Western European Standard Time", "MDT": "Mountain Daylight Time", "CDT": "Central Daylight Time", "AKDT": "Alaska Daylight Time", "IST": "India Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "CAT": "Central Africa Time", "WAT": "West Africa Standard Time", "AWDT": "Australian Western Daylight Time", "BOT": "Bolivia Time", "EDT": "Eastern Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "COT": "Colombia Standard Time", "WIB": "Western Indonesia Time", "AEDT": "Australian Eastern Daylight Time", "UYT": "Uruguay Standard Time", "UYST": "Uruguay Summer Time", "ACST": "Australian Central Standard Time", "CHAST": "Chatham Standard Time", "NZDT": "New Zealand Daylight Time", "GYT": "Guyana Time", "EST": "Eastern Standard Time", "GFT": "French Guiana Time", "ART": "Argentina Standard Time", "JDT": "Japan Daylight Time", "MEZ": "Central European Standard Time", "LHDT": "Lord Howe Daylight Time", "∅∅∅": "Brasilia Summer Time", "AKST": "Alaska Standard Time", "WITA": "Central Indonesia Time", "WIT": "Eastern Indonesia Time", "BT": "Bhutan Time", "VET": "Venezuela Time", "HAT": "Newfoundland Daylight Time", "WARST": "Western Argentina Summer Time", "ACWST": "Australian Central Western Standard Time", "COST": "Colombia Summer Time", "GMT": "Greenwich Mean Time", "HKT": "Hong Kong Standard Time", "CHADT": "Chatham Daylight Time", "ECT": "Ecuador Time", "NZST": "New Zealand Standard Time", "PST": "Pacific Standard Time", "MST": "Mountain Standard Time", "ACDT": "Australian Central Daylight Time", "SRT": "Suriname Time", "ADT": "Atlantic Daylight Time", "ACWDT": "Australian Central Western Daylight Time", "MESZ": "Central European Summer Time", "TMT": "Turkmenistan Standard Time", "OESZ": "Eastern European Summer Time", "CST": "Central Standard Time", "AST": "Atlantic Standard Time", "HNT": "Newfoundland Standard Time", "EAT": "East Africa Time", "WESZ": "Western European Summer Time", "OEZ": "Eastern European Standard Time", "AEST": "Australian Eastern Standard Time", "WART": "Western Argentina Standard Time", "JST": "Japan Standard Time", "SGT": "Singapore Standard Time", "MYT": "Malaysia Time", "HKST": "Hong Kong Summer Time", "AWST": "Australian Western Standard Time", "ARST": "Argentina Summer Time", "TMST": "Turkmenistan Summer Time", "WAST": "West Africa Summer Time"},
}
}
@@ -112,8 +112,8 @@ func (en *en_PW) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
func (en *en_PW) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
n := math.Abs(num)
- nMod10 := math.Mod(n, 10)
nMod100 := math.Mod(n, 100)
+ nMod10 := math.Mod(n, 10)
if nMod10 == 1 && nMod100 != 11 {
return locales.PluralRuleOne
diff --git a/en_PW/en_PW_test.go b/en_PW/en_PW_test.go
new file mode 100644
index 00000000..90a3ab06
--- /dev/null
+++ b/en_PW/en_PW_test.go
@@ -0,0 +1,1120 @@
+package en_PW
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_PW"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_RW/en_RW.go b/en_RW/en_RW.go
index c46e60a2..8f830671 100644
--- a/en_RW/en_RW.go
+++ b/en_RW/en_RW.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"BT": "Bhutan Time", "NZDT": "New Zealand Daylight Time", "ChST": "Chamorro Standard Time", "∅∅∅": "Acre Summer Time", "HNT": "Newfoundland Standard Time", "MYT": "Malaysia Time", "UYT": "Uruguay Standard Time", "COT": "Colombia Standard Time", "SAST": "South Africa Standard Time", "OEZ": "Eastern European Standard Time", "EAT": "East Africa Time", "CDT": "Central Daylight Time", "EDT": "Eastern Daylight Time", "SGT": "Singapore Standard Time", "AST": "Atlantic Standard Time", "LHDT": "Lord Howe Daylight Time", "AKST": "Alaska Standard Time", "AEST": "Australian Eastern Standard Time", "ACWST": "Australian Central Western Standard Time", "ACST": "Australian Central Standard Time", "AWDT": "Australian Western Daylight Time", "JDT": "Japan Daylight Time", "SRT": "Suriname Time", "CST": "Central Standard Time", "CLST": "Chile Summer Time", "VET": "Venezuela Time", "WAST": "West Africa Summer Time", "LHST": "Lord Howe Standard Time", "JST": "Japan Standard Time", "PDT": "Pacific Daylight Time", "OESZ": "Eastern European Summer Time", "TMT": "Turkmenistan Standard Time", "HKT": "Hong Kong Standard Time", "HAT": "Newfoundland Daylight Time", "COST": "Colombia Summer Time", "EST": "Eastern Standard Time", "WAT": "West Africa Standard Time", "WIB": "Western Indonesia Time", "AKDT": "Alaska Daylight Time", "MEZ": "Central European Standard Time", "UYST": "Uruguay Summer Time", "AEDT": "Australian Eastern Daylight Time", "GMT": "Greenwich Mean Time", "TMST": "Turkmenistan Summer Time", "PST": "Pacific Standard Time", "NZST": "New Zealand Standard Time", "BOT": "Bolivia Time", "CHADT": "Chatham Daylight Time", "ADT": "Atlantic Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "WARST": "Western Argentina Summer Time", "ACDT": "Australian Central Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "WART": "Western Argentina Standard Time", "ACWDT": "Australian Central Western Daylight Time", "WESZ": "Western European Summer Time", "WIT": "Eastern Indonesia Time", "GYT": "Guyana Time", "MESZ": "Central European Summer Time", "CLT": "Chile Standard Time", "WITA": "Central Indonesia Time", "ARST": "Argentina Summer Time", "MST": "Macau Standard Time", "CAT": "Central Africa Time", "WEZ": "Western European Standard Time", "GFT": "French Guiana Time", "IST": "India Standard Time", "ART": "Argentina Standard Time", "AWST": "Australian Western Standard Time", "HKST": "Hong Kong Summer Time", "MDT": "Macau Summer Time", "CHAST": "Chatham Standard Time", "ECT": "Ecuador Time"},
+ timezones: map[string]string{"HAT": "Newfoundland Daylight Time", "ChST": "Chamorro Standard Time", "ARST": "Argentina Summer Time", "TMST": "Turkmenistan Summer Time", "OEZ": "Eastern European Standard Time", "GFT": "French Guiana Time", "MST": "Macau Standard Time", "WITA": "Central Indonesia Time", "NZDT": "New Zealand Daylight Time", "PST": "Pacific Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "HNT": "Newfoundland Standard Time", "MYT": "Malaysia Time", "CST": "Central Standard Time", "∅∅∅": "Azores Summer Time", "CHAST": "Chatham Standard Time", "VET": "Venezuela Time", "AWDT": "Australian Western Daylight Time", "PDT": "Pacific Daylight Time", "WAT": "West Africa Standard Time", "AEST": "Australian Eastern Standard Time", "CDT": "Central Daylight Time", "JST": "Japan Standard Time", "ACWST": "Australian Central Western Standard Time", "ART": "Argentina Standard Time", "BOT": "Bolivia Time", "SAST": "South Africa Standard Time", "AEDT": "Australian Eastern Daylight Time", "MDT": "Macau Summer Time", "CHADT": "Chatham Daylight Time", "JDT": "Japan Daylight Time", "EST": "Eastern Standard Time", "MESZ": "Central European Summer Time", "UYST": "Uruguay Summer Time", "CLST": "Chile Summer Time", "WARST": "Western Argentina Summer Time", "AKST": "Alaska Standard Time", "AKDT": "Alaska Daylight Time", "TMT": "Turkmenistan Standard Time", "COT": "Colombia Standard Time", "OESZ": "Eastern European Summer Time", "BT": "Bhutan Time", "ACDT": "Australian Central Daylight Time", "SGT": "Singapore Standard Time", "WART": "Western Argentina Standard Time", "ECT": "Ecuador Time", "ACWDT": "Australian Central Western Daylight Time", "HKST": "Hong Kong Summer Time", "AST": "Atlantic Standard Time", "IST": "India Standard Time", "WAST": "West Africa Summer Time", "COST": "Colombia Summer Time", "GMT": "Greenwich Mean Time", "WIB": "Western Indonesia Time", "LHST": "Lord Howe Standard Time", "ACST": "Australian Central Standard Time", "HKT": "Hong Kong Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "WESZ": "Western European Summer Time", "GYT": "Guyana Time", "LHDT": "Lord Howe Daylight Time", "CLT": "Chile Standard Time", "ADT": "Atlantic Daylight Time", "NZST": "New Zealand Standard Time", "UYT": "Uruguay Standard Time", "WIT": "Eastern Indonesia Time", "EAT": "East Africa Time", "SRT": "Suriname Time", "AWST": "Australian Western Standard Time", "EDT": "Eastern Daylight Time", "MEZ": "Central European Standard Time", "CAT": "Central Africa Time", "WEZ": "Western European Standard Time"},
}
}
@@ -112,8 +112,8 @@ func (en *en_RW) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
func (en *en_RW) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
n := math.Abs(num)
- nMod100 := math.Mod(n, 100)
nMod10 := math.Mod(n, 10)
+ nMod100 := math.Mod(n, 100)
if nMod10 == 1 && nMod100 != 11 {
return locales.PluralRuleOne
diff --git a/en_RW/en_RW_test.go b/en_RW/en_RW_test.go
new file mode 100644
index 00000000..7698296c
--- /dev/null
+++ b/en_RW/en_RW_test.go
@@ -0,0 +1,1120 @@
+package en_RW
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_RW"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_SB/en_SB.go b/en_SB/en_SB.go
index 4d94721f..828a0794 100644
--- a/en_SB/en_SB.go
+++ b/en_SB/en_SB.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"ACWST": "Australian Central Western Standard Time", "AEST": "Australian Eastern Standard Time", "ART": "Argentina Standard Time", "MYT": "Malaysia Time", "BOT": "Bolivia Time", "ChST": "Chamorro Standard Time", "OEZ": "Eastern European Standard Time", "WESZ": "Western European Summer Time", "MST": "Macau Standard Time", "CDT": "Central Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "IST": "India Standard Time", "TMT": "Turkmenistan Standard Time", "WEZ": "Western European Standard Time", "WITA": "Central Indonesia Time", "AWST": "Australian Western Standard Time", "NZDT": "New Zealand Daylight Time", "ACWDT": "Australian Central Western Daylight Time", "WIB": "Western Indonesia Time", "ACST": "Australian Central Standard Time", "CHAST": "Chatham Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "SAST": "South Africa Standard Time", "WAST": "West Africa Summer Time", "HKT": "Hong Kong Standard Time", "WARST": "Western Argentina Summer Time", "ARST": "Argentina Summer Time", "PDT": "Pacific Daylight Time", "LHDT": "Lord Howe Daylight Time", "MEZ": "Central European Standard Time", "EDT": "Eastern Daylight Time", "WAT": "West Africa Standard Time", "TMST": "Turkmenistan Summer Time", "JST": "Japan Standard Time", "VET": "Venezuela Time", "COST": "Colombia Summer Time", "SGT": "Singapore Standard Time", "BT": "Bhutan Time", "PST": "Pacific Standard Time", "NZST": "New Zealand Standard Time", "WART": "Western Argentina Standard Time", "WIT": "Eastern Indonesia Time", "LHST": "Lord Howe Standard Time", "JDT": "Japan Daylight Time", "AKST": "Alaska Standard Time", "UYT": "Uruguay Standard Time", "CAT": "Central Africa Time", "AST": "Atlantic Standard Time", "HNT": "Newfoundland Standard Time", "EAT": "East Africa Time", "AKDT": "Alaska Daylight Time", "MESZ": "Central European Summer Time", "CST": "Central Standard Time", "EST": "Eastern Standard Time", "OESZ": "Eastern European Summer Time", "MDT": "Macau Summer Time", "ACDT": "Australian Central Daylight Time", "AWDT": "Australian Western Daylight Time", "UYST": "Uruguay Summer Time", "CLST": "Chile Summer Time", "ADT": "Atlantic Daylight Time", "HAT": "Newfoundland Daylight Time", "GFT": "French Guiana Time", "SRT": "Suriname Time", "AEDT": "Australian Eastern Daylight Time", "ECT": "Ecuador Time", "HKST": "Hong Kong Summer Time", "∅∅∅": "Amazon Summer Time", "GYT": "Guyana Time", "CHADT": "Chatham Daylight Time", "CLT": "Chile Standard Time", "COT": "Colombia Standard Time", "GMT": "Greenwich Mean Time"},
+ timezones: map[string]string{"LHDT": "Lord Howe Daylight Time", "UYST": "Uruguay Summer Time", "ACWDT": "Australian Central Western Daylight Time", "OEZ": "Eastern European Standard Time", "CHAST": "Chatham Standard Time", "IST": "India Standard Time", "HNT": "Newfoundland Standard Time", "HKST": "Hong Kong Summer Time", "ADT": "Atlantic Daylight Time", "NZST": "New Zealand Standard Time", "GFT": "French Guiana Time", "AWST": "Australian Western Standard Time", "AWDT": "Australian Western Daylight Time", "JST": "Japan Standard Time", "∅∅∅": "Amazon Summer Time", "GYT": "Guyana Time", "BT": "Bhutan Time", "ACST": "Australian Central Standard Time", "WEZ": "Western European Standard Time", "MST": "Mountain Standard Time", "LHST": "Lord Howe Standard Time", "MYT": "Malaysia Time", "CHADT": "Chatham Daylight Time", "ECT": "Ecuador Time", "WITA": "Central Indonesia Time", "COST": "Colombia Summer Time", "SGT": "Singapore Standard Time", "CAT": "Central Africa Time", "WART": "Western Argentina Standard Time", "MESZ": "Central European Summer Time", "WAST": "West Africa Summer Time", "GMT": "Greenwich Mean Time", "AEST": "Australian Eastern Standard Time", "MDT": "Mountain Daylight Time", "WIT": "Eastern Indonesia Time", "VET": "Venezuela Time", "SAST": "South Africa Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "HAT": "Newfoundland Daylight Time", "WIB": "Western Indonesia Time", "SRT": "Suriname Time", "HAST": "Hawaii-Aleutian Standard Time", "BOT": "Bolivia Time", "TMT": "Turkmenistan Standard Time", "ChST": "Chamorro Standard Time", "OESZ": "Eastern European Summer Time", "EAT": "East Africa Time", "CST": "Central Standard Time", "ARST": "Argentina Summer Time", "PDT": "Pacific Daylight Time", "JDT": "Japan Daylight Time", "WESZ": "Western European Summer Time", "AST": "Atlantic Standard Time", "ACWST": "Australian Central Western Standard Time", "EST": "Eastern Standard Time", "COT": "Colombia Standard Time", "CDT": "Central Daylight Time", "ART": "Argentina Standard Time", "AKST": "Alaska Standard Time", "NZDT": "New Zealand Daylight Time", "CLST": "Chile Summer Time", "MEZ": "Central European Standard Time", "WAT": "West Africa Standard Time", "TMST": "Turkmenistan Summer Time", "CLT": "Chile Standard Time", "UYT": "Uruguay Standard Time", "ACDT": "Australian Central Daylight Time", "HKT": "Hong Kong Standard Time", "AKDT": "Alaska Daylight Time", "EDT": "Eastern Daylight Time", "AEDT": "Australian Eastern Daylight Time", "WARST": "Western Argentina Summer Time", "PST": "Pacific Standard Time"},
}
}
diff --git a/en_SB/en_SB_test.go b/en_SB/en_SB_test.go
new file mode 100644
index 00000000..b799bcdf
--- /dev/null
+++ b/en_SB/en_SB_test.go
@@ -0,0 +1,1120 @@
+package en_SB
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_SB"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_SC/en_SC.go b/en_SC/en_SC.go
index c142f2bd..5d4ce5d4 100644
--- a/en_SC/en_SC.go
+++ b/en_SC/en_SC.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"NZDT": "New Zealand Daylight Time", "WARST": "Western Argentina Summer Time", "GMT": "Greenwich Mean Time", "ART": "Argentina Standard Time", "AWDT": "Australian Western Daylight Time", "CDT": "Central Daylight Time", "AEST": "Australian Eastern Standard Time", "∅∅∅": "Brasilia Summer Time", "BT": "Bhutan Time", "WAST": "West Africa Summer Time", "TMT": "Turkmenistan Standard Time", "WAT": "West Africa Standard Time", "OESZ": "Eastern European Summer Time", "ACDT": "Australian Central Daylight Time", "MDT": "Macau Summer Time", "ChST": "Chamorro Standard Time", "WESZ": "Western European Summer Time", "ACWDT": "Australian Central Western Daylight Time", "CAT": "Central Africa Time", "ADT": "Atlantic Daylight Time", "WEZ": "Western European Standard Time", "HAT": "Newfoundland Daylight Time", "ACST": "Australian Central Standard Time", "UYST": "Uruguay Summer Time", "CLT": "Chile Standard Time", "WITA": "Central Indonesia Time", "LHST": "Lord Howe Standard Time", "GYT": "Guyana Time", "NZST": "New Zealand Standard Time", "BOT": "Bolivia Time", "AEDT": "Australian Eastern Daylight Time", "HKST": "Hong Kong Summer Time", "PST": "Pacific Standard Time", "UYT": "Uruguay Standard Time", "WIB": "Western Indonesia Time", "EAT": "East Africa Time", "MEZ": "Central European Standard Time", "ACWST": "Australian Central Western Standard Time", "EST": "Eastern Standard Time", "AST": "Atlantic Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "CHADT": "Chatham Daylight Time", "SAST": "South Africa Standard Time", "OEZ": "Eastern European Standard Time", "CHAST": "Chatham Standard Time", "VET": "Venezuela Time", "COST": "Colombia Summer Time", "ECT": "Ecuador Time", "HNT": "Newfoundland Standard Time", "WIT": "Eastern Indonesia Time", "CLST": "Chile Summer Time", "COT": "Colombia Standard Time", "SGT": "Singapore Standard Time", "WART": "Western Argentina Standard Time", "AWST": "Australian Western Standard Time", "MYT": "Malaysia Time", "SRT": "Suriname Time", "AKDT": "Alaska Daylight Time", "PDT": "Pacific Daylight Time", "EDT": "Eastern Daylight Time", "HKT": "Hong Kong Standard Time", "IST": "India Standard Time", "LHDT": "Lord Howe Daylight Time", "MESZ": "Central European Summer Time", "MST": "Macau Standard Time", "JST": "Japan Standard Time", "JDT": "Japan Daylight Time", "AKST": "Alaska Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "GFT": "French Guiana Time", "ARST": "Argentina Summer Time", "TMST": "Turkmenistan Summer Time", "CST": "Central Standard Time"},
+ timezones: map[string]string{"AKST": "Alaska Standard Time", "EDT": "Eastern Daylight Time", "∅∅∅": "Amazon Summer Time", "TMT": "Turkmenistan Standard Time", "WEZ": "Western European Standard Time", "CDT": "Central Daylight Time", "ACDT": "Australian Central Daylight Time", "AWST": "Australian Western Standard Time", "EST": "Eastern Standard Time", "LHDT": "Lord Howe Daylight Time", "CLST": "Chile Summer Time", "HADT": "Hawaii-Aleutian Daylight Time", "AEDT": "Australian Eastern Daylight Time", "SAST": "South Africa Standard Time", "PDT": "Pacific Daylight Time", "MESZ": "Central European Summer Time", "TMST": "Turkmenistan Summer Time", "ChST": "Chamorro Standard Time", "LHST": "Lord Howe Standard Time", "ACST": "Australian Central Standard Time", "SRT": "Suriname Time", "ECT": "Ecuador Time", "HAT": "Newfoundland Daylight Time", "UYT": "Uruguay Standard Time", "BT": "Bhutan Time", "GFT": "French Guiana Time", "BOT": "Bolivia Time", "OEZ": "Eastern European Standard Time", "GMT": "Greenwich Mean Time", "ADT": "Atlantic Daylight Time", "OESZ": "Eastern European Summer Time", "JST": "Japan Standard Time", "AST": "Atlantic Standard Time", "UYST": "Uruguay Summer Time", "WART": "Western Argentina Standard Time", "ACWST": "Australian Central Western Standard Time", "PST": "Pacific Standard Time", "WAST": "West Africa Summer Time", "COST": "Colombia Summer Time", "MST": "Mountain Standard Time", "HKT": "Hong Kong Standard Time", "HKST": "Hong Kong Summer Time", "JDT": "Japan Daylight Time", "AKDT": "Alaska Daylight Time", "WITA": "Central Indonesia Time", "MYT": "Malaysia Time", "VET": "Venezuela Time", "AWDT": "Australian Western Daylight Time", "ARST": "Argentina Summer Time", "IST": "India Standard Time", "MEZ": "Central European Standard Time", "WIB": "Western Indonesia Time", "WAT": "West Africa Standard Time", "SGT": "Singapore Standard Time", "AEST": "Australian Eastern Standard Time", "EAT": "East Africa Time", "MDT": "Mountain Daylight Time", "CST": "Central Standard Time", "ACWDT": "Australian Central Western Daylight Time", "ART": "Argentina Standard Time", "NZDT": "New Zealand Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "CAT": "Central Africa Time", "WESZ": "Western European Summer Time", "GYT": "Guyana Time", "WARST": "Western Argentina Summer Time", "HNT": "Newfoundland Standard Time", "CHAST": "Chatham Standard Time", "NZST": "New Zealand Standard Time", "COT": "Colombia Standard Time", "WIT": "Eastern Indonesia Time", "CLT": "Chile Standard Time", "CHADT": "Chatham Daylight Time"},
}
}
@@ -112,8 +112,8 @@ func (en *en_SC) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
func (en *en_SC) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
n := math.Abs(num)
- nMod100 := math.Mod(n, 100)
nMod10 := math.Mod(n, 10)
+ nMod100 := math.Mod(n, 100)
if nMod10 == 1 && nMod100 != 11 {
return locales.PluralRuleOne
diff --git a/en_SC/en_SC_test.go b/en_SC/en_SC_test.go
new file mode 100644
index 00000000..f7db7e1f
--- /dev/null
+++ b/en_SC/en_SC_test.go
@@ -0,0 +1,1120 @@
+package en_SC
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_SC"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_SD/en_SD.go b/en_SD/en_SD.go
index 403ebb58..acf0634c 100644
--- a/en_SD/en_SD.go
+++ b/en_SD/en_SD.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"WAST": "West Africa Summer Time", "ACDT": "Australian Central Daylight Time", "SRT": "Suriname Time", "UYT": "Uruguay Standard Time", "VET": "Venezuela Time", "CAT": "Central Africa Time", "SGT": "Singapore Standard Time", "SAST": "South Africa Standard Time", "WESZ": "Western European Summer Time", "AEST": "Australian Eastern Standard Time", "HNT": "Newfoundland Standard Time", "ACWST": "Australian Central Western Standard Time", "WIT": "Eastern Indonesia Time", "ART": "Argentina Standard Time", "JST": "Japan Standard Time", "NZDT": "New Zealand Daylight Time", "ACWDT": "Australian Central Western Daylight Time", "CLST": "Chile Summer Time", "GMT": "Greenwich Mean Time", "AKST": "Alaska Standard Time", "MESZ": "Central European Summer Time", "HKT": "Hong Kong Standard Time", "HKST": "Hong Kong Summer Time", "WITA": "Central Indonesia Time", "ARST": "Argentina Summer Time", "ADT": "Atlantic Daylight Time", "WAT": "West Africa Standard Time", "HAT": "Newfoundland Daylight Time", "PDT": "Pacific Daylight Time", "COST": "Colombia Summer Time", "ECT": "Ecuador Time", "WART": "Western Argentina Standard Time", "GYT": "Guyana Time", "NZST": "New Zealand Standard Time", "WEZ": "Western European Standard Time", "CLT": "Chile Standard Time", "ACST": "Australian Central Standard Time", "PST": "Pacific Standard Time", "MYT": "Malaysia Time", "HAST": "Hawaii-Aleutian Standard Time", "BT": "Bhutan Time", "∅∅∅": "Amazon Summer Time", "UYST": "Uruguay Summer Time", "WARST": "Western Argentina Summer Time", "OESZ": "Eastern European Summer Time", "AWST": "Australian Western Standard Time", "AWDT": "Australian Western Daylight Time", "JDT": "Japan Daylight Time", "AEDT": "Australian Eastern Daylight Time", "OEZ": "Eastern European Standard Time", "EAT": "East Africa Time", "TMT": "Turkmenistan Standard Time", "AKDT": "Alaska Daylight Time", "LHDT": "Lord Howe Daylight Time", "MEZ": "Central European Standard Time", "EST": "Eastern Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "MDT": "Macau Summer Time", "CHADT": "Chatham Daylight Time", "AST": "Atlantic Standard Time", "GFT": "French Guiana Time", "MST": "Macau Standard Time", "TMST": "Turkmenistan Summer Time", "LHST": "Lord Howe Standard Time", "CHAST": "Chatham Standard Time", "CST": "Central Standard Time", "CDT": "Central Daylight Time", "BOT": "Bolivia Time", "COT": "Colombia Standard Time", "IST": "India Standard Time", "ChST": "Chamorro Standard Time", "EDT": "Eastern Daylight Time", "WIB": "Western Indonesia Time"},
+ timezones: map[string]string{"WESZ": "Western European Summer Time", "WIB": "Western Indonesia Time", "CLT": "Chile Standard Time", "VET": "Venezuela Time", "ART": "Argentina Standard Time", "WITA": "Central Indonesia Time", "SAST": "South Africa Standard Time", "PST": "Pacific Standard Time", "NZDT": "New Zealand Daylight Time", "WEZ": "Western European Standard Time", "AWST": "Australian Western Standard Time", "COT": "Colombia Standard Time", "WIT": "Eastern Indonesia Time", "CST": "Central Standard Time", "CHAST": "Chatham Standard Time", "∅∅∅": "Amazon Summer Time", "HNT": "Newfoundland Standard Time", "AEDT": "Australian Eastern Daylight Time", "MST": "Mountain Standard Time", "OESZ": "Eastern European Summer Time", "GYT": "Guyana Time", "UYT": "Uruguay Standard Time", "MESZ": "Central European Summer Time", "NZST": "New Zealand Standard Time", "TMT": "Turkmenistan Standard Time", "EAT": "East Africa Time", "LHDT": "Lord Howe Daylight Time", "CLST": "Chile Summer Time", "WART": "Western Argentina Standard Time", "GFT": "French Guiana Time", "HKT": "Hong Kong Standard Time", "HKST": "Hong Kong Summer Time", "AKST": "Alaska Standard Time", "ACWDT": "Australian Central Western Daylight Time", "ARST": "Argentina Summer Time", "HAT": "Newfoundland Daylight Time", "TMST": "Turkmenistan Summer Time", "OEZ": "Eastern European Standard Time", "ACST": "Australian Central Standard Time", "EDT": "Eastern Daylight Time", "COST": "Colombia Summer Time", "ACDT": "Australian Central Daylight Time", "CHADT": "Chatham Daylight Time", "CAT": "Central Africa Time", "WAT": "West Africa Standard Time", "GMT": "Greenwich Mean Time", "WARST": "Western Argentina Summer Time", "ECT": "Ecuador Time", "BOT": "Bolivia Time", "BT": "Bhutan Time", "AST": "Atlantic Standard Time", "EST": "Eastern Standard Time", "MDT": "Mountain Daylight Time", "ACWST": "Australian Central Western Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "LHST": "Lord Howe Standard Time", "UYST": "Uruguay Summer Time", "IST": "India Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "AEST": "Australian Eastern Standard Time", "MYT": "Malaysia Time", "ADT": "Atlantic Daylight Time", "WAST": "West Africa Summer Time", "ChST": "Chamorro Standard Time", "AWDT": "Australian Western Daylight Time", "PDT": "Pacific Daylight Time", "MEZ": "Central European Standard Time", "SGT": "Singapore Standard Time", "CDT": "Central Daylight Time", "SRT": "Suriname Time", "AKDT": "Alaska Daylight Time", "JST": "Japan Standard Time", "JDT": "Japan Daylight Time"},
}
}
diff --git a/en_SD/en_SD_test.go b/en_SD/en_SD_test.go
new file mode 100644
index 00000000..a420973b
--- /dev/null
+++ b/en_SD/en_SD_test.go
@@ -0,0 +1,1120 @@
+package en_SD
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_SD"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_SE/en_SE.go b/en_SE/en_SE.go
index 75e7b685..613895aa 100644
--- a/en_SE/en_SE.go
+++ b/en_SE/en_SE.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"ACST": "Australian Central Standard Time", "CAT": "Central Africa Time", "HADT": "Hawaii-Aleutian Daylight Time", "WAT": "West Africa Standard Time", "ACDT": "Australian Central Daylight Time", "LHDT": "Lord Howe Daylight Time", "SAST": "South Africa Standard Time", "WAST": "West Africa Summer Time", "WITA": "Central Indonesia Time", "AKDT": "Alaska Daylight Time", "MYT": "Malaysia Time", "CDT": "Central Daylight Time", "AEST": "Australian Eastern Standard Time", "ChST": "Chamorro Standard Time", "EDT": "Eastern Daylight Time", "IST": "India Standard Time", "CHAST": "Chatham Standard Time", "ECT": "Ecuador Time", "GFT": "French Guiana Time", "AKST": "Alaska Standard Time", "MEZ": "Central European Standard Time", "ACWDT": "Australian Central Western Daylight Time", "AEDT": "Australian Eastern Daylight Time", "EST": "Eastern Standard Time", "ADT": "Atlantic Daylight Time", "ARST": "Argentina Summer Time", "PST": "Pacific Standard Time", "ACWST": "Australian Central Western Standard Time", "WART": "Western Argentina Standard Time", "WIT": "Eastern Indonesia Time", "PDT": "Pacific Daylight Time", "AST": "Atlantic Standard Time", "HAT": "Newfoundland Daylight Time", "SRT": "Suriname Time", "AWST": "Australian Western Standard Time", "WARST": "Western Argentina Summer Time", "GMT": "Greenwich Mean Time", "WIB": "Western Indonesia Time", "JST": "Japan Standard Time", "NZST": "New Zealand Standard Time", "BOT": "Bolivia Time", "VET": "Venezuela Time", "WEZ": "Western European Standard Time", "MDT": "Mountain Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "OEZ": "Eastern European Standard Time", "OESZ": "Eastern European Summer Time", "MST": "Mountain Standard Time", "COST": "Colombia Summer Time", "SGT": "Singapore Standard Time", "WESZ": "Western European Summer Time", "JDT": "Japan Daylight Time", "AWDT": "Australian Western Daylight Time", "LHST": "Lord Howe Standard Time", "GYT": "Guyana Time", "CST": "Central Standard Time", "NZDT": "New Zealand Daylight Time", "CLST": "Chile Summer Time", "COT": "Colombia Standard Time", "HNT": "Newfoundland Standard Time", "ART": "Argentina Standard Time", "CHADT": "Chatham Daylight Time", "HKST": "Hong Kong Summer Time", "∅∅∅": "Azores Summer Time", "UYST": "Uruguay Summer Time", "BT": "Bhutan Time", "HKT": "Hong Kong Standard Time", "TMT": "Turkmenistan Standard Time", "MESZ": "Central European Summer Time", "UYT": "Uruguay Standard Time", "CLT": "Chile Standard Time", "EAT": "East Africa Time", "TMST": "Turkmenistan Summer Time"},
+ timezones: map[string]string{"ACWDT": "Australian Central Western Daylight Time", "OEZ": "Eastern European Standard Time", "CLT": "Chile Standard Time", "AWDT": "Australian Western Daylight Time", "ARST": "Argentina Summer Time", "MESZ": "Central European Summer Time", "WESZ": "Western European Summer Time", "HAT": "Newfoundland Daylight Time", "COT": "Colombia Standard Time", "WITA": "Central Indonesia Time", "JST": "Japan Standard Time", "EST": "Eastern Standard Time", "BOT": "Bolivia Time", "CHADT": "Chatham Daylight Time", "WIB": "Western Indonesia Time", "ChST": "Chamorro Standard Time", "UYST": "Uruguay Summer Time", "WART": "Western Argentina Standard Time", "MST": "Macau Standard Time", "ADT": "Atlantic Daylight Time", "SAST": "South Africa Standard Time", "GYT": "Guyana Time", "LHDT": "Lord Howe Daylight Time", "CST": "Central Standard Time", "CHAST": "Chatham Standard Time", "AKDT": "Alaska Daylight Time", "AWST": "Australian Western Standard Time", "AEST": "Australian Eastern Standard Time", "CLST": "Chile Summer Time", "CDT": "Central Daylight Time", "WARST": "Western Argentina Summer Time", "GFT": "French Guiana Time", "TMT": "Turkmenistan Standard Time", "GMT": "Greenwich Mean Time", "BT": "Bhutan Time", "LHST": "Lord Howe Standard Time", "HKST": "Hong Kong Summer Time", "AKST": "Alaska Standard Time", "CAT": "Central Africa Time", "ACST": "Australian Central Standard Time", "∅∅∅": "Azores Summer Time", "AST": "Atlantic Standard Time", "ART": "Argentina Standard Time", "TMST": "Turkmenistan Summer Time", "WIT": "Eastern Indonesia Time", "PST": "Pacific Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "MYT": "Malaysia Time", "JDT": "Japan Daylight Time", "NZDT": "New Zealand Daylight Time", "WEZ": "Western European Standard Time", "HNT": "Newfoundland Standard Time", "UYT": "Uruguay Standard Time", "MDT": "Macau Summer Time", "VET": "Venezuela Time", "PDT": "Pacific Daylight Time", "MEZ": "Central European Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "NZST": "New Zealand Standard Time", "SGT": "Singapore Standard Time", "WAT": "West Africa Standard Time", "WAST": "West Africa Summer Time", "COST": "Colombia Summer Time", "EAT": "East Africa Time", "HKT": "Hong Kong Standard Time", "ACWST": "Australian Central Western Standard Time", "ACDT": "Australian Central Daylight Time", "SRT": "Suriname Time", "ECT": "Ecuador Time", "IST": "India Standard Time", "EDT": "Eastern Daylight Time", "OESZ": "Eastern European Summer Time", "AEDT": "Australian Eastern Daylight Time"},
}
}
diff --git a/en_SE/en_SE_test.go b/en_SE/en_SE_test.go
new file mode 100644
index 00000000..8aedecdf
--- /dev/null
+++ b/en_SE/en_SE_test.go
@@ -0,0 +1,1120 @@
+package en_SE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_SE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_SG/en_SG.go b/en_SG/en_SG.go
index bf0bddc6..a50d3fa8 100644
--- a/en_SG/en_SG.go
+++ b/en_SG/en_SG.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"MST": "Mountain Standard Time", "WIT": "Eastern Indonesia Time", "CHADT": "Chatham Daylight Time", "ACWST": "Australian Central Western Standard Time", "AKST": "Alaska Standard Time", "NZST": "New Zealand Standard Time", "AST": "Atlantic Standard Time", "GFT": "French Guiana Time", "AWST": "Australian Western Standard Time", "SRT": "Suriname Time", "IST": "India Standard Time", "WART": "Western Argentina Standard Time", "WAT": "West Africa Standard Time", "HAT": "Newfoundland Daylight Time", "ART": "Argentina Standard Time", "AKDT": "Alaska Daylight Time", "PDT": "Pacific Daylight Time", "UYT": "Uruguay Standard Time", "BT": "Bhutan Time", "AEST": "Australian Eastern Standard Time", "COST": "Colombia Summer Time", "WITA": "Central Indonesia Time", "TMT": "Turkmenistan Standard Time", "GYT": "Guyana Time", "CLST": "Chile Summer Time", "NZDT": "New Zealand Daylight Time", "ChST": "Chamorro Standard Time", "WESZ": "Western European Summer Time", "EDT": "Eastern Daylight Time", "OEZ": "Eastern European Standard Time", "OESZ": "Eastern European Summer Time", "LHDT": "Lord Howe Daylight Time", "JDT": "Japan Daylight Time", "PST": "Pacific Standard Time", "BOT": "Bolivia Time", "UYST": "Uruguay Summer Time", "CDT": "Central Daylight Time", "MEZ": "Central European Standard Time", "GMT": "Greenwich Mean Time", "MYT": "Malaysia Time", "JST": "Japan Standard Time", "SGT": "Singapore Standard Time", "ARST": "Argentina Summer Time", "MDT": "Mountain Daylight Time", "ACWDT": "Australian Central Western Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "ACST": "Australian Central Standard Time", "ACDT": "Australian Central Daylight Time", "CST": "Central Standard Time", "WEZ": "Western European Standard Time", "EST": "Eastern Standard Time", "SAST": "South Africa Standard Time", "WIB": "Western Indonesia Time", "EAT": "East Africa Time", "LHST": "Lord Howe Standard Time", "MESZ": "Central European Summer Time", "CAT": "Central Africa Time", "ADT": "Atlantic Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "WAST": "West Africa Summer Time", "TMST": "Turkmenistan Summer Time", "CLT": "Chile Standard Time", "ECT": "Ecuador Time", "HKT": "Hong Kong Standard Time", "HKST": "Hong Kong Summer Time", "AEDT": "Australian Eastern Daylight Time", "CHAST": "Chatham Standard Time", "VET": "Venezuela Time", "COT": "Colombia Standard Time", "WARST": "Western Argentina Summer Time", "HNT": "Newfoundland Standard Time", "AWDT": "Australian Western Daylight Time", "∅∅∅": "Azores Summer Time"},
+ timezones: map[string]string{"MYT": "Malaysia Time", "OEZ": "Eastern European Standard Time", "COST": "Colombia Summer Time", "CLT": "Chile Standard Time", "ACST": "Australian Central Standard Time", "HKST": "Hong Kong Summer Time", "WITA": "Central Indonesia Time", "PST": "Pacific Standard Time", "COT": "Colombia Standard Time", "WIB": "Western Indonesia Time", "TMST": "Turkmenistan Summer Time", "∅∅∅": "Brasilia Summer Time", "CST": "Central Standard Time", "AWST": "Australian Western Standard Time", "HNT": "Newfoundland Standard Time", "GMT": "Greenwich Mean Time", "MST": "Mountain Standard Time", "UYT": "Uruguay Standard Time", "SRT": "Suriname Time", "ECT": "Ecuador Time", "ART": "Argentina Standard Time", "WARST": "Western Argentina Summer Time", "NZST": "New Zealand Standard Time", "IST": "India Standard Time", "CAT": "Central Africa Time", "CDT": "Central Daylight Time", "ACWST": "Australian Central Western Standard Time", "EDT": "Eastern Daylight Time", "NZDT": "New Zealand Daylight Time", "SAST": "South Africa Standard Time", "AEDT": "Australian Eastern Daylight Time", "HKT": "Hong Kong Standard Time", "AKST": "Alaska Standard Time", "PDT": "Pacific Daylight Time", "MEZ": "Central European Standard Time", "MESZ": "Central European Summer Time", "TMT": "Turkmenistan Standard Time", "GYT": "Guyana Time", "SGT": "Singapore Standard Time", "BT": "Bhutan Time", "LHST": "Lord Howe Standard Time", "CHADT": "Chatham Daylight Time", "AKDT": "Alaska Daylight Time", "BOT": "Bolivia Time", "LHDT": "Lord Howe Daylight Time", "GFT": "French Guiana Time", "JST": "Japan Standard Time", "WAT": "West Africa Standard Time", "HAT": "Newfoundland Daylight Time", "WAST": "West Africa Summer Time", "WEZ": "Western European Standard Time", "MDT": "Mountain Daylight Time", "CLST": "Chile Summer Time", "UYST": "Uruguay Summer Time", "VET": "Venezuela Time", "HADT": "Hawaii-Aleutian Daylight Time", "AST": "Atlantic Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "WIT": "Eastern Indonesia Time", "EAT": "East Africa Time", "ACDT": "Australian Central Daylight Time", "WART": "Western Argentina Standard Time", "CHAST": "Chatham Standard Time", "ACWDT": "Australian Central Western Daylight Time", "EST": "Eastern Standard Time", "OESZ": "Eastern European Summer Time", "AWDT": "Australian Western Daylight Time", "ADT": "Atlantic Daylight Time", "ChST": "Chamorro Standard Time", "ARST": "Argentina Summer Time", "JDT": "Japan Daylight Time", "WESZ": "Western European Summer Time", "AEST": "Australian Eastern Standard Time"},
}
}
@@ -112,8 +112,8 @@ func (en *en_SG) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
func (en *en_SG) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
n := math.Abs(num)
- nMod10 := math.Mod(n, 10)
nMod100 := math.Mod(n, 100)
+ nMod10 := math.Mod(n, 10)
if nMod10 == 1 && nMod100 != 11 {
return locales.PluralRuleOne
diff --git a/en_SG/en_SG_test.go b/en_SG/en_SG_test.go
new file mode 100644
index 00000000..cac88612
--- /dev/null
+++ b/en_SG/en_SG_test.go
@@ -0,0 +1,1120 @@
+package en_SG
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_SG"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_SH/en_SH.go b/en_SH/en_SH.go
index 9842b4cc..fe3ac616 100644
--- a/en_SH/en_SH.go
+++ b/en_SH/en_SH.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"CHADT": "Chatham Daylight Time", "CLT": "Chile Standard Time", "CLST": "Chile Summer Time", "HADT": "Hawaii-Aleutian Daylight Time", "WAT": "West Africa Standard Time", "ACDT": "Australian Central Daylight Time", "CST": "Central Standard Time", "EDT": "Eastern Daylight Time", "SAST": "South Africa Standard Time", "BT": "Bhutan Time", "UYST": "Uruguay Summer Time", "MESZ": "Central European Summer Time", "ACWST": "Australian Central Western Standard Time", "EST": "Eastern Standard Time", "HKST": "Hong Kong Summer Time", "HAST": "Hawaii-Aleutian Standard Time", "HAT": "Newfoundland Daylight Time", "EAT": "East Africa Time", "AWST": "Australian Western Standard Time", "BOT": "Bolivia Time", "ChST": "Chamorro Standard Time", "OESZ": "Eastern European Summer Time", "ART": "Argentina Standard Time", "∅∅∅": "Amazon Summer Time", "NZST": "New Zealand Standard Time", "ACWDT": "Australian Central Western Daylight Time", "WITA": "Central Indonesia Time", "GMT": "Greenwich Mean Time", "ARST": "Argentina Summer Time", "TMST": "Turkmenistan Summer Time", "MDT": "Macau Summer Time", "AWDT": "Australian Western Daylight Time", "CHAST": "Chatham Standard Time", "VET": "Venezuela Time", "WIB": "Western Indonesia Time", "IST": "India Standard Time", "ECT": "Ecuador Time", "CAT": "Central Africa Time", "TMT": "Turkmenistan Standard Time", "MYT": "Malaysia Time", "CDT": "Central Daylight Time", "WESZ": "Western European Summer Time", "AEDT": "Australian Eastern Daylight Time", "LHDT": "Lord Howe Daylight Time", "GYT": "Guyana Time", "PDT": "Pacific Daylight Time", "COT": "Colombia Standard Time", "SGT": "Singapore Standard Time", "HKT": "Hong Kong Standard Time", "OEZ": "Eastern European Standard Time", "LHST": "Lord Howe Standard Time", "JST": "Japan Standard Time", "AKDT": "Alaska Daylight Time", "WEZ": "Western European Standard Time", "WAST": "West Africa Summer Time", "MST": "Macau Standard Time", "PST": "Pacific Standard Time", "UYT": "Uruguay Standard Time", "COST": "Colombia Summer Time", "AKST": "Alaska Standard Time", "ACST": "Australian Central Standard Time", "AST": "Atlantic Standard Time", "JDT": "Japan Daylight Time", "MEZ": "Central European Standard Time", "NZDT": "New Zealand Daylight Time", "AEST": "Australian Eastern Standard Time", "WART": "Western Argentina Standard Time", "WARST": "Western Argentina Summer Time", "HNT": "Newfoundland Standard Time", "GFT": "French Guiana Time", "WIT": "Eastern Indonesia Time", "SRT": "Suriname Time", "ADT": "Atlantic Daylight Time"},
+ timezones: map[string]string{"CAT": "Central Africa Time", "WESZ": "Western European Summer Time", "UYST": "Uruguay Summer Time", "BT": "Bhutan Time", "LHST": "Lord Howe Standard Time", "WARST": "Western Argentina Summer Time", "AST": "Atlantic Standard Time", "ART": "Argentina Standard Time", "JDT": "Japan Daylight Time", "AKST": "Alaska Standard Time", "ACWST": "Australian Central Western Standard Time", "ACWDT": "Australian Central Western Daylight Time", "TMT": "Turkmenistan Standard Time", "GFT": "French Guiana Time", "HKST": "Hong Kong Summer Time", "OEZ": "Eastern European Standard Time", "AEST": "Australian Eastern Standard Time", "MST": "Macau Standard Time", "JST": "Japan Standard Time", "NZST": "New Zealand Standard Time", "BOT": "Bolivia Time", "HAT": "Newfoundland Daylight Time", "GMT": "Greenwich Mean Time", "CDT": "Central Daylight Time", "MDT": "Macau Summer Time", "WAST": "West Africa Summer Time", "GYT": "Guyana Time", "UYT": "Uruguay Standard Time", "MEZ": "Central European Standard Time", "WAT": "West Africa Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "ChST": "Chamorro Standard Time", "WART": "Western Argentina Standard Time", "∅∅∅": "Azores Summer Time", "HNT": "Newfoundland Standard Time", "SAST": "South Africa Standard Time", "SGT": "Singapore Standard Time", "AWST": "Australian Western Standard Time", "EST": "Eastern Standard Time", "WIB": "Western Indonesia Time", "WEZ": "Western European Standard Time", "LHDT": "Lord Howe Daylight Time", "CHADT": "Chatham Daylight Time", "WITA": "Central Indonesia Time", "VET": "Venezuela Time", "EDT": "Eastern Daylight Time", "PST": "Pacific Standard Time", "TMST": "Turkmenistan Summer Time", "WIT": "Eastern Indonesia Time", "ACST": "Australian Central Standard Time", "SRT": "Suriname Time", "PDT": "Pacific Daylight Time", "COT": "Colombia Standard Time", "CLT": "Chile Standard Time", "HKT": "Hong Kong Standard Time", "ECT": "Ecuador Time", "MESZ": "Central European Summer Time", "OESZ": "Eastern European Summer Time", "AEDT": "Australian Eastern Daylight Time", "MYT": "Malaysia Time", "CST": "Central Standard Time", "AKDT": "Alaska Daylight Time", "CHAST": "Chatham Standard Time", "IST": "India Standard Time", "ADT": "Atlantic Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "COST": "Colombia Summer Time", "ACDT": "Australian Central Daylight Time", "ARST": "Argentina Summer Time", "AWDT": "Australian Western Daylight Time", "EAT": "East Africa Time", "NZDT": "New Zealand Daylight Time", "CLST": "Chile Summer Time"},
}
}
diff --git a/en_SH/en_SH_test.go b/en_SH/en_SH_test.go
new file mode 100644
index 00000000..72529e0d
--- /dev/null
+++ b/en_SH/en_SH_test.go
@@ -0,0 +1,1120 @@
+package en_SH
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_SH"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_SI/en_SI.go b/en_SI/en_SI.go
index ca91f532..dbffb079 100644
--- a/en_SI/en_SI.go
+++ b/en_SI/en_SI.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"GMT": "Greenwich Mean Time", "ACDT": "Australian Central Daylight Time", "GYT": "Guyana Time", "MDT": "Mountain Daylight Time", "AST": "Atlantic Standard Time", "OESZ": "Eastern European Summer Time", "AEST": "Australian Eastern Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "IST": "India Standard Time", "OEZ": "Eastern European Standard Time", "MST": "Mountain Standard Time", "WAST": "West Africa Summer Time", "PST": "Pacific Standard Time", "PDT": "Pacific Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "MYT": "Malaysia Time", "UYST": "Uruguay Summer Time", "EDT": "Eastern Daylight Time", "COST": "Colombia Summer Time", "HKST": "Hong Kong Summer Time", "GFT": "French Guiana Time", "ART": "Argentina Standard Time", "ARST": "Argentina Summer Time", "CLST": "Chile Summer Time", "EST": "Eastern Standard Time", "NZST": "New Zealand Standard Time", "ACWST": "Australian Central Western Standard Time", "∅∅∅": "Brasilia Summer Time", "ADT": "Atlantic Daylight Time", "HAT": "Newfoundland Daylight Time", "AKDT": "Alaska Daylight Time", "CST": "Central Standard Time", "ACWDT": "Australian Central Western Daylight Time", "ECT": "Ecuador Time", "BT": "Bhutan Time", "WIT": "Eastern Indonesia Time", "HNT": "Newfoundland Standard Time", "TMT": "Turkmenistan Standard Time", "ACST": "Australian Central Standard Time", "NZDT": "New Zealand Daylight Time", "WESZ": "Western European Summer Time", "JST": "Japan Standard Time", "SRT": "Suriname Time", "AWST": "Australian Western Standard Time", "CDT": "Central Daylight Time", "SAST": "South Africa Standard Time", "WAT": "West Africa Standard Time", "WIB": "Western Indonesia Time", "UYT": "Uruguay Standard Time", "ChST": "Chamorro Standard Time", "LHST": "Lord Howe Standard Time", "MEZ": "Central European Standard Time", "MESZ": "Central European Summer Time", "TMST": "Turkmenistan Summer Time", "LHDT": "Lord Howe Daylight Time", "BOT": "Bolivia Time", "WARST": "Western Argentina Summer Time", "COT": "Colombia Standard Time", "HKT": "Hong Kong Standard Time", "WEZ": "Western European Standard Time", "CAT": "Central Africa Time", "VET": "Venezuela Time", "AEDT": "Australian Eastern Daylight Time", "SGT": "Singapore Standard Time", "AKST": "Alaska Standard Time", "AWDT": "Australian Western Daylight Time", "CHAST": "Chatham Standard Time", "CLT": "Chile Standard Time", "WITA": "Central Indonesia Time", "EAT": "East Africa Time", "JDT": "Japan Daylight Time", "CHADT": "Chatham Daylight Time", "WART": "Western Argentina Standard Time"},
+ timezones: map[string]string{"ART": "Argentina Standard Time", "EDT": "Eastern Daylight Time", "∅∅∅": "Azores Summer Time", "CHAST": "Chatham Standard Time", "ADT": "Atlantic Daylight Time", "PDT": "Pacific Daylight Time", "OEZ": "Eastern European Standard Time", "EAT": "East Africa Time", "ACDT": "Australian Central Daylight Time", "HNT": "Newfoundland Standard Time", "ChST": "Chamorro Standard Time", "HKT": "Hong Kong Standard Time", "SRT": "Suriname Time", "HKST": "Hong Kong Summer Time", "WITA": "Central Indonesia Time", "JDT": "Japan Daylight Time", "BOT": "Bolivia Time", "EST": "Eastern Standard Time", "WAST": "West Africa Summer Time", "CDT": "Central Daylight Time", "SGT": "Singapore Standard Time", "JST": "Japan Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "CAT": "Central Africa Time", "AST": "Atlantic Standard Time", "AEST": "Australian Eastern Standard Time", "GYT": "Guyana Time", "LHST": "Lord Howe Standard Time", "CLST": "Chile Summer Time", "WART": "Western Argentina Standard Time", "PST": "Pacific Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "AKDT": "Alaska Daylight Time", "ECT": "Ecuador Time", "SAST": "South Africa Standard Time", "MEZ": "Central European Standard Time", "MESZ": "Central European Summer Time", "TMST": "Turkmenistan Summer Time", "WAT": "West Africa Standard Time", "COT": "Colombia Standard Time", "MST": "Macau Standard Time", "OESZ": "Eastern European Summer Time", "NZDT": "New Zealand Daylight Time", "HAT": "Newfoundland Daylight Time", "COST": "Colombia Summer Time", "UYST": "Uruguay Summer Time", "VET": "Venezuela Time", "TMT": "Turkmenistan Standard Time", "UYT": "Uruguay Standard Time", "AWST": "Australian Western Standard Time", "AWDT": "Australian Western Daylight Time", "MYT": "Malaysia Time", "CST": "Central Standard Time", "ACWST": "Australian Central Western Standard Time", "ARST": "Argentina Summer Time", "IST": "India Standard Time", "WIB": "Western Indonesia Time", "BT": "Bhutan Time", "ACST": "Australian Central Standard Time", "AKST": "Alaska Standard Time", "WEZ": "Western European Standard Time", "GMT": "Greenwich Mean Time", "WARST": "Western Argentina Summer Time", "WESZ": "Western European Summer Time", "CLT": "Chile Standard Time", "GFT": "French Guiana Time", "NZST": "New Zealand Standard Time", "AEDT": "Australian Eastern Daylight Time", "WIT": "Eastern Indonesia Time", "LHDT": "Lord Howe Daylight Time", "MDT": "Macau Summer Time", "ACWDT": "Australian Central Western Daylight Time", "CHADT": "Chatham Daylight Time"},
}
}
diff --git a/en_SI/en_SI_test.go b/en_SI/en_SI_test.go
new file mode 100644
index 00000000..b50c3e07
--- /dev/null
+++ b/en_SI/en_SI_test.go
@@ -0,0 +1,1120 @@
+package en_SI
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_SI"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_SL/en_SL.go b/en_SL/en_SL.go
index ad18e6b5..7896f0bc 100644
--- a/en_SL/en_SL.go
+++ b/en_SL/en_SL.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"UYST": "Uruguay Summer Time", "HNT": "Newfoundland Standard Time", "LHST": "Lord Howe Standard Time", "PST": "Pacific Standard Time", "ACST": "Australian Central Standard Time", "SRT": "Suriname Time", "WARST": "Western Argentina Summer Time", "OEZ": "Eastern European Standard Time", "EAT": "East Africa Time", "IST": "India Standard Time", "LHDT": "Lord Howe Daylight Time", "MYT": "Malaysia Time", "PDT": "Pacific Daylight Time", "AWST": "Australian Western Standard Time", "ACWST": "Australian Central Western Standard Time", "HAT": "Newfoundland Daylight Time", "WIB": "Western Indonesia Time", "BOT": "Bolivia Time", "WAT": "West Africa Standard Time", "WITA": "Central Indonesia Time", "NZST": "New Zealand Standard Time", "ACWDT": "Australian Central Western Daylight Time", "ECT": "Ecuador Time", "CAT": "Central Africa Time", "JDT": "Japan Daylight Time", "AKDT": "Alaska Daylight Time", "AST": "Atlantic Standard Time", "ADT": "Atlantic Daylight Time", "GMT": "Greenwich Mean Time", "WEZ": "Western European Standard Time", "HKT": "Hong Kong Standard Time", "CST": "Central Standard Time", "AWDT": "Australian Western Daylight Time", "CHADT": "Chatham Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "ARST": "Argentina Summer Time", "COT": "Colombia Standard Time", "WART": "Western Argentina Standard Time", "TMST": "Turkmenistan Summer Time", "OESZ": "Eastern European Summer Time", "ART": "Argentina Standard Time", "CLT": "Chile Standard Time", "COST": "Colombia Summer Time", "GFT": "French Guiana Time", "WESZ": "Western European Summer Time", "UYT": "Uruguay Standard Time", "SAST": "South Africa Standard Time", "TMT": "Turkmenistan Standard Time", "ACDT": "Australian Central Daylight Time", "∅∅∅": "Brasilia Summer Time", "AKST": "Alaska Standard Time", "MEZ": "Central European Standard Time", "NZDT": "New Zealand Daylight Time", "MST": "Mountain Standard Time", "SGT": "Singapore Standard Time", "GYT": "Guyana Time", "ChST": "Chamorro Standard Time", "HKST": "Hong Kong Summer Time", "WAST": "West Africa Summer Time", "CLST": "Chile Summer Time", "AEST": "Australian Eastern Standard Time", "AEDT": "Australian Eastern Daylight Time", "EST": "Eastern Standard Time", "EDT": "Eastern Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "BT": "Bhutan Time", "WIT": "Eastern Indonesia Time", "MDT": "Mountain Daylight Time", "CHAST": "Chatham Standard Time", "VET": "Venezuela Time", "JST": "Japan Standard Time", "CDT": "Central Daylight Time", "MESZ": "Central European Summer Time"},
+ timezones: map[string]string{"WAST": "West Africa Summer Time", "OESZ": "Eastern European Summer Time", "WITA": "Central Indonesia Time", "HAT": "Newfoundland Daylight Time", "WIB": "Western Indonesia Time", "ACST": "Australian Central Standard Time", "ACDT": "Australian Central Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "GYT": "Guyana Time", "LHST": "Lord Howe Standard Time", "TMST": "Turkmenistan Summer Time", "WESZ": "Western European Summer Time", "HKT": "Hong Kong Standard Time", "NZST": "New Zealand Standard Time", "COST": "Colombia Summer Time", "WIT": "Eastern Indonesia Time", "ACWST": "Australian Central Western Standard Time", "PST": "Pacific Standard Time", "MEZ": "Central European Standard Time", "CLT": "Chile Standard Time", "LHDT": "Lord Howe Daylight Time", "HKST": "Hong Kong Summer Time", "ARST": "Argentina Summer Time", "JDT": "Japan Daylight Time", "WARST": "Western Argentina Summer Time", "JST": "Japan Standard Time", "MESZ": "Central European Summer Time", "SGT": "Singapore Standard Time", "ChST": "Chamorro Standard Time", "AEST": "Australian Eastern Standard Time", "ECT": "Ecuador Time", "MDT": "Macau Summer Time", "CHAST": "Chatham Standard Time", "MYT": "Malaysia Time", "TMT": "Turkmenistan Standard Time", "WAT": "West Africa Standard Time", "ACWDT": "Australian Central Western Daylight Time", "PDT": "Pacific Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "EST": "Eastern Standard Time", "WEZ": "Western European Standard Time", "CHADT": "Chatham Daylight Time", "AWDT": "Australian Western Daylight Time", "AKST": "Alaska Standard Time", "CDT": "Central Daylight Time", "GFT": "French Guiana Time", "OEZ": "Eastern European Standard Time", "WART": "Western Argentina Standard Time", "AKDT": "Alaska Daylight Time", "UYT": "Uruguay Standard Time", "MST": "Macau Standard Time", "COT": "Colombia Standard Time", "CAT": "Central Africa Time", "AEDT": "Australian Eastern Daylight Time", "UYST": "Uruguay Summer Time", "CST": "Central Standard Time", "ART": "Argentina Standard Time", "ADT": "Atlantic Daylight Time", "HNT": "Newfoundland Standard Time", "SRT": "Suriname Time", "VET": "Venezuela Time", "AWST": "Australian Western Standard Time", "NZDT": "New Zealand Daylight Time", "BOT": "Bolivia Time", "BT": "Bhutan Time", "EDT": "Eastern Daylight Time", "∅∅∅": "Amazon Summer Time", "GMT": "Greenwich Mean Time", "CLST": "Chile Summer Time", "EAT": "East Africa Time", "AST": "Atlantic Standard Time", "SAST": "South Africa Standard Time", "IST": "India Standard Time"},
}
}
diff --git a/en_SL/en_SL_test.go b/en_SL/en_SL_test.go
new file mode 100644
index 00000000..b69a27ae
--- /dev/null
+++ b/en_SL/en_SL_test.go
@@ -0,0 +1,1120 @@
+package en_SL
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_SL"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_SS/en_SS.go b/en_SS/en_SS.go
index 7be48d3e..3ee755ff 100644
--- a/en_SS/en_SS.go
+++ b/en_SS/en_SS.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"ACWST": "Australian Central Western Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "HKT": "Hong Kong Standard Time", "BT": "Bhutan Time", "AWDT": "Australian Western Daylight Time", "WAT": "West Africa Standard Time", "OEZ": "Eastern European Standard Time", "TMT": "Turkmenistan Standard Time", "AWST": "Australian Western Standard Time", "CST": "Central Standard Time", "WEZ": "Western European Standard Time", "AEST": "Australian Eastern Standard Time", "HNT": "Newfoundland Standard Time", "WIT": "Eastern Indonesia Time", "OESZ": "Eastern European Summer Time", "ARST": "Argentina Summer Time", "AKST": "Alaska Standard Time", "PDT": "Pacific Daylight Time", "CHADT": "Chatham Daylight Time", "ECT": "Ecuador Time", "HAT": "Newfoundland Daylight Time", "GFT": "French Guiana Time", "IST": "India Standard Time", "WIB": "Western Indonesia Time", "AKDT": "Alaska Daylight Time", "NZDT": "New Zealand Daylight Time", "MST": "Mountain Standard Time", "GMT": "Greenwich Mean Time", "JST": "Japan Standard Time", "SRT": "Suriname Time", "MESZ": "Central European Summer Time", "COT": "Colombia Standard Time", "WART": "Western Argentina Standard Time", "LHST": "Lord Howe Standard Time", "UYT": "Uruguay Standard Time", "CLST": "Chile Summer Time", "EDT": "Eastern Daylight Time", "SAST": "South Africa Standard Time", "LHDT": "Lord Howe Daylight Time", "BOT": "Bolivia Time", "CLT": "Chile Standard Time", "COST": "Colombia Summer Time", "ADT": "Atlantic Daylight Time", "WARST": "Western Argentina Summer Time", "∅∅∅": "Brasilia Summer Time", "MYT": "Malaysia Time", "MEZ": "Central European Standard Time", "TMST": "Turkmenistan Summer Time", "EAT": "East Africa Time", "PST": "Pacific Standard Time", "ChST": "Chamorro Standard Time", "MDT": "Mountain Daylight Time", "CHAST": "Chatham Standard Time", "WESZ": "Western European Summer Time", "AST": "Atlantic Standard Time", "ACST": "Australian Central Standard Time", "GYT": "Guyana Time", "ACWDT": "Australian Central Western Daylight Time", "WAST": "West Africa Summer Time", "ART": "Argentina Standard Time", "NZST": "New Zealand Standard Time", "EST": "Eastern Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "ACDT": "Australian Central Daylight Time", "VET": "Venezuela Time", "SGT": "Singapore Standard Time", "UYST": "Uruguay Summer Time", "CDT": "Central Daylight Time", "AEDT": "Australian Eastern Daylight Time", "CAT": "Central Africa Time", "HKST": "Hong Kong Summer Time", "WITA": "Central Indonesia Time", "JDT": "Japan Daylight Time"},
+ timezones: map[string]string{"OESZ": "Eastern European Summer Time", "∅∅∅": "Azores Summer Time", "MDT": "Macau Summer Time", "ACWST": "Australian Central Western Standard Time", "AEST": "Australian Eastern Standard Time", "CDT": "Central Daylight Time", "ACST": "Australian Central Standard Time", "HKST": "Hong Kong Summer Time", "ChST": "Chamorro Standard Time", "GYT": "Guyana Time", "UYT": "Uruguay Standard Time", "EAT": "East Africa Time", "LHDT": "Lord Howe Daylight Time", "JST": "Japan Standard Time", "EDT": "Eastern Daylight Time", "TMT": "Turkmenistan Standard Time", "AWDT": "Australian Western Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "MYT": "Malaysia Time", "AST": "Atlantic Standard Time", "NZST": "New Zealand Standard Time", "EST": "Eastern Standard Time", "WESZ": "Western European Summer Time", "SGT": "Singapore Standard Time", "CST": "Central Standard Time", "AKST": "Alaska Standard Time", "AKDT": "Alaska Daylight Time", "UYST": "Uruguay Summer Time", "TMST": "Turkmenistan Summer Time", "CAT": "Central Africa Time", "GFT": "French Guiana Time", "ACWDT": "Australian Central Western Daylight Time", "WIB": "Western Indonesia Time", "SAST": "South Africa Standard Time", "BT": "Bhutan Time", "HKT": "Hong Kong Standard Time", "GMT": "Greenwich Mean Time", "LHST": "Lord Howe Standard Time", "ADT": "Atlantic Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "COST": "Colombia Summer Time", "ECT": "Ecuador Time", "PST": "Pacific Standard Time", "AEDT": "Australian Eastern Daylight Time", "CLST": "Chile Summer Time", "SRT": "Suriname Time", "COT": "Colombia Standard Time", "WAT": "West Africa Standard Time", "NZDT": "New Zealand Daylight Time", "PDT": "Pacific Daylight Time", "MESZ": "Central European Summer Time", "ARST": "Argentina Summer Time", "CLT": "Chile Standard Time", "MST": "Macau Standard Time", "WITA": "Central Indonesia Time", "ART": "Argentina Standard Time", "WIT": "Eastern Indonesia Time", "VET": "Venezuela Time", "WAST": "West Africa Summer Time", "OEZ": "Eastern European Standard Time", "AWST": "Australian Western Standard Time", "IST": "India Standard Time", "MEZ": "Central European Standard Time", "ACDT": "Australian Central Daylight Time", "WART": "Western Argentina Standard Time", "JDT": "Japan Daylight Time", "BOT": "Bolivia Time", "WEZ": "Western European Standard Time", "HNT": "Newfoundland Standard Time", "HAT": "Newfoundland Daylight Time", "WARST": "Western Argentina Summer Time", "CHAST": "Chatham Standard Time", "CHADT": "Chatham Daylight Time"},
}
}
@@ -112,8 +112,8 @@ func (en *en_SS) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
func (en *en_SS) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
n := math.Abs(num)
- nMod10 := math.Mod(n, 10)
nMod100 := math.Mod(n, 100)
+ nMod10 := math.Mod(n, 10)
if nMod10 == 1 && nMod100 != 11 {
return locales.PluralRuleOne
diff --git a/en_SS/en_SS_test.go b/en_SS/en_SS_test.go
new file mode 100644
index 00000000..edc48b1b
--- /dev/null
+++ b/en_SS/en_SS_test.go
@@ -0,0 +1,1120 @@
+package en_SS
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_SS"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_SX/en_SX.go b/en_SX/en_SX.go
index f228aa19..be93b8a1 100644
--- a/en_SX/en_SX.go
+++ b/en_SX/en_SX.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"ADT": "Atlantic Daylight Time", "TMST": "Turkmenistan Summer Time", "GYT": "Guyana Time", "CHAST": "Chatham Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "HNT": "Newfoundland Standard Time", "WITA": "Central Indonesia Time", "MEZ": "Central European Standard Time", "CLT": "Chile Standard Time", "WART": "Western Argentina Standard Time", "GFT": "French Guiana Time", "MDT": "Macau Summer Time", "EST": "Eastern Standard Time", "VET": "Venezuela Time", "AST": "Atlantic Standard Time", "ART": "Argentina Standard Time", "SRT": "Suriname Time", "AKST": "Alaska Standard Time", "NZDT": "New Zealand Daylight Time", "ACWDT": "Australian Central Western Daylight Time", "CLST": "Chile Summer Time", "∅∅∅": "Acre Summer Time", "WAST": "West Africa Summer Time", "MST": "Macau Standard Time", "UYST": "Uruguay Summer Time", "CDT": "Central Daylight Time", "WARST": "Western Argentina Summer Time", "WIT": "Eastern Indonesia Time", "ACDT": "Australian Central Daylight Time", "ARST": "Argentina Summer Time", "GMT": "Greenwich Mean Time", "ACST": "Australian Central Standard Time", "AEDT": "Australian Eastern Daylight Time", "EDT": "Eastern Daylight Time", "OEZ": "Eastern European Standard Time", "IST": "India Standard Time", "PDT": "Pacific Daylight Time", "MESZ": "Central European Summer Time", "UYT": "Uruguay Standard Time", "CHADT": "Chatham Daylight Time", "COST": "Colombia Summer Time", "BT": "Bhutan Time", "WIB": "Western Indonesia Time", "MYT": "Malaysia Time", "WEZ": "Western European Standard Time", "COT": "Colombia Standard Time", "WAT": "West Africa Standard Time", "AKDT": "Alaska Daylight Time", "SGT": "Singapore Standard Time", "HKT": "Hong Kong Standard Time", "EAT": "East Africa Time", "LHDT": "Lord Howe Daylight Time", "AEST": "Australian Eastern Standard Time", "HKST": "Hong Kong Summer Time", "TMT": "Turkmenistan Standard Time", "JDT": "Japan Daylight Time", "SAST": "South Africa Standard Time", "OESZ": "Eastern European Summer Time", "CST": "Central Standard Time", "WESZ": "Western European Summer Time", "HAT": "Newfoundland Daylight Time", "LHST": "Lord Howe Standard Time", "JST": "Japan Standard Time", "ACWST": "Australian Central Western Standard Time", "ChST": "Chamorro Standard Time", "ECT": "Ecuador Time", "CAT": "Central Africa Time", "HAST": "Hawaii-Aleutian Standard Time", "PST": "Pacific Standard Time", "AWST": "Australian Western Standard Time", "AWDT": "Australian Western Daylight Time", "NZST": "New Zealand Standard Time", "BOT": "Bolivia Time"},
+ timezones: map[string]string{"ART": "Argentina Standard Time", "NZDT": "New Zealand Daylight Time", "COT": "Colombia Standard Time", "WIB": "Western Indonesia Time", "GYT": "Guyana Time", "MST": "Mountain Standard Time", "ECT": "Ecuador Time", "IST": "India Standard Time", "EDT": "Eastern Daylight Time", "SAST": "South Africa Standard Time", "TMST": "Turkmenistan Summer Time", "LHDT": "Lord Howe Daylight Time", "ACST": "Australian Central Standard Time", "ACDT": "Australian Central Daylight Time", "AKDT": "Alaska Daylight Time", "PDT": "Pacific Daylight Time", "LHST": "Lord Howe Standard Time", "AWDT": "Australian Western Daylight Time", "AEDT": "Australian Eastern Daylight Time", "MDT": "Mountain Daylight Time", "HKST": "Hong Kong Summer Time", "CHADT": "Chatham Daylight Time", "AWST": "Australian Western Standard Time", "JST": "Japan Standard Time", "WAST": "West Africa Summer Time", "WEZ": "Western European Standard Time", "GMT": "Greenwich Mean Time", "BT": "Bhutan Time", "UYST": "Uruguay Summer Time", "∅∅∅": "Amazon Summer Time", "OEZ": "Eastern European Standard Time", "CLST": "Chile Summer Time", "GFT": "French Guiana Time", "HKT": "Hong Kong Standard Time", "ADT": "Atlantic Daylight Time", "MEZ": "Central European Standard Time", "WAT": "West Africa Standard Time", "CAT": "Central Africa Time", "ACWDT": "Australian Central Western Daylight Time", "WITA": "Central Indonesia Time", "MESZ": "Central European Summer Time", "HAT": "Newfoundland Daylight Time", "ChST": "Chamorro Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "BOT": "Bolivia Time", "HNT": "Newfoundland Standard Time", "TMT": "Turkmenistan Standard Time", "CHAST": "Chatham Standard Time", "EST": "Eastern Standard Time", "COST": "Colombia Summer Time", "OESZ": "Eastern European Summer Time", "UYT": "Uruguay Standard Time", "WART": "Western Argentina Standard Time", "WARST": "Western Argentina Summer Time", "CDT": "Central Daylight Time", "ACWST": "Australian Central Western Standard Time", "AKST": "Alaska Standard Time", "VET": "Venezuela Time", "AST": "Atlantic Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "CLT": "Chile Standard Time", "JDT": "Japan Daylight Time", "PST": "Pacific Standard Time", "MYT": "Malaysia Time", "WIT": "Eastern Indonesia Time", "EAT": "East Africa Time", "CST": "Central Standard Time", "ARST": "Argentina Summer Time", "NZST": "New Zealand Standard Time", "WESZ": "Western European Summer Time", "SGT": "Singapore Standard Time", "AEST": "Australian Eastern Standard Time", "SRT": "Suriname Time"},
}
}
diff --git a/en_SX/en_SX_test.go b/en_SX/en_SX_test.go
new file mode 100644
index 00000000..c9b7d5e4
--- /dev/null
+++ b/en_SX/en_SX_test.go
@@ -0,0 +1,1120 @@
+package en_SX
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_SX"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_SZ/en_SZ.go b/en_SZ/en_SZ.go
index 7dec0809..e275eef9 100644
--- a/en_SZ/en_SZ.go
+++ b/en_SZ/en_SZ.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"PDT": "Pacific Daylight Time", "LHDT": "Lord Howe Daylight Time", "EST": "Eastern Standard Time", "WAST": "West Africa Summer Time", "CLT": "Chile Standard Time", "GMT": "Greenwich Mean Time", "HAT": "Newfoundland Daylight Time", "CLST": "Chile Summer Time", "HKT": "Hong Kong Standard Time", "OEZ": "Eastern European Standard Time", "TMT": "Turkmenistan Standard Time", "EAT": "East Africa Time", "ACST": "Australian Central Standard Time", "SRT": "Suriname Time", "ChST": "Chamorro Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "WITA": "Central Indonesia Time", "AEST": "Australian Eastern Standard Time", "COST": "Colombia Summer Time", "ECT": "Ecuador Time", "CHADT": "Chatham Daylight Time", "AEDT": "Australian Eastern Daylight Time", "COT": "Colombia Standard Time", "HKST": "Hong Kong Summer Time", "GYT": "Guyana Time", "MYT": "Malaysia Time", "UYST": "Uruguay Summer Time", "NZST": "New Zealand Standard Time", "ART": "Argentina Standard Time", "SGT": "Singapore Standard Time", "WARST": "Western Argentina Summer Time", "BT": "Bhutan Time", "ACDT": "Australian Central Daylight Time", "AWDT": "Australian Western Daylight Time", "MESZ": "Central European Summer Time", "ACWST": "Australian Central Western Standard Time", "TMST": "Turkmenistan Summer Time", "JDT": "Japan Daylight Time", "WART": "Western Argentina Standard Time", "IST": "India Standard Time", "MEZ": "Central European Standard Time", "NZDT": "New Zealand Daylight Time", "VET": "Venezuela Time", "HNT": "Newfoundland Standard Time", "AST": "Atlantic Standard Time", "PST": "Pacific Standard Time", "BOT": "Bolivia Time", "CHAST": "Chatham Standard Time", "CAT": "Central Africa Time", "MST": "Mountain Standard Time", "ACWDT": "Australian Central Western Daylight Time", "EDT": "Eastern Daylight Time", "WIT": "Eastern Indonesia Time", "CST": "Central Standard Time", "WAT": "West Africa Standard Time", "GFT": "French Guiana Time", "SAST": "South Africa Standard Time", "ARST": "Argentina Summer Time", "AKDT": "Alaska Daylight Time", "AWST": "Australian Western Standard Time", "∅∅∅": "Azores Summer Time", "UYT": "Uruguay Standard Time", "OESZ": "Eastern European Summer Time", "LHST": "Lord Howe Standard Time", "CDT": "Central Daylight Time", "WEZ": "Western European Standard Time", "WESZ": "Western European Summer Time", "HADT": "Hawaii-Aleutian Daylight Time", "WIB": "Western Indonesia Time", "JST": "Japan Standard Time", "AKST": "Alaska Standard Time", "MDT": "Mountain Daylight Time", "ADT": "Atlantic Daylight Time"},
+ timezones: map[string]string{"WARST": "Western Argentina Summer Time", "ECT": "Ecuador Time", "AWDT": "Australian Western Daylight Time", "ART": "Argentina Standard Time", "ADT": "Atlantic Daylight Time", "MDT": "Mountain Daylight Time", "CLT": "Chile Standard Time", "WIT": "Eastern Indonesia Time", "WAST": "West Africa Summer Time", "WAT": "West Africa Standard Time", "GMT": "Greenwich Mean Time", "AEDT": "Australian Eastern Daylight Time", "CLST": "Chile Summer Time", "CST": "Central Standard Time", "HKT": "Hong Kong Standard Time", "WART": "Western Argentina Standard Time", "WITA": "Central Indonesia Time", "AST": "Atlantic Standard Time", "OEZ": "Eastern European Standard Time", "AEST": "Australian Eastern Standard Time", "MST": "Mountain Standard Time", "MYT": "Malaysia Time", "SRT": "Suriname Time", "CDT": "Central Daylight Time", "WIB": "Western Indonesia Time", "TMST": "Turkmenistan Summer Time", "∅∅∅": "Brasilia Summer Time", "ACST": "Australian Central Standard Time", "ACWST": "Australian Central Western Standard Time", "HNT": "Newfoundland Standard Time", "COST": "Colombia Summer Time", "UYT": "Uruguay Standard Time", "EAT": "East Africa Time", "LHST": "Lord Howe Standard Time", "ARST": "Argentina Summer Time", "MESZ": "Central European Summer Time", "BT": "Bhutan Time", "ACDT": "Australian Central Daylight Time", "PDT": "Pacific Daylight Time", "SGT": "Singapore Standard Time", "HKST": "Hong Kong Summer Time", "CHAST": "Chatham Standard Time", "AWST": "Australian Western Standard Time", "JST": "Japan Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "ChST": "Chamorro Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "EDT": "Eastern Daylight Time", "GYT": "Guyana Time", "LHDT": "Lord Howe Daylight Time", "CHADT": "Chatham Daylight Time", "ACWDT": "Australian Central Western Daylight Time", "CAT": "Central Africa Time", "UYST": "Uruguay Summer Time", "GFT": "French Guiana Time", "AKDT": "Alaska Daylight Time", "BOT": "Bolivia Time", "WESZ": "Western European Summer Time", "WEZ": "Western European Standard Time", "OESZ": "Eastern European Summer Time", "VET": "Venezuela Time", "PST": "Pacific Standard Time", "NZDT": "New Zealand Daylight Time", "HAT": "Newfoundland Daylight Time", "AKST": "Alaska Standard Time", "EST": "Eastern Standard Time", "COT": "Colombia Standard Time", "TMT": "Turkmenistan Standard Time", "JDT": "Japan Daylight Time", "MEZ": "Central European Standard Time", "NZST": "New Zealand Standard Time", "SAST": "South Africa Standard Time", "IST": "India Standard Time"},
}
}
diff --git a/en_SZ/en_SZ_test.go b/en_SZ/en_SZ_test.go
new file mode 100644
index 00000000..502f2dea
--- /dev/null
+++ b/en_SZ/en_SZ_test.go
@@ -0,0 +1,1120 @@
+package en_SZ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_SZ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_TC/en_TC.go b/en_TC/en_TC.go
index 276ba20f..8b2f90c2 100644
--- a/en_TC/en_TC.go
+++ b/en_TC/en_TC.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"∅∅∅": "Amazon Summer Time", "CHAST": "Chatham Standard Time", "IST": "India Standard Time", "JST": "Japan Standard Time", "ACWDT": "Australian Central Western Daylight Time", "JDT": "Japan Daylight Time", "LHST": "Lord Howe Standard Time", "WAT": "West Africa Standard Time", "HAT": "Newfoundland Daylight Time", "HKT": "Hong Kong Standard Time", "OEZ": "Eastern European Standard Time", "ART": "Argentina Standard Time", "AKDT": "Alaska Daylight Time", "GYT": "Guyana Time", "MEZ": "Central European Standard Time", "CHADT": "Chatham Daylight Time", "MYT": "Malaysia Time", "PDT": "Pacific Daylight Time", "CDT": "Central Daylight Time", "BOT": "Bolivia Time", "ACWST": "Australian Central Western Standard Time", "WITA": "Central Indonesia Time", "HNT": "Newfoundland Standard Time", "EAT": "East Africa Time", "AKST": "Alaska Standard Time", "AWDT": "Australian Western Daylight Time", "LHDT": "Lord Howe Daylight Time", "CST": "Central Standard Time", "GFT": "French Guiana Time", "ADT": "Atlantic Daylight Time", "WIB": "Western Indonesia Time", "ACST": "Australian Central Standard Time", "WESZ": "Western European Summer Time", "EDT": "Eastern Daylight Time", "AEST": "Australian Eastern Standard Time", "COT": "Colombia Standard Time", "TMST": "Turkmenistan Summer Time", "MST": "Macau Standard Time", "ACDT": "Australian Central Daylight Time", "AWST": "Australian Western Standard Time", "CLST": "Chile Summer Time", "UYT": "Uruguay Standard Time", "EST": "Eastern Standard Time", "COST": "Colombia Summer Time", "BT": "Bhutan Time", "WART": "Western Argentina Standard Time", "TMT": "Turkmenistan Standard Time", "WEZ": "Western European Standard Time", "WAST": "West Africa Summer Time", "GMT": "Greenwich Mean Time", "HKST": "Hong Kong Summer Time", "MESZ": "Central European Summer Time", "NZST": "New Zealand Standard Time", "UYST": "Uruguay Summer Time", "ECT": "Ecuador Time", "SGT": "Singapore Standard Time", "ARST": "Argentina Summer Time", "AEDT": "Australian Eastern Daylight Time", "ChST": "Chamorro Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "OESZ": "Eastern European Summer Time", "CLT": "Chile Standard Time", "VET": "Venezuela Time", "WARST": "Western Argentina Summer Time", "AST": "Atlantic Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "SAST": "South Africa Standard Time", "MDT": "Macau Summer Time", "SRT": "Suriname Time", "PST": "Pacific Standard Time", "NZDT": "New Zealand Daylight Time", "CAT": "Central Africa Time", "WIT": "Eastern Indonesia Time"},
+ timezones: map[string]string{"BOT": "Bolivia Time", "GYT": "Guyana Time", "ACST": "Australian Central Standard Time", "COT": "Colombia Standard Time", "BT": "Bhutan Time", "WAT": "West Africa Standard Time", "ACDT": "Australian Central Daylight Time", "ECT": "Ecuador Time", "AWDT": "Australian Western Daylight Time", "CHADT": "Chatham Daylight Time", "VET": "Venezuela Time", "PST": "Pacific Standard Time", "AEST": "Australian Eastern Standard Time", "UYST": "Uruguay Summer Time", "WIT": "Eastern Indonesia Time", "CDT": "Central Daylight Time", "WART": "Western Argentina Standard Time", "ART": "Argentina Standard Time", "IST": "India Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "∅∅∅": "Amazon Summer Time", "WAST": "West Africa Summer Time", "ChST": "Chamorro Standard Time", "HKST": "Hong Kong Summer Time", "MESZ": "Central European Summer Time", "CAT": "Central Africa Time", "TMST": "Turkmenistan Summer Time", "MST": "Mountain Standard Time", "WITA": "Central Indonesia Time", "JDT": "Japan Daylight Time", "COST": "Colombia Summer Time", "OESZ": "Eastern European Summer Time", "AEDT": "Australian Eastern Daylight Time", "SRT": "Suriname Time", "ACWST": "Australian Central Western Standard Time", "WEZ": "Western European Standard Time", "OEZ": "Eastern European Standard Time", "CLT": "Chile Standard Time", "ADT": "Atlantic Daylight Time", "WIB": "Western Indonesia Time", "TMT": "Turkmenistan Standard Time", "SAST": "South Africa Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "SGT": "Singapore Standard Time", "LHDT": "Lord Howe Daylight Time", "AKST": "Alaska Standard Time", "AST": "Atlantic Standard Time", "EDT": "Eastern Daylight Time", "WESZ": "Western European Summer Time", "EAT": "East Africa Time", "CST": "Central Standard Time", "ARST": "Argentina Summer Time", "MEZ": "Central European Standard Time", "HNT": "Newfoundland Standard Time", "CLST": "Chile Summer Time", "CHAST": "Chatham Standard Time", "GFT": "French Guiana Time", "PDT": "Pacific Daylight Time", "NZST": "New Zealand Standard Time", "HAT": "Newfoundland Daylight Time", "MDT": "Mountain Daylight Time", "MYT": "Malaysia Time", "WARST": "Western Argentina Summer Time", "GMT": "Greenwich Mean Time", "LHST": "Lord Howe Standard Time", "UYT": "Uruguay Standard Time", "JST": "Japan Standard Time", "EST": "Eastern Standard Time", "NZDT": "New Zealand Daylight Time", "HKT": "Hong Kong Standard Time", "AKDT": "Alaska Daylight Time", "ACWDT": "Australian Central Western Daylight Time", "AWST": "Australian Western Standard Time"},
}
}
diff --git a/en_TC/en_TC_test.go b/en_TC/en_TC_test.go
new file mode 100644
index 00000000..2aedceaa
--- /dev/null
+++ b/en_TC/en_TC_test.go
@@ -0,0 +1,1120 @@
+package en_TC
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_TC"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_TK/en_TK.go b/en_TK/en_TK.go
index 570fc510..bb46ffe1 100644
--- a/en_TK/en_TK.go
+++ b/en_TK/en_TK.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"ECT": "Ecuador Time", "MDT": "Macau Summer Time", "GYT": "Guyana Time", "JST": "Japan Standard Time", "SAST": "South Africa Standard Time", "HNT": "Newfoundland Standard Time", "GFT": "French Guiana Time", "AKST": "Alaska Standard Time", "LHST": "Lord Howe Standard Time", "VET": "Venezuela Time", "CLT": "Chile Standard Time", "COT": "Colombia Standard Time", "AST": "Atlantic Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "LHDT": "Lord Howe Daylight Time", "CAT": "Central Africa Time", "∅∅∅": "Brasilia Summer Time", "WAT": "West Africa Standard Time", "TMT": "Turkmenistan Standard Time", "MESZ": "Central European Summer Time", "CLST": "Chile Summer Time", "COST": "Colombia Summer Time", "OEZ": "Eastern European Standard Time", "WIT": "Eastern Indonesia Time", "MST": "Macau Standard Time", "TMST": "Turkmenistan Summer Time", "PDT": "Pacific Daylight Time", "CHADT": "Chatham Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "ACWST": "Australian Central Western Standard Time", "ACWDT": "Australian Central Western Daylight Time", "WEZ": "Western European Standard Time", "BOT": "Bolivia Time", "WESZ": "Western European Summer Time", "EST": "Eastern Standard Time", "WIB": "Western Indonesia Time", "NZDT": "New Zealand Daylight Time", "HKT": "Hong Kong Standard Time", "EDT": "Eastern Daylight Time", "HKST": "Hong Kong Summer Time", "WARST": "Western Argentina Summer Time", "ACDT": "Australian Central Daylight Time", "UYT": "Uruguay Standard Time", "CHAST": "Chatham Standard Time", "BT": "Bhutan Time", "PST": "Pacific Standard Time", "AEDT": "Australian Eastern Daylight Time", "WAST": "West Africa Summer Time", "WART": "Western Argentina Standard Time", "OESZ": "Eastern European Summer Time", "ART": "Argentina Standard Time", "ARST": "Argentina Summer Time", "AWST": "Australian Western Standard Time", "NZST": "New Zealand Standard Time", "ChST": "Chamorro Standard Time", "ADT": "Atlantic Daylight Time", "GMT": "Greenwich Mean Time", "WITA": "Central Indonesia Time", "ACST": "Australian Central Standard Time", "MYT": "Malaysia Time", "MEZ": "Central European Standard Time", "UYST": "Uruguay Summer Time", "SGT": "Singapore Standard Time", "HAT": "Newfoundland Daylight Time", "SRT": "Suriname Time", "AKDT": "Alaska Daylight Time", "AWDT": "Australian Western Daylight Time", "JDT": "Japan Daylight Time", "IST": "India Standard Time", "EAT": "East Africa Time", "CST": "Central Standard Time", "CDT": "Central Daylight Time", "AEST": "Australian Eastern Standard Time"},
+ timezones: map[string]string{"WITA": "Central Indonesia Time", "EST": "Eastern Standard Time", "WESZ": "Western European Summer Time", "COST": "Colombia Summer Time", "OESZ": "Eastern European Summer Time", "ACDT": "Australian Central Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "WIT": "Eastern Indonesia Time", "CDT": "Central Daylight Time", "WARST": "Western Argentina Summer Time", "NZDT": "New Zealand Daylight Time", "PDT": "Pacific Daylight Time", "TMST": "Turkmenistan Summer Time", "CAT": "Central Africa Time", "GYT": "Guyana Time", "CLT": "Chile Standard Time", "MEZ": "Central European Standard Time", "COT": "Colombia Standard Time", "OEZ": "Eastern European Standard Time", "CLST": "Chile Summer Time", "CHADT": "Chatham Daylight Time", "AWST": "Australian Western Standard Time", "ARST": "Argentina Summer Time", "MYT": "Malaysia Time", "JDT": "Japan Daylight Time", "AST": "Atlantic Standard Time", "ART": "Argentina Standard Time", "NZST": "New Zealand Standard Time", "IST": "India Standard Time", "WEZ": "Western European Standard Time", "UYST": "Uruguay Summer Time", "WART": "Western Argentina Standard Time", "EDT": "Eastern Daylight Time", "AEDT": "Australian Eastern Daylight Time", "EAT": "East Africa Time", "TMT": "Turkmenistan Standard Time", "WAST": "West Africa Summer Time", "BT": "Bhutan Time", "BOT": "Bolivia Time", "MESZ": "Central European Summer Time", "LHST": "Lord Howe Standard Time", "MST": "Mountain Standard Time", "AWDT": "Australian Western Daylight Time", "GMT": "Greenwich Mean Time", "UYT": "Uruguay Standard Time", "HKT": "Hong Kong Standard Time", "AKST": "Alaska Standard Time", "∅∅∅": "Amazon Summer Time", "CST": "Central Standard Time", "GFT": "French Guiana Time", "VET": "Venezuela Time", "JST": "Japan Standard Time", "SRT": "Suriname Time", "ECT": "Ecuador Time", "ACWDT": "Australian Central Western Daylight Time", "SAST": "South Africa Standard Time", "SGT": "Singapore Standard Time", "AEST": "Australian Eastern Standard Time", "ACST": "Australian Central Standard Time", "ACWST": "Australian Central Western Standard Time", "WAT": "West Africa Standard Time", "HNT": "Newfoundland Standard Time", "HAT": "Newfoundland Daylight Time", "HKST": "Hong Kong Summer Time", "CHAST": "Chatham Standard Time", "AKDT": "Alaska Daylight Time", "ADT": "Atlantic Daylight Time", "PST": "Pacific Standard Time", "WIB": "Western Indonesia Time", "ChST": "Chamorro Standard Time", "LHDT": "Lord Howe Daylight Time", "MDT": "Mountain Daylight Time"},
}
}
diff --git a/en_TK/en_TK_test.go b/en_TK/en_TK_test.go
new file mode 100644
index 00000000..2d515680
--- /dev/null
+++ b/en_TK/en_TK_test.go
@@ -0,0 +1,1120 @@
+package en_TK
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_TK"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_TO/en_TO.go b/en_TO/en_TO.go
index 7709d992..09c1fa19 100644
--- a/en_TO/en_TO.go
+++ b/en_TO/en_TO.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"∅∅∅": "Brasilia Summer Time", "WITA": "Central Indonesia Time", "MYT": "Malaysia Time", "LHDT": "Lord Howe Daylight Time", "CDT": "Central Daylight Time", "UYT": "Uruguay Standard Time", "WESZ": "Western European Summer Time", "ACWST": "Australian Central Western Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "HKT": "Hong Kong Standard Time", "ACST": "Australian Central Standard Time", "MDT": "Mountain Daylight Time", "COST": "Colombia Summer Time", "OEZ": "Eastern European Standard Time", "ACDT": "Australian Central Daylight Time", "SRT": "Suriname Time", "CHAST": "Chatham Standard Time", "EDT": "Eastern Daylight Time", "WAST": "West Africa Summer Time", "IST": "India Standard Time", "AKST": "Alaska Standard Time", "VET": "Venezuela Time", "COT": "Colombia Standard Time", "LHST": "Lord Howe Standard Time", "BOT": "Bolivia Time", "UYST": "Uruguay Summer Time", "HAT": "Newfoundland Daylight Time", "NZST": "New Zealand Standard Time", "CHADT": "Chatham Daylight Time", "AEST": "Australian Eastern Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "OESZ": "Eastern European Summer Time", "GMT": "Greenwich Mean Time", "ACWDT": "Australian Central Western Daylight Time", "MST": "Mountain Standard Time", "WARST": "Western Argentina Summer Time", "HNT": "Newfoundland Standard Time", "TMT": "Turkmenistan Standard Time", "CLST": "Chile Summer Time", "ECT": "Ecuador Time", "EAT": "East Africa Time", "ART": "Argentina Standard Time", "NZDT": "New Zealand Daylight Time", "AEDT": "Australian Eastern Daylight Time", "BT": "Bhutan Time", "HKST": "Hong Kong Summer Time", "GFT": "French Guiana Time", "MEZ": "Central European Standard Time", "CAT": "Central Africa Time", "ARST": "Argentina Summer Time", "JDT": "Japan Daylight Time", "AWDT": "Australian Western Daylight Time", "TMST": "Turkmenistan Summer Time", "PDT": "Pacific Daylight Time", "AWST": "Australian Western Standard Time", "ADT": "Atlantic Daylight Time", "WIB": "Western Indonesia Time", "CST": "Central Standard Time", "AST": "Atlantic Standard Time", "WAT": "West Africa Standard Time", "WART": "Western Argentina Standard Time", "WIT": "Eastern Indonesia Time", "PST": "Pacific Standard Time", "AKDT": "Alaska Daylight Time", "CLT": "Chile Standard Time", "WEZ": "Western European Standard Time", "ChST": "Chamorro Standard Time", "SAST": "South Africa Standard Time", "JST": "Japan Standard Time", "EST": "Eastern Standard Time", "SGT": "Singapore Standard Time", "GYT": "Guyana Time", "MESZ": "Central European Summer Time"},
+ timezones: map[string]string{"WEZ": "Western European Standard Time", "UYST": "Uruguay Summer Time", "VET": "Venezuela Time", "SGT": "Singapore Standard Time", "ACDT": "Australian Central Daylight Time", "GFT": "French Guiana Time", "IST": "India Standard Time", "LHST": "Lord Howe Standard Time", "ACST": "Australian Central Standard Time", "WITA": "Central Indonesia Time", "HNT": "Newfoundland Standard Time", "SRT": "Suriname Time", "ADT": "Atlantic Daylight Time", "ChST": "Chamorro Standard Time", "WART": "Western Argentina Standard Time", "JST": "Japan Standard Time", "JDT": "Japan Daylight Time", "CLT": "Chile Standard Time", "CLST": "Chile Summer Time", "TMT": "Turkmenistan Standard Time", "OESZ": "Eastern European Summer Time", "BT": "Bhutan Time", "WARST": "Western Argentina Summer Time", "HKT": "Hong Kong Standard Time", "ECT": "Ecuador Time", "EDT": "Eastern Daylight Time", "MESZ": "Central European Summer Time", "EAT": "East Africa Time", "ARST": "Argentina Summer Time", "NZDT": "New Zealand Daylight Time", "MEZ": "Central European Standard Time", "WAST": "West Africa Summer Time", "AWDT": "Australian Western Daylight Time", "ART": "Argentina Standard Time", "PDT": "Pacific Daylight Time", "WESZ": "Western European Summer Time", "COT": "Colombia Standard Time", "OEZ": "Eastern European Standard Time", "MDT": "Mountain Daylight Time", "CST": "Central Standard Time", "CDT": "Central Daylight Time", "AST": "Atlantic Standard Time", "WAT": "West Africa Standard Time", "AEST": "Australian Eastern Standard Time", "AEDT": "Australian Eastern Daylight Time", "MST": "Mountain Standard Time", "MYT": "Malaysia Time", "ACWST": "Australian Central Western Standard Time", "ACWDT": "Australian Central Western Daylight Time", "BOT": "Bolivia Time", "HAT": "Newfoundland Daylight Time", "COST": "Colombia Summer Time", "GMT": "Greenwich Mean Time", "GYT": "Guyana Time", "∅∅∅": "Brasilia Summer Time", "AWST": "Australian Western Standard Time", "NZST": "New Zealand Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "WIB": "Western Indonesia Time", "TMST": "Turkmenistan Summer Time", "CAT": "Central Africa Time", "LHDT": "Lord Howe Daylight Time", "UYT": "Uruguay Standard Time", "WIT": "Eastern Indonesia Time", "HKST": "Hong Kong Summer Time", "CHAST": "Chatham Standard Time", "AKST": "Alaska Standard Time", "AKDT": "Alaska Daylight Time", "SAST": "South Africa Standard Time", "EST": "Eastern Standard Time", "CHADT": "Chatham Daylight Time", "PST": "Pacific Standard Time"},
}
}
diff --git a/en_TO/en_TO_test.go b/en_TO/en_TO_test.go
new file mode 100644
index 00000000..5fc4e930
--- /dev/null
+++ b/en_TO/en_TO_test.go
@@ -0,0 +1,1120 @@
+package en_TO
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_TO"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_TT/en_TT.go b/en_TT/en_TT.go
index 4c295a9e..921abd6e 100644
--- a/en_TT/en_TT.go
+++ b/en_TT/en_TT.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"VET": "Venezuela Time", "CLT": "Chile Standard Time", "WESZ": "Western European Summer Time", "AKDT": "Alaska Daylight Time", "UYT": "Uruguay Standard Time", "CST": "Central Standard Time", "CDT": "Central Daylight Time", "NZST": "New Zealand Standard Time", "SGT": "Singapore Standard Time", "HNT": "Newfoundland Standard Time", "WIB": "Western Indonesia Time", "BOT": "Bolivia Time", "EST": "Eastern Standard Time", "BT": "Bhutan Time", "HAT": "Newfoundland Daylight Time", "WIT": "Eastern Indonesia Time", "OESZ": "Eastern European Summer Time", "LHST": "Lord Howe Standard Time", "MEZ": "Central European Standard Time", "NZDT": "New Zealand Daylight Time", "CLST": "Chile Summer Time", "∅∅∅": "Brasilia Summer Time", "CAT": "Central Africa Time", "WAT": "West Africa Standard Time", "MST": "Macau Standard Time", "ACDT": "Australian Central Daylight Time", "COT": "Colombia Standard Time", "COST": "Colombia Summer Time", "JDT": "Japan Daylight Time", "PST": "Pacific Standard Time", "CHAST": "Chatham Standard Time", "WART": "Western Argentina Standard Time", "ACST": "Australian Central Standard Time", "AWDT": "Australian Western Daylight Time", "AST": "Atlantic Standard Time", "ACWST": "Australian Central Western Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "AWST": "Australian Western Standard Time", "AEDT": "Australian Eastern Daylight Time", "JST": "Japan Standard Time", "AKST": "Alaska Standard Time", "ACWDT": "Australian Central Western Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "HKST": "Hong Kong Summer Time", "WARST": "Western Argentina Summer Time", "WITA": "Central Indonesia Time", "MYT": "Malaysia Time", "ChST": "Chamorro Standard Time", "WEZ": "Western European Standard Time", "PDT": "Pacific Daylight Time", "ECT": "Ecuador Time", "GFT": "French Guiana Time", "ART": "Argentina Standard Time", "EAT": "East Africa Time", "LHDT": "Lord Howe Daylight Time", "ARST": "Argentina Summer Time", "MDT": "Macau Summer Time", "CHADT": "Chatham Daylight Time", "HKT": "Hong Kong Standard Time", "SAST": "South Africa Standard Time", "IST": "India Standard Time", "OEZ": "Eastern European Standard Time", "GMT": "Greenwich Mean Time", "UYST": "Uruguay Summer Time", "EDT": "Eastern Daylight Time", "ADT": "Atlantic Daylight Time", "WAST": "West Africa Summer Time", "TMST": "Turkmenistan Summer Time", "GYT": "Guyana Time", "TMT": "Turkmenistan Standard Time", "SRT": "Suriname Time", "MESZ": "Central European Summer Time", "AEST": "Australian Eastern Standard Time"},
+ timezones: map[string]string{"NZST": "New Zealand Standard Time", "CAT": "Central Africa Time", "WESZ": "Western European Summer Time", "COT": "Colombia Standard Time", "MDT": "Mountain Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "OEZ": "Eastern European Standard Time", "GMT": "Greenwich Mean Time", "CST": "Central Standard Time", "AKST": "Alaska Standard Time", "PST": "Pacific Standard Time", "PDT": "Pacific Daylight Time", "∅∅∅": "Amazon Summer Time", "TMT": "Turkmenistan Standard Time", "SGT": "Singapore Standard Time", "GYT": "Guyana Time", "JDT": "Japan Daylight Time", "WIB": "Western Indonesia Time", "WEZ": "Western European Standard Time", "BT": "Bhutan Time", "AWST": "Australian Western Standard Time", "HAT": "Newfoundland Daylight Time", "COST": "Colombia Summer Time", "MYT": "Malaysia Time", "ADT": "Atlantic Daylight Time", "ACWDT": "Australian Central Western Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "OESZ": "Eastern European Summer Time", "ACST": "Australian Central Standard Time", "SRT": "Suriname Time", "HKT": "Hong Kong Standard Time", "MST": "Mountain Standard Time", "CHADT": "Chatham Daylight Time", "VET": "Venezuela Time", "ACWST": "Australian Central Western Standard Time", "AWDT": "Australian Western Daylight Time", "AEDT": "Australian Eastern Daylight Time", "AKDT": "Alaska Daylight Time", "ARST": "Argentina Summer Time", "BOT": "Bolivia Time", "UYST": "Uruguay Summer Time", "EAT": "East Africa Time", "CDT": "Central Daylight Time", "WARST": "Western Argentina Summer Time", "NZDT": "New Zealand Daylight Time", "SAST": "South Africa Standard Time", "EDT": "Eastern Daylight Time", "WAT": "West Africa Standard Time", "LHST": "Lord Howe Standard Time", "ACDT": "Australian Central Daylight Time", "AST": "Atlantic Standard Time", "IST": "India Standard Time", "UYT": "Uruguay Standard Time", "HKST": "Hong Kong Summer Time", "ECT": "Ecuador Time", "EST": "Eastern Standard Time", "MESZ": "Central European Summer Time", "WAST": "West Africa Summer Time", "AEST": "Australian Eastern Standard Time", "WART": "Western Argentina Standard Time", "ChST": "Chamorro Standard Time", "CLST": "Chile Summer Time", "ART": "Argentina Standard Time", "WITA": "Central Indonesia Time", "MEZ": "Central European Standard Time", "CLT": "Chile Standard Time", "CHAST": "Chatham Standard Time", "TMST": "Turkmenistan Summer Time", "LHDT": "Lord Howe Daylight Time", "JST": "Japan Standard Time", "HNT": "Newfoundland Standard Time", "WIT": "Eastern Indonesia Time", "GFT": "French Guiana Time"},
}
}
diff --git a/en_TT/en_TT_test.go b/en_TT/en_TT_test.go
new file mode 100644
index 00000000..b6bcc9eb
--- /dev/null
+++ b/en_TT/en_TT_test.go
@@ -0,0 +1,1120 @@
+package en_TT
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_TT"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_TV/en_TV.go b/en_TV/en_TV.go
index c8612902..3a7c5560 100644
--- a/en_TV/en_TV.go
+++ b/en_TV/en_TV.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"COT": "Colombia Standard Time", "WAT": "West Africa Standard Time", "WAST": "West Africa Summer Time", "TMT": "Turkmenistan Standard Time", "LHDT": "Lord Howe Daylight Time", "VET": "Venezuela Time", "WESZ": "Western European Summer Time", "EDT": "Eastern Daylight Time", "SGT": "Singapore Standard Time", "PST": "Pacific Standard Time", "NZST": "New Zealand Standard Time", "CLST": "Chile Summer Time", "WARST": "Western Argentina Summer Time", "OESZ": "Eastern European Summer Time", "TMST": "Turkmenistan Summer Time", "CHADT": "Chatham Daylight Time", "HKST": "Hong Kong Summer Time", "ACST": "Australian Central Standard Time", "ACDT": "Australian Central Daylight Time", "ARST": "Argentina Summer Time", "HKT": "Hong Kong Standard Time", "AEDT": "Australian Eastern Daylight Time", "WEZ": "Western European Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "GYT": "Guyana Time", "BOT": "Bolivia Time", "CST": "Central Standard Time", "ECT": "Ecuador Time", "JST": "Japan Standard Time", "UYST": "Uruguay Summer Time", "GFT": "French Guiana Time", "CAT": "Central Africa Time", "HAST": "Hawaii-Aleutian Standard Time", "OEZ": "Eastern European Standard Time", "WITA": "Central Indonesia Time", "AEST": "Australian Eastern Standard Time", "AKDT": "Alaska Daylight Time", "AWDT": "Australian Western Daylight Time", "∅∅∅": "Brasilia Summer Time", "HNT": "Newfoundland Standard Time", "LHST": "Lord Howe Standard Time", "UYT": "Uruguay Standard Time", "EST": "Eastern Standard Time", "AST": "Atlantic Standard Time", "PDT": "Pacific Daylight Time", "ChST": "Chamorro Standard Time", "GMT": "Greenwich Mean Time", "WIT": "Eastern Indonesia Time", "WIB": "Western Indonesia Time", "AWST": "Australian Western Standard Time", "MYT": "Malaysia Time", "AKST": "Alaska Standard Time", "NZDT": "New Zealand Daylight Time", "ADT": "Atlantic Daylight Time", "BT": "Bhutan Time", "HAT": "Newfoundland Daylight Time", "IST": "India Standard Time", "ART": "Argentina Standard Time", "MESZ": "Central European Summer Time", "CHAST": "Chatham Standard Time", "JDT": "Japan Daylight Time", "SRT": "Suriname Time", "MEZ": "Central European Standard Time", "ACWST": "Australian Central Western Standard Time", "ACWDT": "Australian Central Western Daylight Time", "COST": "Colombia Summer Time", "WART": "Western Argentina Standard Time", "SAST": "South Africa Standard Time", "CDT": "Central Daylight Time", "MDT": "Mountain Daylight Time", "CLT": "Chile Standard Time", "EAT": "East Africa Time", "MST": "Mountain Standard Time"},
+ timezones: map[string]string{"MST": "Macau Standard Time", "MDT": "Macau Summer Time", "AEDT": "Australian Eastern Daylight Time", "UYT": "Uruguay Standard Time", "CLST": "Chile Summer Time", "IST": "India Standard Time", "MYT": "Malaysia Time", "CST": "Central Standard Time", "WITA": "Central Indonesia Time", "NZST": "New Zealand Standard Time", "MESZ": "Central European Summer Time", "CAT": "Central Africa Time", "WAT": "West Africa Standard Time", "HAT": "Newfoundland Daylight Time", "AEST": "Australian Eastern Standard Time", "ARST": "Argentina Summer Time", "PST": "Pacific Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "∅∅∅": "Amazon Summer Time", "OESZ": "Eastern European Summer Time", "TMT": "Turkmenistan Standard Time", "WESZ": "Western European Summer Time", "HNT": "Newfoundland Standard Time", "UYST": "Uruguay Summer Time", "CLT": "Chile Standard Time", "HKT": "Hong Kong Standard Time", "HKST": "Hong Kong Summer Time", "JST": "Japan Standard Time", "ADT": "Atlantic Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "GYT": "Guyana Time", "AWDT": "Australian Western Daylight Time", "EST": "Eastern Standard Time", "WIB": "Western Indonesia Time", "SGT": "Singapore Standard Time", "AST": "Atlantic Standard Time", "ACWDT": "Australian Central Western Daylight Time", "SAST": "South Africa Standard Time", "PDT": "Pacific Daylight Time", "MEZ": "Central European Standard Time", "LHDT": "Lord Howe Daylight Time", "CDT": "Central Daylight Time", "CHADT": "Chatham Daylight Time", "COST": "Colombia Summer Time", "GMT": "Greenwich Mean Time", "WART": "Western Argentina Standard Time", "AKDT": "Alaska Daylight Time", "ECT": "Ecuador Time", "WEZ": "Western European Standard Time", "ACST": "Australian Central Standard Time", "ACDT": "Australian Central Daylight Time", "CHAST": "Chatham Standard Time", "TMST": "Turkmenistan Summer Time", "OEZ": "Eastern European Standard Time", "BT": "Bhutan Time", "LHST": "Lord Howe Standard Time", "SRT": "Suriname Time", "ACWST": "Australian Central Western Standard Time", "NZDT": "New Zealand Daylight Time", "WIT": "Eastern Indonesia Time", "WARST": "Western Argentina Summer Time", "VET": "Venezuela Time", "BOT": "Bolivia Time", "EDT": "Eastern Daylight Time", "EAT": "East Africa Time", "JDT": "Japan Daylight Time", "AKST": "Alaska Standard Time", "AWST": "Australian Western Standard Time", "ART": "Argentina Standard Time", "WAST": "West Africa Summer Time", "COT": "Colombia Standard Time", "ChST": "Chamorro Standard Time", "GFT": "French Guiana Time"},
}
}
diff --git a/en_TV/en_TV_test.go b/en_TV/en_TV_test.go
new file mode 100644
index 00000000..db75dbbe
--- /dev/null
+++ b/en_TV/en_TV_test.go
@@ -0,0 +1,1120 @@
+package en_TV
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_TV"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_TZ/en_TZ.go b/en_TZ/en_TZ.go
index 22ed82be..c46295e6 100644
--- a/en_TZ/en_TZ.go
+++ b/en_TZ/en_TZ.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"NZDT": "New Zealand Daylight Time", "MDT": "Mountain Daylight Time", "CHADT": "Chatham Daylight Time", "WART": "Western Argentina Standard Time", "IST": "India Standard Time", "LHDT": "Lord Howe Daylight Time", "CST": "Central Standard Time", "ACWDT": "Australian Central Western Daylight Time", "COST": "Colombia Summer Time", "PDT": "Pacific Daylight Time", "MYT": "Malaysia Time", "MEZ": "Central European Standard Time", "NZST": "New Zealand Standard Time", "EAT": "East Africa Time", "WESZ": "Western European Summer Time", "COT": "Colombia Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "CDT": "Central Daylight Time", "AEST": "Australian Eastern Standard Time", "ChST": "Chamorro Standard Time", "SAST": "South Africa Standard Time", "HNT": "Newfoundland Standard Time", "JST": "Japan Standard Time", "JDT": "Japan Daylight Time", "CLST": "Chile Summer Time", "WAST": "West Africa Summer Time", "HAT": "Newfoundland Daylight Time", "TMT": "Turkmenistan Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "WAT": "West Africa Standard Time", "GFT": "French Guiana Time", "WIB": "Western Indonesia Time", "ART": "Argentina Standard Time", "AWDT": "Australian Western Daylight Time", "WIT": "Eastern Indonesia Time", "BOT": "Bolivia Time", "CHAST": "Chatham Standard Time", "CAT": "Central Africa Time", "OEZ": "Eastern European Standard Time", "AWST": "Australian Western Standard Time", "ACWST": "Australian Central Western Standard Time", "ADT": "Atlantic Daylight Time", "OESZ": "Eastern European Summer Time", "ARST": "Argentina Summer Time", "AKST": "Alaska Standard Time", "AKDT": "Alaska Daylight Time", "WEZ": "Western European Standard Time", "CLT": "Chile Standard Time", "BT": "Bhutan Time", "WITA": "Central Indonesia Time", "ACDT": "Australian Central Daylight Time", "UYT": "Uruguay Standard Time", "AEDT": "Australian Eastern Daylight Time", "VET": "Venezuela Time", "TMST": "Turkmenistan Summer Time", "SRT": "Suriname Time", "UYST": "Uruguay Summer Time", "MST": "Mountain Standard Time", "SGT": "Singapore Standard Time", "WARST": "Western Argentina Summer Time", "PST": "Pacific Standard Time", "MESZ": "Central European Summer Time", "GYT": "Guyana Time", "EST": "Eastern Standard Time", "ECT": "Ecuador Time", "HKT": "Hong Kong Standard Time", "GMT": "Greenwich Mean Time", "EDT": "Eastern Daylight Time", "∅∅∅": "Brasilia Summer Time", "AST": "Atlantic Standard Time", "HKST": "Hong Kong Summer Time", "ACST": "Australian Central Standard Time", "LHST": "Lord Howe Standard Time"},
+ timezones: map[string]string{"PDT": "Pacific Daylight Time", "WESZ": "Western European Summer Time", "OESZ": "Eastern European Summer Time", "BT": "Bhutan Time", "CDT": "Central Daylight Time", "AST": "Atlantic Standard Time", "ACWDT": "Australian Central Western Daylight Time", "EDT": "Eastern Daylight Time", "CAT": "Central Africa Time", "SGT": "Singapore Standard Time", "CHADT": "Chatham Daylight Time", "WITA": "Central Indonesia Time", "AKDT": "Alaska Daylight Time", "ACWST": "Australian Central Western Standard Time", "ART": "Argentina Standard Time", "NZST": "New Zealand Standard Time", "NZDT": "New Zealand Daylight Time", "EST": "Eastern Standard Time", "ChST": "Chamorro Standard Time", "CLST": "Chile Summer Time", "ECT": "Ecuador Time", "WAST": "West Africa Summer Time", "GYT": "Guyana Time", "ACDT": "Australian Central Daylight Time", "ARST": "Argentina Summer Time", "WART": "Western Argentina Standard Time", "VET": "Venezuela Time", "TMST": "Turkmenistan Summer Time", "AEDT": "Australian Eastern Daylight Time", "EAT": "East Africa Time", "MYT": "Malaysia Time", "HAT": "Newfoundland Daylight Time", "OEZ": "Eastern European Standard Time", "MDT": "Mountain Daylight Time", "AWDT": "Australian Western Daylight Time", "IST": "India Standard Time", "COT": "Colombia Standard Time", "UYST": "Uruguay Summer Time", "LHST": "Lord Howe Standard Time", "LHDT": "Lord Howe Daylight Time", "AEST": "Australian Eastern Standard Time", "MST": "Mountain Standard Time", "WEZ": "Western European Standard Time", "AKST": "Alaska Standard Time", "BOT": "Bolivia Time", "WIT": "Eastern Indonesia Time", "CST": "Central Standard Time", "JDT": "Japan Daylight Time", "ADT": "Atlantic Daylight Time", "SAST": "South Africa Standard Time", "MESZ": "Central European Summer Time", "∅∅∅": "Brasilia Summer Time", "ACST": "Australian Central Standard Time", "GFT": "French Guiana Time", "HADT": "Hawaii-Aleutian Daylight Time", "WIB": "Western Indonesia Time", "SRT": "Suriname Time", "HKST": "Hong Kong Summer Time", "AWST": "Australian Western Standard Time", "UYT": "Uruguay Standard Time", "WARST": "Western Argentina Summer Time", "CHAST": "Chatham Standard Time", "PST": "Pacific Standard Time", "MEZ": "Central European Standard Time", "WAT": "West Africa Standard Time", "HNT": "Newfoundland Standard Time", "CLT": "Chile Standard Time", "JST": "Japan Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "TMT": "Turkmenistan Standard Time", "GMT": "Greenwich Mean Time", "HKT": "Hong Kong Standard Time", "COST": "Colombia Summer Time"},
}
}
diff --git a/en_TZ/en_TZ_test.go b/en_TZ/en_TZ_test.go
new file mode 100644
index 00000000..c2bcc582
--- /dev/null
+++ b/en_TZ/en_TZ_test.go
@@ -0,0 +1,1120 @@
+package en_TZ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_TZ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_UG/en_UG.go b/en_UG/en_UG.go
index 91843b51..ef6ba309 100644
--- a/en_UG/en_UG.go
+++ b/en_UG/en_UG.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"HKT": "Hong Kong Standard Time", "ACWST": "Australian Central Western Standard Time", "EST": "Eastern Standard Time", "SGT": "Singapore Standard Time", "ACST": "Australian Central Standard Time", "AKDT": "Alaska Daylight Time", "AWDT": "Australian Western Daylight Time", "MEZ": "Central European Standard Time", "CHAST": "Chatham Standard Time", "ACWDT": "Australian Central Western Daylight Time", "WIB": "Western Indonesia Time", "ART": "Argentina Standard Time", "GYT": "Guyana Time", "VET": "Venezuela Time", "EDT": "Eastern Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "WESZ": "Western European Summer Time", "MDT": "Mountain Daylight Time", "CDT": "Central Daylight Time", "AEDT": "Australian Eastern Daylight Time", "TMST": "Turkmenistan Summer Time", "WAST": "West Africa Summer Time", "PDT": "Pacific Daylight Time", "LHDT": "Lord Howe Daylight Time", "BOT": "Bolivia Time", "ECT": "Ecuador Time", "SAST": "South Africa Standard Time", "MYT": "Malaysia Time", "NZDT": "New Zealand Daylight Time", "WARST": "Western Argentina Summer Time", "IST": "India Standard Time", "WAT": "West Africa Standard Time", "OESZ": "Eastern European Summer Time", "HNT": "Newfoundland Standard Time", "GFT": "French Guiana Time", "EAT": "East Africa Time", "CST": "Central Standard Time", "CLST": "Chile Summer Time", "HAST": "Hawaii-Aleutian Standard Time", "SRT": "Suriname Time", "AWST": "Australian Western Standard Time", "MESZ": "Central European Summer Time", "ADT": "Atlantic Daylight Time", "JDT": "Japan Daylight Time", "UYT": "Uruguay Standard Time", "∅∅∅": "Brasilia Summer Time", "TMT": "Turkmenistan Standard Time", "CLT": "Chile Standard Time", "ARST": "Argentina Summer Time", "JST": "Japan Standard Time", "NZST": "New Zealand Standard Time", "COT": "Colombia Standard Time", "WART": "Western Argentina Standard Time", "WITA": "Central Indonesia Time", "AKST": "Alaska Standard Time", "LHST": "Lord Howe Standard Time", "UYST": "Uruguay Summer Time", "AEST": "Australian Eastern Standard Time", "HKST": "Hong Kong Summer Time", "HAT": "Newfoundland Daylight Time", "ACDT": "Australian Central Daylight Time", "PST": "Pacific Standard Time", "ChST": "Chamorro Standard Time", "MST": "Mountain Standard Time", "AST": "Atlantic Standard Time", "WIT": "Eastern Indonesia Time", "OEZ": "Eastern European Standard Time", "GMT": "Greenwich Mean Time", "COST": "Colombia Summer Time", "BT": "Bhutan Time", "CHADT": "Chatham Daylight Time", "WEZ": "Western European Standard Time", "CAT": "Central Africa Time"},
+ timezones: map[string]string{"ART": "Argentina Standard Time", "SAST": "South Africa Standard Time", "CAT": "Central Africa Time", "WART": "Western Argentina Standard Time", "AKDT": "Alaska Daylight Time", "WARST": "Western Argentina Summer Time", "SRT": "Suriname Time", "JST": "Japan Standard Time", "UYT": "Uruguay Standard Time", "BT": "Bhutan Time", "CST": "Central Standard Time", "EST": "Eastern Standard Time", "COST": "Colombia Summer Time", "TMT": "Turkmenistan Standard Time", "HNT": "Newfoundland Standard Time", "IST": "India Standard Time", "WITA": "Central Indonesia Time", "HADT": "Hawaii-Aleutian Daylight Time", "GYT": "Guyana Time", "ACST": "Australian Central Standard Time", "HKT": "Hong Kong Standard Time", "ChST": "Chamorro Standard Time", "EAT": "East Africa Time", "MYT": "Malaysia Time", "WIB": "Western Indonesia Time", "OEZ": "Eastern European Standard Time", "AEST": "Australian Eastern Standard Time", "∅∅∅": "Brasilia Summer Time", "CDT": "Central Daylight Time", "AWDT": "Australian Western Daylight Time", "COT": "Colombia Standard Time", "WEZ": "Western European Standard Time", "WIT": "Eastern Indonesia Time", "ACWST": "Australian Central Western Standard Time", "PDT": "Pacific Daylight Time", "OESZ": "Eastern European Summer Time", "LHST": "Lord Howe Standard Time", "ACDT": "Australian Central Daylight Time", "PST": "Pacific Standard Time", "CLST": "Chile Summer Time", "ACWDT": "Australian Central Western Daylight Time", "NZST": "New Zealand Standard Time", "HKST": "Hong Kong Summer Time", "CHADT": "Chatham Daylight Time", "WAT": "West Africa Standard Time", "CLT": "Chile Standard Time", "LHDT": "Lord Howe Daylight Time", "NZDT": "New Zealand Daylight Time", "VET": "Venezuela Time", "JDT": "Japan Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "TMST": "Turkmenistan Summer Time", "HAT": "Newfoundland Daylight Time", "MESZ": "Central European Summer Time", "MST": "Mountain Standard Time", "AKST": "Alaska Standard Time", "BOT": "Bolivia Time", "CHAST": "Chatham Standard Time", "EDT": "Eastern Daylight Time", "GMT": "Greenwich Mean Time", "AEDT": "Australian Eastern Daylight Time", "MDT": "Mountain Daylight Time", "ECT": "Ecuador Time", "ADT": "Atlantic Daylight Time", "AWST": "Australian Western Standard Time", "ARST": "Argentina Summer Time", "MEZ": "Central European Standard Time", "WESZ": "Western European Summer Time", "SGT": "Singapore Standard Time", "GFT": "French Guiana Time", "WAST": "West Africa Summer Time", "UYST": "Uruguay Summer Time", "AST": "Atlantic Standard Time"},
}
}
diff --git a/en_UG/en_UG_test.go b/en_UG/en_UG_test.go
new file mode 100644
index 00000000..ef51782d
--- /dev/null
+++ b/en_UG/en_UG_test.go
@@ -0,0 +1,1120 @@
+package en_UG
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_UG"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_UM/en_UM.go b/en_UM/en_UM.go
index 4551e118..eb6a7a4f 100644
--- a/en_UM/en_UM.go
+++ b/en_UM/en_UM.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"AEDT": "Australian Eastern Daylight Time", "VET": "Venezuela Time", "ACST": "Australian Central Standard Time", "NZST": "New Zealand Standard Time", "PDT": "Pacific Daylight Time", "GYT": "Guyana Time", "JDT": "Japan Daylight Time", "CST": "Central Standard Time", "CLT": "Chile Standard Time", "WAST": "West Africa Summer Time", "CHAST": "Chatham Standard Time", "AEST": "Australian Eastern Standard Time", "SGT": "Singapore Standard Time", "ACDT": "Australian Central Daylight Time", "MEZ": "Central European Standard Time", "MDT": "Mountain Daylight Time", "HKST": "Hong Kong Summer Time", "OESZ": "Eastern European Summer Time", "AWDT": "Australian Western Daylight Time", "MST": "Mountain Standard Time", "IST": "India Standard Time", "ACWDT": "Australian Central Western Daylight Time", "WART": "Western Argentina Standard Time", "WARST": "Western Argentina Summer Time", "TMST": "Turkmenistan Summer Time", "PST": "Pacific Standard Time", "NZDT": "New Zealand Daylight Time", "ACWST": "Australian Central Western Standard Time", "CHADT": "Chatham Daylight Time", "HKT": "Hong Kong Standard Time", "GMT": "Greenwich Mean Time", "HNT": "Newfoundland Standard Time", "AKDT": "Alaska Daylight Time", "CDT": "Central Daylight Time", "WIT": "Eastern Indonesia Time", "COST": "Colombia Summer Time", "AST": "Atlantic Standard Time", "ADT": "Atlantic Daylight Time", "WITA": "Central Indonesia Time", "WIB": "Western Indonesia Time", "MYT": "Malaysia Time", "AKST": "Alaska Standard Time", "ChST": "Chamorro Standard Time", "UYST": "Uruguay Summer Time", "EDT": "Eastern Daylight Time", "CAT": "Central Africa Time", "BT": "Bhutan Time", "HAT": "Newfoundland Daylight Time", "AWST": "Australian Western Standard Time", "LHST": "Lord Howe Standard Time", "UYT": "Uruguay Standard Time", "JST": "Japan Standard Time", "EST": "Eastern Standard Time", "ARST": "Argentina Summer Time", "TMT": "Turkmenistan Standard Time", "WEZ": "Western European Standard Time", "SRT": "Suriname Time", "SAST": "South Africa Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "WAT": "West Africa Standard Time", "OEZ": "Eastern European Standard Time", "GFT": "French Guiana Time", "EAT": "East Africa Time", "BOT": "Bolivia Time", "∅∅∅": "Brasilia Summer Time", "HADT": "Hawaii-Aleutian Daylight Time", "LHDT": "Lord Howe Daylight Time", "COT": "Colombia Standard Time", "CLST": "Chile Summer Time", "WESZ": "Western European Summer Time", "ECT": "Ecuador Time", "ART": "Argentina Standard Time", "MESZ": "Central European Summer Time"},
+ timezones: map[string]string{"UYST": "Uruguay Summer Time", "LHDT": "Lord Howe Daylight Time", "WARST": "Western Argentina Summer Time", "IST": "India Standard Time", "COST": "Colombia Summer Time", "PDT": "Pacific Daylight Time", "SAST": "South Africa Standard Time", "CST": "Central Standard Time", "GFT": "French Guiana Time", "AWST": "Australian Western Standard Time", "CDT": "Central Daylight Time", "EAT": "East Africa Time", "ADT": "Atlantic Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "WAT": "West Africa Standard Time", "NZDT": "New Zealand Daylight Time", "EST": "Eastern Standard Time", "UYT": "Uruguay Standard Time", "ACWDT": "Australian Central Western Daylight Time", "WEZ": "Western European Standard Time", "LHST": "Lord Howe Standard Time", "MDT": "Macau Summer Time", "HKST": "Hong Kong Summer Time", "ART": "Argentina Standard Time", "MESZ": "Central European Summer Time", "HNT": "Newfoundland Standard Time", "CLT": "Chile Standard Time", "ACST": "Australian Central Standard Time", "ARST": "Argentina Summer Time", "AKST": "Alaska Standard Time", "AKDT": "Alaska Daylight Time", "PST": "Pacific Standard Time", "EDT": "Eastern Daylight Time", "TMT": "Turkmenistan Standard Time", "CAT": "Central Africa Time", "ECT": "Ecuador Time", "AWDT": "Australian Western Daylight Time", "JDT": "Japan Daylight Time", "TMST": "Turkmenistan Summer Time", "ChST": "Chamorro Standard Time", "OESZ": "Eastern European Summer Time", "HKT": "Hong Kong Standard Time", "AST": "Atlantic Standard Time", "HAT": "Newfoundland Daylight Time", "WITA": "Central Indonesia Time", "BOT": "Bolivia Time", "SRT": "Suriname Time", "ACDT": "Australian Central Daylight Time", "CHAST": "Chatham Standard Time", "WIB": "Western Indonesia Time", "CLST": "Chile Summer Time", "∅∅∅": "Azores Summer Time", "ACWST": "Australian Central Western Standard Time", "SGT": "Singapore Standard Time", "WAST": "West Africa Summer Time", "GMT": "Greenwich Mean Time", "MST": "Macau Standard Time", "CHADT": "Chatham Daylight Time", "NZST": "New Zealand Standard Time", "AEST": "Australian Eastern Standard Time", "MYT": "Malaysia Time", "WIT": "Eastern Indonesia Time", "MEZ": "Central European Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "COT": "Colombia Standard Time", "WESZ": "Western European Summer Time", "GYT": "Guyana Time", "OEZ": "Eastern European Standard Time", "AEDT": "Australian Eastern Daylight Time", "BT": "Bhutan Time", "WART": "Western Argentina Standard Time", "VET": "Venezuela Time", "JST": "Japan Standard Time"},
}
}
diff --git a/en_UM/en_UM_test.go b/en_UM/en_UM_test.go
new file mode 100644
index 00000000..f15ecdc8
--- /dev/null
+++ b/en_UM/en_UM_test.go
@@ -0,0 +1,1120 @@
+package en_UM
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_UM"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_US/en_US.go b/en_US/en_US.go
index 34a5d3cd..eeacdd18 100644
--- a/en_US/en_US.go
+++ b/en_US/en_US.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"HAT": "Newfoundland Daylight Time", "WIT": "Eastern Indonesia Time", "OESZ": "Eastern European Summer Time", "VET": "Venezuela Time", "WAST": "West Africa Summer Time", "HKST": "Hong Kong Summer Time", "ART": "Argentina Standard Time", "GYT": "Guyana Time", "MESZ": "Central European Summer Time", "AST": "Atlantic Standard Time", "WAT": "West Africa Standard Time", "OEZ": "Eastern European Standard Time", "NZDT": "New Zealand Daylight Time", "CLT": "Chile Standard Time", "WART": "Western Argentina Standard Time", "GFT": "French Guiana Time", "WITA": "Central Indonesia Time", "∅∅∅": "Amazon Summer Time", "TMT": "Turkmenistan Standard Time", "TMST": "Turkmenistan Summer Time", "ChST": "Chamorro Standard Time", "ECT": "Ecuador Time", "AWDT": "Australian Western Daylight Time", "WEZ": "Western European Standard Time", "CAT": "Central Africa Time", "EDT": "Eastern Daylight Time", "HKT": "Hong Kong Standard Time", "UYT": "Uruguay Standard Time", "EST": "Eastern Standard Time", "IST": "India Standard Time", "GMT": "Greenwich Mean Time", "PDT": "Pacific Daylight Time", "COT": "Colombia Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "WIB": "Western Indonesia Time", "ARST": "Argentina Summer Time", "MYT": "Malaysia Time", "JST": "Japan Standard Time", "SRT": "Suriname Time", "CDT": "Central Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "BT": "Bhutan Time", "MST": "Macau Standard Time", "NZST": "New Zealand Standard Time", "ACWST": "Australian Central Western Standard Time", "AEST": "Australian Eastern Standard Time", "CHADT": "Chatham Daylight Time", "CLST": "Chile Summer Time", "MDT": "Macau Summer Time", "MEZ": "Central European Standard Time", "BOT": "Bolivia Time", "ACWDT": "Australian Central Western Daylight Time", "AWST": "Australian Western Standard Time", "LHST": "Lord Howe Standard Time", "COST": "Colombia Summer Time", "SGT": "Singapore Standard Time", "EAT": "East Africa Time", "LHDT": "Lord Howe Daylight Time", "CHAST": "Chatham Standard Time", "AKST": "Alaska Standard Time", "PST": "Pacific Standard Time", "CST": "Central Standard Time", "UYST": "Uruguay Summer Time", "AEDT": "Australian Eastern Daylight Time", "WARST": "Western Argentina Summer Time", "HNT": "Newfoundland Standard Time", "ACST": "Australian Central Standard Time", "ACDT": "Australian Central Daylight Time", "AKDT": "Alaska Daylight Time", "JDT": "Japan Daylight Time", "ADT": "Atlantic Daylight Time", "WESZ": "Western European Summer Time", "SAST": "South Africa Standard Time"},
+ timezones: map[string]string{"SAST": "South Africa Standard Time", "MESZ": "Central European Summer Time", "HNT": "Newfoundland Standard Time", "ChST": "Chamorro Standard Time", "MDT": "Mountain Daylight Time", "GYT": "Guyana Time", "ACDT": "Australian Central Daylight Time", "AWDT": "Australian Western Daylight Time", "SGT": "Singapore Standard Time", "WARST": "Western Argentina Summer Time", "EST": "Eastern Standard Time", "TMT": "Turkmenistan Standard Time", "ACST": "Australian Central Standard Time", "WART": "Western Argentina Standard Time", "EDT": "Eastern Daylight Time", "GMT": "Greenwich Mean Time", "CDT": "Central Daylight Time", "GFT": "French Guiana Time", "MEZ": "Central European Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "LHDT": "Lord Howe Daylight Time", "WIT": "Eastern Indonesia Time", "ACWDT": "Australian Central Western Daylight Time", "ARST": "Argentina Summer Time", "JDT": "Japan Daylight Time", "CAT": "Central Africa Time", "COT": "Colombia Standard Time", "AEST": "Australian Eastern Standard Time", "HKST": "Hong Kong Summer Time", "PST": "Pacific Standard Time", "NZST": "New Zealand Standard Time", "SRT": "Suriname Time", "ECT": "Ecuador Time", "CHAST": "Chatham Standard Time", "AKST": "Alaska Standard Time", "ACWST": "Australian Central Western Standard Time", "IST": "India Standard Time", "WAT": "West Africa Standard Time", "OESZ": "Eastern European Summer Time", "UYT": "Uruguay Standard Time", "VET": "Venezuela Time", "AKDT": "Alaska Daylight Time", "AWST": "Australian Western Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "NZDT": "New Zealand Daylight Time", "TMST": "Turkmenistan Summer Time", "CLT": "Chile Standard Time", "HAT": "Newfoundland Daylight Time", "LHST": "Lord Howe Standard Time", "MYT": "Malaysia Time", "CLST": "Chile Summer Time", "CST": "Central Standard Time", "AST": "Atlantic Standard Time", "WEZ": "Western European Standard Time", "WESZ": "Western European Summer Time", "COST": "Colombia Summer Time", "MST": "Mountain Standard Time", "JST": "Japan Standard Time", "BOT": "Bolivia Time", "OEZ": "Eastern European Standard Time", "WITA": "Central Indonesia Time", "∅∅∅": "Amazon Summer Time", "WAST": "West Africa Summer Time", "BT": "Bhutan Time", "UYST": "Uruguay Summer Time", "ADT": "Atlantic Daylight Time", "ART": "Argentina Standard Time", "PDT": "Pacific Daylight Time", "WIB": "Western Indonesia Time", "AEDT": "Australian Eastern Daylight Time", "EAT": "East Africa Time", "HKT": "Hong Kong Standard Time", "CHADT": "Chatham Daylight Time"},
}
}
diff --git a/en_US/en_US_test.go b/en_US/en_US_test.go
new file mode 100644
index 00000000..9b43fecd
--- /dev/null
+++ b/en_US/en_US_test.go
@@ -0,0 +1,1120 @@
+package en_US
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_US"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_US_POSIX/en_US_POSIX.go b/en_US_POSIX/en_US_POSIX.go
index ed7ad489..f163b9e3 100644
--- a/en_US_POSIX/en_US_POSIX.go
+++ b/en_US_POSIX/en_US_POSIX.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"HKT": "Hong Kong Standard Time", "JDT": "Japan Daylight Time", "AWDT": "Australian Western Daylight Time", "MEZ": "Central European Standard Time", "WESZ": "Western European Summer Time", "SGT": "Singapore Standard Time", "WIB": "Western Indonesia Time", "OESZ": "Eastern European Summer Time", "LHST": "Lord Howe Standard Time", "CHADT": "Chatham Daylight Time", "WARST": "Western Argentina Summer Time", "HKST": "Hong Kong Summer Time", "CAT": "Central Africa Time", "OEZ": "Eastern European Standard Time", "HNT": "Newfoundland Standard Time", "CLST": "Chile Summer Time", "WEZ": "Western European Standard Time", "MESZ": "Central European Summer Time", "NZST": "New Zealand Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "WITA": "Central Indonesia Time", "ACDT": "Australian Central Daylight Time", "CDT": "Central Daylight Time", "WAT": "West Africa Standard Time", "ACST": "Australian Central Standard Time", "ACWDT": "Australian Central Western Daylight Time", "GMT": "Greenwich Mean Time", "CHAST": "Chatham Standard Time", "VET": "Venezuela Time", "AKDT": "Alaska Daylight Time", "BOT": "Bolivia Time", "ACWST": "Australian Central Western Standard Time", "ChST": "Chamorro Standard Time", "∅∅∅": "Brasilia Summer Time", "ADT": "Atlantic Daylight Time", "WAST": "West Africa Summer Time", "UYT": "Uruguay Standard Time", "CST": "Central Standard Time", "MDT": "Mountain Daylight Time", "CLT": "Chile Standard Time", "WIT": "Eastern Indonesia Time", "SRT": "Suriname Time", "AEST": "Australian Eastern Standard Time", "GFT": "French Guiana Time", "JST": "Japan Standard Time", "PDT": "Pacific Daylight Time", "WART": "Western Argentina Standard Time", "ARST": "Argentina Summer Time", "UYST": "Uruguay Summer Time", "AEDT": "Australian Eastern Daylight Time", "IST": "India Standard Time", "ECT": "Ecuador Time", "SAST": "South Africa Standard Time", "HAT": "Newfoundland Daylight Time", "PST": "Pacific Standard Time", "NZDT": "New Zealand Daylight Time", "EDT": "Eastern Daylight Time", "COST": "Colombia Summer Time", "HAST": "Hawaii-Aleutian Standard Time", "BT": "Bhutan Time", "TMT": "Turkmenistan Standard Time", "EAT": "East Africa Time", "GYT": "Guyana Time", "MST": "Mountain Standard Time", "COT": "Colombia Standard Time", "AKST": "Alaska Standard Time", "EST": "Eastern Standard Time", "MYT": "Malaysia Time", "ART": "Argentina Standard Time", "AWST": "Australian Western Standard Time", "LHDT": "Lord Howe Daylight Time", "AST": "Atlantic Standard Time", "TMST": "Turkmenistan Summer Time"},
+ timezones: map[string]string{"LHDT": "Lord Howe Daylight Time", "CST": "Central Standard Time", "MDT": "Macau Summer Time", "HKT": "Hong Kong Standard Time", "CHAST": "Chatham Standard Time", "ADT": "Atlantic Daylight Time", "NZST": "New Zealand Standard Time", "GYT": "Guyana Time", "MST": "Macau Standard Time", "AWST": "Australian Western Standard Time", "SRT": "Suriname Time", "WITA": "Central Indonesia Time", "JDT": "Japan Daylight Time", "IST": "India Standard Time", "OESZ": "Eastern European Summer Time", "UYT": "Uruguay Standard Time", "CDT": "Central Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "WESZ": "Western European Summer Time", "COT": "Colombia Standard Time", "OEZ": "Eastern European Standard Time", "AEST": "Australian Eastern Standard Time", "ChST": "Chamorro Standard Time", "MESZ": "Central European Summer Time", "SGT": "Singapore Standard Time", "WIB": "Western Indonesia Time", "AEDT": "Australian Eastern Daylight Time", "WIT": "Eastern Indonesia Time", "ACDT": "Australian Central Daylight Time", "ACWST": "Australian Central Western Standard Time", "HNT": "Newfoundland Standard Time", "COST": "Colombia Summer Time", "LHST": "Lord Howe Standard Time", "AKST": "Alaska Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "ACST": "Australian Central Standard Time", "WART": "Western Argentina Standard Time", "VET": "Venezuela Time", "AKDT": "Alaska Daylight Time", "PDT": "Pacific Daylight Time", "HAT": "Newfoundland Daylight Time", "BT": "Bhutan Time", "JST": "Japan Standard Time", "EST": "Eastern Standard Time", "WEZ": "Western European Standard Time", "CHADT": "Chatham Daylight Time", "AWDT": "Australian Western Daylight Time", "SAST": "South Africa Standard Time", "WAST": "West Africa Summer Time", "CLT": "Chile Standard Time", "HKST": "Hong Kong Summer Time", "ARST": "Argentina Summer Time", "EDT": "Eastern Daylight Time", "NZDT": "New Zealand Daylight Time", "WAT": "West Africa Standard Time", "BOT": "Bolivia Time", "PST": "Pacific Standard Time", "MEZ": "Central European Standard Time", "TMT": "Turkmenistan Standard Time", "UYST": "Uruguay Summer Time", "CAT": "Central Africa Time", "EAT": "East Africa Time", "MYT": "Malaysia Time", "WARST": "Western Argentina Summer Time", "GFT": "French Guiana Time", "∅∅∅": "Azores Summer Time", "ART": "Argentina Standard Time", "TMST": "Turkmenistan Summer Time", "ECT": "Ecuador Time", "AST": "Atlantic Standard Time", "ACWDT": "Australian Central Western Daylight Time", "GMT": "Greenwich Mean Time", "CLST": "Chile Summer Time"},
}
}
diff --git a/en_US_POSIX/en_US_POSIX_test.go b/en_US_POSIX/en_US_POSIX_test.go
new file mode 100644
index 00000000..23734629
--- /dev/null
+++ b/en_US_POSIX/en_US_POSIX_test.go
@@ -0,0 +1,1120 @@
+package en_US_POSIX
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_US_POSIX"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_VC/en_VC.go b/en_VC/en_VC.go
index 86aed55c..de4690e6 100644
--- a/en_VC/en_VC.go
+++ b/en_VC/en_VC.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"VET": "Venezuela Time", "ACWDT": "Australian Central Western Daylight Time", "EDT": "Eastern Daylight Time", "AKDT": "Alaska Daylight Time", "UYT": "Uruguay Standard Time", "CDT": "Central Daylight Time", "WESZ": "Western European Summer Time", "OEZ": "Eastern European Standard Time", "WIT": "Eastern Indonesia Time", "ARST": "Argentina Summer Time", "PDT": "Pacific Daylight Time", "CHADT": "Chatham Daylight Time", "ADT": "Atlantic Daylight Time", "GMT": "Greenwich Mean Time", "GFT": "French Guiana Time", "HKST": "Hong Kong Summer Time", "ACDT": "Australian Central Daylight Time", "LHST": "Lord Howe Standard Time", "MESZ": "Central European Summer Time", "ChST": "Chamorro Standard Time", "COST": "Colombia Summer Time", "EAT": "East Africa Time", "WAST": "West Africa Summer Time", "HAT": "Newfoundland Daylight Time", "MYT": "Malaysia Time", "NZDT": "New Zealand Daylight Time", "BOT": "Bolivia Time", "MEZ": "Central European Standard Time", "CLST": "Chile Summer Time", "AWDT": "Australian Western Daylight Time", "AEST": "Australian Eastern Standard Time", "CHAST": "Chatham Standard Time", "OESZ": "Eastern European Summer Time", "ACST": "Australian Central Standard Time", "WEZ": "Western European Standard Time", "ECT": "Ecuador Time", "CAT": "Central Africa Time", "AKST": "Alaska Standard Time", "WARST": "Western Argentina Summer Time", "WAT": "West Africa Standard Time", "GYT": "Guyana Time", "CLT": "Chile Standard Time", "COT": "Colombia Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "BT": "Bhutan Time", "JDT": "Japan Daylight Time", "MST": "Mountain Standard Time", "HKT": "Hong Kong Standard Time", "SAST": "South Africa Standard Time", "AWST": "Australian Western Standard Time", "SGT": "Singapore Standard Time", "IST": "India Standard Time", "JST": "Japan Standard Time", "HNT": "Newfoundland Standard Time", "LHDT": "Lord Howe Daylight Time", "PST": "Pacific Standard Time", "ART": "Argentina Standard Time", "AEDT": "Australian Eastern Daylight Time", "∅∅∅": "Brasilia Summer Time", "AST": "Atlantic Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "WART": "Western Argentina Standard Time", "TMT": "Turkmenistan Standard Time", "TMST": "Turkmenistan Summer Time", "SRT": "Suriname Time", "NZST": "New Zealand Standard Time", "MDT": "Mountain Daylight Time", "ACWST": "Australian Central Western Standard Time", "EST": "Eastern Standard Time", "UYST": "Uruguay Summer Time", "CST": "Central Standard Time", "WITA": "Central Indonesia Time", "WIB": "Western Indonesia Time"},
+ timezones: map[string]string{"WIB": "Western Indonesia Time", "ACST": "Australian Central Standard Time", "∅∅∅": "Azores Summer Time", "ACWST": "Australian Central Western Standard Time", "ACWDT": "Australian Central Western Daylight Time", "SAST": "South Africa Standard Time", "CHADT": "Chatham Daylight Time", "SGT": "Singapore Standard Time", "WEZ": "Western European Standard Time", "CLT": "Chile Standard Time", "UYST": "Uruguay Summer Time", "LHST": "Lord Howe Standard Time", "WARST": "Western Argentina Summer Time", "MDT": "Macau Summer Time", "WITA": "Central Indonesia Time", "MEZ": "Central European Standard Time", "HAT": "Newfoundland Daylight Time", "LHDT": "Lord Howe Daylight Time", "ADT": "Atlantic Daylight Time", "CAT": "Central Africa Time", "OEZ": "Eastern European Standard Time", "GFT": "French Guiana Time", "HKT": "Hong Kong Standard Time", "PST": "Pacific Standard Time", "MESZ": "Central European Summer Time", "WIT": "Eastern Indonesia Time", "ACDT": "Australian Central Daylight Time", "AKDT": "Alaska Daylight Time", "PDT": "Pacific Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "NZDT": "New Zealand Daylight Time", "UYT": "Uruguay Standard Time", "ART": "Argentina Standard Time", "EST": "Eastern Standard Time", "TMT": "Turkmenistan Standard Time", "AEDT": "Australian Eastern Daylight Time", "MYT": "Malaysia Time", "BOT": "Bolivia Time", "IST": "India Standard Time", "WAST": "West Africa Summer Time", "SRT": "Suriname Time", "CDT": "Central Daylight Time", "MST": "Macau Standard Time", "AWST": "Australian Western Standard Time", "AWDT": "Australian Western Daylight Time", "CLST": "Chile Summer Time", "BT": "Bhutan Time", "GYT": "Guyana Time", "HADT": "Hawaii-Aleutian Daylight Time", "NZST": "New Zealand Standard Time", "HNT": "Newfoundland Standard Time", "TMST": "Turkmenistan Summer Time", "WESZ": "Western European Summer Time", "VET": "Venezuela Time", "AST": "Atlantic Standard Time", "OESZ": "Eastern European Summer Time", "CST": "Central Standard Time", "ECT": "Ecuador Time", "HKST": "Hong Kong Summer Time", "COST": "Colombia Summer Time", "WAT": "West Africa Standard Time", "WART": "Western Argentina Standard Time", "ChST": "Chamorro Standard Time", "GMT": "Greenwich Mean Time", "JST": "Japan Standard Time", "COT": "Colombia Standard Time", "AEST": "Australian Eastern Standard Time", "CHAST": "Chatham Standard Time", "ARST": "Argentina Summer Time", "JDT": "Japan Daylight Time", "AKST": "Alaska Standard Time", "EDT": "Eastern Daylight Time", "EAT": "East Africa Time"},
}
}
diff --git a/en_VC/en_VC_test.go b/en_VC/en_VC_test.go
new file mode 100644
index 00000000..26cfaa2d
--- /dev/null
+++ b/en_VC/en_VC_test.go
@@ -0,0 +1,1120 @@
+package en_VC
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_VC"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_VG/en_VG.go b/en_VG/en_VG.go
index a31af64b..44a8c4e1 100644
--- a/en_VG/en_VG.go
+++ b/en_VG/en_VG.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"CAT": "Central Africa Time", "HADT": "Hawaii-Aleutian Daylight Time", "HAT": "Newfoundland Daylight Time", "JDT": "Japan Daylight Time", "ChST": "Chamorro Standard Time", "ECT": "Ecuador Time", "WIB": "Western Indonesia Time", "AKDT": "Alaska Daylight Time", "MESZ": "Central European Summer Time", "WEZ": "Western European Standard Time", "ACWST": "Australian Central Western Standard Time", "CHADT": "Chatham Daylight Time", "MST": "Macau Standard Time", "EST": "Eastern Standard Time", "COST": "Colombia Summer Time", "WAST": "West Africa Summer Time", "WART": "Western Argentina Standard Time", "WARST": "Western Argentina Summer Time", "IST": "India Standard Time", "WITA": "Central Indonesia Time", "LHST": "Lord Howe Standard Time", "HKST": "Hong Kong Summer Time", "EAT": "East Africa Time", "TMST": "Turkmenistan Summer Time", "UYT": "Uruguay Standard Time", "CLST": "Chile Summer Time", "GFT": "French Guiana Time", "WESZ": "Western European Summer Time", "AEST": "Australian Eastern Standard Time", "EDT": "Eastern Daylight Time", "OESZ": "Eastern European Summer Time", "PDT": "Pacific Daylight Time", "BOT": "Bolivia Time", "VET": "Venezuela Time", "CHAST": "Chatham Standard Time", "BT": "Bhutan Time", "TMT": "Turkmenistan Standard Time", "AWST": "Australian Western Standard Time", "LHDT": "Lord Howe Daylight Time", "NZST": "New Zealand Standard Time", "NZDT": "New Zealand Daylight Time", "ART": "Argentina Standard Time", "AEDT": "Australian Eastern Daylight Time", "COT": "Colombia Standard Time", "ADT": "Atlantic Daylight Time", "SRT": "Suriname Time", "AST": "Atlantic Standard Time", "GMT": "Greenwich Mean Time", "ARST": "Argentina Summer Time", "MYT": "Malaysia Time", "MEZ": "Central European Standard Time", "SAST": "South Africa Standard Time", "HNT": "Newfoundland Standard Time", "WIT": "Eastern Indonesia Time", "MDT": "Macau Summer Time", "HKT": "Hong Kong Standard Time", "ACDT": "Australian Central Daylight Time", "CDT": "Central Daylight Time", "SGT": "Singapore Standard Time", "WAT": "West Africa Standard Time", "PST": "Pacific Standard Time", "AWDT": "Australian Western Daylight Time", "JST": "Japan Standard Time", "UYST": "Uruguay Summer Time", "∅∅∅": "Brasilia Summer Time", "HAST": "Hawaii-Aleutian Standard Time", "ACST": "Australian Central Standard Time", "AKST": "Alaska Standard Time", "GYT": "Guyana Time", "ACWDT": "Australian Central Western Daylight Time", "OEZ": "Eastern European Standard Time", "CST": "Central Standard Time", "CLT": "Chile Standard Time"},
+ timezones: map[string]string{"AEST": "Australian Eastern Standard Time", "CLST": "Chile Summer Time", "CST": "Central Standard Time", "WART": "Western Argentina Standard Time", "WIB": "Western Indonesia Time", "TMST": "Turkmenistan Summer Time", "HADT": "Hawaii-Aleutian Daylight Time", "OESZ": "Eastern European Summer Time", "MDT": "Mountain Daylight Time", "ACDT": "Australian Central Daylight Time", "SRT": "Suriname Time", "HKST": "Hong Kong Summer Time", "SAST": "South Africa Standard Time", "AST": "Atlantic Standard Time", "AWDT": "Australian Western Daylight Time", "WESZ": "Western European Summer Time", "ChST": "Chamorro Standard Time", "GYT": "Guyana Time", "BT": "Bhutan Time", "ACWST": "Australian Central Western Standard Time", "IST": "India Standard Time", "PDT": "Pacific Daylight Time", "CLT": "Chile Standard Time", "CAT": "Central Africa Time", "ACST": "Australian Central Standard Time", "WARST": "Western Argentina Summer Time", "ECT": "Ecuador Time", "WAST": "West Africa Summer Time", "GMT": "Greenwich Mean Time", "UYST": "Uruguay Summer Time", "CHADT": "Chatham Daylight Time", "NZST": "New Zealand Standard Time", "COT": "Colombia Standard Time", "EAT": "East Africa Time", "MST": "Mountain Standard Time", "ART": "Argentina Standard Time", "MEZ": "Central European Standard Time", "MESZ": "Central European Summer Time", "HAT": "Newfoundland Daylight Time", "AEDT": "Australian Eastern Daylight Time", "CDT": "Central Daylight Time", "GFT": "French Guiana Time", "AKST": "Alaska Standard Time", "EDT": "Eastern Daylight Time", "TMT": "Turkmenistan Standard Time", "LHST": "Lord Howe Standard Time", "VET": "Venezuela Time", "AKDT": "Alaska Daylight Time", "AWST": "Australian Western Standard Time", "HNT": "Newfoundland Standard Time", "COST": "Colombia Summer Time", "OEZ": "Eastern European Standard Time", "WIT": "Eastern Indonesia Time", "∅∅∅": "Brasilia Summer Time", "JST": "Japan Standard Time", "NZDT": "New Zealand Daylight Time", "WAT": "West Africa Standard Time", "MYT": "Malaysia Time", "JDT": "Japan Daylight Time", "ARST": "Argentina Summer Time", "PST": "Pacific Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "SGT": "Singapore Standard Time", "WITA": "Central Indonesia Time", "BOT": "Bolivia Time", "UYT": "Uruguay Standard Time", "LHDT": "Lord Howe Daylight Time", "HKT": "Hong Kong Standard Time", "CHAST": "Chatham Standard Time", "ADT": "Atlantic Daylight Time", "ACWDT": "Australian Central Western Daylight Time", "EST": "Eastern Standard Time", "WEZ": "Western European Standard Time"},
}
}
@@ -112,8 +112,8 @@ func (en *en_VG) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
func (en *en_VG) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
n := math.Abs(num)
- nMod100 := math.Mod(n, 100)
nMod10 := math.Mod(n, 10)
+ nMod100 := math.Mod(n, 100)
if nMod10 == 1 && nMod100 != 11 {
return locales.PluralRuleOne
diff --git a/en_VG/en_VG_test.go b/en_VG/en_VG_test.go
new file mode 100644
index 00000000..21d8fa9f
--- /dev/null
+++ b/en_VG/en_VG_test.go
@@ -0,0 +1,1120 @@
+package en_VG
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_VG"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_VI/en_VI.go b/en_VI/en_VI.go
index 1032c377..393e34c5 100644
--- a/en_VI/en_VI.go
+++ b/en_VI/en_VI.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"AKDT": "Alaska Daylight Time", "HNT": "Newfoundland Standard Time", "HKT": "Hong Kong Standard Time", "GMT": "Greenwich Mean Time", "ACST": "Australian Central Standard Time", "SRT": "Suriname Time", "AWDT": "Australian Western Daylight Time", "CDT": "Central Daylight Time", "MESZ": "Central European Summer Time", "WAST": "West Africa Summer Time", "ADT": "Atlantic Daylight Time", "SAST": "South Africa Standard Time", "MYT": "Malaysia Time", "MEZ": "Central European Standard Time", "NZST": "New Zealand Standard Time", "COT": "Colombia Standard Time", "BT": "Bhutan Time", "MDT": "Macau Summer Time", "ACDT": "Australian Central Daylight Time", "AWST": "Australian Western Standard Time", "CHAST": "Chatham Standard Time", "EST": "Eastern Standard Time", "IST": "India Standard Time", "CST": "Central Standard Time", "AEDT": "Australian Eastern Daylight Time", "CAT": "Central Africa Time", "WART": "Western Argentina Standard Time", "MST": "Macau Standard Time", "PDT": "Pacific Daylight Time", "UYST": "Uruguay Summer Time", "AEST": "Australian Eastern Standard Time", "HKST": "Hong Kong Summer Time", "LHDT": "Lord Howe Daylight Time", "JST": "Japan Standard Time", "CLST": "Chile Summer Time", "SGT": "Singapore Standard Time", "EAT": "East Africa Time", "TMST": "Turkmenistan Summer Time", "GYT": "Guyana Time", "BOT": "Bolivia Time", "GFT": "French Guiana Time", "PST": "Pacific Standard Time", "ACWST": "Australian Central Western Standard Time", "WARST": "Western Argentina Summer Time", "WIT": "Eastern Indonesia Time", "ARST": "Argentina Summer Time", "CHADT": "Chatham Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "WITA": "Central Indonesia Time", "WEZ": "Western European Standard Time", "WESZ": "Western European Summer Time", "CLT": "Chile Standard Time", "OESZ": "Eastern European Summer Time", "WIB": "Western Indonesia Time", "ART": "Argentina Standard Time", "ECT": "Ecuador Time", "∅∅∅": "Brasilia Summer Time", "NZDT": "New Zealand Daylight Time", "EDT": "Eastern Daylight Time", "OEZ": "Eastern European Standard Time", "TMT": "Turkmenistan Standard Time", "JDT": "Japan Daylight Time", "UYT": "Uruguay Standard Time", "ACWDT": "Australian Central Western Daylight Time", "ChST": "Chamorro Standard Time", "WAT": "West Africa Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "HAT": "Newfoundland Daylight Time", "AKST": "Alaska Standard Time", "LHST": "Lord Howe Standard Time", "VET": "Venezuela Time", "COST": "Colombia Summer Time", "AST": "Atlantic Standard Time"},
+ timezones: map[string]string{"COT": "Colombia Standard Time", "WIB": "Western Indonesia Time", "WAST": "West Africa Summer Time", "WEZ": "Western European Standard Time", "HNT": "Newfoundland Standard Time", "CHADT": "Chatham Daylight Time", "JST": "Japan Standard Time", "UYT": "Uruguay Standard Time", "ARST": "Argentina Summer Time", "PST": "Pacific Standard Time", "LHST": "Lord Howe Standard Time", "ART": "Argentina Standard Time", "AEDT": "Australian Eastern Daylight Time", "AWST": "Australian Western Standard Time", "MESZ": "Central European Summer Time", "SAST": "South Africa Standard Time", "CLT": "Chile Standard Time", "UYST": "Uruguay Summer Time", "HKST": "Hong Kong Summer Time", "AST": "Atlantic Standard Time", "WIT": "Eastern Indonesia Time", "MEZ": "Central European Standard Time", "NZST": "New Zealand Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "WESZ": "Western European Summer Time", "CDT": "Central Daylight Time", "AKDT": "Alaska Daylight Time", "ACWST": "Australian Central Western Standard Time", "WARST": "Western Argentina Summer Time", "SRT": "Suriname Time", "∅∅∅": "Amazon Summer Time", "HAT": "Newfoundland Daylight Time", "GYT": "Guyana Time", "EAT": "East Africa Time", "ACWDT": "Australian Central Western Daylight Time", "EST": "Eastern Standard Time", "CLST": "Chile Summer Time", "BT": "Bhutan Time", "PDT": "Pacific Daylight Time", "SGT": "Singapore Standard Time", "CHAST": "Chatham Standard Time", "ECT": "Ecuador Time", "AKST": "Alaska Standard Time", "ADT": "Atlantic Daylight Time", "EDT": "Eastern Daylight Time", "TMST": "Turkmenistan Summer Time", "MST": "Macau Standard Time", "MDT": "Macau Summer Time", "WAT": "West Africa Standard Time", "LHDT": "Lord Howe Daylight Time", "OESZ": "Eastern European Summer Time", "ChST": "Chamorro Standard Time", "IST": "India Standard Time", "TMT": "Turkmenistan Standard Time", "MYT": "Malaysia Time", "CST": "Central Standard Time", "HKT": "Hong Kong Standard Time", "JDT": "Japan Daylight Time", "WART": "Western Argentina Standard Time", "AWDT": "Australian Western Daylight Time", "OEZ": "Eastern European Standard Time", "ACST": "Australian Central Standard Time", "NZDT": "New Zealand Daylight Time", "CAT": "Central Africa Time", "COST": "Colombia Summer Time", "ACDT": "Australian Central Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "BOT": "Bolivia Time", "GMT": "Greenwich Mean Time", "AEST": "Australian Eastern Standard Time", "GFT": "French Guiana Time", "VET": "Venezuela Time", "WITA": "Central Indonesia Time"},
}
}
diff --git a/en_VI/en_VI_test.go b/en_VI/en_VI_test.go
new file mode 100644
index 00000000..979be2da
--- /dev/null
+++ b/en_VI/en_VI_test.go
@@ -0,0 +1,1120 @@
+package en_VI
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_VI"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_VU/en_VU.go b/en_VU/en_VU.go
index 95fe1f5f..bae44c95 100644
--- a/en_VU/en_VU.go
+++ b/en_VU/en_VU.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"EDT": "Eastern Daylight Time", "COT": "Colombia Standard Time", "HKT": "Hong Kong Standard Time", "AKST": "Alaska Standard Time", "PDT": "Pacific Daylight Time", "UYST": "Uruguay Summer Time", "CDT": "Central Daylight Time", "ACWDT": "Australian Central Western Daylight Time", "OESZ": "Eastern European Summer Time", "∅∅∅": "Azores Summer Time", "AST": "Atlantic Standard Time", "WIB": "Western Indonesia Time", "ChST": "Chamorro Standard Time", "CHAST": "Chatham Standard Time", "OEZ": "Eastern European Standard Time", "ACST": "Australian Central Standard Time", "MYT": "Malaysia Time", "SRT": "Suriname Time", "HAST": "Hawaii-Aleutian Standard Time", "LHST": "Lord Howe Standard Time", "MEZ": "Central European Standard Time", "MST": "Mountain Standard Time", "CLST": "Chile Summer Time", "BT": "Bhutan Time", "GMT": "Greenwich Mean Time", "AWST": "Australian Western Standard Time", "CST": "Central Standard Time", "NZST": "New Zealand Standard Time", "WESZ": "Western European Summer Time", "AEDT": "Australian Eastern Daylight Time", "WITA": "Central Indonesia Time", "JDT": "Japan Daylight Time", "MESZ": "Central European Summer Time", "AEST": "Australian Eastern Standard Time", "ECT": "Ecuador Time", "HAT": "Newfoundland Daylight Time", "LHDT": "Lord Howe Daylight Time", "AWDT": "Australian Western Daylight Time", "GYT": "Guyana Time", "EST": "Eastern Standard Time", "HKST": "Hong Kong Summer Time", "IST": "India Standard Time", "ART": "Argentina Standard Time", "ARST": "Argentina Summer Time", "PST": "Pacific Standard Time", "BOT": "Bolivia Time", "CHADT": "Chatham Daylight Time", "WAT": "West Africa Standard Time", "HNT": "Newfoundland Standard Time", "JST": "Japan Standard Time", "COST": "Colombia Summer Time", "WIT": "Eastern Indonesia Time", "EAT": "East Africa Time", "MDT": "Mountain Daylight Time", "CLT": "Chile Standard Time", "ACWST": "Australian Central Western Standard Time", "WARST": "Western Argentina Summer Time", "GFT": "French Guiana Time", "AKDT": "Alaska Daylight Time", "ADT": "Atlantic Daylight Time", "TMST": "Turkmenistan Summer Time", "NZDT": "New Zealand Daylight Time", "WEZ": "Western European Standard Time", "SAST": "South Africa Standard Time", "UYT": "Uruguay Standard Time", "SGT": "Singapore Standard Time", "TMT": "Turkmenistan Standard Time", "ACDT": "Australian Central Daylight Time", "VET": "Venezuela Time", "CAT": "Central Africa Time", "HADT": "Hawaii-Aleutian Daylight Time", "WART": "Western Argentina Standard Time", "WAST": "West Africa Summer Time"},
+ timezones: map[string]string{"WIT": "Eastern Indonesia Time", "∅∅∅": "Peru Summer Time", "HKT": "Hong Kong Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "NZDT": "New Zealand Daylight Time", "CLT": "Chile Standard Time", "CST": "Central Standard Time", "CHADT": "Chatham Daylight Time", "COST": "Colombia Summer Time", "CAT": "Central Africa Time", "LHST": "Lord Howe Standard Time", "MDT": "Mountain Daylight Time", "EDT": "Eastern Daylight Time", "MYT": "Malaysia Time", "UYST": "Uruguay Summer Time", "GFT": "French Guiana Time", "BOT": "Bolivia Time", "SGT": "Singapore Standard Time", "ART": "Argentina Standard Time", "MESZ": "Central European Summer Time", "UYT": "Uruguay Standard Time", "ACST": "Australian Central Standard Time", "AST": "Atlantic Standard Time", "AWDT": "Australian Western Daylight Time", "GMT": "Greenwich Mean Time", "AEST": "Australian Eastern Standard Time", "SRT": "Suriname Time", "NZST": "New Zealand Standard Time", "WEZ": "Western European Standard Time", "AEDT": "Australian Eastern Daylight Time", "CLST": "Chile Summer Time", "EAT": "East Africa Time", "JST": "Japan Standard Time", "AKDT": "Alaska Daylight Time", "IST": "India Standard Time", "WARST": "Western Argentina Summer Time", "AWST": "Australian Western Standard Time", "TMT": "Turkmenistan Standard Time", "ChST": "Chamorro Standard Time", "MST": "Mountain Standard Time", "ACWDT": "Australian Central Western Daylight Time", "WITA": "Central Indonesia Time", "JDT": "Japan Daylight Time", "ACDT": "Australian Central Daylight Time", "WART": "Western Argentina Standard Time", "CDT": "Central Daylight Time", "WESZ": "Western European Summer Time", "HNT": "Newfoundland Standard Time", "OESZ": "Eastern European Summer Time", "GYT": "Guyana Time", "BT": "Bhutan Time", "ADT": "Atlantic Daylight Time", "AKST": "Alaska Standard Time", "PST": "Pacific Standard Time", "WAST": "West Africa Summer Time", "HAT": "Newfoundland Daylight Time", "WIB": "Western Indonesia Time", "OEZ": "Eastern European Standard Time", "ARST": "Argentina Summer Time", "TMST": "Turkmenistan Summer Time", "HKST": "Hong Kong Summer Time", "ECT": "Ecuador Time", "ACWST": "Australian Central Western Standard Time", "PDT": "Pacific Daylight Time", "MEZ": "Central European Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "WAT": "West Africa Standard Time", "COT": "Colombia Standard Time", "LHDT": "Lord Howe Daylight Time", "CHAST": "Chatham Standard Time", "VET": "Venezuela Time", "EST": "Eastern Standard Time", "SAST": "South Africa Standard Time"},
}
}
diff --git a/en_VU/en_VU_test.go b/en_VU/en_VU_test.go
new file mode 100644
index 00000000..8df491b1
--- /dev/null
+++ b/en_VU/en_VU_test.go
@@ -0,0 +1,1120 @@
+package en_VU
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_VU"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_WS/en_WS.go b/en_WS/en_WS.go
index 849d3e99..f9ffdae7 100644
--- a/en_WS/en_WS.go
+++ b/en_WS/en_WS.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"COT": "Colombia Standard Time", "HNT": "Newfoundland Standard Time", "WIB": "Western Indonesia Time", "CLST": "Chile Summer Time", "ADT": "Atlantic Daylight Time", "OEZ": "Eastern European Standard Time", "AWDT": "Australian Western Daylight Time", "LHST": "Lord Howe Standard Time", "EDT": "Eastern Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "OESZ": "Eastern European Summer Time", "ACDT": "Australian Central Daylight Time", "ARST": "Argentina Summer Time", "TMST": "Turkmenistan Summer Time", "AKST": "Alaska Standard Time", "MEZ": "Central European Standard Time", "BOT": "Bolivia Time", "UYST": "Uruguay Summer Time", "CLT": "Chile Standard Time", "VET": "Venezuela Time", "HKT": "Hong Kong Standard Time", "NZDT": "New Zealand Daylight Time", "WESZ": "Western European Summer Time", "ACWDT": "Australian Central Western Daylight Time", "IST": "India Standard Time", "ART": "Argentina Standard Time", "PDT": "Pacific Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "GMT": "Greenwich Mean Time", "ACST": "Australian Central Standard Time", "ACWST": "Australian Central Western Standard Time", "WAST": "West Africa Summer Time", "JST": "Japan Standard Time", "ECT": "Ecuador Time", "SAST": "South Africa Standard Time", "WARST": "Western Argentina Summer Time", "WIT": "Eastern Indonesia Time", "AKDT": "Alaska Daylight Time", "CST": "Central Standard Time", "CDT": "Central Daylight Time", "MESZ": "Central European Summer Time", "NZST": "New Zealand Standard Time", "AST": "Atlantic Standard Time", "BT": "Bhutan Time", "SRT": "Suriname Time", "CHADT": "Chatham Daylight Time", "GFT": "French Guiana Time", "WITA": "Central Indonesia Time", "AEST": "Australian Eastern Standard Time", "EST": "Eastern Standard Time", "WAT": "West Africa Standard Time", "SGT": "Singapore Standard Time", "TMT": "Turkmenistan Standard Time", "JDT": "Japan Daylight Time", "AWST": "Australian Western Standard Time", "MYT": "Malaysia Time", "CAT": "Central Africa Time", "COST": "Colombia Summer Time", "∅∅∅": "Brasilia Summer Time", "PST": "Pacific Standard Time", "LHDT": "Lord Howe Daylight Time", "UYT": "Uruguay Standard Time", "WEZ": "Western European Standard Time", "AEDT": "Australian Eastern Daylight Time", "ChST": "Chamorro Standard Time", "HKST": "Hong Kong Summer Time", "WART": "Western Argentina Standard Time", "HAT": "Newfoundland Daylight Time", "EAT": "East Africa Time", "MST": "Macau Standard Time", "MDT": "Macau Summer Time", "GYT": "Guyana Time", "CHAST": "Chatham Standard Time"},
+ timezones: map[string]string{"EDT": "Eastern Daylight Time", "WAST": "West Africa Summer Time", "UYT": "Uruguay Standard Time", "EAT": "East Africa Time", "VET": "Venezuela Time", "HADT": "Hawaii-Aleutian Daylight Time", "GYT": "Guyana Time", "NZDT": "New Zealand Daylight Time", "ChST": "Chamorro Standard Time", "MYT": "Malaysia Time", "WARST": "Western Argentina Summer Time", "CHADT": "Chatham Daylight Time", "AWDT": "Australian Western Daylight Time", "AKST": "Alaska Standard Time", "ADT": "Atlantic Daylight Time", "OESZ": "Eastern European Summer Time", "GMT": "Greenwich Mean Time", "CST": "Central Standard Time", "ACDT": "Australian Central Daylight Time", "ACWDT": "Australian Central Western Daylight Time", "JST": "Japan Standard Time", "MESZ": "Central European Summer Time", "WEZ": "Western European Standard Time", "∅∅∅": "Azores Summer Time", "ACWST": "Australian Central Western Standard Time", "BOT": "Bolivia Time", "AEST": "Australian Eastern Standard Time", "ART": "Argentina Standard Time", "UYST": "Uruguay Summer Time", "IST": "India Standard Time", "SGT": "Singapore Standard Time", "WIB": "Western Indonesia Time", "ACST": "Australian Central Standard Time", "CAT": "Central Africa Time", "WAT": "West Africa Standard Time", "LHDT": "Lord Howe Daylight Time", "CLT": "Chile Standard Time", "CHAST": "Chatham Standard Time", "HKT": "Hong Kong Standard Time", "AWST": "Australian Western Standard Time", "AKDT": "Alaska Daylight Time", "WIT": "Eastern Indonesia Time", "SRT": "Suriname Time", "ECT": "Ecuador Time", "ARST": "Argentina Summer Time", "JDT": "Japan Daylight Time", "MEZ": "Central European Standard Time", "COT": "Colombia Standard Time", "TMT": "Turkmenistan Standard Time", "HNT": "Newfoundland Standard Time", "WART": "Western Argentina Standard Time", "MDT": "Macau Summer Time", "AST": "Atlantic Standard Time", "PST": "Pacific Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "EST": "Eastern Standard Time", "TMST": "Turkmenistan Summer Time", "CDT": "Central Daylight Time", "PDT": "Pacific Daylight Time", "OEZ": "Eastern European Standard Time", "CLST": "Chile Summer Time", "COST": "Colombia Summer Time", "AEDT": "Australian Eastern Daylight Time", "MST": "Macau Standard Time", "NZST": "New Zealand Standard Time", "SAST": "South Africa Standard Time", "WESZ": "Western European Summer Time", "GFT": "French Guiana Time", "HKST": "Hong Kong Summer Time", "WITA": "Central Indonesia Time", "HAT": "Newfoundland Daylight Time", "LHST": "Lord Howe Standard Time", "BT": "Bhutan Time"},
}
}
@@ -112,8 +112,8 @@ func (en *en_WS) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
func (en *en_WS) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
n := math.Abs(num)
- nMod10 := math.Mod(n, 10)
nMod100 := math.Mod(n, 100)
+ nMod10 := math.Mod(n, 10)
if nMod10 == 1 && nMod100 != 11 {
return locales.PluralRuleOne
diff --git a/en_WS/en_WS_test.go b/en_WS/en_WS_test.go
new file mode 100644
index 00000000..156e856b
--- /dev/null
+++ b/en_WS/en_WS_test.go
@@ -0,0 +1,1120 @@
+package en_WS
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_WS"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_ZA/en_ZA.go b/en_ZA/en_ZA.go
index b8b6cd49..b775cec3 100644
--- a/en_ZA/en_ZA.go
+++ b/en_ZA/en_ZA.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"∅∅∅": "Brasilia Summer Time", "HNT": "Newfoundland Standard Time", "EAT": "East Africa Time", "WEZ": "Western European Standard Time", "ChST": "Chamorro Standard Time", "WAST": "West Africa Summer Time", "GYT": "Guyana Time", "AWST": "Australian Western Standard Time", "COT": "Colombia Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "WIB": "Western Indonesia Time", "AKDT": "Alaska Daylight Time", "CHADT": "Chatham Daylight Time", "AEDT": "Australian Eastern Daylight Time", "WARST": "Western Argentina Summer Time", "ADT": "Atlantic Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "WART": "Western Argentina Standard Time", "GMT": "Greenwich Mean Time", "OESZ": "Eastern European Summer Time", "MYT": "Malaysia Time", "ACWDT": "Australian Central Western Daylight Time", "HKT": "Hong Kong Standard Time", "NZDT": "New Zealand Daylight Time", "AEST": "Australian Eastern Standard Time", "EST": "Eastern Standard Time", "AST": "Atlantic Standard Time", "UYT": "Uruguay Standard Time", "NZST": "New Zealand Standard Time", "WAT": "West Africa Standard Time", "GFT": "French Guiana Time", "WIT": "Eastern Indonesia Time", "AWDT": "Australian Western Daylight Time", "COST": "Colombia Summer Time", "ECT": "Ecuador Time", "CLT": "Chile Standard Time", "ACWST": "Australian Central Western Standard Time", "SAST": "South Africa Standard Time", "IST": "India Standard Time", "TMST": "Turkmenistan Summer Time", "SRT": "Suriname Time", "BOT": "Bolivia Time", "MDT": "Mountain Daylight Time", "BT": "Bhutan Time", "LHST": "Lord Howe Standard Time", "LHDT": "Lord Howe Daylight Time", "MESZ": "Central European Summer Time", "SGT": "Singapore Standard Time", "ART": "Argentina Standard Time", "JST": "Japan Standard Time", "MST": "Mountain Standard Time", "ARST": "Argentina Summer Time", "VET": "Venezuela Time", "OEZ": "Eastern European Standard Time", "ACDT": "Australian Central Daylight Time", "CDT": "Central Daylight Time", "CHAST": "Chatham Standard Time", "WITA": "Central Indonesia Time", "ACST": "Australian Central Standard Time", "PST": "Pacific Standard Time", "PDT": "Pacific Daylight Time", "WESZ": "Western European Summer Time", "EDT": "Eastern Daylight Time", "JDT": "Japan Daylight Time", "AKST": "Alaska Standard Time", "HKST": "Hong Kong Summer Time", "HAT": "Newfoundland Daylight Time", "MEZ": "Central European Standard Time", "CLST": "Chile Summer Time", "CAT": "Central Africa Time", "TMT": "Turkmenistan Standard Time", "UYST": "Uruguay Summer Time", "CST": "Central Standard Time"},
+ timezones: map[string]string{"EST": "Eastern Standard Time", "WAST": "West Africa Summer Time", "HAT": "Newfoundland Daylight Time", "AEDT": "Australian Eastern Daylight Time", "LHST": "Lord Howe Standard Time", "ACST": "Australian Central Standard Time", "CHADT": "Chatham Daylight Time", "ART": "Argentina Standard Time", "COT": "Colombia Standard Time", "WIB": "Western Indonesia Time", "ADT": "Atlantic Daylight Time", "PST": "Pacific Standard Time", "WAT": "West Africa Standard Time", "GMT": "Greenwich Mean Time", "ChST": "Chamorro Standard Time", "UYT": "Uruguay Standard Time", "LHDT": "Lord Howe Daylight Time", "AST": "Atlantic Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "SAST": "South Africa Standard Time", "PDT": "Pacific Daylight Time", "WEZ": "Western European Standard Time", "MDT": "Mountain Daylight Time", "EDT": "Eastern Daylight Time", "BOT": "Bolivia Time", "GYT": "Guyana Time", "∅∅∅": "Brasilia Summer Time", "CDT": "Central Daylight Time", "HKT": "Hong Kong Standard Time", "AWDT": "Australian Western Daylight Time", "HNT": "Newfoundland Standard Time", "SGT": "Singapore Standard Time", "WIT": "Eastern Indonesia Time", "VET": "Venezuela Time", "ARST": "Argentina Summer Time", "MESZ": "Central European Summer Time", "TMT": "Turkmenistan Standard Time", "CAT": "Central Africa Time", "AEST": "Australian Eastern Standard Time", "MST": "Mountain Standard Time", "WARST": "Western Argentina Summer Time", "SRT": "Suriname Time", "AKDT": "Alaska Daylight Time", "CLT": "Chile Standard Time", "WART": "Western Argentina Standard Time", "GFT": "French Guiana Time", "ACWDT": "Australian Central Western Daylight Time", "WESZ": "Western European Summer Time", "IST": "India Standard Time", "EAT": "East Africa Time", "BT": "Bhutan Time", "HKST": "Hong Kong Summer Time", "JST": "Japan Standard Time", "HAST": "Hawaii-Aleutian Standard Time", "JDT": "Japan Daylight Time", "COST": "Colombia Summer Time", "CLST": "Chile Summer Time", "UYST": "Uruguay Summer Time", "MYT": "Malaysia Time", "CHAST": "Chatham Standard Time", "ACWST": "Australian Central Western Standard Time", "MEZ": "Central European Standard Time", "TMST": "Turkmenistan Summer Time", "OEZ": "Eastern European Standard Time", "OESZ": "Eastern European Summer Time", "CST": "Central Standard Time", "AWST": "Australian Western Standard Time", "NZDT": "New Zealand Daylight Time", "AKST": "Alaska Standard Time", "ACDT": "Australian Central Daylight Time", "ECT": "Ecuador Time", "WITA": "Central Indonesia Time", "NZST": "New Zealand Standard Time"},
}
}
diff --git a/en_ZA/en_ZA_test.go b/en_ZA/en_ZA_test.go
new file mode 100644
index 00000000..2c6b52b1
--- /dev/null
+++ b/en_ZA/en_ZA_test.go
@@ -0,0 +1,1120 @@
+package en_ZA
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_ZA"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_ZM/en_ZM.go b/en_ZM/en_ZM.go
index 9d6eb7cc..2b08b3f7 100644
--- a/en_ZM/en_ZM.go
+++ b/en_ZM/en_ZM.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"AKDT": "Alaska Daylight Time", "PDT": "Pacific Daylight Time", "MYT": "Malaysia Time", "ACWST": "Australian Central Western Standard Time", "CAT": "Central Africa Time", "SAST": "South Africa Standard Time", "HKST": "Hong Kong Summer Time", "EDT": "Eastern Daylight Time", "HAST": "Hawaii-Aleutian Standard Time", "WARST": "Western Argentina Summer Time", "ChST": "Chamorro Standard Time", "COT": "Colombia Standard Time", "ADT": "Atlantic Daylight Time", "GFT": "French Guiana Time", "MDT": "Macau Summer Time", "ARST": "Argentina Summer Time", "TMT": "Turkmenistan Standard Time", "GYT": "Guyana Time", "AEDT": "Australian Eastern Daylight Time", "OESZ": "Eastern European Summer Time", "AWST": "Australian Western Standard Time", "AWDT": "Australian Western Daylight Time", "MESZ": "Central European Summer Time", "NZST": "New Zealand Standard Time", "EST": "Eastern Standard Time", "SGT": "Singapore Standard Time", "NZDT": "New Zealand Daylight Time", "ACWDT": "Australian Central Western Daylight Time", "VET": "Venezuela Time", "ECT": "Ecuador Time", "ACST": "Australian Central Standard Time", "AEST": "Australian Eastern Standard Time", "HAT": "Newfoundland Daylight Time", "WIT": "Eastern Indonesia Time", "LHDT": "Lord Howe Daylight Time", "MEZ": "Central European Standard Time", "BOT": "Bolivia Time", "CLT": "Chile Standard Time", "GMT": "Greenwich Mean Time", "CHADT": "Chatham Daylight Time", "CLST": "Chile Summer Time", "∅∅∅": "Acre Summer Time", "HKT": "Hong Kong Standard Time", "IST": "India Standard Time", "AKST": "Alaska Standard Time", "HADT": "Hawaii-Aleutian Daylight Time", "WAT": "West Africa Standard Time", "PST": "Pacific Standard Time", "SRT": "Suriname Time", "UYST": "Uruguay Summer Time", "CHAST": "Chatham Standard Time", "WAST": "West Africa Summer Time", "EAT": "East Africa Time", "ACDT": "Australian Central Daylight Time", "LHST": "Lord Howe Standard Time", "WEZ": "Western European Standard Time", "WESZ": "Western European Summer Time", "AST": "Atlantic Standard Time", "WART": "Western Argentina Standard Time", "ART": "Argentina Standard Time", "COST": "Colombia Summer Time", "OEZ": "Eastern European Standard Time", "WIB": "Western Indonesia Time", "JST": "Japan Standard Time", "JDT": "Japan Daylight Time", "CST": "Central Standard Time", "UYT": "Uruguay Standard Time", "BT": "Bhutan Time", "HNT": "Newfoundland Standard Time", "WITA": "Central Indonesia Time", "MST": "Macau Standard Time", "TMST": "Turkmenistan Summer Time", "CDT": "Central Daylight Time"},
+ timezones: map[string]string{"HAST": "Hawaii-Aleutian Standard Time", "HAT": "Newfoundland Daylight Time", "TMST": "Turkmenistan Summer Time", "CHAST": "Chatham Standard Time", "COT": "Colombia Standard Time", "OESZ": "Eastern European Summer Time", "BT": "Bhutan Time", "CDT": "Central Daylight Time", "EST": "Eastern Standard Time", "ACWDT": "Australian Central Western Daylight Time", "AWST": "Australian Western Standard Time", "∅∅∅": "Amazon Summer Time", "GYT": "Guyana Time", "MDT": "Mountain Daylight Time", "UYST": "Uruguay Summer Time", "HKT": "Hong Kong Standard Time", "ART": "Argentina Standard Time", "PST": "Pacific Standard Time", "WAST": "West Africa Summer Time", "CLT": "Chile Standard Time", "WARST": "Western Argentina Summer Time", "EDT": "Eastern Daylight Time", "MEZ": "Central European Standard Time", "WIB": "Western Indonesia Time", "AWDT": "Australian Western Daylight Time", "BOT": "Bolivia Time", "CAT": "Central Africa Time", "WAT": "West Africa Standard Time", "LHST": "Lord Howe Standard Time", "LHDT": "Lord Howe Daylight Time", "WIT": "Eastern Indonesia Time", "JST": "Japan Standard Time", "SGT": "Singapore Standard Time", "COST": "Colombia Summer Time", "OEZ": "Eastern European Standard Time", "AEST": "Australian Eastern Standard Time", "ChST": "Chamorro Standard Time", "ACDT": "Australian Central Daylight Time", "PDT": "Pacific Daylight Time", "WART": "Western Argentina Standard Time", "ADT": "Atlantic Daylight Time", "HKST": "Hong Kong Summer Time", "AKST": "Alaska Standard Time", "SAST": "South Africa Standard Time", "NZST": "New Zealand Standard Time", "WEZ": "Western European Standard Time", "EAT": "East Africa Time", "MST": "Mountain Standard Time", "MYT": "Malaysia Time", "WITA": "Central Indonesia Time", "JDT": "Japan Daylight Time", "HADT": "Hawaii-Aleutian Daylight Time", "GMT": "Greenwich Mean Time", "AEDT": "Australian Eastern Daylight Time", "SRT": "Suriname Time", "CST": "Central Standard Time", "ACST": "Australian Central Standard Time", "AST": "Atlantic Standard Time", "TMT": "Turkmenistan Standard Time", "CLST": "Chile Summer Time", "MESZ": "Central European Summer Time", "NZDT": "New Zealand Daylight Time", "CHADT": "Chatham Daylight Time", "ARST": "Argentina Summer Time", "WESZ": "Western European Summer Time", "HNT": "Newfoundland Standard Time", "UYT": "Uruguay Standard Time", "VET": "Venezuela Time", "IST": "India Standard Time", "GFT": "French Guiana Time", "ECT": "Ecuador Time", "AKDT": "Alaska Daylight Time", "ACWST": "Australian Central Western Standard Time"},
}
}
diff --git a/en_ZM/en_ZM_test.go b/en_ZM/en_ZM_test.go
new file mode 100644
index 00000000..69ba0ed5
--- /dev/null
+++ b/en_ZM/en_ZM_test.go
@@ -0,0 +1,1120 @@
+package en_ZM
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_ZM"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/en_ZW/en_ZW.go b/en_ZW/en_ZW.go
index fcb49352..c42ca9b2 100644
--- a/en_ZW/en_ZW.go
+++ b/en_ZW/en_ZW.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"B", "A"},
erasWide: []string{"Before Christ", "Anno Domini"},
- timezones: map[string]string{"NZST": "New Zealand Standard Time", "MEZ": "Central European Standard Time", "AEDT": "Australian Eastern Daylight Time", "ECT": "Ecuador Time", "SAST": "South Africa Standard Time", "IST": "India Standard Time", "PDT": "Pacific Daylight Time", "WEZ": "Western European Standard Time", "SGT": "Singapore Standard Time", "AST": "Atlantic Standard Time", "ACST": "Australian Central Standard Time", "ARST": "Argentina Summer Time", "HAST": "Hawaii-Aleutian Standard Time", "AKST": "Alaska Standard Time", "AKDT": "Alaska Daylight Time", "EAT": "East Africa Time", "MST": "Macau Standard Time", "PST": "Pacific Standard Time", "EDT": "Eastern Daylight Time", "WART": "Western Argentina Standard Time", "∅∅∅": "Amazon Summer Time", "COT": "Colombia Standard Time", "HKT": "Hong Kong Standard Time", "GYT": "Guyana Time", "LHDT": "Lord Howe Daylight Time", "NZDT": "New Zealand Daylight Time", "CHADT": "Chatham Daylight Time", "TMST": "Turkmenistan Summer Time", "AWDT": "Australian Western Daylight Time", "CLT": "Chile Standard Time", "COST": "Colombia Summer Time", "HADT": "Hawaii-Aleutian Daylight Time", "MYT": "Malaysia Time", "CDT": "Central Daylight Time", "UYST": "Uruguay Summer Time", "MESZ": "Central European Summer Time", "ACDT": "Australian Central Daylight Time", "LHST": "Lord Howe Standard Time", "WARST": "Western Argentina Summer Time", "WAST": "West Africa Summer Time", "HAT": "Newfoundland Daylight Time", "WITA": "Central Indonesia Time", "TMT": "Turkmenistan Standard Time", "EST": "Eastern Standard Time", "BT": "Bhutan Time", "HKST": "Hong Kong Summer Time", "ADT": "Atlantic Daylight Time", "SRT": "Suriname Time", "WIT": "Eastern Indonesia Time", "WIB": "Western Indonesia Time", "OEZ": "Eastern European Standard Time", "ChST": "Chamorro Standard Time", "HNT": "Newfoundland Standard Time", "GFT": "French Guiana Time", "UYT": "Uruguay Standard Time", "WESZ": "Western European Summer Time", "MDT": "Macau Summer Time", "JDT": "Japan Daylight Time", "BOT": "Bolivia Time", "CLST": "Chile Summer Time", "VET": "Venezuela Time", "ACWDT": "Australian Central Western Daylight Time", "ART": "Argentina Standard Time", "AWST": "Australian Western Standard Time", "GMT": "Greenwich Mean Time", "CAT": "Central Africa Time", "CHAST": "Chatham Standard Time", "ACWST": "Australian Central Western Standard Time", "JST": "Japan Standard Time", "CST": "Central Standard Time", "AEST": "Australian Eastern Standard Time", "WAT": "West Africa Standard Time", "OESZ": "Eastern European Summer Time"},
+ timezones: map[string]string{"CST": "Central Standard Time", "MST": "Macau Standard Time", "ACWDT": "Australian Central Western Daylight Time", "SAST": "South Africa Standard Time", "WAST": "West Africa Summer Time", "CLST": "Chile Summer Time", "CHADT": "Chatham Daylight Time", "BOT": "Bolivia Time", "COST": "Colombia Summer Time", "HADT": "Hawaii-Aleutian Daylight Time", "COT": "Colombia Standard Time", "HAT": "Newfoundland Daylight Time", "HKT": "Hong Kong Standard Time", "HKST": "Hong Kong Summer Time", "CHAST": "Chatham Standard Time", "OEZ": "Eastern European Standard Time", "AWDT": "Australian Western Daylight Time", "ART": "Argentina Standard Time", "PDT": "Pacific Daylight Time", "PST": "Pacific Standard Time", "WEZ": "Western European Standard Time", "AEDT": "Australian Eastern Daylight Time", "CLT": "Chile Standard Time", "UYST": "Uruguay Summer Time", "∅∅∅": "Azores Summer Time", "WESZ": "Western European Summer Time", "SGT": "Singapore Standard Time", "GFT": "French Guiana Time", "ACWST": "Australian Central Western Standard Time", "TMT": "Turkmenistan Standard Time", "WITA": "Central Indonesia Time", "AKDT": "Alaska Daylight Time", "TMST": "Turkmenistan Summer Time", "HNT": "Newfoundland Standard Time", "OESZ": "Eastern European Summer Time", "MDT": "Macau Summer Time", "ECT": "Ecuador Time", "VET": "Venezuela Time", "GYT": "Guyana Time", "LHST": "Lord Howe Standard Time", "SRT": "Suriname Time", "NZDT": "New Zealand Daylight Time", "IST": "India Standard Time", "WIT": "Eastern Indonesia Time", "CDT": "Central Daylight Time", "JST": "Japan Standard Time", "AST": "Atlantic Standard Time", "ARST": "Argentina Summer Time", "WAT": "West Africa Standard Time", "EAT": "East Africa Time", "ACST": "Australian Central Standard Time", "WARST": "Western Argentina Summer Time", "HAST": "Hawaii-Aleutian Standard Time", "MEZ": "Central European Standard Time", "MESZ": "Central European Summer Time", "ACDT": "Australian Central Daylight Time", "AWST": "Australian Western Standard Time", "AEST": "Australian Eastern Standard Time", "MYT": "Malaysia Time", "GMT": "Greenwich Mean Time", "LHDT": "Lord Howe Daylight Time", "NZST": "New Zealand Standard Time", "EDT": "Eastern Daylight Time", "CAT": "Central Africa Time", "ChST": "Chamorro Standard Time", "UYT": "Uruguay Standard Time", "BT": "Bhutan Time", "WART": "Western Argentina Standard Time", "JDT": "Japan Daylight Time", "AKST": "Alaska Standard Time", "ADT": "Atlantic Daylight Time", "EST": "Eastern Standard Time", "WIB": "Western Indonesia Time"},
}
}
diff --git a/en_ZW/en_ZW_test.go b/en_ZW/en_ZW_test.go
new file mode 100644
index 00000000..36a726e9
--- /dev/null
+++ b/en_ZW/en_ZW_test.go
@@ -0,0 +1,1120 @@
+package en_ZW
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "en_ZW"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/eo/eo.go b/eo/eo.go
index 31fb783b..6443246c 100644
--- a/eo/eo.go
+++ b/eo/eo.go
@@ -74,7 +74,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"aK", "pK"},
erasNarrow: []string{"aK", "pK"},
erasWide: []string{"aK", "pK"},
- timezones: map[string]string{"HKST": "HKST", "GMT": "universala tempo kunordigita", "ARST": "ARST", "NZDT": "NZDT", "ECT": "ECT", "HADT": "HADT", "SAST": "suda afrika tempo", "GYT": "GYT", "MESZ": "centra eŭropa somera tempo", "AEDT": "orienta aŭstralia somera tempo", "WESZ": "okcidenta eŭropa somera tempo", "EST": "orienta nord-amerika norma tempo", "EDT": "orienta nord-amerika somera tempo", "MEZ": "centra eŭropa norma tempo", "CDT": "centra nord-amerika somera tempo", "COST": "COST", "AWST": "okcidenta aŭstralia norma tempo", "AWDT": "okcidenta aŭstralia somera tempo", "SRT": "SRT", "BOT": "BOT", "COT": "COT", "EAT": "orienta afrika tempo", "UYT": "UYT", "ACWST": "centrokcidenta aŭstralia norma tempo", "JST": "japana norma tempo", "AEST": "orienta aŭstralia norma tempo", "WAT": "okcidenta afrika norma tempo", "JDT": "japana somera tempo", "CAT": "centra afrika tempo", "HKT": "HKT", "OESZ": "orienta eŭropa somera tempo", "MST": "MST", "NZST": "NZST", "CST": "centra nord-amerika norma tempo", "HNT": "HNT", "HAT": "HAT", "WIT": "orienta indonezia tempo", "PDT": "pacifika nord-amerika somera tempo", "CHAST": "CHAST", "ART": "ART", "ACWDT": "centrokcidenta aŭstralia somera tempo", "HAST": "HAST", "WARST": "WARST", "WIB": "okcidenta indonezia tempo", "AKDT": "AKDT", "CHADT": "CHADT", "CLT": "CLT", "WAST": "okcidenta afrika somera tempo", "BT": "BT", "GFT": "GFT", "OEZ": "orienta eŭropa norma tempo", "MDT": "MDT", "AKST": "AKST", "ChST": "ChST", "WEZ": "okcidenta eŭropa norma tempo", "AST": "atlantika nord-amerika norma tempo", "WART": "WART", "ACST": "centra aŭstralia norma tempo", "LHDT": "LHDT", "MYT": "MYT", "CLST": "CLST", "VET": "VET", "SGT": "SGT", "WITA": "centra indonezia tempo", "IST": "barata tempo", "TMST": "TMST", "LHST": "LHST", "UYST": "UYST", "ACDT": "centra aŭstralia somera tempo", "∅∅∅": "∅∅∅", "TMT": "TMT", "PST": "pacifika nord-amerika norma tempo", "ADT": "atlantika nord-amerika somera tempo"},
+ timezones: map[string]string{"EST": "orienta nord-amerika norma tempo", "MEZ": "centra eŭropa norma tempo", "MESZ": "centra eŭropa somera tempo", "COST": "COST", "TMST": "TMST", "EAT": "orienta afrika tempo", "CHADT": "CHADT", "ARST": "ARST", "NZST": "NZST", "WESZ": "okcidenta eŭropa somera tempo", "HKT": "HKT", "AKST": "AKST", "WITA": "centra indonezia tempo", "IST": "barata tempo", "WAT": "okcidenta afrika norma tempo", "WIB": "okcidenta indonezia tempo", "MDT": "monta nord-amerika somera tempo", "ACDT": "centra aŭstralia somera tempo", "GFT": "GFT", "AWDT": "okcidenta aŭstralia somera tempo", "HAT": "HAT", "PDT": "pacifika nord-amerika somera tempo", "WART": "WART", "SRT": "SRT", "HADT": "HADT", "CAT": "centra afrika tempo", "WAST": "okcidenta afrika somera tempo", "UYST": "UYST", "CHAST": "CHAST", "AKDT": "AKDT", "CLT": "CLT", "ACWST": "centrokcidenta aŭstralia norma tempo", "PST": "pacifika nord-amerika norma tempo", "HNT": "HNT", "OEZ": "orienta eŭropa norma tempo", "CST": "centra nord-amerika norma tempo", "NZDT": "NZDT", "∅∅∅": "∅∅∅", "AST": "atlantika nord-amerika norma tempo", "ACWDT": "centrokcidenta aŭstralia somera tempo", "WEZ": "okcidenta eŭropa norma tempo", "SGT": "SGT", "TMT": "TMT", "OESZ": "orienta eŭropa somera tempo", "GYT": "GYT", "MST": "monta nord-amerika norma tempo", "AWST": "okcidenta aŭstralia norma tempo", "ART": "ART", "HAST": "HAST", "MYT": "MYT", "CLST": "CLST", "BT": "BT", "ECT": "ECT", "JST": "japana norma tempo", "SAST": "suda afrika tempo", "BOT": "BOT", "GMT": "universala tempo kunordigita", "AEDT": "orienta aŭstralia somera tempo", "UYT": "UYT", "CDT": "centra nord-amerika somera tempo", "HKST": "HKST", "ADT": "atlantika nord-amerika somera tempo", "COT": "COT", "ChST": "ChST", "WARST": "WARST", "EDT": "orienta nord-amerika somera tempo", "LHST": "LHST", "WIT": "orienta indonezia tempo", "VET": "VET", "JDT": "japana somera tempo", "AEST": "orienta aŭstralia norma tempo", "LHDT": "LHDT", "ACST": "centra aŭstralia norma tempo"},
}
}
diff --git a/eo/eo_test.go b/eo/eo_test.go
new file mode 100644
index 00000000..154f5293
--- /dev/null
+++ b/eo/eo_test.go
@@ -0,0 +1,1120 @@
+package eo
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "eo"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/eo_001/eo_001.go b/eo_001/eo_001.go
index 2204bd10..409a6a4c 100644
--- a/eo_001/eo_001.go
+++ b/eo_001/eo_001.go
@@ -74,7 +74,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"aK", "pK"},
erasNarrow: []string{"aK", "pK"},
erasWide: []string{"aK", "pK"},
- timezones: map[string]string{"COT": "COT", "WIB": "okcidenta indonezia tempo", "ARST": "ARST", "ECT": "ECT", "LHST": "LHST", "MYT": "MYT", "NZST": "NZST", "ChST": "ChST", "VET": "VET", "HKT": "HKT", "WITA": "centra indonezia tempo", "GMT": "universala tempo kunordigita", "OEZ": "orienta eŭropa norma tempo", "TMT": "TMT", "MDT": "MDT", "JST": "japana norma tempo", "PDT": "pacifika nord-amerika somera tempo", "SAST": "suda afrika tempo", "HNT": "HNT", "IST": "barata tempo", "CDT": "centra nord-amerika somera tempo", "WART": "WART", "EAT": "orienta afrika tempo", "CHAST": "CHAST", "HAT": "HAT", "GFT": "GFT", "GYT": "GYT", "AWDT": "okcidenta aŭstralia somera tempo", "ACWST": "centrokcidenta aŭstralia norma tempo", "HADT": "HADT", "SGT": "SGT", "BT": "BT", "MESZ": "centra eŭropa somera tempo", "ACDT": "centra aŭstralia somera tempo", "SRT": "SRT", "BOT": "BOT", "WAT": "okcidenta afrika norma tempo", "ACST": "centra aŭstralia norma tempo", "AKST": "AKST", "NZDT": "NZDT", "CAT": "centra afrika tempo", "TMST": "TMST", "PST": "pacifika nord-amerika norma tempo", "UYT": "UYT", "ADT": "atlantika nord-amerika somera tempo", "EST": "orienta nord-amerika norma tempo", "AEDT": "orienta aŭstralia somera tempo", "MST": "MST", "UYST": "UYST", "WESZ": "okcidenta eŭropa somera tempo", "MEZ": "centra eŭropa norma tempo", "WEZ": "okcidenta eŭropa norma tempo", "AEST": "orienta aŭstralia norma tempo", "∅∅∅": "∅∅∅", "OESZ": "orienta eŭropa somera tempo", "AWST": "okcidenta aŭstralia norma tempo", "WARST": "WARST", "CLST": "CLST", "COST": "COST", "AST": "atlantika nord-amerika norma tempo", "HAST": "HAST", "WAST": "okcidenta afrika somera tempo", "WIT": "orienta indonezia tempo", "AKDT": "AKDT", "CST": "centra nord-amerika norma tempo", "CLT": "CLT", "HKST": "HKST", "ART": "ART", "JDT": "japana somera tempo", "EDT": "orienta nord-amerika somera tempo", "LHDT": "LHDT", "CHADT": "CHADT", "ACWDT": "centrokcidenta aŭstralia somera tempo"},
+ timezones: map[string]string{"MESZ": "centra eŭropa somera tempo", "ChST": "ChST", "WIT": "orienta indonezia tempo", "∅∅∅": "∅∅∅", "WAST": "okcidenta afrika somera tempo", "MYT": "MYT", "WART": "WART", "PST": "pacifika nord-amerika norma tempo", "HNT": "HNT", "ART": "ART", "MEZ": "centra eŭropa norma tempo", "COT": "COT", "CDT": "centra nord-amerika somera tempo", "SRT": "SRT", "CHAST": "CHAST", "ECT": "ECT", "BOT": "BOT", "TMT": "TMT", "AEST": "orienta aŭstralia norma tempo", "LHST": "LHST", "CST": "centra nord-amerika norma tempo", "EDT": "orienta nord-amerika somera tempo", "CAT": "centra afrika tempo", "GFT": "GFT", "MST": "MST", "AKST": "AKST", "AWST": "okcidenta aŭstralia norma tempo", "AWDT": "okcidenta aŭstralia somera tempo", "EST": "orienta nord-amerika norma tempo", "PDT": "pacifika nord-amerika somera tempo", "OEZ": "orienta eŭropa norma tempo", "GMT": "universala tempo kunordigita", "LHDT": "LHDT", "VET": "VET", "JST": "japana norma tempo", "WIB": "okcidenta indonezia tempo", "EAT": "orienta afrika tempo", "ACST": "centra aŭstralia norma tempo", "HKT": "HKT", "WITA": "centra indonezia tempo", "NZST": "NZST", "ACWDT": "centrokcidenta aŭstralia somera tempo", "HADT": "HADT", "ADT": "atlantika nord-amerika somera tempo", "WESZ": "okcidenta eŭropa somera tempo", "BT": "BT", "UYT": "UYT", "ACWST": "centrokcidenta aŭstralia norma tempo", "JDT": "japana somera tempo", "WEZ": "okcidenta eŭropa norma tempo", "OESZ": "orienta eŭropa somera tempo", "GYT": "GYT", "HKST": "HKST", "HAT": "HAT", "TMST": "TMST", "ACDT": "centra aŭstralia somera tempo", "AKDT": "AKDT", "AST": "atlantika nord-amerika norma tempo", "ARST": "ARST", "IST": "barata tempo", "WAT": "okcidenta afrika norma tempo", "COST": "COST", "MDT": "MDT", "CHADT": "CHADT", "SAST": "suda afrika tempo", "HAST": "HAST", "NZDT": "NZDT", "SGT": "SGT", "AEDT": "orienta aŭstralia somera tempo", "CLT": "CLT", "CLST": "CLST", "UYST": "UYST", "WARST": "WARST"},
}
}
diff --git a/eo_001/eo_001_test.go b/eo_001/eo_001_test.go
new file mode 100644
index 00000000..c9feb904
--- /dev/null
+++ b/eo_001/eo_001_test.go
@@ -0,0 +1,1120 @@
+package eo_001
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "eo_001"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/es/es.go b/es/es.go
index fd9ab436..3630c3f6 100644
--- a/es/es.go
+++ b/es/es.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a. C.", "d. C."},
erasNarrow: []string{"", ""},
erasWide: []string{"antes de Cristo", "después de Cristo"},
- timezones: map[string]string{"ADT": "hora de verano del Atlántico", "HKST": "hora de verano de Hong Kong", "ARST": "hora de verano de Argentina", "LHDT": "hora de verano de Lord Howe", "COT": "hora estándar de Colombia", "WIT": "hora de Indonesia oriental", "AKST": "hora estándar de Alaska", "ECT": "hora de Ecuador", "WAT": "hora estándar de África occidental", "GMT": "hora del meridiano de Greenwich", "HNT": "hora estándar de Terranova", "GFT": "hora de la Guayana Francesa", "ACDT": "hora de verano de Australia central", "TMST": "hora de verano de Turkmenistán", "ChST": "hora estándar de Chamorro", "WAST": "hora de verano de África occidental", "JST": "hora estándar de Japón", "BOT": "hora de Bolivia", "AEDT": "hora de verano de Australia oriental", "HAST": "hora estándar de Hawái-Aleutiano", "PDT": "hora de verano del Pacífico", "GYT": "hora de Guyana", "CLT": "hora estándar de Chile", "CAT": "hora de África central", "WART": "hora estándar de Argentina occidental", "ACST": "hora estándar de Australia central", "ART": "hora estándar de Argentina", "VET": "hora de Venezuela", "EDT": "hora de verano oriental", "HADT": "hora de verano de Hawái-Aleutiano", "SAST": "hora de Sudáfrica", "∅∅∅": "hora de verano del Amazonas", "NZST": "hora estándar de Nueva Zelanda", "OESZ": "hora de verano de Europa oriental", "EAT": "hora de África oriental", "AKDT": "hora de verano de Alaska", "AWDT": "hora de verano de Australia occidental", "WEZ": "hora estándar de Europa occidental", "WIB": "hora de Indonesia occidental", "PST": "hora estándar del Pacífico", "MEZ": "hora estándar de Europa central", "ACWST": "hora estándar de Australia centroccidental", "CHADT": "hora de verano de Chatham", "AST": "hora estándar del Atlántico", "EST": "hora estándar oriental", "WITA": "hora de Indonesia central", "MDT": "Hora de verano de Macao", "SRT": "hora de Surinam", "LHST": "hora estándar de Lord Howe", "MYT": "hora de Malasia", "COST": "hora de verano de Colombia", "SGT": "hora de Singapur", "OEZ": "hora estándar de Europa oriental", "TMT": "hora estándar de Turkmenistán", "UYT": "hora estándar de Uruguay", "AEST": "hora estándar de Australia oriental", "CHAST": "hora estándar de Chatham", "CDT": "hora de verano central", "MESZ": "hora de verano de Europa central", "WESZ": "hora de verano de Europa occidental", "CLST": "hora de verano de Chile", "HAT": "hora de verano de Terranova", "CST": "hora estándar central", "ACWDT": "hora de verano de Australia centroccidental", "BT": "hora de Bután", "WARST": "hora de verano de Argentina occidental", "IST": "hora estándar de la India", "MST": "Hora estándar de Macao", "AWST": "hora estándar de Australia occidental", "JDT": "hora de verano de Japón", "NZDT": "hora de verano de Nueva Zelanda", "UYST": "hora de verano de Uruguay", "HKT": "hora estándar de Hong Kong"},
+ timezones: map[string]string{"TMT": "hora estándar de Turkmenistán", "GYT": "hora de Guyana", "UYST": "hora de verano de Uruguay", "MDT": "hora de verano de las Montañas", "MEZ": "hora estándar de Europa central", "WIB": "hora de Indonesia occidental", "TMST": "hora de verano de Turkmenistán", "WAT": "hora estándar de África occidental", "WESZ": "hora de verano de Europa occidental", "GMT": "hora del meridiano de Greenwich", "WEZ": "hora estándar de Europa occidental", "SGT": "hora de Singapur", "NZST": "hora estándar de Nueva Zelanda", "IST": "hora estándar de la India", "MESZ": "hora de verano de Europa central", "ADT": "hora de verano del Atlántico", "COST": "hora de verano de Colombia", "CST": "hora estándar central", "CDT": "hora de verano central", "HKT": "hora estándar de Hong Kong", "JST": "hora estándar de Japón", "COT": "hora estándar de Colombia", "LHST": "hora estándar de Lord Howe", "PDT": "hora de verano del Pacífico", "CAT": "hora de África central", "CHAST": "hora estándar de Chatham", "ECT": "hora de Ecuador", "ART": "hora estándar de Argentina", "SAST": "hora de Sudáfrica", "HNT": "hora estándar de Terranova", "ChST": "hora estándar de Chamorro", "UYT": "hora estándar de Uruguay", "CHADT": "hora de verano de Chatham", "AST": "hora estándar del Atlántico", "EST": "hora estándar oriental", "EDT": "hora de verano oriental", "OESZ": "hora de verano de Europa oriental", "∅∅∅": "hora de verano de Brasilia", "ACST": "hora estándar de Australia central", "WART": "hora estándar de Argentina occidental", "BOT": "hora de Bolivia", "CLST": "hora de verano de Chile", "MST": "hora estándar de las Montañas", "GFT": "hora de la Guayana Francesa", "JDT": "hora de verano de Japón", "NZDT": "hora de verano de Nueva Zelanda", "HADT": "hora de verano de Hawái-Aleutiano", "PST": "hora estándar del Pacífico", "OEZ": "hora estándar de Europa oriental", "ACWST": "hora estándar de Australia centroccidental", "ARST": "hora de verano de Argentina", "LHDT": "hora de verano de Lord Howe", "AEDT": "hora de verano de Australia oriental", "WIT": "hora de Indonesia oriental", "HKST": "hora de verano de Hong Kong", "VET": "hora de Venezuela", "WITA": "hora de Indonesia central", "AEST": "hora estándar de Australia oriental", "CLT": "hora estándar de Chile", "BT": "hora de Bután", "ACDT": "hora de verano de Australia central", "WARST": "hora de verano de Argentina occidental", "AKST": "hora estándar de Alaska", "HAT": "hora de verano de Terranova", "SRT": "hora de Surinam", "ACWDT": "hora de verano de Australia centroccidental", "AWST": "hora estándar de Australia occidental", "AWDT": "hora de verano de Australia occidental", "WAST": "hora de verano de África occidental", "EAT": "hora de África oriental", "MYT": "hora de Malasia", "AKDT": "hora de verano de Alaska", "HAST": "hora estándar de Hawái-Aleutiano"},
}
}
diff --git a/es/es_test.go b/es/es_test.go
new file mode 100644
index 00000000..1a9d0eb6
--- /dev/null
+++ b/es/es_test.go
@@ -0,0 +1,1120 @@
+package es
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "es"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/es_419/es_419.go b/es_419/es_419.go
index 9f047626..f804eae8 100644
--- a/es_419/es_419.go
+++ b/es_419/es_419.go
@@ -69,7 +69,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a. C.", "d. C."},
erasNarrow: []string{"", ""},
erasWide: []string{"antes de Cristo", "después de Cristo"},
- timezones: map[string]string{"EAT": "hora de África oriental", "∅∅∅": "hora de verano de Brasilia", "EDT": "hora de verano oriental", "WART": "hora estándar de Argentina occidental", "AEDT": "hora de verano de Australia oriental", "HKT": "hora estándar de Hong Kong", "TMST": "hora de verano de Turkmenistán", "LHDT": "hora de verano de Lord Howe", "ACWST": "hora estándar de Australia centroccidental", "AEST": "hora estándar de Australia oriental", "COST": "hora de verano de Colombia", "NZDT": "hora de verano de Nueva Zelanda", "VET": "hora de Venezuela", "AWDT": "hora de verano de Australia occidental", "CDT": "hora de verano central", "UYT": "hora estándar de Uruguay", "CLT": "hora estándar de Chile", "OEZ": "hora estándar de Europa oriental", "ACDT": "hora de verano de Australia central", "AKDT": "hora de verano de Alaska", "WAST": "hora de verano de África occidental", "JDT": "hora de verano de Japón", "COT": "hora estándar de Colombia", "SGT": "hora de Singapur", "WAT": "hora estándar de África occidental", "OESZ": "hora de verano de Europa oriental", "MST": "Hora estándar de Macao", "ARST": "hora de verano de Argentina", "CAT": "hora de África central", "AST": "hora estándar del Atlántico", "HAST": "hora estándar de Hawái-Aleutianas", "GFT": "hora de la Guayana Francesa", "JST": "hora estándar de Japón", "PDT": "hora de verano del Pacífico", "LHST": "hora estándar de Lord Howe", "NZST": "hora estándar de Nueva Zelanda", "ECT": "hora de Ecuador", "HADT": "hora de verano de Hawái-Aleutianas", "WARST": "hora de verano de Argentina occidental", "HAT": "hora de verano de Terranova", "EST": "hora estándar oriental", "WIT": "hora de Indonesia oriental", "MDT": "Hora de verano de Macao", "MYT": "hora de Malasia", "CHAST": "hora estándar de Chatham", "ChST": "hora de Chamorro", "WITA": "hora de Indonesia central", "ART": "hora estándar de Argentina", "WEZ": "hora estándar de Europa occidental", "ACWDT": "hora de verano de Australia centroccidental", "HKST": "hora de verano de Hong Kong", "HNT": "hora estándar de Terranova", "AKST": "hora estándar de Alaska", "UYST": "hora de verano de Uruguay", "BT": "hora de Bután", "IST": "hora de India", "SRT": "hora de Surinam", "GYT": "hora de Guyana", "MEZ": "hora estándar de Europa central", "CHADT": "hora de verano de Chatham", "CLST": "hora de verano de Chile", "ADT": "hora de verano del Atlántico", "SAST": "hora de Sudáfrica", "WIB": "hora de Indonesia occidental", "WESZ": "hora de verano de Europa occidental", "TMT": "hora estándar de Turkmenistán", "MESZ": "hora de verano de Europa central", "BOT": "hora de Bolivia", "AWST": "hora estándar de Australia occidental", "CST": "hora estándar central", "GMT": "hora del meridiano de Greenwich", "ACST": "hora estándar de Australia central", "PST": "hora estándar del Pacífico"},
+ timezones: map[string]string{"ACWST": "hora estándar de Australia centroccidental", "ARST": "hora de verano de Argentina", "HKT": "hora estándar de Hong Kong", "AST": "hora estándar del Atlántico", "ART": "hora estándar de Argentina", "IST": "hora de India", "PST": "hora estándar del Pacífico", "EDT": "hora de verano oriental", "ChST": "hora de Chamorro", "CDT": "hora de verano central", "ECT": "hora de Ecuador", "UYT": "hora estándar de Uruguay", "EAT": "hora de África oriental", "SRT": "hora de Surinam", "AKST": "hora estándar de Alaska", "PDT": "hora de verano del Pacífico", "HAST": "hora estándar de Hawái-Aleutianas", "TMST": "hora de verano de Turkmenistán", "SGT": "hora de Singapur", "LHDT": "hora de verano de Lord Howe", "ACDT": "hora de verano de Australia central", "JDT": "hora de verano de Japón", "BOT": "hora de Bolivia", "SAST": "hora de Sudáfrica", "WAT": "hora estándar de África occidental", "GMT": "hora del meridiano de Greenwich", "AEDT": "hora de verano de Australia oriental", "LHST": "hora estándar de Lord Howe", "AKDT": "hora de verano de Alaska", "AWDT": "hora de verano de Australia occidental", "BT": "hora de Bután", "CST": "hora estándar central", "MESZ": "hora de verano de Europa central", "HNT": "hora estándar de Terranova", "GYT": "hora de Guyana", "WIT": "hora de Indonesia oriental", "CLST": "hora de verano de Chile", "ACST": "hora estándar de Australia central", "ACWDT": "hora de verano de Australia centroccidental", "WESZ": "hora de verano de Europa occidental", "OEZ": "hora estándar de Europa oriental", "JST": "hora estándar de Japón", "NZDT": "hora de verano de Nueva Zelanda", "HADT": "hora de verano de Hawái-Aleutianas", "HAT": "hora de verano de Terranova", "MDT": "Hora de verano de Macao", "NZST": "hora estándar de Nueva Zelanda", "WEZ": "hora estándar de Europa occidental", "COT": "hora estándar de Colombia", "COST": "hora de verano de Colombia", "OESZ": "hora de verano de Europa oriental", "AEST": "hora estándar de Australia oriental", "CLT": "hora estándar de Chile", "GFT": "hora de la Guayana Francesa", "ADT": "hora de verano del Atlántico", "CAT": "hora de África central", "HKST": "hora de verano de Hong Kong", "MEZ": "hora estándar de Europa central", "WAST": "hora de verano de África occidental", "UYST": "hora de verano de Uruguay", "WART": "hora estándar de Argentina occidental", "∅∅∅": "hora de verano de las Azores", "WITA": "hora de Indonesia central", "WARST": "hora de verano de Argentina occidental", "MST": "Hora estándar de Macao", "CHAST": "hora estándar de Chatham", "CHADT": "hora de verano de Chatham", "VET": "hora de Venezuela", "AWST": "hora estándar de Australia occidental", "EST": "hora estándar oriental", "WIB": "hora de Indonesia occidental", "TMT": "hora estándar de Turkmenistán", "MYT": "hora de Malasia"},
}
}
diff --git a/es_419/es_419_test.go b/es_419/es_419_test.go
new file mode 100644
index 00000000..9ccc5b9a
--- /dev/null
+++ b/es_419/es_419_test.go
@@ -0,0 +1,1120 @@
+package es_419
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "es_419"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/es_AR/es_AR.go b/es_AR/es_AR.go
index 4e19d41d..6b7e0af5 100644
--- a/es_AR/es_AR.go
+++ b/es_AR/es_AR.go
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a. C.", "d. C."},
erasNarrow: []string{"", ""},
erasWide: []string{"antes de Cristo", "después de Cristo"},
- timezones: map[string]string{"HKST": "hora de verano de Hong Kong", "OESZ": "hora de verano de Europa oriental", "NZST": "hora estándar de Nueva Zelanda", "ECT": "hora de Ecuador", "AKST": "hora estándar de Alaska", "PDT": "hora de verano del Pacífico", "AWDT": "hora de verano de Australia occidental", "MEZ": "hora estándar de Europa central", "CLST": "hora de verano de Chile", "HNT": "hora estándar de Terranova", "GFT": "hora de la Guayana Francesa", "WIT": "hora de Indonesia oriental", "BT": "hora de Bután", "AST": "hora estándar del Atlántico", "HAT": "hora de verano de Terranova", "MESZ": "hora de verano de Europa central", "AEST": "hora estándar de Australia oriental", "CAT": "hora de África central", "ADT": "hora de verano del Atlántico", "WAT": "hora estándar de África occidental", "WITA": "hora de Indonesia central", "LHST": "hora estándar de Lord Howe", "WESZ": "hora de verano de Europa occidental", "∅∅∅": "hora de verano del Amazonas", "CLT": "hora estándar de Chile", "VET": "hora de Venezuela", "AEDT": "hora de verano de Australia oriental", "EST": "hora estándar oriental", "HADT": "hora de verano de Hawái-Aleutiano", "TMT": "hora estándar de Turkmenistán", "CST": "hora estándar central", "CHADT": "hora de verano de Chatham", "MYT": "hora de Malasia", "SRT": "hora de Surinam", "UYT": "hora estándar de Uruguay", "WART": "hora estándar de Argentina occidental", "EAT": "hora de África oriental", "MST": "Hora estándar de Macao", "WEZ": "hora estándar de Europa occidental", "WARST": "hora de verano de Argentina occidental", "GYT": "hora de Guyana", "EDT": "hora de verano oriental", "SGT": "hora de Singapur", "ACDT": "hora de verano de Australia central", "LHDT": "hora de verano de Lord Howe", "AWST": "hora estándar de Australia occidental", "COT": "hora estándar de Colombia", "OEZ": "hora estándar de Europa oriental", "ARST": "hora de verano de Argentina", "ACST": "hora estándar de Australia central", "BOT": "hora de Bolivia", "HAST": "hora estándar de Hawái-Aleutiano", "WIB": "hora de Indonesia occidental", "TMST": "hora de verano de Turkmenistán", "AKDT": "hora de verano de Alaska", "ACWST": "hora estándar de Australia centroccidental", "HKT": "hora estándar de Hong Kong", "IST": "hora estándar de la India", "NZDT": "hora de verano de Nueva Zelanda", "CDT": "hora de verano central", "CHAST": "hora estándar de Chatham", "COST": "hora de verano de Colombia", "SAST": "hora de Sudáfrica", "GMT": "hora del meridiano de Greenwich", "JDT": "hora de verano de Japón", "PST": "hora estándar del Pacífico", "UYST": "hora de verano de Uruguay", "ChST": "hora estándar de Chamorro", "ACWDT": "hora de verano de Australia centroccidental", "WAST": "hora de verano de África occidental", "ART": "hora estándar de Argentina", "MDT": "Hora de verano de Macao", "JST": "hora estándar de Japón"},
+ timezones: map[string]string{"ART": "hora estándar de Argentina", "CLT": "hora estándar de Chile", "ACWST": "hora estándar de Australia centroccidental", "TMST": "hora de verano de Turkmenistán", "CHAST": "hora estándar de Chatham", "NZST": "hora estándar de Nueva Zelanda", "SGT": "hora de Singapur", "CAT": "hora de África central", "LHST": "hora estándar de Lord Howe", "HKT": "hora estándar de Hong Kong", "PDT": "hora de verano del Pacífico", "∅∅∅": "Hora de verano de Acre", "WIB": "hora de Indonesia occidental", "UYST": "hora de verano de Uruguay", "EDT": "hora de verano oriental", "WEZ": "hora estándar de Europa occidental", "ADT": "hora de verano del Atlántico", "AEDT": "hora de verano de Australia oriental", "WIT": "hora de Indonesia oriental", "WESZ": "hora de verano de Europa occidental", "HAT": "hora de verano de Terranova", "SRT": "hora de Surinam", "AWST": "hora estándar de Australia occidental", "MEZ": "hora estándar de Europa central", "MESZ": "hora de verano de Europa central", "AWDT": "hora de verano de Australia occidental", "JST": "hora estándar de Japón", "HAST": "hora estándar de Hawái-Aleutiano", "LHDT": "hora de verano de Lord Howe", "CLST": "hora de verano de Chile", "UYT": "hora estándar de Uruguay", "WARST": "hora de verano de Argentina occidental", "GYT": "hora de Guyana", "MST": "hora estándar de las Montañas", "ChST": "hora estándar de Chamorro", "OEZ": "hora estándar de Europa oriental", "GMT": "hora del meridiano de Greenwich", "AKST": "hora estándar de Alaska", "HADT": "hora de verano de Hawái-Aleutiano", "IST": "hora estándar de la India", "CST": "hora estándar central", "WITA": "hora de Indonesia central", "JDT": "hora de verano de Japón", "HNT": "hora estándar de Terranova", "WAST": "hora de verano de África occidental", "MDT": "hora de verano de las Montañas", "NZDT": "hora de verano de Nueva Zelanda", "WAT": "hora estándar de África occidental", "EAT": "hora de África oriental", "ACST": "hora estándar de Australia central", "AKDT": "hora de verano de Alaska", "EST": "hora estándar oriental", "BOT": "hora de Bolivia", "VET": "hora de Venezuela", "HKST": "hora de verano de Hong Kong", "AEST": "hora estándar de Australia oriental", "GFT": "hora de la Guayana Francesa", "MYT": "hora de Malasia", "BT": "hora de Bután", "CHADT": "hora de verano de Chatham", "ACWDT": "hora de verano de Australia centroccidental", "ARST": "hora de verano de Argentina", "COT": "hora estándar de Colombia", "COST": "hora de verano de Colombia", "OESZ": "hora de verano de Europa oriental", "WART": "hora estándar de Argentina occidental", "CDT": "hora de verano central", "ACDT": "hora de verano de Australia central", "ECT": "hora de Ecuador", "PST": "hora estándar del Pacífico", "TMT": "hora estándar de Turkmenistán", "SAST": "hora de Sudáfrica", "AST": "hora estándar del Atlántico"},
}
}
diff --git a/es_AR/es_AR_test.go b/es_AR/es_AR_test.go
new file mode 100644
index 00000000..ce4a210e
--- /dev/null
+++ b/es_AR/es_AR_test.go
@@ -0,0 +1,1120 @@
+package es_AR
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "es_AR"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/es_BO/es_BO.go b/es_BO/es_BO.go
index 569f973c..b8c31198 100644
--- a/es_BO/es_BO.go
+++ b/es_BO/es_BO.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a. C.", "d. C."},
erasNarrow: []string{"", ""},
erasWide: []string{"antes de Cristo", "después de Cristo"},
- timezones: map[string]string{"HNT": "hora estándar de Terranova", "ACDT": "hora de verano de Australia central", "AEST": "hora estándar de Australia oriental", "∅∅∅": "hora de verano del Amazonas", "TMT": "hora estándar de Turkmenistán", "JST": "hora estándar de Japón", "AKDT": "hora de verano de Alaska", "MESZ": "hora de verano de Europa central", "HADT": "hora de verano de Hawái-Aleutiano", "WIB": "hora de Indonesia occidental", "NZDT": "hora de verano de Nueva Zelanda", "UYT": "hora estándar de Uruguay", "CDT": "hora de verano central", "CHADT": "hora de verano de Chatham", "HKST": "hora de verano de Hong Kong", "ARST": "hora de verano de Argentina", "AKST": "hora estándar de Alaska", "UYST": "hora de verano de Uruguay", "CHAST": "hora estándar de Chatham", "EST": "hora estándar oriental", "WIT": "hora de Indonesia oriental", "ACWST": "hora estándar de Australia centroccidental", "CLST": "hora de verano de Chile", "MDT": "Hora de verano de Macao", "TMST": "hora de verano de Turkmenistán", "ChST": "hora estándar de Chamorro", "COST": "hora de verano de Colombia", "WAT": "hora estándar de África occidental", "SAST": "hora de Sudáfrica", "GYT": "hora de Guyana", "NZST": "hora estándar de Nueva Zelanda", "AWST": "hora estándar de Australia occidental", "MEZ": "hora estándar de Europa central", "CST": "hora estándar central", "AEDT": "hora de verano de Australia oriental", "CAT": "hora de África central", "WITA": "hora de Indonesia central", "EAT": "hora de África oriental", "MYT": "hora de Malasia", "CLT": "hora estándar de Chile", "GFT": "hora de la Guayana Francesa", "ACST": "hora estándar de Australia central", "LHDT": "hora de verano de Lord Howe", "HAST": "hora estándar de Hawái-Aleutiano", "WARST": "hora de verano de Argentina occidental", "OESZ": "hora de verano de Europa oriental", "COT": "hora estándar de Colombia", "WAST": "hora de verano de África occidental", "HKT": "hora estándar de Hong Kong", "AWDT": "hora de verano de Australia occidental", "WESZ": "hora de verano de Europa occidental", "EDT": "hora de verano oriental", "WART": "hora estándar de Argentina occidental", "OEZ": "hora estándar de Europa oriental", "PST": "hora estándar del Pacífico", "BOT": "hora de Bolivia", "WEZ": "hora estándar de Europa occidental", "SGT": "hora de Singapur", "ADT": "hora de verano del Atlántico", "BT": "hora de Bután", "IST": "hora estándar de la India", "ART": "hora estándar de Argentina", "PDT": "hora de verano del Pacífico", "LHST": "hora estándar de Lord Howe", "SRT": "hora de Surinam", "ECT": "hora de Ecuador", "GMT": "hora del meridiano de Greenwich", "HAT": "hora de verano de Terranova", "MST": "Hora estándar de Macao", "JDT": "hora de verano de Japón", "ACWDT": "hora de verano de Australia centroccidental", "VET": "hora de Venezuela", "AST": "hora estándar del Atlántico"},
+ timezones: map[string]string{"WITA": "hora de Indonesia central", "TMT": "hora estándar de Turkmenistán", "TMST": "hora de verano de Turkmenistán", "AEDT": "hora de verano de Australia oriental", "JST": "hora estándar de Japón", "NZDT": "hora de verano de Nueva Zelanda", "ChST": "hora estándar de Chamorro", "ACDT": "hora de verano de Australia central", "AST": "hora estándar del Atlántico", "ACWST": "hora estándar de Australia centroccidental", "NZST": "hora estándar de Nueva Zelanda", "WEZ": "hora estándar de Europa occidental", "BT": "hora de Bután", "CLT": "hora estándar de Chile", "CLST": "hora de verano de Chile", "AKDT": "hora de verano de Alaska", "AWDT": "hora de verano de Australia occidental", "HAST": "hora estándar de Hawái-Aleutiano", "COT": "hora estándar de Colombia", "EAT": "hora de África oriental", "MST": "Hora estándar de Macao", "HKST": "hora de verano de Hong Kong", "AKST": "hora estándar de Alaska", "∅∅∅": "hora de verano del Amazonas", "CST": "hora estándar central", "CDT": "hora de verano central", "ADT": "hora de verano del Atlántico", "UYT": "hora estándar de Uruguay", "CHAST": "hora estándar de Chatham", "BOT": "hora de Bolivia", "SAST": "hora de Sudáfrica", "HNT": "hora estándar de Terranova", "VET": "hora de Venezuela", "WIB": "hora de Indonesia occidental", "CAT": "hora de África central", "WAT": "hora estándar de África occidental", "WAST": "hora de verano de África occidental", "SGT": "hora de Singapur", "WIT": "hora de Indonesia oriental", "LHST": "hora estándar de Lord Howe", "COST": "hora de verano de Colombia", "UYST": "hora de verano de Uruguay", "HKT": "hora estándar de Hong Kong", "JDT": "hora de verano de Japón", "ARST": "hora de verano de Argentina", "HADT": "hora de verano de Hawái-Aleutiano", "WART": "hora estándar de Argentina occidental", "ACST": "hora estándar de Australia central", "WARST": "hora de verano de Argentina occidental", "MDT": "Hora de verano de Macao", "IST": "hora estándar de la India", "MESZ": "hora de verano de Europa central", "AEST": "hora estándar de Australia oriental", "EDT": "hora de verano oriental", "PDT": "hora de verano del Pacífico", "MEZ": "hora estándar de Europa central", "GMT": "hora del meridiano de Greenwich", "LHDT": "hora de verano de Lord Howe", "SRT": "hora de Surinam", "GFT": "hora de la Guayana Francesa", "CHADT": "hora de verano de Chatham", "ACWDT": "hora de verano de Australia centroccidental", "AWST": "hora estándar de Australia occidental", "EST": "hora estándar oriental", "PST": "hora estándar del Pacífico", "WESZ": "hora de verano de Europa occidental", "OEZ": "hora estándar de Europa oriental", "GYT": "hora de Guyana", "MYT": "hora de Malasia", "ECT": "hora de Ecuador", "ART": "hora estándar de Argentina", "HAT": "hora de verano de Terranova", "OESZ": "hora de verano de Europa oriental"},
}
}
diff --git a/es_BO/es_BO_test.go b/es_BO/es_BO_test.go
new file mode 100644
index 00000000..8f041540
--- /dev/null
+++ b/es_BO/es_BO_test.go
@@ -0,0 +1,1120 @@
+package es_BO
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "es_BO"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/es_BR/es_BR.go b/es_BR/es_BR.go
index 555c30c4..47de4829 100644
--- a/es_BR/es_BR.go
+++ b/es_BR/es_BR.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a. C.", "d. C."},
erasNarrow: []string{"", ""},
erasWide: []string{"antes de Cristo", "después de Cristo"},
- timezones: map[string]string{"PDT": "hora de verano del Pacífico", "MST": "Hora estándar de Macao", "MDT": "Hora de verano de Macao", "ART": "hora estándar de Argentina", "PST": "hora estándar del Pacífico", "UYST": "hora de verano de Uruguay", "ECT": "hora de Ecuador", "MYT": "hora de Malasia", "LHST": "hora estándar de Lord Howe", "CST": "hora estándar central", "CDT": "hora de verano central", "BOT": "hora de Bolivia", "CLT": "hora estándar de Chile", "AEDT": "hora de verano de Australia oriental", "OEZ": "hora estándar de Europa oriental", "GMT": "hora del meridiano de Greenwich", "GFT": "hora de la Guayana Francesa", "MEZ": "hora estándar de Europa central", "WART": "hora estándar de Argentina occidental", "HKST": "hora de verano de Hong Kong", "IST": "hora estándar de la India", "NZST": "hora estándar de Nueva Zelanda", "COST": "hora de verano de Colombia", "BT": "hora de Bután", "HAST": "hora estándar de Hawái-Aleutiano", "WARST": "hora de verano de Argentina occidental", "WAT": "hora estándar de África occidental", "OESZ": "hora de verano de Europa oriental", "HAT": "hora de verano de Terranova", "JDT": "hora de verano de Japón", "COT": "hora estándar de Colombia", "ADT": "hora de verano del Atlántico", "AWDT": "hora de verano de Australia occidental", "MESZ": "hora de verano de Europa central", "WIB": "hora de Indonesia occidental", "ACWST": "hora estándar de Australia centroccidental", "WAST": "hora de verano de África occidental", "WITA": "hora de Indonesia central", "CHAST": "hora estándar de Chatham", "ChST": "hora estándar de Chamorro", "EAT": "hora de África oriental", "GYT": "hora de Guyana", "AEST": "hora estándar de Australia oriental", "TMT": "hora estándar de Turkmenistán", "CLST": "hora de verano de Chile", "HADT": "hora de verano de Hawái-Aleutiano", "HKT": "hora estándar de Hong Kong", "∅∅∅": "hora de verano de Brasilia", "EDT": "hora de verano oriental", "ACST": "hora estándar de Australia central", "ACDT": "hora de verano de Australia central", "WIT": "hora de Indonesia oriental", "HNT": "hora estándar de Terranova", "NZDT": "hora de verano de Nueva Zelanda", "WEZ": "hora estándar de Europa occidental", "CAT": "hora de África central", "SGT": "hora de Singapur", "WESZ": "hora de verano de Europa occidental", "AST": "hora estándar del Atlántico", "UYT": "hora estándar de Uruguay", "LHDT": "hora de verano de Lord Howe", "VET": "hora de Venezuela", "SAST": "hora de Sudáfrica", "ARST": "hora de verano de Argentina", "JST": "hora estándar de Japón", "SRT": "hora de Surinam", "AKST": "hora estándar de Alaska", "AKDT": "hora de verano de Alaska", "AWST": "hora estándar de Australia occidental", "CHADT": "hora de verano de Chatham", "EST": "hora estándar oriental", "TMST": "hora de verano de Turkmenistán", "ACWDT": "hora de verano de Australia centroccidental"},
+ timezones: map[string]string{"AWDT": "hora de verano de Australia occidental", "WITA": "hora de Indonesia central", "BOT": "hora de Bolivia", "AKDT": "hora de verano de Alaska", "WAST": "hora de verano de África occidental", "WIB": "hora de Indonesia occidental", "GMT": "hora del meridiano de Greenwich", "AEDT": "hora de verano de Australia oriental", "GYT": "hora de Guyana", "BT": "hora de Bután", "∅∅∅": "hora de verano de Perú", "EDT": "hora de verano oriental", "COT": "hora estándar de Colombia", "CHADT": "hora de verano de Chatham", "HADT": "hora de verano de Hawái-Aleutiano", "UYT": "hora estándar de Uruguay", "ACDT": "hora de verano de Australia central", "SRT": "hora de Surinam", "AST": "hora estándar del Atlántico", "ADT": "hora de verano del Atlántico", "JST": "hora estándar de Japón", "WAT": "hora estándar de África occidental", "MYT": "hora de Malasia", "CLT": "hora estándar de Chile", "CLST": "hora de verano de Chile", "EAT": "hora de África oriental", "ECT": "hora de Ecuador", "SAST": "hora de Sudáfrica", "WEZ": "hora estándar de Europa occidental", "TMT": "hora estándar de Turkmenistán", "AEST": "hora estándar de Australia oriental", "MDT": "hora de verano de las Montañas", "ARST": "hora de verano de Argentina", "JDT": "hora de verano de Japón", "HAT": "hora de verano de Terranova", "WARST": "hora de verano de Argentina occidental", "PST": "hora estándar del Pacífico", "ART": "hora estándar de Argentina", "HNT": "hora estándar de Terranova", "OEZ": "hora estándar de Europa oriental", "LHDT": "hora de verano de Lord Howe", "MST": "hora estándar de las Montañas", "ACST": "hora estándar de Australia central", "HKT": "hora estándar de Hong Kong", "ACWDT": "hora de verano de Australia centroccidental", "MESZ": "hora de verano de Europa central", "TMST": "hora de verano de Turkmenistán", "PDT": "hora de verano del Pacífico", "UYST": "hora de verano de Uruguay", "WIT": "hora de Indonesia oriental", "WART": "hora estándar de Argentina occidental", "CHAST": "hora estándar de Chatham", "AWST": "hora estándar de Australia occidental", "MEZ": "hora estándar de Europa central", "OESZ": "hora de verano de Europa oriental", "CST": "hora estándar central", "NZDT": "hora de verano de Nueva Zelanda", "SGT": "hora de Singapur", "AKST": "hora estándar de Alaska", "IST": "hora estándar de la India", "HAST": "hora estándar de Hawái-Aleutiano", "NZST": "hora estándar de Nueva Zelanda", "CDT": "hora de verano central", "GFT": "hora de la Guayana Francesa", "HKST": "hora de verano de Hong Kong", "WESZ": "hora de verano de Europa occidental", "LHST": "hora estándar de Lord Howe", "VET": "hora de Venezuela", "ChST": "hora estándar de Chamorro", "ACWST": "hora estándar de Australia centroccidental", "COST": "hora de verano de Colombia", "CAT": "hora de África central", "EST": "hora estándar oriental"},
}
}
diff --git a/es_BR/es_BR_test.go b/es_BR/es_BR_test.go
new file mode 100644
index 00000000..fab5afc5
--- /dev/null
+++ b/es_BR/es_BR_test.go
@@ -0,0 +1,1120 @@
+package es_BR
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "es_BR"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/es_CL/es_CL.go b/es_CL/es_CL.go
index 74f6b9b6..4af6582c 100644
--- a/es_CL/es_CL.go
+++ b/es_CL/es_CL.go
@@ -69,7 +69,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a. C.", "d. C."},
erasNarrow: []string{"", ""},
erasWide: []string{"antes de Cristo", "después de Cristo"},
- timezones: map[string]string{"HAT": "hora de verano de Terranova", "OEZ": "hora estándar de Europa oriental", "AWST": "hora estándar de Australia occidental", "WEZ": "hora estándar de Europa occidental", "∅∅∅": "hora de verano de Brasilia", "AKDT": "hora de verano de Alaska", "OESZ": "hora de verano de Europa oriental", "TMST": "hora de verano de Turkmenistán", "VET": "hora de Venezuela", "HADT": "hora de verano de Hawái-Aleutiano", "WARST": "hora de verano de Argentina occidental", "ChST": "hora estándar de Chamorro", "CHAST": "hora estándar de Chatham", "LHST": "hora estándar de Lord Howe", "MST": "hora estándar de las Montañas", "HNT": "hora estándar de Terranova", "WART": "hora estándar de Argentina occidental", "AKST": "hora estándar de Alaska", "CST": "hora estándar central", "WESZ": "hora de verano de Europa occidental", "ADT": "hora de verano del Atlántico", "MYT": "hora de Malasia", "IST": "hora estándar de la India", "ACDT": "hora de verano de Australia central", "WIT": "hora de Indonesia oriental", "TMT": "hora estándar de Turkmenistán", "CHADT": "hora de verano de Chatham", "WITA": "hora de Indonesia central", "BT": "hora de Bután", "WAT": "hora estándar de África occidental", "AWDT": "hora de verano de Australia occidental", "GYT": "hora de Guyana", "JDT": "hora de verano de Japón", "SRT": "hora de Surinam", "ACWDT": "hora de verano de Australia centroccidental", "COST": "hora de verano de Colombia", "WAST": "hora de verano de África occidental", "ACST": "hora estándar de Australia central", "UYT": "hora estándar de Uruguay", "MESZ": "hora de verano de Europa central", "EST": "hora estándar oriental", "EDT": "hora de verano oriental", "MEZ": "hora estándar de Europa central", "CAT": "hora de África central", "ART": "hora estándar de Argentina", "HAST": "hora estándar de Hawái-Aleutiano", "WIB": "hora de Indonesia occidental", "EAT": "hora de África oriental", "NZDT": "hora de verano de Nueva Zelanda", "ACWST": "hora estándar de Australia centroccidental", "AST": "hora estándar del Atlántico", "HKT": "hora estándar de Hong Kong", "GMT": "hora del meridiano de Greenwich", "SAST": "hora de Sudáfrica", "PDT": "hora de verano del Pacífico", "CDT": "hora de verano central", "AEDT": "hora de verano de Australia oriental", "COT": "hora estándar de Colombia", "CLT": "hora estándar de Chile", "GFT": "hora de la Guayana Francesa", "PST": "hora estándar del Pacífico", "NZST": "hora estándar de Nueva Zelanda", "BOT": "hora de Bolivia", "ECT": "hora de Ecuador", "LHDT": "hora de verano de Lord Howe", "CLST": "hora de verano de Chile", "SGT": "hora de Singapur", "HKST": "hora de verano de Hong Kong", "ARST": "hora de verano de Argentina", "JST": "hora estándar de Japón", "UYST": "hora de verano de Uruguay", "AEST": "hora estándar de Australia oriental", "MDT": "hora de verano de las Montañas"},
+ timezones: map[string]string{"UYST": "hora de verano de Uruguay", "LHST": "hora estándar de Lord Howe", "CST": "hora estándar central", "ACWDT": "hora de verano de Australia centroccidental", "ART": "hora estándar de Argentina", "TMT": "hora estándar de Turkmenistán", "WEZ": "hora estándar de Europa occidental", "WESZ": "hora de verano de Europa occidental", "ACST": "hora estándar de Australia central", "ACDT": "hora de verano de Australia central", "HKT": "hora estándar de Hong Kong", "CHADT": "hora de verano de Chatham", "AEST": "hora estándar de Australia oriental", "IST": "hora estándar de la India", "WAST": "hora de verano de África occidental", "VET": "hora de Venezuela", "ECT": "hora de Ecuador", "WITA": "hora de Indonesia central", "AST": "hora estándar del Atlántico", "ARST": "hora de verano de Argentina", "AWST": "hora estándar de Australia occidental", "AEDT": "hora de verano de Australia oriental", "HADT": "hora de verano de Hawái-Aleutiano", "NZST": "hora estándar de Nueva Zelanda", "PST": "hora estándar del Pacífico", "HAT": "hora de verano de Terranova", "WAT": "hora estándar de África occidental", "GFT": "hora de la Guayana Francesa", "MEZ": "hora estándar de Europa central", "NZDT": "hora de verano de Nueva Zelanda", "SGT": "hora de Singapur", "CLT": "hora estándar de Chile", "HAST": "hora estándar de Hawái-Aleutiano", "PDT": "hora de verano del Pacífico", "HNT": "hora estándar de Terranova", "OEZ": "hora estándar de Europa oriental", "LHDT": "hora de verano de Lord Howe", "MDT": "hora de verano de las Montañas", "WART": "hora estándar de Argentina occidental", "ADT": "hora de verano del Atlántico", "BOT": "hora de Bolivia", "COT": "hora estándar de Colombia", "GYT": "hora de Guyana", "WIT": "hora de Indonesia oriental", "∅∅∅": "hora de verano de Brasilia", "CDT": "hora de verano central", "JDT": "hora de verano de Japón", "ChST": "hora estándar de Chamorro", "BT": "hora de Bután", "SRT": "hora de Surinam", "ACWST": "hora estándar de Australia centroccidental", "WIB": "hora de Indonesia occidental", "CHAST": "hora estándar de Chatham", "OESZ": "hora de verano de Europa oriental", "EST": "hora estándar oriental", "MYT": "hora de Malasia", "EAT": "hora de África oriental", "MST": "hora estándar de las Montañas", "AWDT": "hora de verano de Australia occidental", "UYT": "hora estándar de Uruguay", "HKST": "hora de verano de Hong Kong", "SAST": "hora de Sudáfrica", "TMST": "hora de verano de Turkmenistán", "CLST": "hora de verano de Chile", "WARST": "hora de verano de Argentina occidental", "COST": "hora de verano de Colombia", "GMT": "hora del meridiano de Greenwich", "AKST": "hora estándar de Alaska", "MESZ": "hora de verano de Europa central", "JST": "hora estándar de Japón", "AKDT": "hora de verano de Alaska", "EDT": "hora de verano oriental", "CAT": "hora de África central"},
}
}
diff --git a/es_CL/es_CL_test.go b/es_CL/es_CL_test.go
new file mode 100644
index 00000000..3f0df68c
--- /dev/null
+++ b/es_CL/es_CL_test.go
@@ -0,0 +1,1120 @@
+package es_CL
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "es_CL"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/es_CO/es_CO.go b/es_CO/es_CO.go
index 853168c9..3e4f2549 100644
--- a/es_CO/es_CO.go
+++ b/es_CO/es_CO.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a. C.", "d. C."},
erasNarrow: []string{"", ""},
erasWide: []string{"antes de Cristo", "después de Cristo"},
- timezones: map[string]string{"ECT": "hora de Ecuador", "AKDT": "hora de verano de Alaska", "MYT": "hora de Malasia", "OEZ": "hora estándar de Europa oriental", "VET": "hora de Venezuela", "CAT": "hora de África central", "∅∅∅": "hora de verano de Brasilia", "ADT": "hora de verano del Atlántico", "HADT": "hora de verano de Hawái-Aleutiano", "SAST": "hora de Sudáfrica", "WARST": "hora de verano de Argentina occidental", "AEDT": "hora de verano de Australia oriental", "EDT": "hora de verano oriental", "GFT": "hora de la Guayana Francesa", "TMT": "hora estándar de Turkmenistán", "PDT": "hora de verano del Pacífico", "CDT": "hora de verano central", "NZST": "hora estándar de Nueva Zelanda", "COT": "hora estándar de Colombia", "PST": "hora estándar del Pacífico", "CHADT": "hora de verano de Chatham", "COST": "hora de verano de Colombia", "BT": "hora de Bután", "HKST": "hora de verano de Hong Kong", "AST": "hora estándar del Atlántico", "ACDT": "hora de verano de Australia central", "ACWDT": "hora de verano de Australia centroccidental", "MDT": "hora de verano de las Montañas", "WIB": "hora de Indonesia occidental", "AKST": "hora estándar de Alaska", "JST": "hora estándar de Japón", "MESZ": "hora de verano de Europa central", "BOT": "hora de Bolivia", "WAST": "hora de verano de África occidental", "WITA": "hora de Indonesia central", "ACST": "hora estándar de Australia central", "AWDT": "hora de verano de Australia occidental", "LHST": "hora estándar de Lord Howe", "MST": "hora estándar de las Montañas", "WIT": "hora de Indonesia oriental", "AEST": "hora estándar de Australia oriental", "CHAST": "hora estándar de Chatham", "IST": "hora estándar de la India", "EAT": "hora de África oriental", "TMST": "hora de verano de Turkmenistán", "UYT": "hora estándar de Uruguay", "SGT": "hora de Singapur", "HNT": "hora estándar de Terranova", "HAT": "hora de verano de Terranova", "GYT": "hora de Guyana", "JDT": "hora de verano de Japón", "UYST": "hora de verano de Uruguay", "ChST": "hora estándar de Chamorro", "CLT": "hora estándar de Chile", "ARST": "hora de verano de Argentina", "SRT": "hora de Surinam", "CST": "hora estándar central", "NZDT": "hora de verano de Nueva Zelanda", "EST": "hora estándar oriental", "WAT": "hora estándar de África occidental", "LHDT": "hora de verano de Lord Howe", "AWST": "hora estándar de Australia occidental", "WESZ": "hora de verano de Europa occidental", "ACWST": "hora estándar de Australia centroccidental", "HAST": "hora estándar de Hawái-Aleutiano", "HKT": "hora estándar de Hong Kong", "GMT": "hora del meridiano de Greenwich", "MEZ": "hora estándar de Europa central", "WEZ": "hora estándar de Europa occidental", "CLST": "hora de verano de Chile", "WART": "hora estándar de Argentina occidental", "OESZ": "hora de verano de Europa oriental", "ART": "hora estándar de Argentina"},
+ timezones: map[string]string{"MEZ": "hora estándar de Europa central", "IST": "hora estándar de la India", "WAT": "hora estándar de África occidental", "OEZ": "hora estándar de Europa oriental", "UYST": "hora de verano de Uruguay", "ACST": "hora estándar de Australia central", "ACDT": "hora de verano de Australia central", "TMST": "hora de verano de Turkmenistán", "AEST": "hora estándar de Australia oriental", "EAT": "hora de África oriental", "AKDT": "hora de verano de Alaska", "BOT": "hora de Bolivia", "WIB": "hora de Indonesia occidental", "JST": "hora estándar de Japón", "ADT": "hora de verano del Atlántico", "PDT": "hora de verano del Pacífico", "MESZ": "hora de verano de Europa central", "SGT": "hora de Singapur", "WEZ": "hora estándar de Europa occidental", "WARST": "hora de verano de Argentina occidental", "AWST": "hora estándar de Australia occidental", "ACWDT": "hora de verano de Australia centroccidental", "AEDT": "hora de verano de Australia oriental", "MDT": "hora de verano de las Montañas", "WIT": "hora de Indonesia oriental", "SRT": "hora de Surinam", "SAST": "hora de Sudáfrica", "GMT": "hora del meridiano de Greenwich", "MST": "hora estándar de las Montañas", "PST": "hora estándar del Pacífico", "EDT": "hora de verano oriental", "COT": "hora estándar de Colombia", "LHDT": "hora de verano de Lord Howe", "CHAST": "hora estándar de Chatham", "HAT": "hora de verano de Terranova", "CAT": "hora de África central", "CLT": "hora estándar de Chile", "JDT": "hora de verano de Japón", "OESZ": "hora de verano de Europa oriental", "CLST": "hora de verano de Chile", "WART": "hora estándar de Argentina occidental", "WITA": "hora de Indonesia central", "AKST": "hora estándar de Alaska", "COST": "hora de verano de Colombia", "TMT": "hora estándar de Turkmenistán", "WESZ": "hora de verano de Europa occidental", "MYT": "hora de Malasia", "∅∅∅": "hora de verano de Brasilia", "VET": "hora de Venezuela", "CHADT": "hora de verano de Chatham", "AWDT": "hora de verano de Australia occidental", "ARST": "hora de verano de Argentina", "NZST": "hora estándar de Nueva Zelanda", "NZDT": "hora de verano de Nueva Zelanda", "EST": "hora estándar oriental", "HNT": "hora estándar de Terranova", "BT": "hora de Bután", "GFT": "hora de la Guayana Francesa", "ACWST": "hora estándar de Australia centroccidental", "HADT": "hora de verano de Hawái-Aleutiano", "WAST": "hora de verano de África occidental", "GYT": "hora de Guyana", "UYT": "hora estándar de Uruguay", "CDT": "hora de verano central", "HAST": "hora estándar de Hawái-Aleutiano", "HKT": "hora estándar de Hong Kong", "HKST": "hora de verano de Hong Kong", "AST": "hora estándar del Atlántico", "ChST": "hora estándar de Chamorro", "LHST": "hora estándar de Lord Howe", "CST": "hora estándar central", "ECT": "hora de Ecuador", "ART": "hora estándar de Argentina"},
}
}
diff --git a/es_CO/es_CO_test.go b/es_CO/es_CO_test.go
new file mode 100644
index 00000000..7dcfde5d
--- /dev/null
+++ b/es_CO/es_CO_test.go
@@ -0,0 +1,1120 @@
+package es_CO
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "es_CO"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/es_CR/es_CR.go b/es_CR/es_CR.go
index 3a78b4d7..a729901a 100644
--- a/es_CR/es_CR.go
+++ b/es_CR/es_CR.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a. C.", "d. C."},
erasNarrow: []string{"", ""},
erasWide: []string{"antes de Cristo", "después de Cristo"},
- timezones: map[string]string{"BT": "hora de Bután", "MDT": "Hora de verano de Macao", "EDT": "hora de verano oriental", "UYT": "hora estándar de Uruguay", "AST": "hora estándar del Atlántico", "GFT": "hora de la Guayana Francesa", "WITA": "hora de Indonesia central", "ACST": "hora estándar de Australia central", "ART": "hora estándar de Argentina", "PDT": "hora de verano del Pacífico", "SAST": "hora de Sudáfrica", "AKDT": "hora de verano de Alaska", "EST": "hora estándar oriental", "COT": "hora estándar de Colombia", "HADT": "hora de verano de Hawái-Aleutiano", "WAT": "hora estándar de África occidental", "WIT": "hora de Indonesia oriental", "UYST": "hora de verano de Uruguay", "AEST": "hora estándar de Australia oriental", "MESZ": "hora de verano de Europa central", "HKST": "hora de verano de Hong Kong", "WART": "hora estándar de Argentina occidental", "EAT": "hora de África oriental", "MST": "Hora estándar de Macao", "AWST": "hora estándar de Australia occidental", "GYT": "hora de Guyana", "SGT": "hora de Singapur", "OESZ": "hora de verano de Europa oriental", "WIB": "hora de Indonesia occidental", "LHST": "hora estándar de Lord Howe", "ADT": "hora de verano del Atlántico", "SRT": "hora de Surinam", "ChST": "hora estándar de Chamorro", "GMT": "hora del meridiano de Greenwich", "MYT": "hora de Malasia", "JDT": "hora de verano de Japón", "CLST": "hora de verano de Chile", "CAT": "hora de África central", "HAST": "hora estándar de Hawái-Aleutiano", "HKT": "hora estándar de Hong Kong", "AKST": "hora estándar de Alaska", "AEDT": "hora de verano de Australia oriental", "COST": "hora de verano de Colombia", "WAST": "hora de verano de África occidental", "ACDT": "hora de verano de Australia central", "AWDT": "hora de verano de Australia occidental", "VET": "hora de Venezuela", "CHAST": "hora estándar de Chatham", "IST": "hora estándar de la India", "OEZ": "hora estándar de Europa oriental", "TMT": "hora estándar de Turkmenistán", "TMST": "hora de verano de Turkmenistán", "CDT": "hora de verano central", "ACWST": "hora estándar de Australia centroccidental", "MEZ": "hora estándar de Europa central", "NZST": "hora estándar de Nueva Zelanda", "JST": "hora estándar de Japón", "CST": "hora estándar central", "CLT": "hora estándar de Chile", "ECT": "hora de Ecuador", "HNT": "hora estándar de Terranova", "CHADT": "hora de verano de Chatham", "∅∅∅": "Hora de verano de Acre", "WARST": "hora de verano de Argentina occidental", "ARST": "hora de verano de Argentina", "NZDT": "hora de verano de Nueva Zelanda", "BOT": "hora de Bolivia", "WEZ": "hora estándar de Europa occidental", "HAT": "hora de verano de Terranova", "PST": "hora estándar del Pacífico", "LHDT": "hora de verano de Lord Howe", "WESZ": "hora de verano de Europa occidental", "ACWDT": "hora de verano de Australia centroccidental"},
+ timezones: map[string]string{"AWDT": "hora de verano de Australia occidental", "NZDT": "hora de verano de Nueva Zelanda", "HNT": "hora estándar de Terranova", "SGT": "hora de Singapur", "WART": "hora estándar de Argentina occidental", "VET": "hora de Venezuela", "JDT": "hora de verano de Japón", "ACWDT": "hora de verano de Australia centroccidental", "ART": "hora estándar de Argentina", "SAST": "hora de Sudáfrica", "MEZ": "hora estándar de Europa central", "TMT": "hora estándar de Turkmenistán", "WAST": "hora de verano de África occidental", "LHDT": "hora de verano de Lord Howe", "TMST": "hora de verano de Turkmenistán", "HKT": "hora estándar de Hong Kong", "JST": "hora estándar de Japón", "ARST": "hora de verano de Argentina", "UYST": "hora de verano de Uruguay", "MDT": "hora de verano de las Montañas", "AKST": "hora estándar de Alaska", "BOT": "hora de Bolivia", "WIB": "hora de Indonesia occidental", "OEZ": "hora estándar de Europa oriental", "AEDT": "hora de verano de Australia oriental", "LHST": "hora estándar de Lord Howe", "HADT": "hora de verano de Hawái-Aleutiano", "COST": "hora de verano de Colombia", "ACDT": "hora de verano de Australia central", "CHAST": "hora estándar de Chatham", "GYT": "hora de Guyana", "CLT": "hora estándar de Chile", "UYT": "hora estándar de Uruguay", "ECT": "hora de Ecuador", "AST": "hora estándar del Atlántico", "EAT": "hora de África oriental", "AWST": "hora estándar de Australia occidental", "IST": "hora estándar de la India", "AEST": "hora estándar de Australia oriental", "WARST": "hora de verano de Argentina occidental", "CHADT": "hora de verano de Chatham", "ACWST": "hora estándar de Australia centroccidental", "WEZ": "hora estándar de Europa occidental", "HAT": "hora de verano de Terranova", "GMT": "hora del meridiano de Greenwich", "ChST": "hora estándar de Chamorro", "ACST": "hora estándar de Australia central", "HAST": "hora estándar de Hawái-Aleutiano", "EDT": "hora de verano oriental", "BT": "hora de Bután", "CST": "hora estándar central", "GFT": "hora de la Guayana Francesa", "WIT": "hora de Indonesia oriental", "CDT": "hora de verano central", "MYT": "hora de Malasia", "SRT": "hora de Surinam", "HKST": "hora de verano de Hong Kong", "PST": "hora estándar del Pacífico", "MESZ": "hora de verano de Europa central", "∅∅∅": "hora de verano del Amazonas", "WESZ": "hora de verano de Europa occidental", "CLST": "hora de verano de Chile", "PDT": "hora de verano del Pacífico", "COT": "hora estándar de Colombia", "MST": "hora estándar de las Montañas", "WITA": "hora de Indonesia central", "ADT": "hora de verano del Atlántico", "AKDT": "hora de verano de Alaska", "NZST": "hora estándar de Nueva Zelanda", "EST": "hora estándar oriental", "CAT": "hora de África central", "WAT": "hora estándar de África occidental", "OESZ": "hora de verano de Europa oriental"},
}
}
diff --git a/es_CR/es_CR_test.go b/es_CR/es_CR_test.go
new file mode 100644
index 00000000..bbc67039
--- /dev/null
+++ b/es_CR/es_CR_test.go
@@ -0,0 +1,1120 @@
+package es_CR
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "es_CR"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/es_CU/es_CU.go b/es_CU/es_CU.go
index 017bd102..823df023 100644
--- a/es_CU/es_CU.go
+++ b/es_CU/es_CU.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a. C.", "d. C."},
erasNarrow: []string{"", ""},
erasWide: []string{"antes de Cristo", "después de Cristo"},
- timezones: map[string]string{"OESZ": "hora de verano de Europa oriental", "LHST": "hora estándar de Lord Howe", "SRT": "hora de Surinam", "MEZ": "hora estándar de Europa central", "WIT": "hora de Indonesia oriental", "ACST": "hora estándar de Australia central", "UYT": "hora estándar de Uruguay", "MST": "hora estándar de las Montañas", "SAST": "hora de Sudáfrica", "BT": "hora de Bután", "GFT": "hora de la Guayana Francesa", "NZST": "hora estándar de Nueva Zelanda", "WESZ": "hora de verano de Europa occidental", "WART": "hora estándar de Argentina occidental", "AEST": "hora estándar de Australia oriental", "WAST": "hora de verano de África occidental", "ART": "hora estándar de Argentina", "JST": "hora estándar de Japón", "AKST": "hora estándar de Alaska", "AWDT": "hora de verano de Australia occidental", "ACWDT": "hora de verano de Australia centroccidental", "AEDT": "hora de verano de Australia oriental", "CAT": "hora de África central", "SGT": "hora de Singapur", "ARST": "hora de verano de Argentina", "PST": "hora estándar del Pacífico", "MESZ": "hora de verano de Europa central", "ACWST": "hora estándar de Australia centroccidental", "WITA": "hora de Indonesia central", "WIB": "hora de Indonesia occidental", "TMST": "hora de verano de Turkmenistán", "ACDT": "hora de verano de Australia central", "CLST": "hora de verano de Chile", "ECT": "hora de Ecuador", "COST": "hora de verano de Colombia", "CLT": "hora estándar de Chile", "MYT": "hora de Malasia", "CST": "hora estándar central", "CHADT": "hora de verano de Chatham", "GMT": "hora del meridiano de Greenwich", "WEZ": "hora estándar de Europa occidental", "COT": "hora estándar de Colombia", "HAST": "hora estándar de Hawái-Aleutiano", "NZDT": "hora de verano de Nueva Zelanda", "ChST": "hora estándar de Chamorro", "∅∅∅": "hora de verano de las Azores", "WAT": "hora estándar de África occidental", "AST": "hora estándar del Atlántico", "HKST": "hora de verano de Hong Kong", "OEZ": "hora estándar de Europa oriental", "EAT": "hora de África oriental", "PDT": "hora de verano del Pacífico", "AWST": "hora estándar de Australia occidental", "VET": "hora de Venezuela", "EST": "hora estándar oriental", "ADT": "hora de verano del Atlántico", "WARST": "hora de verano de Argentina occidental", "HNT": "hora estándar de Terranova", "HAT": "hora de verano de Terranova", "GYT": "hora de Guyana", "BOT": "hora de Bolivia", "MDT": "hora de verano de las Montañas", "LHDT": "hora de verano de Lord Howe", "IST": "hora estándar de la India", "TMT": "hora estándar de Turkmenistán", "HKT": "hora estándar de Hong Kong", "JDT": "hora de verano de Japón", "CDT": "hora de verano central", "CHAST": "hora estándar de Chatham", "EDT": "hora de verano oriental", "HADT": "hora de verano de Hawái-Aleutiano", "AKDT": "hora de verano de Alaska", "UYST": "hora de verano de Uruguay"},
+ timezones: map[string]string{"AKDT": "hora de verano de Alaska", "AST": "hora estándar del Atlántico", "ACWDT": "hora de verano de Australia centroccidental", "GMT": "hora del meridiano de Greenwich", "GYT": "hora de Guyana", "AWST": "hora estándar de Australia occidental", "EDT": "hora de verano oriental", "AEDT": "hora de verano de Australia oriental", "CLT": "hora estándar de Chile", "MEZ": "hora estándar de Europa central", "TMST": "hora de verano de Turkmenistán", "COST": "hora de verano de Colombia", "AEST": "hora estándar de Australia oriental", "LHDT": "hora de verano de Lord Howe", "ACDT": "hora de verano de Australia central", "WARST": "hora de verano de Argentina occidental", "PDT": "hora de verano del Pacífico", "CLST": "hora de verano de Chile", "CST": "hora estándar central", "ADT": "hora de verano del Atlántico", "ARST": "hora de verano de Argentina", "SAST": "hora de Sudáfrica", "LHST": "hora estándar de Lord Howe", "WIT": "hora de Indonesia oriental", "∅∅∅": "hora de verano de las Azores", "HKST": "hora de verano de Hong Kong", "ECT": "hora de Ecuador", "JST": "hora estándar de Japón", "WAT": "hora estándar de África occidental", "EAT": "hora de África oriental", "UYT": "hora estándar de Uruguay", "VET": "hora de Venezuela", "EST": "hora estándar oriental", "OEZ": "hora estándar de Europa oriental", "ACST": "hora estándar de Australia central", "WITA": "hora de Indonesia central", "CAT": "hora de África central", "HNT": "hora estándar de Terranova", "SGT": "hora de Singapur", "OESZ": "hora de verano de Europa oriental", "CDT": "hora de verano central", "GFT": "hora de la Guayana Francesa", "ART": "hora estándar de Argentina", "IST": "hora estándar de la India", "PST": "hora estándar del Pacífico", "BOT": "hora de Bolivia", "WAST": "hora de verano de África occidental", "HAT": "hora de verano de Terranova", "MYT": "hora de Malasia", "SRT": "hora de Surinam", "CHADT": "hora de verano de Chatham", "AWDT": "hora de verano de Australia occidental", "BT": "hora de Bután", "HKT": "hora estándar de Hong Kong", "AKST": "hora estándar de Alaska", "JDT": "hora de verano de Japón", "MDT": "Hora de verano de Macao", "ACWST": "hora estándar de Australia centroccidental", "NZST": "hora estándar de Nueva Zelanda", "CHAST": "hora estándar de Chatham", "HADT": "hora de verano de Hawái-Aleutiano", "NZDT": "hora de verano de Nueva Zelanda", "COT": "hora estándar de Colombia", "WART": "hora estándar de Argentina occidental", "MST": "Hora estándar de Macao", "MESZ": "hora de verano de Europa central", "HAST": "hora estándar de Hawái-Aleutiano", "WEZ": "hora estándar de Europa occidental", "WESZ": "hora de verano de Europa occidental", "WIB": "hora de Indonesia occidental", "TMT": "hora estándar de Turkmenistán", "ChST": "hora estándar de Chamorro", "UYST": "hora de verano de Uruguay"},
}
}
diff --git a/es_CU/es_CU_test.go b/es_CU/es_CU_test.go
new file mode 100644
index 00000000..f5999213
--- /dev/null
+++ b/es_CU/es_CU_test.go
@@ -0,0 +1,1120 @@
+package es_CU
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "es_CU"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/es_DO/es_DO.go b/es_DO/es_DO.go
index d393daa6..02591b60 100644
--- a/es_DO/es_DO.go
+++ b/es_DO/es_DO.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"", ""},
erasNarrow: []string{"", ""},
erasWide: []string{"antes de la Era Común", "Era Común"},
- timezones: map[string]string{"WAT": "hora estándar de África occidental", "BT": "hora de Bután", "HNT": "hora estándar de Terranova", "AEST": "hora estándar de Australia oriental", "SGT": "hora de Singapur", "HKT": "hora estándar de Hong Kong", "WITA": "hora de Indonesia central", "ACST": "hora estándar de Australia central", "CDT": "hora de verano central", "AST": "hora estándar del Atlántico", "MST": "Hora estándar de Macao", "AWST": "hora estándar de Australia occidental", "NZDT": "hora de verano de Nueva Zelanda", "CAT": "hora de África central", "∅∅∅": "Hora de verano de Acre", "PDT": "hora de verano del Pacífico", "NZST": "hora estándar de Nueva Zelanda", "UYST": "hora de verano de Uruguay", "CLT": "hora estándar de Chile", "EDT": "hora de verano oriental", "TMT": "hora estándar de Turkmenistán", "EST": "hora estándar oriental", "ADT": "hora de verano del Atlántico", "HADT": "hora de verano de Hawái-Aleutiano", "SAST": "hora de Sudáfrica", "ACDT": "hora de verano de Australia central", "SRT": "hora de Surinam", "BOT": "hora de Bolivia", "OESZ": "hora de verano de Europa oriental", "GFT": "hora de la Guayana Francesa", "ART": "hora estándar de Argentina", "CLST": "hora de verano de Chile", "WIB": "hora de Indonesia occidental", "PST": "hora estándar del Pacífico", "MESZ": "hora de verano de Europa central", "WAST": "hora de verano de África occidental", "WART": "hora estándar de Argentina occidental", "AWDT": "hora de verano de Australia occidental", "MEZ": "hora estándar de Europa central", "CHAST": "hora estándar de Chatham", "LHST": "hora estándar de Lord Howe", "UYT": "hora estándar de Uruguay", "COT": "hora estándar de Colombia", "HAST": "hora estándar de Hawái-Aleutiano", "WIT": "hora de Indonesia oriental", "TMST": "hora de verano de Turkmenistán", "GYT": "hora de Guyana", "ACWDT": "hora de verano de Australia centroccidental", "ECT": "hora de Ecuador", "CHADT": "hora de verano de Chatham", "IST": "hora estándar de la India", "AKST": "hora estándar de Alaska", "LHDT": "hora de verano de Lord Howe", "MYT": "hora de Malasia", "WEZ": "hora estándar de Europa occidental", "WESZ": "hora de verano de Europa occidental", "HKST": "hora de verano de Hong Kong", "HAT": "hora de verano de Terranova", "EAT": "hora de África oriental", "JDT": "hora de verano de Japón", "ACWST": "hora estándar de Australia centroccidental", "COST": "hora de verano de Colombia", "GMT": "hora del meridiano de Greenwich", "MDT": "Hora de verano de Macao", "ARST": "hora de verano de Argentina", "AKDT": "hora de verano de Alaska", "CST": "hora estándar central", "VET": "hora de Venezuela", "WARST": "hora de verano de Argentina occidental", "OEZ": "hora estándar de Europa oriental", "JST": "hora estándar de Japón", "AEDT": "hora de verano de Australia oriental", "ChST": "hora estándar de Chamorro"},
+ timezones: map[string]string{"AWDT": "hora de verano de Australia occidental", "CLT": "hora estándar de Chile", "EAT": "hora de África oriental", "LHST": "hora estándar de Lord Howe", "MDT": "Hora de verano de Macao", "HKT": "hora estándar de Hong Kong", "WAT": "hora estándar de África occidental", "LHDT": "hora de verano de Lord Howe", "COST": "hora de verano de Colombia", "HAT": "hora de verano de Terranova", "UYST": "hora de verano de Uruguay", "GFT": "hora de la Guayana Francesa", "JST": "hora estándar de Japón", "JDT": "hora de verano de Japón", "IST": "hora estándar de la India", "COT": "hora estándar de Colombia", "WART": "hora estándar de Argentina occidental", "MYT": "hora de Malasia", "CHADT": "hora de verano de Chatham", "BOT": "hora de Bolivia", "SAST": "hora de Sudáfrica", "MEZ": "hora estándar de Europa central", "UYT": "hora estándar de Uruguay", "AEST": "hora estándar de Australia oriental", "CST": "hora estándar central", "SRT": "hora de Surinam", "HAST": "hora estándar de Hawái-Aleutiano", "NZDT": "hora de verano de Nueva Zelanda", "WIB": "hora de Indonesia occidental", "CAT": "hora de África central", "WEZ": "hora estándar de Europa occidental", "PST": "hora estándar del Pacífico", "ChST": "hora estándar de Chamorro", "CLST": "hora de verano de Chile", "CDT": "hora de verano central", "ARST": "hora de verano de Argentina", "ACST": "hora estándar de Australia central", "WARST": "hora de verano de Argentina occidental", "AWST": "hora estándar de Australia occidental", "HADT": "hora de verano de Hawái-Aleutiano", "WESZ": "hora de verano de Europa occidental", "MST": "Hora estándar de Macao", "CHAST": "hora estándar de Chatham", "VET": "hora de Venezuela", "WITA": "hora de Indonesia central", "AST": "hora estándar del Atlántico", "OESZ": "hora de verano de Europa oriental", "AKDT": "hora de verano de Alaska", "ACWDT": "hora de verano de Australia centroccidental", "PDT": "hora de verano del Pacífico", "GMT": "hora del meridiano de Greenwich", "∅∅∅": "hora de verano de las Azores", "EDT": "hora de verano oriental", "NZST": "hora estándar de Nueva Zelanda", "ADT": "hora de verano del Atlántico", "ACWST": "hora estándar de Australia centroccidental", "HKST": "hora de verano de Hong Kong", "EST": "hora estándar oriental", "MESZ": "hora de verano de Europa central", "WAST": "hora de verano de África occidental", "GYT": "hora de Guyana", "ECT": "hora de Ecuador", "AKST": "hora estándar de Alaska", "TMT": "hora estándar de Turkmenistán", "SGT": "hora de Singapur", "WIT": "hora de Indonesia oriental", "BT": "hora de Bután", "ACDT": "hora de verano de Australia central", "ART": "hora estándar de Argentina", "TMST": "hora de verano de Turkmenistán", "HNT": "hora estándar de Terranova", "OEZ": "hora estándar de Europa oriental", "AEDT": "hora de verano de Australia oriental"},
}
}
diff --git a/es_DO/es_DO_test.go b/es_DO/es_DO_test.go
new file mode 100644
index 00000000..40833466
--- /dev/null
+++ b/es_DO/es_DO_test.go
@@ -0,0 +1,1120 @@
+package es_DO
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "es_DO"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/es_EA/es_EA.go b/es_EA/es_EA.go
index 68cf9473..f3bab81e 100644
--- a/es_EA/es_EA.go
+++ b/es_EA/es_EA.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a. C.", "d. C."},
erasNarrow: []string{"", ""},
erasWide: []string{"antes de Cristo", "después de Cristo"},
- timezones: map[string]string{"HAT": "hora de verano de Terranova", "ACST": "hora estándar de Australia central", "PST": "hora estándar del Pacífico", "WITA": "hora de Indonesia central", "ART": "hora estándar de Argentina", "WEZ": "hora estándar de Europa occidental", "ACWST": "hora estándar de Australia centroccidental", "EDT": "hora de verano oriental", "HAST": "hora estándar de Hawái-Aleutiano", "MESZ": "hora de verano de Europa central", "CLST": "hora de verano de Chile", "COST": "hora de verano de Colombia", "HKT": "hora estándar de Hong Kong", "ChST": "hora estándar de Chamorro", "JDT": "hora de verano de Japón", "BOT": "hora de Bolivia", "IST": "hora estándar de la India", "MDT": "Hora de verano de Macao", "AWST": "hora estándar de Australia occidental", "NZDT": "hora de verano de Nueva Zelanda", "OESZ": "hora de verano de Europa oriental", "HNT": "hora estándar de Terranova", "JST": "hora estándar de Japón", "AKDT": "hora de verano de Alaska", "CAT": "hora de África central", "ECT": "hora de Ecuador", "SGT": "hora de Singapur", "GFT": "hora de la Guayana Francesa", "ARST": "hora de verano de Argentina", "UYT": "hora estándar de Uruguay", "CST": "hora estándar central", "MEZ": "hora estándar de Europa central", "COT": "hora estándar de Colombia", "GMT": "hora del meridiano de Greenwich", "EAT": "hora de África oriental", "ACDT": "hora de verano de Australia central", "CHADT": "hora de verano de Chatham", "VET": "hora de Venezuela", "EST": "hora estándar oriental", "OEZ": "hora estándar de Europa oriental", "TMT": "hora estándar de Turkmenistán", "AEST": "hora estándar de Australia oriental", "WART": "hora estándar de Argentina occidental", "AWDT": "hora de verano de Australia occidental", "CLT": "hora estándar de Chile", "WIB": "hora de Indonesia occidental", "TMST": "hora de verano de Turkmenistán", "GYT": "hora de Guyana", "NZST": "hora estándar de Nueva Zelanda", "WAST": "hora de verano de África occidental", "HKST": "hora de verano de Hong Kong", "WIT": "hora de Indonesia oriental", "ACWDT": "hora de verano de Australia centroccidental", "HADT": "hora de verano de Hawái-Aleutiano", "WARST": "hora de verano de Argentina occidental", "SAST": "hora de Sudáfrica", "WAT": "hora estándar de África occidental", "CDT": "hora de verano central", "CHAST": "hora estándar de Chatham", "∅∅∅": "hora de verano de Brasilia", "MYT": "hora de Malasia", "AKST": "hora estándar de Alaska", "LHST": "hora estándar de Lord Howe", "MST": "Hora estándar de Macao", "LHDT": "hora de verano de Lord Howe", "UYST": "hora de verano de Uruguay", "PDT": "hora de verano del Pacífico", "WESZ": "hora de verano de Europa occidental", "AEDT": "hora de verano de Australia oriental", "AST": "hora estándar del Atlántico", "ADT": "hora de verano del Atlántico", "BT": "hora de Bután", "SRT": "hora de Surinam"},
+ timezones: map[string]string{"HAST": "hora estándar de Hawái-Aleutiano", "SGT": "hora de Singapur", "WIB": "hora de Indonesia occidental", "WIT": "hora de Indonesia oriental", "EDT": "hora de verano oriental", "TMST": "hora de verano de Turkmenistán", "WAST": "hora de verano de África occidental", "JDT": "hora de verano de Japón", "CDT": "hora de verano central", "WARST": "hora de verano de Argentina occidental", "AKDT": "hora de verano de Alaska", "MEZ": "hora estándar de Europa central", "∅∅∅": "hora de verano del Amazonas", "ChST": "hora estándar de Chamorro", "AEST": "hora estándar de Australia oriental", "MDT": "hora de verano de las Montañas", "ACWDT": "hora de verano de Australia centroccidental", "SAST": "hora de Sudáfrica", "WAT": "hora estándar de África occidental", "CLT": "hora estándar de Chile", "ART": "hora estándar de Argentina", "ADT": "hora de verano del Atlántico", "EST": "hora estándar oriental", "MYT": "hora de Malasia", "CLST": "hora de verano de Chile", "UYT": "hora estándar de Uruguay", "BT": "hora de Bután", "NZDT": "hora de verano de Nueva Zelanda", "OESZ": "hora de verano de Europa oriental", "CHAST": "hora estándar de Chatham", "ACWST": "hora estándar de Australia centroccidental", "JST": "hora estándar de Japón", "AKST": "hora estándar de Alaska", "MESZ": "hora de verano de Europa central", "BOT": "hora de Bolivia", "WESZ": "hora de verano de Europa occidental", "EAT": "hora de África oriental", "LHST": "hora estándar de Lord Howe", "HAT": "hora de verano de Terranova", "CST": "hora estándar central", "AWST": "hora estándar de Australia occidental", "HNT": "hora estándar de Terranova", "HKT": "hora estándar de Hong Kong", "CHADT": "hora de verano de Chatham", "PST": "hora estándar del Pacífico", "CAT": "hora de África central", "WART": "hora estándar de Argentina occidental", "ACDT": "hora de verano de Australia central", "GFT": "hora de la Guayana Francesa", "PDT": "hora de verano del Pacífico", "HADT": "hora de verano de Hawái-Aleutiano", "COST": "hora de verano de Colombia", "GYT": "hora de Guyana", "MST": "hora estándar de las Montañas", "VET": "hora de Venezuela", "HKST": "hora de verano de Hong Kong", "WITA": "hora de Indonesia central", "NZST": "hora estándar de Nueva Zelanda", "AEDT": "hora de verano de Australia oriental", "UYST": "hora de verano de Uruguay", "LHDT": "hora de verano de Lord Howe", "ECT": "hora de Ecuador", "ACST": "hora estándar de Australia central", "ARST": "hora de verano de Argentina", "IST": "hora estándar de la India", "COT": "hora estándar de Colombia", "WEZ": "hora estándar de Europa occidental", "OEZ": "hora estándar de Europa oriental", "SRT": "hora de Surinam", "TMT": "hora estándar de Turkmenistán", "AST": "hora estándar del Atlántico", "GMT": "hora del meridiano de Greenwich", "AWDT": "hora de verano de Australia occidental"},
}
}
diff --git a/es_EA/es_EA_test.go b/es_EA/es_EA_test.go
new file mode 100644
index 00000000..82edcc7b
--- /dev/null
+++ b/es_EA/es_EA_test.go
@@ -0,0 +1,1120 @@
+package es_EA
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "es_EA"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/es_EC/es_EC.go b/es_EC/es_EC.go
index 7251a6d4..7b43cad8 100644
--- a/es_EC/es_EC.go
+++ b/es_EC/es_EC.go
@@ -69,7 +69,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a. C.", "d. C."},
erasNarrow: []string{"", ""},
erasWide: []string{"antes de Cristo", "después de Cristo"},
- timezones: map[string]string{"PST": "hora estándar del Pacífico", "PDT": "hora de verano del Pacífico", "AST": "hora estándar del Atlántico", "EAT": "hora de África oriental", "AWDT": "hora de verano de Australia occidental", "MST": "hora estándar de las Montañas", "ECT": "hora de Ecuador", "WESZ": "hora de verano de Europa occidental", "SAST": "hora de Sudáfrica", "MEZ": "hora estándar de Europa central", "CHAST": "hora estándar de Chatham", "CHADT": "hora de verano de Chatham", "MDT": "hora de verano de las Montañas", "HKT": "hora estándar de Hong Kong", "GFT": "hora de la Guayana Francesa", "ACST": "hora estándar de Australia central", "MYT": "hora de Malasia", "JST": "hora estándar de Japón", "GYT": "hora de Guyana", "WAST": "hora de verano de África occidental", "AWST": "hora estándar de Australia occidental", "CLST": "hora de verano de Chile", "SGT": "hora de Singapur", "NZDT": "hora de verano de Nueva Zelanda", "HADT": "hora de verano de Hawái-Aleutiano", "WAT": "hora estándar de África occidental", "MESZ": "hora de verano de Europa central", "WIB": "hora de Indonesia occidental", "HAT": "hora de verano de Terranova", "AKST": "hora estándar de Alaska", "AKDT": "hora de verano de Alaska", "CST": "hora estándar central", "WITA": "hora de Indonesia central", "OEZ": "hora estándar de Europa oriental", "GMT": "hora del meridiano de Greenwich", "JDT": "hora de verano de Japón", "LHST": "hora estándar de Lord Howe", "ACWST": "hora estándar de Australia centroccidental", "WARST": "hora de verano de Argentina occidental", "OESZ": "hora de verano de Europa oriental", "TMST": "hora de verano de Turkmenistán", "ACDT": "hora de verano de Australia central", "SRT": "hora de Surinam", "CDT": "hora de verano central", "WEZ": "hora estándar de Europa occidental", "HKST": "hora de verano de Hong Kong", "ChST": "hora estándar de Chamorro", "ADT": "hora de verano del Atlántico", "BT": "hora de Bután", "AEST": "hora estándar de Australia oriental", "AEDT": "hora de verano de Australia oriental", "COT": "hora estándar de Colombia", "HAST": "hora estándar de Hawái-Aleutiano", "BOT": "hora de Bolivia", "UYST": "hora de verano de Uruguay", "ACWDT": "hora de verano de Australia centroccidental", "HNT": "hora estándar de Terranova", "TMT": "hora estándar de Turkmenistán", "ARST": "hora de verano de Argentina", "CLT": "hora estándar de Chile", "CAT": "hora de África central", "EDT": "hora de verano oriental", "LHDT": "hora de verano de Lord Howe", "∅∅∅": "hora de verano de las Azores", "VET": "hora de Venezuela", "ART": "hora estándar de Argentina", "WART": "hora estándar de Argentina occidental", "WIT": "hora de Indonesia oriental", "IST": "hora estándar de la India", "COST": "hora de verano de Colombia", "NZST": "hora estándar de Nueva Zelanda", "UYT": "hora estándar de Uruguay", "EST": "hora estándar oriental"},
+ timezones: map[string]string{"SRT": "hora de Surinam", "VET": "hora de Venezuela", "WAST": "hora de verano de África occidental", "GMT": "hora del meridiano de Greenwich", "∅∅∅": "hora de verano de Brasilia", "ADT": "hora de verano del Atlántico", "PST": "hora estándar del Pacífico", "WAT": "hora estándar de África occidental", "HNT": "hora estándar de Terranova", "AEST": "hora estándar de Australia oriental", "ACWDT": "hora de verano de Australia centroccidental", "PDT": "hora de verano del Pacífico", "COT": "hora estándar de Colombia", "AKST": "hora estándar de Alaska", "UYST": "hora de verano de Uruguay", "JDT": "hora de verano de Japón", "MST": "hora estándar de las Montañas", "GYT": "hora de Guyana", "WIT": "hora de Indonesia oriental", "MYT": "hora de Malasia", "ACST": "hora estándar de Australia central", "OEZ": "hora estándar de Europa oriental", "AWST": "hora estándar de Australia occidental", "EST": "hora estándar oriental", "TMST": "hora de verano de Turkmenistán", "SGT": "hora de Singapur", "AEDT": "hora de verano de Australia oriental", "CLST": "hora de verano de Chile", "ACDT": "hora de verano de Australia central", "GFT": "hora de la Guayana Francesa", "ECT": "hora de Ecuador", "ACWST": "hora estándar de Australia centroccidental", "ChST": "hora estándar de Chamorro", "CST": "hora estándar central", "NZDT": "hora de verano de Nueva Zelanda", "OESZ": "hora de verano de Europa oriental", "UYT": "hora estándar de Uruguay", "WARST": "hora de verano de Argentina occidental", "AKDT": "hora de verano de Alaska", "ARST": "hora de verano de Argentina", "JST": "hora estándar de Japón", "TMT": "hora estándar de Turkmenistán", "CAT": "hora de África central", "EAT": "hora de África oriental", "BOT": "hora de Bolivia", "HKST": "hora de verano de Hong Kong", "HAST": "hora estándar de Hawái-Aleutiano", "HAT": "hora de verano de Terranova", "IST": "hora estándar de la India", "ART": "hora estándar de Argentina", "EDT": "hora de verano oriental", "MEZ": "hora estándar de Europa central", "HADT": "hora de verano de Hawái-Aleutiano", "CHAST": "hora estándar de Chatham", "LHDT": "hora de verano de Lord Howe", "WESZ": "hora de verano de Europa occidental", "COST": "hora de verano de Colombia", "WIB": "hora de Indonesia occidental", "BT": "hora de Bután", "NZST": "hora estándar de Nueva Zelanda", "SAST": "hora de Sudáfrica", "CLT": "hora estándar de Chile", "CDT": "hora de verano central", "WART": "hora estándar de Argentina occidental", "HKT": "hora estándar de Hong Kong", "CHADT": "hora de verano de Chatham", "AWDT": "hora de verano de Australia occidental", "MESZ": "hora de verano de Europa central", "MDT": "hora de verano de las Montañas", "AST": "hora estándar del Atlántico", "WITA": "hora de Indonesia central", "WEZ": "hora estándar de Europa occidental", "LHST": "hora estándar de Lord Howe"},
}
}
diff --git a/es_EC/es_EC_test.go b/es_EC/es_EC_test.go
new file mode 100644
index 00000000..c53d3626
--- /dev/null
+++ b/es_EC/es_EC_test.go
@@ -0,0 +1,1120 @@
+package es_EC
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "es_EC"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/es_ES/es_ES.go b/es_ES/es_ES.go
index 32cbfb1c..b8727761 100644
--- a/es_ES/es_ES.go
+++ b/es_ES/es_ES.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a. C.", "d. C."},
erasNarrow: []string{"", ""},
erasWide: []string{"antes de Cristo", "después de Cristo"},
- timezones: map[string]string{"CHAST": "hora estándar de Chatham", "HAST": "hora estándar de Hawái-Aleutiano", "SAST": "hora de Sudáfrica", "∅∅∅": "hora de verano del Amazonas", "AWST": "hora estándar de Australia occidental", "LHST": "hora estándar de Lord Howe", "CDT": "hora de verano central", "NZST": "hora estándar de Nueva Zelanda", "AEDT": "hora de verano de Australia oriental", "WART": "hora estándar de Argentina occidental", "ACST": "hora estándar de Australia central", "AKDT": "hora de verano de Alaska", "HADT": "hora de verano de Hawái-Aleutiano", "GMT": "hora del meridiano de Greenwich", "ARST": "hora de verano de Argentina", "GYT": "hora de Guyana", "CST": "hora estándar central", "WEZ": "hora estándar de Europa occidental", "ACWDT": "hora de verano de Australia centroccidental", "GFT": "hora de la Guayana Francesa", "VET": "hora de Venezuela", "COST": "hora de verano de Colombia", "WIT": "hora de Indonesia oriental", "ECT": "hora de Ecuador", "BT": "hora de Bután", "AKST": "hora estándar de Alaska", "MEZ": "hora estándar de Europa central", "BOT": "hora de Bolivia", "SGT": "hora de Singapur", "HNT": "hora estándar de Terranova", "AEST": "hora estándar de Australia oriental", "OEZ": "hora estándar de Europa oriental", "TMST": "hora de verano de Turkmenistán", "MYT": "hora de Malasia", "JST": "hora estándar de Japón", "NZDT": "hora de verano de Nueva Zelanda", "ACWST": "hora estándar de Australia centroccidental", "EDT": "hora de verano oriental", "WAT": "hora estándar de África occidental", "AWDT": "hora de verano de Australia occidental", "LHDT": "hora de verano de Lord Howe", "UYST": "hora de verano de Uruguay", "ChST": "hora estándar de Chamorro", "EST": "hora estándar oriental", "MST": "Hora estándar de Macao", "MDT": "Hora de verano de Macao", "WESZ": "hora de verano de Europa occidental", "CLT": "hora estándar de Chile", "AST": "hora estándar del Atlántico", "ADT": "hora de verano del Atlántico", "WAST": "hora de verano de África occidental", "WARST": "hora de verano de Argentina occidental", "OESZ": "hora de verano de Europa oriental", "EAT": "hora de África oriental", "TMT": "hora estándar de Turkmenistán", "PDT": "hora de verano del Pacífico", "MESZ": "hora de verano de Europa central", "HKT": "hora estándar de Hong Kong", "WIB": "hora de Indonesia occidental", "WITA": "hora de Indonesia central", "PST": "hora estándar del Pacífico", "JDT": "hora de verano de Japón", "UYT": "hora estándar de Uruguay", "COT": "hora estándar de Colombia", "HKST": "hora de verano de Hong Kong", "HAT": "hora de verano de Terranova", "ART": "hora estándar de Argentina", "IST": "hora estándar de la India", "ACDT": "hora de verano de Australia central", "SRT": "hora de Surinam", "CHADT": "hora de verano de Chatham", "CLST": "hora de verano de Chile", "CAT": "hora de África central"},
+ timezones: map[string]string{"JST": "hora estándar de Japón", "MEZ": "hora estándar de Europa central", "SAST": "hora de Sudáfrica", "LHDT": "hora de verano de Lord Howe", "HADT": "hora de verano de Hawái-Aleutiano", "WEZ": "hora estándar de Europa occidental", "HKST": "hora de verano de Hong Kong", "JDT": "hora de verano de Japón", "WESZ": "hora de verano de Europa occidental", "HAT": "hora de verano de Terranova", "OESZ": "hora de verano de Europa oriental", "GMT": "hora del meridiano de Greenwich", "CST": "hora estándar central", "ADT": "hora de verano del Atlántico", "AWST": "hora estándar de Australia occidental", "EDT": "hora de verano oriental", "COST": "hora de verano de Colombia", "CDT": "hora de verano central", "WARST": "hora de verano de Argentina occidental", "GFT": "hora de la Guayana Francesa", "VET": "hora de Venezuela", "UYST": "hora de verano de Uruguay", "ACDT": "hora de verano de Australia central", "ACWDT": "hora de verano de Australia centroccidental", "MYT": "hora de Malasia", "AEST": "hora estándar de Australia oriental", "ACST": "hora estándar de Australia central", "MDT": "Hora de verano de Macao", "CHADT": "hora de verano de Chatham", "TMST": "hora de verano de Turkmenistán", "PDT": "hora de verano del Pacífico", "BT": "hora de Bután", "AWDT": "hora de verano de Australia occidental", "NZDT": "hora de verano de Nueva Zelanda", "WART": "hora estándar de Argentina occidental", "EST": "hora estándar oriental", "EAT": "hora de África oriental", "AKDT": "hora de verano de Alaska", "MESZ": "hora de verano de Europa central", "NZST": "hora estándar de Nueva Zelanda", "CAT": "hora de África central", "OEZ": "hora estándar de Europa oriental", "AEDT": "hora de verano de Australia oriental", "HKT": "hora estándar de Hong Kong", "AKST": "hora estándar de Alaska", "UYT": "hora estándar de Uruguay", "COT": "hora estándar de Colombia", "TMT": "hora estándar de Turkmenistán", "ChST": "hora estándar de Chamorro", "CLST": "hora de verano de Chile", "CHAST": "hora estándar de Chatham", "ACWST": "hora estándar de Australia centroccidental", "HNT": "hora estándar de Terranova", "GYT": "hora de Guyana", "ARST": "hora de verano de Argentina", "SGT": "hora de Singapur", "SRT": "hora de Surinam", "HAST": "hora estándar de Hawái-Aleutiano", "WIT": "hora de Indonesia oriental", "IST": "hora estándar de la India", "PST": "hora estándar del Pacífico", "WIB": "hora de Indonesia occidental", "WAT": "hora estándar de África occidental", "MST": "Hora estándar de Macao", "ART": "hora estándar de Argentina", "WITA": "hora de Indonesia central", "AST": "hora estándar del Atlántico", "BOT": "hora de Bolivia", "WAST": "hora de verano de África occidental", "CLT": "hora estándar de Chile", "LHST": "hora estándar de Lord Howe", "∅∅∅": "hora de verano de las Azores", "ECT": "hora de Ecuador"},
}
}
diff --git a/es_ES/es_ES_test.go b/es_ES/es_ES_test.go
new file mode 100644
index 00000000..1968501e
--- /dev/null
+++ b/es_ES/es_ES_test.go
@@ -0,0 +1,1120 @@
+package es_ES
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "es_ES"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/es_GQ/es_GQ.go b/es_GQ/es_GQ.go
index 277e823b..a033896c 100644
--- a/es_GQ/es_GQ.go
+++ b/es_GQ/es_GQ.go
@@ -69,7 +69,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a. C.", "d. C."},
erasNarrow: []string{"", ""},
erasWide: []string{"antes de Cristo", "después de Cristo"},
- timezones: map[string]string{"AST": "hora estándar del Atlántico", "HAT": "hora de verano de Terranova", "ARST": "hora de verano de Argentina", "LHST": "hora estándar de Lord Howe", "COST": "hora de verano de Colombia", "HADT": "hora de verano de Hawái-Aleutiano", "WARST": "hora de verano de Argentina occidental", "WIB": "hora de Indonesia occidental", "JDT": "hora de verano de Japón", "CHADT": "hora de verano de Chatham", "UYST": "hora de verano de Uruguay", "WESZ": "hora de verano de Europa occidental", "HKST": "hora de verano de Hong Kong", "SAST": "hora de Sudáfrica", "HNT": "hora estándar de Terranova", "GMT": "hora del meridiano de Greenwich", "LHDT": "hora de verano de Lord Howe", "CST": "hora estándar central", "NZST": "hora estándar de Nueva Zelanda", "EDT": "hora de verano oriental", "∅∅∅": "Hora de verano de Acre", "WIT": "hora de Indonesia oriental", "MDT": "Hora de verano de Macao", "SRT": "hora de Surinam", "UYT": "hora estándar de Uruguay", "ADT": "hora de verano del Atlántico", "WITA": "hora de Indonesia central", "TMST": "hora de verano de Turkmenistán", "AEDT": "hora de verano de Australia oriental", "MST": "Hora estándar de Macao", "AKDT": "hora de verano de Alaska", "CLT": "hora estándar de Chile", "VET": "hora de Venezuela", "WART": "hora estándar de Argentina occidental", "ACST": "hora estándar de Australia central", "MYT": "hora de Malasia", "MESZ": "hora de verano de Europa central", "EAT": "hora de África oriental", "JST": "hora estándar de Japón", "MEZ": "hora estándar de Europa central", "CLST": "hora de verano de Chile", "BT": "hora de Bután", "GFT": "hora de la Guayana Francesa", "OESZ": "hora de verano de Europa oriental", "CDT": "hora de verano central", "ChST": "hora estándar de Chamorro", "WEZ": "hora estándar de Europa occidental", "ART": "hora estándar de Argentina", "GYT": "hora de Guyana", "BOT": "hora de Bolivia", "ECT": "hora de Ecuador", "EST": "hora estándar oriental", "HKT": "hora estándar de Hong Kong", "IST": "hora estándar de la India", "TMT": "hora estándar de Turkmenistán", "PST": "hora estándar del Pacífico", "ACWST": "hora estándar de Australia centroccidental", "AEST": "hora estándar de Australia oriental", "CAT": "hora de África central", "SGT": "hora de Singapur", "WAT": "hora estándar de África occidental", "AKST": "hora estándar de Alaska", "AWST": "hora estándar de Australia occidental", "CHAST": "hora estándar de Chatham", "ACDT": "hora de verano de Australia central", "PDT": "hora de verano del Pacífico", "AWDT": "hora de verano de Australia occidental", "NZDT": "hora de verano de Nueva Zelanda", "ACWDT": "hora de verano de Australia centroccidental", "HAST": "hora estándar de Hawái-Aleutiano", "WAST": "hora de verano de África occidental", "OEZ": "hora estándar de Europa oriental", "COT": "hora estándar de Colombia"},
+ timezones: map[string]string{"WIB": "hora de Indonesia occidental", "AWDT": "hora de verano de Australia occidental", "AST": "hora estándar del Atlántico", "BOT": "hora de Bolivia", "COT": "hora estándar de Colombia", "∅∅∅": "hora de verano de las Azores", "VET": "hora de Venezuela", "AEDT": "hora de verano de Australia oriental", "EAT": "hora de África oriental", "WARST": "hora de verano de Argentina occidental", "SRT": "hora de Surinam", "ECT": "hora de Ecuador", "AKDT": "hora de verano de Alaska", "PDT": "hora de verano del Pacífico", "TMST": "hora de verano de Turkmenistán", "MST": "Hora estándar de Macao", "EDT": "hora de verano oriental", "HAST": "hora estándar de Hawái-Aleutiano", "IST": "hora estándar de la India", "CHADT": "hora de verano de Chatham", "ADT": "hora de verano del Atlántico", "HADT": "hora de verano de Hawái-Aleutiano", "GMT": "hora del meridiano de Greenwich", "LHST": "hora estándar de Lord Howe", "MEZ": "hora estándar de Europa central", "NZDT": "hora de verano de Nueva Zelanda", "WESZ": "hora de verano de Europa occidental", "GYT": "hora de Guyana", "CST": "hora estándar central", "CDT": "hora de verano central", "ACDT": "hora de verano de Australia central", "WAST": "hora de verano de África occidental", "AEST": "hora estándar de Australia oriental", "ChST": "hora estándar de Chamorro", "WART": "hora estándar de Argentina occidental", "BT": "hora de Bután", "MDT": "Hora de verano de Macao", "ARST": "hora de verano de Argentina", "TMT": "hora estándar de Turkmenistán", "WIT": "hora de Indonesia oriental", "GFT": "hora de la Guayana Francesa", "HKT": "hora estándar de Hong Kong", "HKST": "hora de verano de Hong Kong", "ACWDT": "hora de verano de Australia centroccidental", "JST": "hora estándar de Japón", "PST": "hora estándar del Pacífico", "WEZ": "hora estándar de Europa occidental", "HAT": "hora de verano de Terranova", "ACWST": "hora estándar de Australia centroccidental", "MESZ": "hora de verano de Europa central", "NZST": "hora estándar de Nueva Zelanda", "UYST": "hora de verano de Uruguay", "AWST": "hora estándar de Australia occidental", "AKST": "hora estándar de Alaska", "OEZ": "hora estándar de Europa oriental", "CLST": "hora de verano de Chile", "WAT": "hora estándar de África occidental", "ART": "hora estándar de Argentina", "WITA": "hora de Indonesia central", "HNT": "hora estándar de Terranova", "SGT": "hora de Singapur", "CAT": "hora de África central", "CLT": "hora estándar de Chile", "UYT": "hora estándar de Uruguay", "CHAST": "hora estándar de Chatham", "EST": "hora estándar oriental", "OESZ": "hora de verano de Europa oriental", "MYT": "hora de Malasia", "ACST": "hora estándar de Australia central", "JDT": "hora de verano de Japón", "SAST": "hora de Sudáfrica", "COST": "hora de verano de Colombia", "LHDT": "hora de verano de Lord Howe"},
}
}
diff --git a/es_GQ/es_GQ_test.go b/es_GQ/es_GQ_test.go
new file mode 100644
index 00000000..8eed144b
--- /dev/null
+++ b/es_GQ/es_GQ_test.go
@@ -0,0 +1,1120 @@
+package es_GQ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "es_GQ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/es_GT/es_GT.go b/es_GT/es_GT.go
index 3cfc148b..4ce0f4b1 100644
--- a/es_GT/es_GT.go
+++ b/es_GT/es_GT.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a. C.", "d. C."},
erasNarrow: []string{"", ""},
erasWide: []string{"antes de Cristo", "después de Cristo"},
- timezones: map[string]string{"ACWDT": "hora de verano de Australia centroccidental", "AST": "hora estándar del Atlántico", "HAT": "hora de verano de Terranova", "ACDT": "hora de verano de Australia central", "AEDT": "hora de verano de Australia oriental", "MST": "Hora estándar de Macao", "AKST": "hora estándar de Alaska", "EDT": "hora de verano oriental", "HKT": "hora estándar de Hong Kong", "WAST": "hora de verano de África occidental", "∅∅∅": "hora de verano del Amazonas", "TMT": "hora estándar de Turkmenistán", "NZST": "hora estándar de Nueva Zelanda", "CAT": "hora de África central", "AWST": "hora estándar de Australia occidental", "JDT": "hora de verano de Japón", "MEZ": "hora estándar de Europa central", "HADT": "hora de verano de Hawái-Aleutiano", "GYT": "hora de Guyana", "SRT": "hora de Surinam", "NZDT": "hora de verano de Nueva Zelanda", "CDT": "hora de verano central", "ACWST": "hora estándar de Australia centroccidental", "HAST": "hora estándar de Hawái-Aleutiano", "WARST": "hora de verano de Argentina occidental", "TMST": "hora de verano de Turkmenistán", "LHST": "hora estándar de Lord Howe", "JST": "hora estándar de Japón", "PST": "hora estándar del Pacífico", "BOT": "hora de Bolivia", "BT": "hora de Bután", "OESZ": "hora de verano de Europa oriental", "ART": "hora estándar de Argentina", "ARST": "hora de verano de Argentina", "ECT": "hora de Ecuador", "HNT": "hora estándar de Terranova", "IST": "hora estándar de la India", "MYT": "hora de Malasia", "AEST": "hora estándar de Australia oriental", "WAT": "hora estándar de África occidental", "GMT": "hora del meridiano de Greenwich", "WESZ": "hora de verano de Europa occidental", "COST": "hora de verano de Colombia", "HKST": "hora de verano de Hong Kong", "AWDT": "hora de verano de Australia occidental", "CLST": "hora de verano de Chile", "EST": "hora estándar oriental", "UYT": "hora estándar de Uruguay", "UYST": "hora de verano de Uruguay", "VET": "hora de Venezuela", "WITA": "hora de Indonesia central", "AKDT": "hora de verano de Alaska", "ChST": "hora estándar de Chamorro", "ADT": "hora de verano del Atlántico", "OEZ": "hora estándar de Europa oriental", "LHDT": "hora de verano de Lord Howe", "COT": "hora estándar de Colombia", "CST": "hora estándar central", "CLT": "hora estándar de Chile", "SAST": "hora de Sudáfrica", "WIT": "hora de Indonesia oriental", "WIB": "hora de Indonesia occidental", "MDT": "Hora de verano de Macao", "PDT": "hora de verano del Pacífico", "EAT": "hora de África oriental", "WART": "hora estándar de Argentina occidental", "WEZ": "hora estándar de Europa occidental", "ACST": "hora estándar de Australia central", "CHAST": "hora estándar de Chatham", "SGT": "hora de Singapur", "GFT": "hora de la Guayana Francesa", "MESZ": "hora de verano de Europa central", "CHADT": "hora de verano de Chatham"},
+ timezones: map[string]string{"GFT": "hora de la Guayana Francesa", "ACWST": "hora estándar de Australia centroccidental", "WAST": "hora de verano de África occidental", "HAT": "hora de verano de Terranova", "AEDT": "hora de verano de Australia oriental", "CLT": "hora estándar de Chile", "WIT": "hora de Indonesia oriental", "WARST": "hora de verano de Argentina occidental", "ARST": "hora de verano de Argentina", "PST": "hora estándar del Pacífico", "COT": "hora estándar de Colombia", "AEST": "hora estándar de Australia oriental", "VET": "hora de Venezuela", "ART": "hora estándar de Argentina", "HAST": "hora estándar de Hawái-Aleutiano", "SGT": "hora de Singapur", "OEZ": "hora estándar de Europa oriental", "LHST": "hora estándar de Lord Howe", "UYT": "hora estándar de Uruguay", "AST": "hora estándar del Atlántico", "JST": "hora estándar de Japón", "WIB": "hora de Indonesia occidental", "GYT": "hora de Guyana", "∅∅∅": "hora de verano de las Azores", "MEZ": "hora estándar de Europa central", "ACDT": "hora de verano de Australia central", "TMST": "hora de verano de Turkmenistán", "AKDT": "hora de verano de Alaska", "HKST": "hora de verano de Hong Kong", "ADT": "hora de verano del Atlántico", "WAT": "hora estándar de África occidental", "HKT": "hora estándar de Hong Kong", "CHADT": "hora de verano de Chatham", "AKST": "hora estándar de Alaska", "MESZ": "hora de verano de Europa central", "NZDT": "hora de verano de Nueva Zelanda", "BOT": "hora de Bolivia", "GMT": "hora del meridiano de Greenwich", "CDT": "hora de verano central", "AWST": "hora estándar de Australia occidental", "JDT": "hora de verano de Japón", "HADT": "hora de verano de Hawái-Aleutiano", "HNT": "hora estándar de Terranova", "BT": "hora de Bután", "WART": "hora estándar de Argentina occidental", "ACWDT": "hora de verano de Australia centroccidental", "WEZ": "hora estándar de Europa occidental", "ChST": "hora estándar de Chamorro", "CLST": "hora de verano de Chile", "UYST": "hora de verano de Uruguay", "WITA": "hora de Indonesia central", "EDT": "hora de verano oriental", "WESZ": "hora de verano de Europa occidental", "CAT": "hora de África central", "CHAST": "hora estándar de Chatham", "SAST": "hora de Sudáfrica", "TMT": "hora estándar de Turkmenistán", "MDT": "Hora de verano de Macao", "AWDT": "hora de verano de Australia occidental", "EST": "hora estándar oriental", "NZST": "hora estándar de Nueva Zelanda", "ACST": "hora estándar de Australia central", "MST": "Hora estándar de Macao", "IST": "hora estándar de la India", "COST": "hora de verano de Colombia", "EAT": "hora de África oriental", "ECT": "hora de Ecuador", "CST": "hora estándar central", "PDT": "hora de verano del Pacífico", "OESZ": "hora de verano de Europa oriental", "LHDT": "hora de verano de Lord Howe", "MYT": "hora de Malasia", "SRT": "hora de Surinam"},
}
}
diff --git a/es_GT/es_GT_test.go b/es_GT/es_GT_test.go
new file mode 100644
index 00000000..605734d2
--- /dev/null
+++ b/es_GT/es_GT_test.go
@@ -0,0 +1,1120 @@
+package es_GT
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "es_GT"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/es_HN/es_HN.go b/es_HN/es_HN.go
index f9101201..60e3edd3 100644
--- a/es_HN/es_HN.go
+++ b/es_HN/es_HN.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a. C.", "d. C."},
erasNarrow: []string{"", ""},
erasWide: []string{"antes de Cristo", "después de Cristo"},
- timezones: map[string]string{"TMT": "hora estándar de Turkmenistán", "MYT": "hora de Malasia", "ACST": "hora estándar de Australia central", "CLST": "hora de verano de Chile", "WESZ": "hora de verano de Europa occidental", "GFT": "hora de la Guayana Francesa", "SRT": "hora de Surinam", "GMT": "hora del meridiano de Greenwich", "ART": "hora estándar de Argentina", "AKDT": "hora de verano de Alaska", "CHADT": "hora de verano de Chatham", "HNT": "hora estándar de Terranova", "HAT": "hora de verano de Terranova", "ARST": "hora de verano de Argentina", "AEDT": "hora de verano de Australia oriental", "ADT": "hora de verano del Atlántico", "HAST": "hora estándar de Hawái-Aleutiano", "WAT": "hora estándar de África occidental", "GYT": "hora de Guyana", "AWDT": "hora de verano de Australia occidental", "BOT": "hora de Bolivia", "PDT": "hora de verano del Pacífico", "NZST": "hora estándar de Nueva Zelanda", "EST": "hora estándar oriental", "COT": "hora estándar de Colombia", "HADT": "hora de verano de Hawái-Aleutiano", "BT": "hora de Bután", "UYT": "hora estándar de Uruguay", "UYST": "hora de verano de Uruguay", "MESZ": "hora de verano de Europa central", "AEST": "hora estándar de Australia oriental", "EDT": "hora de verano oriental", "OESZ": "hora de verano de Europa oriental", "MST": "Hora estándar de Macao", "AKST": "hora estándar de Alaska", "CDT": "hora de verano central", "WIB": "hora de Indonesia occidental", "OEZ": "hora estándar de Europa oriental", "ACDT": "hora de verano de Australia central", "PST": "hora estándar del Pacífico", "WART": "hora estándar de Argentina occidental", "CST": "hora estándar central", "NZDT": "hora de verano de Nueva Zelanda", "WEZ": "hora estándar de Europa occidental", "COST": "hora de verano de Colombia", "SGT": "hora de Singapur", "WAST": "hora de verano de África occidental", "LHST": "hora estándar de Lord Howe", "VET": "hora de Venezuela", "ACWST": "hora estándar de Australia centroccidental", "WARST": "hora de verano de Argentina occidental", "SAST": "hora de Sudáfrica", "JST": "hora estándar de Japón", "AWST": "hora estándar de Australia occidental", "ChST": "hora estándar de Chamorro", "∅∅∅": "hora de verano del Amazonas", "TMST": "hora de verano de Turkmenistán", "LHDT": "hora de verano de Lord Howe", "JDT": "hora de verano de Japón", "IST": "hora estándar de la India", "WITA": "hora de Indonesia central", "WIT": "hora de Indonesia oriental", "EAT": "hora de África oriental", "MDT": "Hora de verano de Macao", "MEZ": "hora estándar de Europa central", "ACWDT": "hora de verano de Australia centroccidental", "ECT": "hora de Ecuador", "HKST": "hora de verano de Hong Kong", "CHAST": "hora estándar de Chatham", "CLT": "hora estándar de Chile", "CAT": "hora de África central", "AST": "hora estándar del Atlántico", "HKT": "hora estándar de Hong Kong"},
+ timezones: map[string]string{"COT": "hora estándar de Colombia", "GMT": "hora del meridiano de Greenwich", "WARST": "hora de verano de Argentina occidental", "MEZ": "hora estándar de Europa central", "MESZ": "hora de verano de Europa central", "IST": "hora estándar de la India", "UYST": "hora de verano de Uruguay", "VET": "hora de Venezuela", "JDT": "hora de verano de Japón", "WAT": "hora estándar de África occidental", "OEZ": "hora estándar de Europa oriental", "SRT": "hora de Surinam", "PST": "hora estándar del Pacífico", "HADT": "hora de verano de Hawái-Aleutiano", "CHAST": "hora estándar de Chatham", "PDT": "hora de verano del Pacífico", "NZDT": "hora de verano de Nueva Zelanda", "ACST": "hora estándar de Australia central", "ACWDT": "hora de verano de Australia centroccidental", "ACWST": "hora estándar de Australia centroccidental", "AWDT": "hora de verano de Australia occidental", "ART": "hora estándar de Argentina", "AKST": "hora estándar de Alaska", "HNT": "hora estándar de Terranova", "WAST": "hora de verano de África occidental", "MDT": "Hora de verano de Macao", "HKT": "hora estándar de Hong Kong", "EAT": "hora de África oriental", "GYT": "hora de Guyana", "COST": "hora de verano de Colombia", "AEST": "hora estándar de Australia oriental", "WESZ": "hora de verano de Europa occidental", "HAT": "hora de verano de Terranova", "WIT": "hora de Indonesia oriental", "ECT": "hora de Ecuador", "AST": "hora estándar del Atlántico", "AKDT": "hora de verano de Alaska", "SGT": "hora de Singapur", "MYT": "hora de Malasia", "CHADT": "hora de verano de Chatham", "JST": "hora estándar de Japón", "AEDT": "hora de verano de Australia oriental", "ChST": "hora estándar de Chamorro", "ACDT": "hora de verano de Australia central", "MST": "Hora estándar de Macao", "UYT": "hora estándar de Uruguay", "HAST": "hora estándar de Hawái-Aleutiano", "LHST": "hora estándar de Lord Howe", "GFT": "hora de la Guayana Francesa", "WIB": "hora de Indonesia occidental", "NZST": "hora estándar de Nueva Zelanda", "BOT": "hora de Bolivia", "CAT": "hora de África central", "CLST": "hora de verano de Chile", "BT": "hora de Bután", "ARST": "hora de verano de Argentina", "ADT": "hora de verano del Atlántico", "TMST": "hora de verano de Turkmenistán", "LHDT": "hora de verano de Lord Howe", "CLT": "hora estándar de Chile", "EDT": "hora de verano oriental", "TMT": "hora estándar de Turkmenistán", "EST": "hora estándar oriental", "SAST": "hora de Sudáfrica", "WEZ": "hora estándar de Europa occidental", "∅∅∅": "hora de verano de las Azores", "AWST": "hora estándar de Australia occidental", "CDT": "hora de verano central", "HKST": "hora de verano de Hong Kong", "WITA": "hora de Indonesia central", "OESZ": "hora de verano de Europa oriental", "WART": "hora estándar de Argentina occidental", "CST": "hora estándar central"},
}
}
diff --git a/es_HN/es_HN_test.go b/es_HN/es_HN_test.go
new file mode 100644
index 00000000..2275be3b
--- /dev/null
+++ b/es_HN/es_HN_test.go
@@ -0,0 +1,1120 @@
+package es_HN
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "es_HN"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/es_IC/es_IC.go b/es_IC/es_IC.go
index 3da43fb3..3fc67ab3 100644
--- a/es_IC/es_IC.go
+++ b/es_IC/es_IC.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a. C.", "d. C."},
erasNarrow: []string{"", ""},
erasWide: []string{"antes de Cristo", "después de Cristo"},
- timezones: map[string]string{"IST": "hora estándar de la India", "GFT": "hora de la Guayana Francesa", "MESZ": "hora de verano de Europa central", "EDT": "hora de verano oriental", "WART": "hora estándar de Argentina occidental", "OESZ": "hora de verano de Europa oriental", "MST": "Hora estándar de Macao", "ARST": "hora de verano de Argentina", "WEZ": "hora estándar de Europa occidental", "WITA": "hora de Indonesia central", "LHST": "hora estándar de Lord Howe", "NZDT": "hora de verano de Nueva Zelanda", "CLT": "hora estándar de Chile", "COST": "hora de verano de Colombia", "HAST": "hora estándar de Hawái-Aleutiano", "SGT": "hora de Singapur", "PST": "hora estándar del Pacífico", "MYT": "hora de Malasia", "ACWST": "hora estándar de Australia centroccidental", "WAST": "hora de verano de África occidental", "OEZ": "hora estándar de Europa oriental", "HNT": "hora estándar de Terranova", "JDT": "hora de verano de Japón", "CST": "hora estándar central", "AEST": "hora estándar de Australia oriental", "WARST": "hora de verano de Argentina occidental", "ACST": "hora estándar de Australia central", "ACDT": "hora de verano de Australia central", "SRT": "hora de Surinam", "ADT": "hora de verano del Atlántico", "HKST": "hora de verano de Hong Kong", "HAT": "hora de verano de Terranova", "CDT": "hora de verano central", "ChST": "hora estándar de Chamorro", "ECT": "hora de Ecuador", "CAT": "hora de África central", "HKT": "hora estándar de Hong Kong", "GYT": "hora de Guyana", "JST": "hora estándar de Japón", "EAT": "hora de África oriental", "AEDT": "hora de verano de Australia oriental", "∅∅∅": "hora de verano de Brasilia", "BT": "hora de Bután", "TMST": "hora de verano de Turkmenistán", "AKDT": "hora de verano de Alaska", "AWST": "hora estándar de Australia occidental", "LHDT": "hora de verano de Lord Howe", "VET": "hora de Venezuela", "AST": "hora estándar del Atlántico", "UYT": "hora estándar de Uruguay", "WESZ": "hora de verano de Europa occidental", "CHADT": "hora de verano de Chatham", "SAST": "hora de Sudáfrica", "WAT": "hora estándar de África occidental", "GMT": "hora del meridiano de Greenwich", "WIT": "hora de Indonesia oriental", "MDT": "Hora de verano de Macao", "CHAST": "hora estándar de Chatham", "CLST": "hora de verano de Chile", "WIB": "hora de Indonesia occidental", "AWDT": "hora de verano de Australia occidental", "MEZ": "hora estándar de Europa central", "UYST": "hora de verano de Uruguay", "NZST": "hora estándar de Nueva Zelanda", "EST": "hora estándar oriental", "COT": "hora estándar de Colombia", "HADT": "hora de verano de Hawái-Aleutiano", "ART": "hora estándar de Argentina", "TMT": "hora estándar de Turkmenistán", "AKST": "hora estándar de Alaska", "PDT": "hora de verano del Pacífico", "BOT": "hora de Bolivia", "ACWDT": "hora de verano de Australia centroccidental"},
+ timezones: map[string]string{"CHADT": "hora de verano de Chatham", "ECT": "hora de Ecuador", "JST": "hora estándar de Japón", "ADT": "hora de verano del Atlántico", "IST": "hora estándar de la India", "AEDT": "hora de verano de Australia oriental", "LHDT": "hora de verano de Lord Howe", "CDT": "hora de verano central", "JDT": "hora de verano de Japón", "ACWST": "hora estándar de Australia centroccidental", "AWDT": "hora de verano de Australia occidental", "CLST": "hora de verano de Chile", "LHST": "hora estándar de Lord Howe", "∅∅∅": "hora de verano de Brasilia", "GYT": "hora de Guyana", "BOT": "hora de Bolivia", "MEZ": "hora estándar de Europa central", "WEZ": "hora estándar de Europa occidental", "WESZ": "hora de verano de Europa occidental", "OEZ": "hora estándar de Europa oriental", "PST": "hora estándar del Pacífico", "WAST": "hora de verano de África occidental", "OESZ": "hora de verano de Europa oriental", "HADT": "hora de verano de Hawái-Aleutiano", "TMT": "hora estándar de Turkmenistán", "SGT": "hora de Singapur", "MESZ": "hora de verano de Europa central", "HNT": "hora estándar de Terranova", "AEST": "hora estándar de Australia oriental", "COST": "hora de verano de Colombia", "ACDT": "hora de verano de Australia central", "VET": "hora de Venezuela", "SRT": "hora de Surinam", "ARST": "hora de verano de Argentina", "WIT": "hora de Indonesia oriental", "MDT": "hora de verano de las Montañas", "CHAST": "hora estándar de Chatham", "AKST": "hora estándar de Alaska", "AWST": "hora estándar de Australia occidental", "NZST": "hora estándar de Nueva Zelanda", "TMST": "hora de verano de Turkmenistán", "UYT": "hora estándar de Uruguay", "UYST": "hora de verano de Uruguay", "ACST": "hora estándar de Australia central", "WART": "hora estándar de Argentina occidental", "HKT": "hora estándar de Hong Kong", "AKDT": "hora de verano de Alaska", "CAT": "hora de África central", "CLT": "hora estándar de Chile", "EAT": "hora de África oriental", "NZDT": "hora de verano de Nueva Zelanda", "WIB": "hora de Indonesia occidental", "ChST": "hora estándar de Chamorro", "WITA": "hora de Indonesia central", "BT": "hora de Bután", "MST": "hora estándar de las Montañas", "EST": "hora estándar oriental", "WAT": "hora estándar de África occidental", "EDT": "hora de verano oriental", "AST": "hora estándar del Atlántico", "ACWDT": "hora de verano de Australia centroccidental", "HAST": "hora estándar de Hawái-Aleutiano", "SAST": "hora de Sudáfrica", "GMT": "hora del meridiano de Greenwich", "MYT": "hora de Malasia", "WARST": "hora de verano de Argentina occidental", "GFT": "hora de la Guayana Francesa", "HKST": "hora de verano de Hong Kong", "ART": "hora estándar de Argentina", "PDT": "hora de verano del Pacífico", "COT": "hora estándar de Colombia", "HAT": "hora de verano de Terranova", "CST": "hora estándar central"},
}
}
diff --git a/es_IC/es_IC_test.go b/es_IC/es_IC_test.go
new file mode 100644
index 00000000..81690147
--- /dev/null
+++ b/es_IC/es_IC_test.go
@@ -0,0 +1,1120 @@
+package es_IC
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "es_IC"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/es_MX/es_MX.go b/es_MX/es_MX.go
index 06cde930..0af6cf71 100644
--- a/es_MX/es_MX.go
+++ b/es_MX/es_MX.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a. C.", "d. C."},
erasNarrow: []string{"", ""},
erasWide: []string{"antes de Cristo", "después de Cristo"},
- timezones: map[string]string{"∅∅∅": "Hora de verano de Acre", "ACST": "Hora estándar de Australia Central", "AWST": "Hora estándar de Australia Occidental", "EST": "Hora estándar del este de Norteamérica", "ARST": "Hora de verano de Argentina", "BOT": "Hora de Bolivia", "CHADT": "Hora de verano de Chatham", "UYST": "Hora de verano de Uruguay", "MESZ": "Hora de verano de Europa Central", "AEST": "Hora estándar de Australia Oriental", "CHAST": "Hora estándar de Chatham", "WAT": "Hora estándar de África Occidental", "GMT": "Hora del meridiano de Greenwich", "HAT": "Hora de verano de Terranova", "SRT": "Hora de Surinam", "WITA": "Hora de Indonesia Central", "GYT": "Hora de Guyana", "JDT": "Hora de verano de Japón", "CDT": "Hora de verano del centro de Norteamérica", "ACWST": "Hora estándar de Australia Centroccidental", "WARST": "Hora de verano de Argentina Occidental", "SAST": "Hora de Sudáfrica", "HNT": "Hora estándar de Terranova", "LHDT": "Hora de verano de Lord Howe", "AEDT": "Hora de verano de Australia Oriental", "ECT": "Hora de Ecuador", "OESZ": "Hora de verano de Europa del Este", "MDT": "Hora de verano de Macao", "MYT": "Hora de Malasia", "JST": "Hora estándar de Japón", "EDT": "Hora de verano del este de Norteamérica", "WIT": "Hora de Indonesia Oriental", "EAT": "Hora de África Oriental", "PST": "Hora estándar del Pacífico de Norteamérica", "COST": "Hora de verano de Colombia", "ACWDT": "Hora de verano de Australia Centroccidental", "COT": "Hora estándar de Colombia", "BT": "Hora de Bután", "ACDT": "Hora de verano de Australia Central", "MEZ": "Hora estándar de Europa Central", "WEZ": "Hora estándar de Europa Occidental", "AKST": "Hora estándar de Alaska", "AKDT": "Hora de verano de Alaska", "CLST": "Hora de verano de Chile", "UYT": "Hora estándar de Uruguay", "CLT": "Hora estándar de Chile", "HKST": "Hora de verano de Hong Kong", "WART": "Hora estándar de Argentina Occidental", "OEZ": "Hora estándar de Europa del Este", "TMST": "Hora de verano de Turkmenistán", "CST": "Hora estándar del centro de Norteamérica", "ChST": "Hora estándar de Chamorro", "AST": "Hora estándar del Atlántico", "HADT": "Hora de verano de Hawái-Aleutiano", "WAST": "Hora de verano de África Occidental", "AWDT": "Hora de verano de Australia Occidental", "LHST": "Hora estándar de Lord Howe", "PDT": "Hora de verano del Pacífico de Norteamérica", "CAT": "Hora de África Central", "HAST": "Hora estándar de Hawái-Aleutiano", "WIB": "Hora de Indonesia Occidental", "IST": "Hora estándar de la India", "MST": "Hora estándar de Macao", "HKT": "Hora estándar de Hong Kong", "GFT": "Hora de la Guayana Francesa", "NZST": "Hora estándar de Nueva Zelanda", "WESZ": "Hora de verano de Europa Occidental", "SGT": "Hora de Singapur", "TMT": "Hora estándar de Turkmenistán", "NZDT": "Hora de verano de Nueva Zelanda", "VET": "Hora de Venezuela", "ADT": "Hora de verano del Atlántico", "ART": "Hora estándar de Argentina"},
+ timezones: map[string]string{"COT": "Hora estándar de Colombia", "WAT": "Hora estándar de África Occidental", "MST": "Hora estándar de la montaña de Norteamérica", "ECT": "Hora de Ecuador", "CHADT": "Hora de verano de Chatham", "AKST": "Hora estándar de Alaska", "HAST": "Hora estándar de Hawái-Aleutiano", "ChST": "Hora estándar de Chamorro", "CST": "Hora estándar del centro de Norteamérica", "AKDT": "Hora de verano de Alaska", "ACWDT": "Hora de verano de Australia Centroccidental", "CLST": "Hora de verano de Chile", "WIB": "Hora de Indonesia Occidental", "WESZ": "Hora de verano de Europa Occidental", "WAST": "Hora de verano de África Occidental", "∅∅∅": "Hora de verano de Brasilia", "ACWST": "Hora estándar de Australia Centroccidental", "PDT": "Hora de verano del Pacífico de Norteamérica", "IST": "Hora estándar de la India", "HNT": "Hora estándar de Terranova", "MDT": "Hora de verano de la montaña de Norteamérica", "EDT": "Hora de verano del este de Norteamérica", "TMST": "Hora de verano de Turkmenistán", "TMT": "Hora estándar de Turkmenistán", "MYT": "Hora de Malasia", "UYT": "Hora estándar de Uruguay", "EAT": "Hora de África Oriental", "ARST": "Hora de verano de Argentina", "NZDT": "Hora de verano de Nueva Zelanda", "HKT": "Hora estándar de Hong Kong", "SAST": "Hora de Sudáfrica", "NZST": "Hora estándar de Nueva Zelanda", "HADT": "Hora de verano de Hawái-Aleutiano", "COST": "Hora de verano de Colombia", "UYST": "Hora de verano de Uruguay", "ACDT": "Hora de verano de Australia Central", "CHAST": "Hora estándar de Chatham", "JDT": "Hora de verano de Japón", "PST": "Hora estándar del Pacífico de Norteamérica", "CDT": "Hora de verano del centro de Norteamérica", "HKST": "Hora de verano de Hong Kong", "WITA": "Hora de Indonesia Central", "OEZ": "Hora estándar de Europa del Este", "OESZ": "Hora de verano de Europa del Este", "WIT": "Hora de Indonesia Oriental", "LHST": "Hora estándar de Lord Howe", "LHDT": "Hora de verano de Lord Howe", "AST": "Hora estándar del Atlántico", "ADT": "Hora de verano del Atlántico", "MESZ": "Hora de verano de Europa Central", "EST": "Hora estándar del este de Norteamérica", "BOT": "Hora de Bolivia", "CAT": "Hora de África Central", "SGT": "Hora de Singapur", "WEZ": "Hora estándar de Europa Occidental", "AEDT": "Hora de verano de Australia Oriental", "BT": "Hora de Bután", "AWST": "Hora estándar de Australia Occidental", "AWDT": "Hora de verano de Australia Occidental", "JST": "Hora estándar de Japón", "AEST": "Hora estándar de Australia Oriental", "HAT": "Hora de verano de Terranova", "SRT": "Hora de Surinam", "GFT": "Hora de la Guayana Francesa", "GMT": "Hora del meridiano de Greenwich", "CLT": "Hora estándar de Chile", "WART": "Hora estándar de Argentina Occidental", "WARST": "Hora de verano de Argentina Occidental", "VET": "Hora de Venezuela", "GYT": "Hora de Guyana", "ACST": "Hora estándar de Australia Central", "ART": "Hora estándar de Argentina", "MEZ": "Hora estándar de Europa Central"},
}
}
diff --git a/es_MX/es_MX_test.go b/es_MX/es_MX_test.go
new file mode 100644
index 00000000..b0616f8c
--- /dev/null
+++ b/es_MX/es_MX_test.go
@@ -0,0 +1,1120 @@
+package es_MX
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "es_MX"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/es_NI/es_NI.go b/es_NI/es_NI.go
index 4aa331ce..669aaf20 100644
--- a/es_NI/es_NI.go
+++ b/es_NI/es_NI.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a. C.", "d. C."},
erasNarrow: []string{"", ""},
erasWide: []string{"antes de Cristo", "después de Cristo"},
- timezones: map[string]string{"JDT": "hora de verano de Japón", "MEZ": "hora estándar de Europa central", "CST": "hora estándar central", "OEZ": "hora estándar de Europa oriental", "GMT": "hora del meridiano de Greenwich", "HAT": "hora de verano de Terranova", "LHST": "hora estándar de Lord Howe", "AEDT": "hora de verano de Australia oriental", "CLST": "hora de verano de Chile", "VET": "hora de Venezuela", "HNT": "hora estándar de Terranova", "ART": "hora estándar de Argentina", "CLT": "hora estándar de Chile", "EST": "hora estándar oriental", "UYST": "hora de verano de Uruguay", "ADT": "hora de verano del Atlántico", "AWST": "hora estándar de Australia occidental", "MYT": "hora de Malasia", "ACWST": "hora estándar de Australia centroccidental", "OESZ": "hora de verano de Europa oriental", "WIB": "hora de Indonesia occidental", "ACDT": "hora de verano de Australia central", "JST": "hora estándar de Japón", "NZDT": "hora de verano de Nueva Zelanda", "ARST": "hora de verano de Argentina", "TMT": "hora estándar de Turkmenistán", "COT": "hora estándar de Colombia", "WAST": "hora de verano de África occidental", "GFT": "hora de la Guayana Francesa", "ACST": "hora estándar de Australia central", "MESZ": "hora de verano de Europa central", "BOT": "hora de Bolivia", "ChST": "hora estándar de Chamorro", "COST": "hora de verano de Colombia", "AST": "hora estándar del Atlántico", "WEZ": "hora estándar de Europa occidental", "BT": "hora de Bután", "GYT": "hora de Guyana", "CDT": "hora de verano central", "AEST": "hora estándar de Australia oriental", "CHAST": "hora estándar de Chatham", "CHADT": "hora de verano de Chatham", "EDT": "hora de verano oriental", "HAST": "hora estándar de Hawái-Aleutiano", "WITA": "hora de Indonesia central", "MDT": "hora de verano de las Montañas", "TMST": "hora de verano de Turkmenistán", "SGT": "hora de Singapur", "PDT": "hora de verano del Pacífico", "LHDT": "hora de verano de Lord Howe", "SRT": "hora de Surinam", "AKDT": "hora de verano de Alaska", "∅∅∅": "hora de verano de las Azores", "ACWDT": "hora de verano de Australia centroccidental", "MST": "hora estándar de las Montañas", "WAT": "hora estándar de África occidental", "UYT": "hora estándar de Uruguay", "HKT": "hora estándar de Hong Kong", "IST": "hora estándar de la India", "EAT": "hora de África oriental", "PST": "hora estándar del Pacífico", "WESZ": "hora de verano de Europa occidental", "ECT": "hora de Ecuador", "HADT": "hora de verano de Hawái-Aleutiano", "WART": "hora estándar de Argentina occidental", "NZST": "hora estándar de Nueva Zelanda", "CAT": "hora de África central", "AWDT": "hora de verano de Australia occidental", "AKST": "hora estándar de Alaska", "HKST": "hora de verano de Hong Kong", "WARST": "hora de verano de Argentina occidental", "SAST": "hora de Sudáfrica", "WIT": "hora de Indonesia oriental"},
+ timezones: map[string]string{"ACST": "hora estándar de Australia central", "HADT": "hora de verano de Hawái-Aleutiano", "NZST": "hora estándar de Nueva Zelanda", "COST": "hora de verano de Colombia", "WIT": "hora de Indonesia oriental", "ACWST": "hora estándar de Australia centroccidental", "EDT": "hora de verano oriental", "PDT": "hora de verano del Pacífico", "GMT": "hora del meridiano de Greenwich", "CST": "hora estándar central", "BOT": "hora de Bolivia", "OEZ": "hora estándar de Europa oriental", "AWST": "hora estándar de Australia occidental", "JST": "hora estándar de Japón", "HNT": "hora estándar de Terranova", "HAT": "hora de verano de Terranova", "WIB": "hora de Indonesia occidental", "VET": "hora de Venezuela", "MDT": "hora de verano de las Montañas", "EAT": "hora de África oriental", "SRT": "hora de Surinam", "ART": "hora estándar de Argentina", "JDT": "hora de verano de Japón", "NZDT": "hora de verano de Nueva Zelanda", "WAST": "hora de verano de África occidental", "OESZ": "hora de verano de Europa oriental", "TMT": "hora estándar de Turkmenistán", "UYST": "hora de verano de Uruguay", "GFT": "hora de la Guayana Francesa", "WEZ": "hora estándar de Europa occidental", "MYT": "hora de Malasia", "AEDT": "hora de verano de Australia oriental", "CDT": "hora de verano central", "CHAST": "hora estándar de Chatham", "AEST": "hora estándar de Australia oriental", "HKT": "hora estándar de Hong Kong", "ADT": "hora de verano del Atlántico", "WARST": "hora de verano de Argentina occidental", "WITA": "hora de Indonesia central", "PST": "hora estándar del Pacífico", "SAST": "hora de Sudáfrica", "COT": "hora estándar de Colombia", "LHST": "hora estándar de Lord Howe", "UYT": "hora estándar de Uruguay", "ACDT": "hora de verano de Australia central", "TMST": "hora de verano de Turkmenistán", "CAT": "hora de África central", "CLST": "hora de verano de Chile", "HKST": "hora de verano de Hong Kong", "ARST": "hora de verano de Argentina", "HAST": "hora estándar de Hawái-Aleutiano", "SGT": "hora de Singapur", "LHDT": "hora de verano de Lord Howe", "ACWDT": "hora de verano de Australia centroccidental", "EST": "hora estándar oriental", "MESZ": "hora de verano de Europa central", "WAT": "hora estándar de África occidental", "WESZ": "hora de verano de Europa occidental", "MST": "hora estándar de las Montañas", "AKDT": "hora de verano de Alaska", "IST": "hora estándar de la India", "MEZ": "hora estándar de Europa central", "ChST": "hora estándar de Chamorro", "CLT": "hora estándar de Chile", "∅∅∅": "hora de verano de Perú", "WART": "hora estándar de Argentina occidental", "ECT": "hora de Ecuador", "AST": "hora estándar del Atlántico", "GYT": "hora de Guyana", "CHADT": "hora de verano de Chatham", "AWDT": "hora de verano de Australia occidental", "AKST": "hora estándar de Alaska", "BT": "hora de Bután"},
}
}
diff --git a/es_NI/es_NI_test.go b/es_NI/es_NI_test.go
new file mode 100644
index 00000000..23f9f962
--- /dev/null
+++ b/es_NI/es_NI_test.go
@@ -0,0 +1,1120 @@
+package es_NI
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "es_NI"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/es_PA/es_PA.go b/es_PA/es_PA.go
index db603829..f5d9ef84 100644
--- a/es_PA/es_PA.go
+++ b/es_PA/es_PA.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a. C.", "d. C."},
erasNarrow: []string{"", ""},
erasWide: []string{"antes de Cristo", "después de Cristo"},
- timezones: map[string]string{"WIT": "hora de Indonesia oriental", "GYT": "hora de Guyana", "AEDT": "hora de verano de Australia oriental", "HAST": "hora estándar de Hawái-Aleutiano", "TMST": "hora de verano de Turkmenistán", "AWDT": "hora de verano de Australia occidental", "CDT": "hora de verano central", "JST": "hora estándar de Japón", "MDT": "Hora de verano de Macao", "∅∅∅": "hora de verano del Amazonas", "HADT": "hora de verano de Hawái-Aleutiano", "SAST": "hora de Sudáfrica", "WAST": "hora de verano de África occidental", "CLT": "hora estándar de Chile", "CHADT": "hora de verano de Chatham", "COT": "hora estándar de Colombia", "AST": "hora estándar del Atlántico", "NZDT": "hora de verano de Nueva Zelanda", "BOT": "hora de Bolivia", "IST": "hora estándar de la India", "OESZ": "hora de verano de Europa oriental", "HNT": "hora estándar de Terranova", "ART": "hora estándar de Argentina", "TMT": "hora estándar de Turkmenistán", "LHDT": "hora de verano de Lord Howe", "UYST": "hora de verano de Uruguay", "VET": "hora de Venezuela", "WEZ": "hora estándar de Europa occidental", "COST": "hora de verano de Colombia", "ECT": "hora de Ecuador", "WAT": "hora estándar de África occidental", "PDT": "hora de verano del Pacífico", "NZST": "hora estándar de Nueva Zelanda", "UYT": "hora estándar de Uruguay", "EST": "hora estándar oriental", "EDT": "hora de verano oriental", "AKDT": "hora de verano de Alaska", "HKST": "hora de verano de Hong Kong", "WIB": "hora de Indonesia occidental", "HAT": "hora de verano de Terranova", "AEST": "hora estándar de Australia oriental", "CHAST": "hora estándar de Chatham", "ARST": "hora de verano de Argentina", "AKST": "hora estándar de Alaska", "AWST": "hora estándar de Australia occidental", "MST": "Hora estándar de Macao", "ACDT": "hora de verano de Australia central", "MYT": "hora de Malasia", "ADT": "hora de verano del Atlántico", "HKT": "hora estándar de Hong Kong", "WARST": "hora de verano de Argentina occidental", "CAT": "hora de África central", "WART": "hora estándar de Argentina occidental", "OEZ": "hora estándar de Europa oriental", "GMT": "hora del meridiano de Greenwich", "WITA": "hora de Indonesia central", "MESZ": "hora de verano de Europa central", "CLST": "hora de verano de Chile", "WESZ": "hora de verano de Europa occidental", "SGT": "hora de Singapur", "GFT": "hora de la Guayana Francesa", "ACWST": "hora estándar de Australia centroccidental", "PST": "hora estándar del Pacífico", "LHST": "hora estándar de Lord Howe", "ACWDT": "hora de verano de Australia centroccidental", "ChST": "hora estándar de Chamorro", "EAT": "hora de África oriental", "ACST": "hora estándar de Australia central", "JDT": "hora de verano de Japón", "SRT": "hora de Surinam", "CST": "hora estándar central", "MEZ": "hora estándar de Europa central", "BT": "hora de Bután"},
+ timezones: map[string]string{"IST": "hora estándar de la India", "COT": "hora estándar de Colombia", "MST": "hora estándar de las Montañas", "UYT": "hora estándar de Uruguay", "JST": "hora estándar de Japón", "ARST": "hora de verano de Argentina", "AEDT": "hora de verano de Australia oriental", "MDT": "hora de verano de las Montañas", "WIT": "hora de Indonesia oriental", "CHAST": "hora estándar de Chatham", "ACWST": "hora estándar de Australia centroccidental", "AWDT": "hora de verano de Australia occidental", "HAT": "hora de verano de Terranova", "GFT": "hora de la Guayana Francesa", "ECT": "hora de Ecuador", "WITA": "hora de Indonesia central", "MESZ": "hora de verano de Europa central", "HAST": "hora estándar de Hawái-Aleutiano", "NZST": "hora estándar de Nueva Zelanda", "WEZ": "hora estándar de Europa occidental", "OEZ": "hora estándar de Europa oriental", "CLT": "hora estándar de Chile", "CST": "hora estándar central", "PST": "hora estándar del Pacífico", "CDT": "hora de verano central", "JDT": "hora de verano de Japón", "SAST": "hora de Sudáfrica", "WAT": "hora estándar de África occidental", "TMST": "hora de verano de Turkmenistán", "BT": "hora de Bután", "LHST": "hora estándar de Lord Howe", "SRT": "hora de Surinam", "AWST": "hora estándar de Australia occidental", "MEZ": "hora estándar de Europa central", "WIB": "hora de Indonesia occidental", "GMT": "hora del meridiano de Greenwich", "ChST": "hora estándar de Chamorro", "OESZ": "hora de verano de Europa oriental", "LHDT": "hora de verano de Lord Howe", "ACST": "hora estándar de Australia central", "AKDT": "hora de verano de Alaska", "HKT": "hora estándar de Hong Kong", "ACDT": "hora de verano de Australia central", "NZDT": "hora de verano de Nueva Zelanda", "WART": "hora estándar de Argentina occidental", "HADT": "hora de verano de Hawái-Aleutiano", "∅∅∅": "hora de verano del Amazonas", "WESZ": "hora de verano de Europa occidental", "AKST": "hora estándar de Alaska", "UYST": "hora de verano de Uruguay", "HKST": "hora de verano de Hong Kong", "CHADT": "hora de verano de Chatham", "COST": "hora de verano de Colombia", "ART": "hora estándar de Argentina", "BOT": "hora de Bolivia", "HNT": "hora estándar de Terranova", "SGT": "hora de Singapur", "GYT": "hora de Guyana", "AST": "hora estándar del Atlántico", "VET": "hora de Venezuela", "EDT": "hora de verano oriental", "EST": "hora estándar oriental", "PDT": "hora de verano del Pacífico", "CAT": "hora de África central", "CLST": "hora de verano de Chile", "WARST": "hora de verano de Argentina occidental", "ACWDT": "hora de verano de Australia centroccidental", "MYT": "hora de Malasia", "WAST": "hora de verano de África occidental", "TMT": "hora estándar de Turkmenistán", "AEST": "hora estándar de Australia oriental", "EAT": "hora de África oriental", "ADT": "hora de verano del Atlántico"},
}
}
diff --git a/es_PA/es_PA_test.go b/es_PA/es_PA_test.go
new file mode 100644
index 00000000..448d9217
--- /dev/null
+++ b/es_PA/es_PA_test.go
@@ -0,0 +1,1120 @@
+package es_PA
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "es_PA"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/es_PE/es_PE.go b/es_PE/es_PE.go
index cfa5ea22..442d4d23 100644
--- a/es_PE/es_PE.go
+++ b/es_PE/es_PE.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a. C.", "d. C."},
erasNarrow: []string{"", ""},
erasWide: []string{"antes de Cristo", "después de Cristo"},
- timezones: map[string]string{"WESZ": "hora de verano de Europa occidental", "ACWST": "hora estándar de Australia centroccidental", "WAT": "hora estándar de África occidental", "TMT": "hora estándar de Turkmenistán", "ART": "hora estándar de Argentina", "GYT": "hora de Guyana", "NZST": "hora estándar de Nueva Zelanda", "JST": "hora estándar de Japón", "MESZ": "hora de verano de Europa central", "UYT": "hora estándar de Uruguay", "WART": "hora estándar de Argentina occidental", "IST": "hora estándar de la India", "ACDT": "hora de verano de Australia central", "AKDT": "hora de verano de Alaska", "LHDT": "hora de verano de Lord Howe", "NZDT": "hora de verano de Nueva Zelanda", "EST": "hora estándar oriental", "AST": "hora estándar del Atlántico", "∅∅∅": "hora de verano de Perú", "WIB": "hora de Indonesia occidental", "HNT": "hora estándar de Terranova", "EAT": "hora de África oriental", "BT": "hora de Bután", "ARST": "hora de verano de Argentina", "VET": "hora de Venezuela", "MYT": "hora de Malasia", "SRT": "hora de Surinam", "LHST": "hora estándar de Lord Howe", "ADT": "hora de verano del Atlántico", "SGT": "hora de Singapur", "SAST": "hora de Sudáfrica", "WARST": "hora de verano de Argentina occidental", "HAT": "hora de verano de Terranova", "CDT": "hora de verano central", "CHADT": "hora de verano de Chatham", "AEST": "hora estándar de Australia oriental", "GFT": "hora de la Guayana Francesa", "WEZ": "hora estándar de Europa occidental", "HADT": "hora de verano de Hawái-Aleutiano", "OESZ": "hora de verano de Europa oriental", "PDT": "hora de verano del Pacífico", "CHAST": "hora estándar de Chatham", "EDT": "hora de verano oriental", "COT": "hora estándar de Colombia", "ECT": "hora de Ecuador", "MST": "Hora estándar de Macao", "MEZ": "hora estándar de Europa central", "UYST": "hora de verano de Uruguay", "AEDT": "hora de verano de Australia oriental", "ChST": "hora estándar de Chamorro", "GMT": "hora del meridiano de Greenwich", "ACST": "hora estándar de Australia central", "JDT": "hora de verano de Japón", "COST": "hora de verano de Colombia", "CLST": "hora de verano de Chile", "OEZ": "hora estándar de Europa oriental", "MDT": "Hora de verano de Macao", "PST": "hora estándar del Pacífico", "AWST": "hora estándar de Australia occidental", "CST": "hora estándar central", "ACWDT": "hora de verano de Australia centroccidental", "CAT": "hora de África central", "HAST": "hora estándar de Hawái-Aleutiano", "HKT": "hora estándar de Hong Kong", "HKST": "hora de verano de Hong Kong", "AWDT": "hora de verano de Australia occidental", "CLT": "hora estándar de Chile", "BOT": "hora de Bolivia", "WAST": "hora de verano de África occidental", "WITA": "hora de Indonesia central", "WIT": "hora de Indonesia oriental", "TMST": "hora de verano de Turkmenistán", "AKST": "hora estándar de Alaska"},
+ timezones: map[string]string{"CHAST": "hora estándar de Chatham", "MDT": "Hora de verano de Macao", "ADT": "hora de verano del Atlántico", "AKST": "hora estándar de Alaska", "SGT": "hora de Singapur", "GMT": "hora del meridiano de Greenwich", "GFT": "hora de la Guayana Francesa", "HKST": "hora de verano de Hong Kong", "NZDT": "hora de verano de Nueva Zelanda", "TMST": "hora de verano de Turkmenistán", "LHST": "hora estándar de Lord Howe", "ACDT": "hora de verano de Australia central", "CDT": "hora de verano central", "ART": "hora estándar de Argentina", "ARST": "hora de verano de Argentina", "AEDT": "hora de verano de Australia oriental", "OESZ": "hora de verano de Europa oriental", "CHADT": "hora de verano de Chatham", "AWST": "hora estándar de Australia occidental", "PST": "hora estándar del Pacífico", "WESZ": "hora de verano de Europa occidental", "HAT": "hora de verano de Terranova", "AKDT": "hora de verano de Alaska", "HAST": "hora estándar de Hawái-Aleutiano", "HNT": "hora estándar de Terranova", "GYT": "hora de Guyana", "OEZ": "hora estándar de Europa oriental", "LHDT": "hora de verano de Lord Howe", "CLT": "hora estándar de Chile", "EDT": "hora de verano oriental", "MESZ": "hora de verano de Europa central", "WAST": "hora de verano de África occidental", "SRT": "hora de Surinam", "HADT": "hora de verano de Hawái-Aleutiano", "BOT": "hora de Bolivia", "∅∅∅": "hora de verano del Amazonas", "WEZ": "hora estándar de Europa occidental", "ACWDT": "hora de verano de Australia centroccidental", "JST": "hora estándar de Japón", "SAST": "hora de Sudáfrica", "WARST": "hora de verano de Argentina occidental", "BT": "hora de Bután", "AST": "hora estándar del Atlántico", "ACWST": "hora estándar de Australia centroccidental", "WITA": "hora de Indonesia central", "JDT": "hora de verano de Japón", "NZST": "hora estándar de Nueva Zelanda", "COT": "hora estándar de Colombia", "AEST": "hora estándar de Australia oriental", "MYT": "hora de Malasia", "ACST": "hora estándar de Australia central", "CST": "hora estándar central", "PDT": "hora de verano del Pacífico", "MEZ": "hora estándar de Europa central", "COST": "hora de verano de Colombia", "CAT": "hora de África central", "WIT": "hora de Indonesia oriental", "WART": "hora estándar de Argentina occidental", "ECT": "hora de Ecuador", "UYT": "hora estándar de Uruguay", "HKT": "hora estándar de Hong Kong", "TMT": "hora estándar de Turkmenistán", "ChST": "hora estándar de Chamorro", "EAT": "hora de África oriental", "VET": "hora de Venezuela", "WAT": "hora estándar de África occidental", "CLST": "hora de verano de Chile", "AWDT": "hora de verano de Australia occidental", "IST": "hora estándar de la India", "EST": "hora estándar oriental", "UYST": "hora de verano de Uruguay", "MST": "Hora estándar de Macao", "WIB": "hora de Indonesia occidental"},
}
}
diff --git a/es_PE/es_PE_test.go b/es_PE/es_PE_test.go
new file mode 100644
index 00000000..9e17cb61
--- /dev/null
+++ b/es_PE/es_PE_test.go
@@ -0,0 +1,1120 @@
+package es_PE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "es_PE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/es_PH/es_PH.go b/es_PH/es_PH.go
index 6e9dc638..342733f2 100644
--- a/es_PH/es_PH.go
+++ b/es_PH/es_PH.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a. C.", "d. C."},
erasNarrow: []string{"", ""},
erasWide: []string{"antes de Cristo", "después de Cristo"},
- timezones: map[string]string{"VET": "hora de Venezuela", "ADT": "hora de verano del Atlántico", "HKST": "hora de verano de Hong Kong", "WITA": "hora de Indonesia central", "ART": "hora estándar de Argentina", "CLT": "hora estándar de Chile", "WIB": "hora de Indonesia occidental", "CST": "hora estándar central", "BOT": "hora de Bolivia", "SRT": "hora de Surinam", "LHST": "hora estándar de Lord Howe", "HAST": "hora estándar de Hawái-Aleutiano", "HNT": "hora estándar de Terranova", "TMT": "hora estándar de Turkmenistán", "JST": "hora estándar de Japón", "JDT": "hora de verano de Japón", "ECT": "hora de Ecuador", "∅∅∅": "hora de verano del Amazonas", "MDT": "Hora de verano de Macao", "WEZ": "hora estándar de Europa occidental", "EST": "hora estándar oriental", "CHADT": "hora de verano de Chatham", "WESZ": "hora de verano de Europa occidental", "ChST": "hora estándar de Chamorro", "AST": "hora estándar del Atlántico", "GMT": "hora del meridiano de Greenwich", "PST": "hora estándar del Pacífico", "CDT": "hora de verano central", "ACWDT": "hora de verano de Australia centroccidental", "GYT": "hora de Guyana", "AKDT": "hora de verano de Alaska", "CHAST": "hora estándar de Chatham", "WART": "hora estándar de Argentina occidental", "WARST": "hora de verano de Argentina occidental", "TMST": "hora de verano de Turkmenistán", "EAT": "hora de África oriental", "ACDT": "hora de verano de Australia central", "EDT": "hora de verano oriental", "UYST": "hora de verano de Uruguay", "NZST": "hora estándar de Nueva Zelanda", "BT": "hora de Bután", "OEZ": "hora estándar de Europa oriental", "MST": "Hora estándar de Macao", "AWDT": "hora de verano de Australia occidental", "WAST": "hora de verano de África occidental", "GFT": "hora de la Guayana Francesa", "AWST": "hora estándar de Australia occidental", "HADT": "hora de verano de Hawái-Aleutiano", "LHDT": "hora de verano de Lord Howe", "UYT": "hora estándar de Uruguay", "MESZ": "hora de verano de Europa central", "WIT": "hora de Indonesia oriental", "OESZ": "hora de verano de Europa oriental", "ARST": "hora de verano de Argentina", "AKST": "hora estándar de Alaska", "SGT": "hora de Singapur", "PDT": "hora de verano del Pacífico", "AEDT": "hora de verano de Australia oriental", "CAT": "hora de África central", "COST": "hora de verano de Colombia", "HKT": "hora estándar de Hong Kong", "CLST": "hora de verano de Chile", "ACWST": "hora estándar de Australia centroccidental", "NZDT": "hora de verano de Nueva Zelanda", "AEST": "hora estándar de Australia oriental", "SAST": "hora de Sudáfrica", "ACST": "hora estándar de Australia central", "MYT": "hora de Malasia", "MEZ": "hora estándar de Europa central", "WAT": "hora estándar de África occidental", "IST": "hora estándar de la India", "HAT": "hora de verano de Terranova", "COT": "hora estándar de Colombia"},
+ timezones: map[string]string{"LHDT": "hora de verano de Lord Howe", "HKST": "hora de verano de Hong Kong", "AWST": "hora estándar de Australia occidental", "MESZ": "hora de verano de Europa central", "COST": "hora de verano de Colombia", "UYST": "hora de verano de Uruguay", "AST": "hora estándar del Atlántico", "ADT": "hora de verano del Atlántico", "MEZ": "hora estándar de Europa central", "SAST": "hora de Sudáfrica", "HAT": "hora de verano de Terranova", "EAT": "hora de África oriental", "CHAST": "hora estándar de Chatham", "EST": "hora estándar oriental", "WEZ": "hora estándar de Europa occidental", "GYT": "hora de Guyana", "CLT": "hora estándar de Chile", "ACWDT": "hora de verano de Australia centroccidental", "ART": "hora estándar de Argentina", "PDT": "hora de verano del Pacífico", "NZDT": "hora de verano de Nueva Zelanda", "BOT": "hora de Bolivia", "ChST": "hora estándar de Chamorro", "IST": "hora estándar de la India", "WITA": "hora de Indonesia central", "ACWST": "hora estándar de Australia centroccidental", "JDT": "hora de verano de Japón", "GMT": "hora del meridiano de Greenwich", "UYT": "hora estándar de Uruguay", "VET": "hora de Venezuela", "AWDT": "hora de verano de Australia occidental", "HADT": "hora de verano de Hawái-Aleutiano", "OEZ": "hora estándar de Europa oriental", "OESZ": "hora de verano de Europa oriental", "MST": "hora estándar de las Montañas", "MDT": "hora de verano de las Montañas", "AKDT": "hora de verano de Alaska", "PST": "hora estándar del Pacífico", "COT": "hora estándar de Colombia", "CAT": "hora de África central", "WIT": "hora de Indonesia oriental", "WART": "hora estándar de Argentina occidental", "TMST": "hora de verano de Turkmenistán", "WESZ": "hora de verano de Europa occidental", "MYT": "hora de Malasia", "ACST": "hora estándar de Australia central", "WAT": "hora estándar de África occidental", "AEDT": "hora de verano de Australia oriental", "ACDT": "hora de verano de Australia central", "JST": "hora estándar de Japón", "NZST": "hora estándar de Nueva Zelanda", "SGT": "hora de Singapur", "∅∅∅": "hora de verano de Perú", "WARST": "hora de verano de Argentina occidental", "CDT": "hora de verano central", "AKST": "hora estándar de Alaska", "WIB": "hora de Indonesia occidental", "CHADT": "hora de verano de Chatham", "HAST": "hora estándar de Hawái-Aleutiano", "LHST": "hora estándar de Lord Howe", "HNT": "hora estándar de Terranova", "AEST": "hora estándar de Australia oriental", "BT": "hora de Bután", "CLST": "hora de verano de Chile", "CST": "hora estándar central", "GFT": "hora de la Guayana Francesa", "ARST": "hora de verano de Argentina", "WAST": "hora de verano de África occidental", "HKT": "hora estándar de Hong Kong", "EDT": "hora de verano oriental", "TMT": "hora estándar de Turkmenistán", "ECT": "hora de Ecuador", "SRT": "hora de Surinam"},
}
}
diff --git a/es_PH/es_PH_test.go b/es_PH/es_PH_test.go
new file mode 100644
index 00000000..29a9c545
--- /dev/null
+++ b/es_PH/es_PH_test.go
@@ -0,0 +1,1120 @@
+package es_PH
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "es_PH"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/es_PR/es_PR.go b/es_PR/es_PR.go
index bbc481bd..d5d534dc 100644
--- a/es_PR/es_PR.go
+++ b/es_PR/es_PR.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a. C.", "d. C."},
erasNarrow: []string{"", ""},
erasWide: []string{"antes de Cristo", "después de Cristo"},
- timezones: map[string]string{"PDT": "hora de verano del Pacífico", "MESZ": "hora de verano de Europa central", "VET": "hora de Venezuela", "ACWST": "hora estándar de Australia centroccidental", "WITA": "hora de Indonesia central", "ACDT": "hora de verano de Australia central", "MYT": "hora de Malasia", "EDT": "hora de verano oriental", "HKST": "hora de verano de Hong Kong", "LHST": "hora estándar de Lord Howe", "AWDT": "hora de verano de Australia occidental", "AEDT": "hora de verano de Australia oriental", "NZDT": "hora de verano de Nueva Zelanda", "HADT": "hora de verano de Hawái-Aleutiano", "SAST": "hora de Sudáfrica", "TMST": "hora de verano de Turkmenistán", "CST": "hora estándar central", "NZST": "hora estándar de Nueva Zelanda", "LHDT": "hora de verano de Lord Howe", "MEZ": "hora estándar de Europa central", "COT": "hora estándar de Colombia", "JDT": "hora de verano de Japón", "CHAST": "hora estándar de Chatham", "CLST": "hora de verano de Chile", "CAT": "hora de África central", "WART": "hora estándar de Argentina occidental", "HNT": "hora estándar de Terranova", "OESZ": "hora de verano de Europa oriental", "MDT": "Hora de verano de Macao", "WAST": "hora de verano de África occidental", "WAT": "hora estándar de África occidental", "WIB": "hora de Indonesia occidental", "MST": "Hora estándar de Macao", "HKT": "hora estándar de Hong Kong", "IST": "hora estándar de la India", "ACST": "hora estándar de Australia central", "GYT": "hora de Guyana", "CHADT": "hora de verano de Chatham", "HAST": "hora estándar de Hawái-Aleutiano", "BOT": "hora de Bolivia", "WEZ": "hora estándar de Europa occidental", "WESZ": "hora de verano de Europa occidental", "GMT": "hora del meridiano de Greenwich", "ART": "hora estándar de Argentina", "∅∅∅": "hora de verano del Amazonas", "OEZ": "hora estándar de Europa oriental", "ARST": "hora de verano de Argentina", "AST": "hora estándar del Atlántico", "BT": "hora de Bután", "WIT": "hora de Indonesia oriental", "JST": "hora estándar de Japón", "ACWDT": "hora de verano de Australia centroccidental", "CDT": "hora de verano central", "ChST": "hora estándar de Chamorro", "CLT": "hora estándar de Chile", "COST": "hora de verano de Colombia", "ADT": "hora de verano del Atlántico", "TMT": "hora estándar de Turkmenistán", "SRT": "hora de Surinam", "AKST": "hora estándar de Alaska", "WARST": "hora de verano de Argentina occidental", "EAT": "hora de África oriental", "UYST": "hora de verano de Uruguay", "HAT": "hora de verano de Terranova", "GFT": "hora de la Guayana Francesa", "UYT": "hora estándar de Uruguay", "SGT": "hora de Singapur", "AKDT": "hora de verano de Alaska", "PST": "hora estándar del Pacífico", "EST": "hora estándar oriental", "AWST": "hora estándar de Australia occidental", "AEST": "hora estándar de Australia oriental", "ECT": "hora de Ecuador"},
+ timezones: map[string]string{"JDT": "hora de verano de Japón", "HAST": "hora estándar de Hawái-Aleutiano", "WIT": "hora de Indonesia oriental", "MST": "Hora estándar de Macao", "JST": "hora estándar de Japón", "CAT": "hora de África central", "HAT": "hora de verano de Terranova", "HKST": "hora de verano de Hong Kong", "ART": "hora estándar de Argentina", "TMT": "hora estándar de Turkmenistán", "AST": "hora estándar del Atlántico", "ADT": "hora de verano del Atlántico", "HADT": "hora de verano de Hawái-Aleutiano", "IST": "hora estándar de la India", "WESZ": "hora de verano de Europa occidental", "WARST": "hora de verano de Argentina occidental", "GFT": "hora de la Guayana Francesa", "∅∅∅": "hora de verano de las Azores", "OEZ": "hora estándar de Europa oriental", "LHDT": "hora de verano de Lord Howe", "MYT": "hora de Malasia", "ACDT": "hora de verano de Australia central", "HKT": "hora estándar de Hong Kong", "WAST": "hora de verano de África occidental", "ChST": "hora estándar de Chamorro", "UYST": "hora de verano de Uruguay", "MDT": "Hora de verano de Macao", "CHAST": "hora estándar de Chatham", "SGT": "hora de Singapur", "COT": "hora estándar de Colombia", "CLST": "hora de verano de Chile", "CHADT": "hora de verano de Chatham", "BOT": "hora de Bolivia", "EST": "hora estándar oriental", "GYT": "hora de Guyana", "AKDT": "hora de verano de Alaska", "ACWDT": "hora de verano de Australia centroccidental", "COST": "hora de verano de Colombia", "GMT": "hora del meridiano de Greenwich", "ECT": "hora de Ecuador", "MEZ": "hora estándar de Europa central", "MESZ": "hora de verano de Europa central", "WAT": "hora estándar de África occidental", "AEST": "hora estándar de Australia oriental", "AWST": "hora estándar de Australia occidental", "PST": "hora estándar del Pacífico", "OESZ": "hora de verano de Europa oriental", "CST": "hora estándar central", "CDT": "hora de verano central", "VET": "hora de Venezuela", "AWDT": "hora de verano de Australia occidental", "NZDT": "hora de verano de Nueva Zelanda", "EDT": "hora de verano oriental", "PDT": "hora de verano del Pacífico", "SRT": "hora de Surinam", "AKST": "hora estándar de Alaska", "ACWST": "hora estándar de Australia centroccidental", "UYT": "hora estándar de Uruguay", "BT": "hora de Bután", "LHST": "hora estándar de Lord Howe", "WART": "hora estándar de Argentina occidental", "ARST": "hora de verano de Argentina", "WIB": "hora de Indonesia occidental", "HNT": "hora estándar de Terranova", "AEDT": "hora de verano de Australia oriental", "ACST": "hora estándar de Australia central", "WITA": "hora de Indonesia central", "NZST": "hora estándar de Nueva Zelanda", "CLT": "hora estándar de Chile", "EAT": "hora de África oriental", "SAST": "hora de Sudáfrica", "TMST": "hora de verano de Turkmenistán", "WEZ": "hora estándar de Europa occidental"},
}
}
diff --git a/es_PR/es_PR_test.go b/es_PR/es_PR_test.go
new file mode 100644
index 00000000..f2681518
--- /dev/null
+++ b/es_PR/es_PR_test.go
@@ -0,0 +1,1120 @@
+package es_PR
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "es_PR"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/es_PY/es_PY.go b/es_PY/es_PY.go
index 52874daf..ca0c364f 100644
--- a/es_PY/es_PY.go
+++ b/es_PY/es_PY.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a. C.", "d. C."},
erasNarrow: []string{"", ""},
erasWide: []string{"antes de Cristo", "después de Cristo"},
- timezones: map[string]string{"HKST": "hora de verano de Hong Kong", "CLST": "hora de verano de Chile", "ACWST": "hora estándar de Australia centroccidental", "HAST": "hora estándar de Hawái-Aleutiano", "HADT": "hora de verano de Hawái-Aleutiano", "WITA": "hora de Indonesia central", "JDT": "hora de verano de Japón", "LHST": "hora estándar de Lord Howe", "ARST": "hora de verano de Argentina", "WART": "hora estándar de Argentina occidental", "AKDT": "hora de verano de Alaska", "PDT": "hora de verano del Pacífico", "CDT": "hora de verano central", "BOT": "hora de Bolivia", "UYST": "hora de verano de Uruguay", "TMST": "hora de verano de Turkmenistán", "MST": "Hora estándar de Macao", "MYT": "hora de Malasia", "HKT": "hora estándar de Hong Kong", "WEZ": "hora estándar de Europa occidental", "ECT": "hora de Ecuador", "WAT": "hora estándar de África occidental", "AEDT": "hora de verano de Australia oriental", "CAT": "hora de África central", "COT": "hora estándar de Colombia", "ADT": "hora de verano del Atlántico", "GMT": "hora del meridiano de Greenwich", "UYT": "hora estándar de Uruguay", "CHAST": "hora estándar de Chatham", "EDT": "hora de verano oriental", "WARST": "hora de verano de Argentina occidental", "SRT": "hora de Surinam", "NZST": "hora estándar de Nueva Zelanda", "CLT": "hora estándar de Chile", "AWDT": "hora de verano de Australia occidental", "AEST": "hora estándar de Australia oriental", "AST": "hora estándar del Atlántico", "HAT": "hora de verano de Terranova", "MDT": "Hora de verano de Macao", "JST": "hora estándar de Japón", "OESZ": "hora de verano de Europa oriental", "HNT": "hora estándar de Terranova", "AWST": "hora estándar de Australia occidental", "VET": "hora de Venezuela", "ART": "hora estándar de Argentina", "GYT": "hora de Guyana", "MESZ": "hora de verano de Europa central", "WIB": "hora de Indonesia occidental", "TMT": "hora estándar de Turkmenistán", "CHADT": "hora de verano de Chatham", "AKST": "hora estándar de Alaska", "PST": "hora estándar del Pacífico", "ACWDT": "hora de verano de Australia centroccidental", "COST": "hora de verano de Colombia", "SAST": "hora de Sudáfrica", "OEZ": "hora estándar de Europa oriental", "ACST": "hora estándar de Australia central", "ACDT": "hora de verano de Australia central", "CST": "hora estándar central", "NZDT": "hora de verano de Nueva Zelanda", "WESZ": "hora de verano de Europa occidental", "EST": "hora estándar oriental", "WAST": "hora de verano de África occidental", "WIT": "hora de Indonesia oriental", "GFT": "hora de la Guayana Francesa", "EAT": "hora de África oriental", "ChST": "hora estándar de Chamorro", "SGT": "hora de Singapur", "∅∅∅": "hora de verano del Amazonas", "LHDT": "hora de verano de Lord Howe", "MEZ": "hora estándar de Europa central", "IST": "hora estándar de la India", "BT": "hora de Bután"},
+ timezones: map[string]string{"MESZ": "hora de verano de Europa central", "WESZ": "hora de verano de Europa occidental", "ACST": "hora estándar de Australia central", "CHADT": "hora de verano de Chatham", "ART": "hora estándar de Argentina", "WAST": "hora de verano de África occidental", "CAT": "hora de África central", "ChST": "hora estándar de Chamorro", "WARST": "hora de verano de Argentina occidental", "VET": "hora de Venezuela", "COST": "hora de verano de Colombia", "GMT": "hora del meridiano de Greenwich", "OEZ": "hora estándar de Europa oriental", "CST": "hora estándar central", "HAT": "hora de verano de Terranova", "OESZ": "hora de verano de Europa oriental", "ACWST": "hora estándar de Australia centroccidental", "EDT": "hora de verano oriental", "HADT": "hora de verano de Hawái-Aleutiano", "NZST": "hora estándar de Nueva Zelanda", "COT": "hora estándar de Colombia", "TMT": "hora estándar de Turkmenistán", "AEST": "hora estándar de Australia oriental", "LHDT": "hora de verano de Lord Howe", "IST": "hora estándar de la India", "UYST": "hora de verano de Uruguay", "ACWDT": "hora de verano de Australia centroccidental", "SAST": "hora de Sudáfrica", "WAT": "hora estándar de África occidental", "WIB": "hora de Indonesia occidental", "GYT": "hora de Guyana", "HKST": "hora de verano de Hong Kong", "MST": "Hora estándar de Macao", "ADT": "hora de verano del Atlántico", "CDT": "hora de verano central", "GFT": "hora de la Guayana Francesa", "ECT": "hora de Ecuador", "WEZ": "hora estándar de Europa occidental", "CLT": "hora estándar de Chile", "MEZ": "hora estándar de Europa central", "JDT": "hora de verano de Japón", "NZDT": "hora de verano de Nueva Zelanda", "HNT": "hora estándar de Terranova", "BT": "hora de Bután", "JST": "hora estándar de Japón", "AWST": "hora estándar de Australia occidental", "AKST": "hora estándar de Alaska", "EST": "hora estándar oriental", "HAST": "hora estándar de Hawái-Aleutiano", "ACDT": "hora de verano de Australia central", "WART": "hora estándar de Argentina occidental", "CHAST": "hora estándar de Chatham", "PST": "hora estándar del Pacífico", "PDT": "hora de verano del Pacífico", "BOT": "hora de Bolivia", "SGT": "hora de Singapur", "WIT": "hora de Indonesia oriental", "MDT": "Hora de verano de Macao", "AST": "hora estándar del Atlántico", "ARST": "hora de verano de Argentina", "TMST": "hora de verano de Turkmenistán", "MYT": "hora de Malasia", "CLST": "hora de verano de Chile", "HKT": "hora estándar de Hong Kong", "WITA": "hora de Indonesia central", "∅∅∅": "hora de verano del Amazonas", "AEDT": "hora de verano de Australia oriental", "LHST": "hora estándar de Lord Howe", "UYT": "hora estándar de Uruguay", "EAT": "hora de África oriental", "SRT": "hora de Surinam", "AWDT": "hora de verano de Australia occidental", "AKDT": "hora de verano de Alaska"},
}
}
diff --git a/es_PY/es_PY_test.go b/es_PY/es_PY_test.go
new file mode 100644
index 00000000..9e7b14d5
--- /dev/null
+++ b/es_PY/es_PY_test.go
@@ -0,0 +1,1120 @@
+package es_PY
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "es_PY"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/es_SV/es_SV.go b/es_SV/es_SV.go
index 15fdd886..bdf46eab 100644
--- a/es_SV/es_SV.go
+++ b/es_SV/es_SV.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a. C.", "d. C."},
erasNarrow: []string{"", ""},
erasWide: []string{"antes de Cristo", "después de Cristo"},
- timezones: map[string]string{"WIT": "hora de Indonesia oriental", "CHAST": "hora estándar de Chatham", "CLT": "hora estándar de Chile", "TMST": "hora de verano de Turkmenistán", "ECT": "hora de Ecuador", "WIB": "hora de Indonesia occidental", "COT": "hora estándar de Colombia", "HKST": "hora de verano de Hong Kong", "AWDT": "hora de verano de Australia occidental", "CST": "hora estándar central", "NZST": "hora estándar de Nueva Zelanda", "AEST": "hora estándar de Australia oriental", "∅∅∅": "hora de verano de Brasilia", "CDT": "hora de verano central", "GFT": "hora de la Guayana Francesa", "LHST": "hora estándar de Lord Howe", "AWST": "hora estándar de Australia occidental", "ARST": "hora de verano de Argentina", "JDT": "hora de verano de Japón", "PST": "hora estándar del Pacífico", "HNT": "hora estándar de Terranova", "EAT": "hora de África oriental", "AEDT": "hora de verano de Australia oriental", "ChST": "hora estándar de Chamorro", "SAST": "hora de Sudáfrica", "HKT": "hora estándar de Hong Kong", "GMT": "hora del meridiano de Greenwich", "ACST": "hora estándar de Australia central", "MST": "hora estándar de las Montañas", "CLST": "hora de verano de Chile", "SRT": "hora de Surinam", "BOT": "hora de Bolivia", "GYT": "hora de Guyana", "JST": "hora estándar de Japón", "ACDT": "hora de verano de Australia central", "EDT": "hora de verano oriental", "WART": "hora estándar de Argentina occidental", "WAT": "hora estándar de África occidental", "UYT": "hora estándar de Uruguay", "ACWDT": "hora de verano de Australia centroccidental", "HAST": "hora estándar de Hawái-Aleutiano", "COST": "hora de verano de Colombia", "ADT": "hora de verano del Atlántico", "OEZ": "hora estándar de Europa oriental", "OESZ": "hora de verano de Europa oriental", "TMT": "hora estándar de Turkmenistán", "LHDT": "hora de verano de Lord Howe", "CAT": "hora de África central", "EST": "hora estándar oriental", "MESZ": "hora de verano de Europa central", "PDT": "hora de verano del Pacífico", "NZDT": "hora de verano de Nueva Zelanda", "HADT": "hora de verano de Hawái-Aleutiano", "AKDT": "hora de verano de Alaska", "WITA": "hora de Indonesia central", "IST": "hora estándar de la India", "ART": "hora estándar de Argentina", "MYT": "hora de Malasia", "UYST": "hora de verano de Uruguay", "VET": "hora de Venezuela", "ACWST": "hora estándar de Australia centroccidental", "WEZ": "hora estándar de Europa occidental", "MEZ": "hora estándar de Europa central", "HAT": "hora de verano de Terranova", "AKST": "hora estándar de Alaska", "CHADT": "hora de verano de Chatham", "AST": "hora estándar del Atlántico", "SGT": "hora de Singapur", "WARST": "hora de verano de Argentina occidental", "WAST": "hora de verano de África occidental", "BT": "hora de Bután", "MDT": "hora de verano de las Montañas", "WESZ": "hora de verano de Europa occidental"},
+ timezones: map[string]string{"EDT": "hora de verano oriental", "TMST": "hora de verano de Turkmenistán", "LHST": "hora estándar de Lord Howe", "WARST": "hora de verano de Argentina occidental", "HKT": "hora estándar de Hong Kong", "VET": "hora de Venezuela", "GMT": "hora del meridiano de Greenwich", "AEST": "hora estándar de Australia oriental", "BT": "hora de Bután", "PST": "hora estándar del Pacífico", "MEZ": "hora estándar de Europa central", "BOT": "hora de Bolivia", "WAT": "hora estándar de África occidental", "HNT": "hora estándar de Terranova", "COST": "hora de verano de Colombia", "AKST": "hora estándar de Alaska", "JST": "hora estándar de Japón", "WESZ": "hora de verano de Europa occidental", "SGT": "hora de Singapur", "TMT": "hora estándar de Turkmenistán", "EAT": "hora de África oriental", "UYT": "hora estándar de Uruguay", "ACWDT": "hora de verano de Australia centroccidental", "ART": "hora estándar de Argentina", "CDT": "hora de verano central", "ACST": "hora estándar de Australia central", "AKDT": "hora de verano de Alaska", "ACWST": "hora estándar de Australia centroccidental", "AWDT": "hora de verano de Australia occidental", "AEDT": "hora de verano de Australia oriental", "UYST": "hora de verano de Uruguay", "ACDT": "hora de verano de Australia central", "HKST": "hora de verano de Hong Kong", "MYT": "hora de Malasia", "CST": "hora estándar central", "SRT": "hora de Surinam", "ARST": "hora de verano de Argentina", "EST": "hora estándar oriental", "WIB": "hora de Indonesia occidental", "GYT": "hora de Guyana", "ADT": "hora de verano del Atlántico", "CLT": "hora estándar de Chile", "ECT": "hora de Ecuador", "WAST": "hora de verano de África occidental", "HAT": "hora de verano de Terranova", "CLST": "hora de verano de Chile", "MST": "Hora estándar de Macao", "MDT": "Hora de verano de Macao", "AWST": "hora estándar de Australia occidental", "WART": "hora estándar de Argentina occidental", "AST": "hora estándar del Atlántico", "SAST": "hora de Sudáfrica", "MESZ": "hora de verano de Europa central", "HADT": "hora de verano de Hawái-Aleutiano", "COT": "hora estándar de Colombia", "OESZ": "hora de verano de Europa oriental", "∅∅∅": "hora de verano de las Azores", "CHADT": "hora de verano de Chatham", "NZDT": "hora de verano de Nueva Zelanda", "LHDT": "hora de verano de Lord Howe", "JDT": "hora de verano de Japón", "HAST": "hora estándar de Hawái-Aleutiano", "CAT": "hora de África central", "GFT": "hora de la Guayana Francesa", "CHAST": "hora estándar de Chatham", "WITA": "hora de Indonesia central", "NZST": "hora estándar de Nueva Zelanda", "WEZ": "hora estándar de Europa occidental", "OEZ": "hora estándar de Europa oriental", "IST": "hora estándar de la India", "PDT": "hora de verano del Pacífico", "ChST": "hora estándar de Chamorro", "WIT": "hora de Indonesia oriental"},
}
}
diff --git a/es_SV/es_SV_test.go b/es_SV/es_SV_test.go
new file mode 100644
index 00000000..cb55eb8f
--- /dev/null
+++ b/es_SV/es_SV_test.go
@@ -0,0 +1,1120 @@
+package es_SV
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "es_SV"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/es_US/es_US.go b/es_US/es_US.go
index 926a4073..c3b0bbda 100644
--- a/es_US/es_US.go
+++ b/es_US/es_US.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a. C.", "d. C."},
erasNarrow: []string{"", ""},
erasWide: []string{"antes de Cristo", "después de Cristo"},
- timezones: map[string]string{"WIB": "hora de Indonesia occidental", "IST": "hora estándar de la India", "OEZ": "hora estándar de Europa oriental", "ACST": "hora estándar de Australia central", "WART": "hora estándar de Argentina occidental", "WAT": "hora estándar de África occidental", "ART": "hora estándar de Argentina", "WIT": "hora de Indonesia oriental", "OESZ": "hora de verano de Europa oriental", "PST": "hora estándar del Pacífico", "CLT": "hora estándar de Chile", "AEDT": "hora de verano de Australia oriental", "COST": "hora de verano de Colombia", "BT": "hora de Bután", "AST": "hora estándar del Atlántico", "GYT": "hora de Guyana", "CHADT": "hora de verano de Chatham", "WEZ": "hora estándar de Europa occidental", "GMT": "hora del meridiano de Greenwich", "MESZ": "hora de verano de Europa central", "PDT": "hora de verano del Pacífico", "AWDT": "hora de verano de Australia occidental", "NZDT": "hora de verano de Nueva Zelanda", "MST": "hora estándar de las Montañas", "CHAST": "hora estándar de Chatham", "CLST": "hora de verano de Chile", "ECT": "hora de Ecuador", "HAT": "hora de verano de Terranova", "TMT": "hora estándar de Turkmenistán", "LHDT": "hora de verano de Lord Howe", "VET": "hora de Venezuela", "ACWDT": "hora de verano de Australia centroccidental", "WARST": "hora de verano de Argentina occidental", "WITA": "hora de Indonesia central", "BOT": "hora de Bolivia", "AEST": "hora estándar de Australia oriental", "HAST": "hora estándar de Hawái-Aleutiano", "LHST": "hora estándar de Lord Howe", "MEZ": "hora estándar de Europa central", "ADT": "hora de verano del Atlántico", "HKT": "hora estándar de Hong Kong", "SRT": "hora de Surinam", "UYST": "hora de verano de Uruguay", "NZST": "hora estándar de Nueva Zelanda", "CAT": "hora de África central", "HADT": "hora de verano de Hawái-Aleutiano", "JDT": "hora de verano de Japón", "UYT": "hora estándar de Uruguay", "ACDT": "hora de verano de Australia central", "ARST": "hora de verano de Argentina", "CDT": "hora de verano central", "WESZ": "hora de verano de Europa occidental", "EDT": "hora de verano oriental", "GFT": "hora de la Guayana Francesa", "TMST": "hora de verano de Turkmenistán", "ACWST": "hora estándar de Australia centroccidental", "HNT": "hora estándar de Terranova", "MYT": "hora de Malasia", "SAST": "hora de Sudáfrica", "HKST": "hora de verano de Hong Kong", "CST": "hora estándar central", "AWST": "hora estándar de Australia occidental", "∅∅∅": "hora de verano de Brasilia", "EST": "hora estándar oriental", "WAST": "hora de verano de África occidental", "JST": "hora estándar de Japón", "ChST": "hora estándar de Chamorro", "COT": "hora estándar de Colombia", "SGT": "hora de Singapur", "AKST": "hora estándar de Alaska", "MDT": "hora de verano de las Montañas", "EAT": "hora de África oriental", "AKDT": "hora de verano de Alaska"},
+ timezones: map[string]string{"CHADT": "hora de verano de Chatham", "LHDT": "hora de verano de Lord Howe", "EST": "hora estándar oriental", "WESZ": "hora de verano de Europa occidental", "COT": "hora estándar de Colombia", "ChST": "hora estándar de Chamorro", "LHST": "hora estándar de Lord Howe", "ACDT": "hora de verano de Australia central", "VET": "hora de Venezuela", "JDT": "hora de verano de Japón", "WAT": "hora estándar de África occidental", "COST": "hora de verano de Colombia", "ACST": "hora estándar de Australia central", "AST": "hora estándar del Atlántico", "HNT": "hora estándar de Terranova", "HKST": "hora de verano de Hong Kong", "ADT": "hora de verano del Atlántico", "AKST": "hora estándar de Alaska", "EDT": "hora de verano oriental", "PST": "hora estándar del Pacífico", "CST": "hora estándar central", "HKT": "hora estándar de Hong Kong", "NZST": "hora estándar de Nueva Zelanda", "GMT": "hora del meridiano de Greenwich", "AEST": "hora estándar de Australia oriental", "GFT": "hora de la Guayana Francesa", "PDT": "hora de verano del Pacífico", "WAST": "hora de verano de África occidental", "ACWDT": "hora de verano de Australia centroccidental", "SRT": "hora de Surinam", "CHAST": "hora estándar de Chatham", "HADT": "hora de verano de Hawái-Aleutiano", "WEZ": "hora estándar de Europa occidental", "TMST": "hora de verano de Turkmenistán", "GYT": "hora de Guyana", "OEZ": "hora estándar de Europa oriental", "EAT": "hora de África oriental", "ACWST": "hora estándar de Australia centroccidental", "WIB": "hora de Indonesia occidental", "CAT": "hora de África central", "UYT": "hora estándar de Uruguay", "WIT": "hora de Indonesia oriental", "ECT": "hora de Ecuador", "MEZ": "hora estándar de Europa central", "AEDT": "hora de verano de Australia oriental", "CLST": "hora de verano de Chile", "MYT": "hora de Malasia", "UYST": "hora de verano de Uruguay", "CDT": "hora de verano central", "WITA": "hora de Indonesia central", "MDT": "hora de verano de las Montañas", "JST": "hora estándar de Japón", "TMT": "hora estándar de Turkmenistán", "OESZ": "hora de verano de Europa oriental", "WART": "hora estándar de Argentina occidental", "HAST": "hora estándar de Hawái-Aleutiano", "SGT": "hora de Singapur", "AWDT": "hora de verano de Australia occidental", "CLT": "hora estándar de Chile", "AKDT": "hora de verano de Alaska", "IST": "hora estándar de la India", "NZDT": "hora de verano de Nueva Zelanda", "BOT": "hora de Bolivia", "BT": "hora de Bután", "ARST": "hora de verano de Argentina", "MESZ": "hora de verano de Europa central", "SAST": "hora de Sudáfrica", "HAT": "hora de verano de Terranova", "WARST": "hora de verano de Argentina occidental", "∅∅∅": "hora de verano de Perú", "AWST": "hora estándar de Australia occidental", "ART": "hora estándar de Argentina", "MST": "hora estándar de las Montañas"},
}
}
diff --git a/es_US/es_US_test.go b/es_US/es_US_test.go
new file mode 100644
index 00000000..93fd0026
--- /dev/null
+++ b/es_US/es_US_test.go
@@ -0,0 +1,1120 @@
+package es_US
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "es_US"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/es_UY/es_UY.go b/es_UY/es_UY.go
index f61069c9..f986bcc2 100644
--- a/es_UY/es_UY.go
+++ b/es_UY/es_UY.go
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a. C.", "d. C."},
erasNarrow: []string{"", ""},
erasWide: []string{"antes de Cristo", "después de Cristo"},
- timezones: map[string]string{"BOT": "hora de Bolivia", "AST": "hora estándar del Atlántico", "TMST": "hora de verano de Turkmenistán", "LHST": "hora estándar de Lord Howe", "PDT": "hora de verano del Pacífico", "NZST": "hora estándar de Nueva Zelanda", "HKST": "hora de verano de Hong Kong", "WIB": "hora de Indonesia occidental", "EAT": "hora de África oriental", "NZDT": "hora de verano de Nueva Zelanda", "CDT": "hora de verano central", "WART": "hora estándar de Argentina occidental", "WARST": "hora de verano de Argentina occidental", "IST": "hora estándar de la India", "ART": "hora estándar de Argentina", "UYT": "hora estándar de Uruguay", "VET": "hora de Venezuela", "HKT": "hora estándar de Hong Kong", "HAT": "hora de verano de Terranova", "ACDT": "hora de verano de Australia central", "LHDT": "hora de verano de Lord Howe", "COT": "hora estándar de Colombia", "HADT": "hora de verano de Hawái-Aleutiano", "MDT": "Hora de verano de Macao", "AWST": "hora estándar de Australia occidental", "GYT": "hora de Guyana", "CST": "hora estándar central", "AWDT": "hora de verano de Australia occidental", "CHADT": "hora de verano de Chatham", "GMT": "hora del meridiano de Greenwich", "HNT": "hora estándar de Terranova", "OEZ": "hora estándar de Europa oriental", "MYT": "hora de Malasia", "CLT": "hora estándar de Chile", "ADT": "hora de verano del Atlántico", "SAST": "hora de Sudáfrica", "ACST": "hora estándar de Australia central", "MST": "Hora estándar de Macao", "CHAST": "hora estándar de Chatham", "GFT": "hora de la Guayana Francesa", "SRT": "hora de Surinam", "AEST": "hora estándar de Australia oriental", "SGT": "hora de Singapur", "HAST": "hora estándar de Hawái-Aleutiano", "WITA": "hora de Indonesia central", "ARST": "hora de verano de Argentina", "AKDT": "hora de verano de Alaska", "MEZ": "hora estándar de Europa central", "BT": "hora de Bután", "EDT": "hora de verano oriental", "∅∅∅": "hora de verano del Amazonas", "UYST": "hora de verano de Uruguay", "ACWST": "hora estándar de Australia centroccidental", "CAT": "hora de África central", "ACWDT": "hora de verano de Australia centroccidental", "MESZ": "hora de verano de Europa central", "AEDT": "hora de verano de Australia oriental", "WESZ": "hora de verano de Europa occidental", "COST": "hora de verano de Colombia", "WAT": "hora estándar de África occidental", "OESZ": "hora de verano de Europa oriental", "TMT": "hora estándar de Turkmenistán", "JDT": "hora de verano de Japón", "EST": "hora estándar oriental", "CLST": "hora de verano de Chile", "WEZ": "hora estándar de Europa occidental", "WAST": "hora de verano de África occidental", "WIT": "hora de Indonesia oriental", "JST": "hora estándar de Japón", "AKST": "hora estándar de Alaska", "PST": "hora estándar del Pacífico", "ChST": "hora estándar de Chamorro", "ECT": "hora de Ecuador"},
+ timezones: map[string]string{"GMT": "hora del meridiano de Greenwich", "AEDT": "hora de verano de Australia oriental", "AKDT": "hora de verano de Alaska", "AWST": "hora estándar de Australia occidental", "WIB": "hora de Indonesia occidental", "AST": "hora estándar del Atlántico", "PST": "hora estándar del Pacífico", "WESZ": "hora de verano de Europa occidental", "GYT": "hora de Guyana", "OESZ": "hora de verano de Europa oriental", "CLST": "hora de verano de Chile", "MDT": "Hora de verano de Macao", "EDT": "hora de verano oriental", "ECT": "hora de Ecuador", "NZDT": "hora de verano de Nueva Zelanda", "HNT": "hora estándar de Terranova", "AEST": "hora estándar de Australia oriental", "LHST": "hora estándar de Lord Howe", "ACST": "hora estándar de Australia central", "CHADT": "hora de verano de Chatham", "MST": "Hora estándar de Macao", "WITA": "hora de Indonesia central", "NZST": "hora estándar de Nueva Zelanda", "COST": "hora de verano de Colombia", "HAT": "hora de verano de Terranova", "CST": "hora estándar central", "WART": "hora estándar de Argentina occidental", "COT": "hora estándar de Colombia", "∅∅∅": "hora de verano de las Azores", "HAST": "hora estándar de Hawái-Aleutiano", "SGT": "hora de Singapur", "TMST": "hora de verano de Turkmenistán", "ChST": "hora estándar de Chamorro", "ACWST": "hora estándar de Australia centroccidental", "SAST": "hora de Sudáfrica", "ARST": "hora de verano de Argentina", "TMT": "hora estándar de Turkmenistán", "MYT": "hora de Malasia", "WARST": "hora de verano de Argentina occidental", "HKT": "hora estándar de Hong Kong", "WIT": "hora de Indonesia oriental", "LHDT": "hora de verano de Lord Howe", "ACWDT": "hora de verano de Australia centroccidental", "UYST": "hora de verano de Uruguay", "IST": "hora estándar de la India", "WAST": "hora de verano de África occidental", "BT": "hora de Bután", "HKST": "hora de verano de Hong Kong", "CHAST": "hora estándar de Chatham", "EAT": "hora de África oriental", "AKST": "hora estándar de Alaska", "AWDT": "hora de verano de Australia occidental", "MEZ": "hora estándar de Europa central", "UYT": "hora estándar de Uruguay", "CDT": "hora de verano central", "ACDT": "hora de verano de Australia central", "WEZ": "hora estándar de Europa occidental", "CLT": "hora estándar de Chile", "EST": "hora estándar oriental", "PDT": "hora de verano del Pacífico", "HADT": "hora de verano de Hawái-Aleutiano", "BOT": "hora de Bolivia", "WAT": "hora estándar de África occidental", "GFT": "hora de la Guayana Francesa", "JST": "hora estándar de Japón", "MESZ": "hora de verano de Europa central", "CAT": "hora de África central", "ART": "hora estándar de Argentina", "JDT": "hora de verano de Japón", "ADT": "hora de verano del Atlántico", "OEZ": "hora estándar de Europa oriental", "SRT": "hora de Surinam", "VET": "hora de Venezuela"},
}
}
diff --git a/es_UY/es_UY_test.go b/es_UY/es_UY_test.go
new file mode 100644
index 00000000..bcec99e6
--- /dev/null
+++ b/es_UY/es_UY_test.go
@@ -0,0 +1,1120 @@
+package es_UY
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "es_UY"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/es_VE/es_VE.go b/es_VE/es_VE.go
index daa5f7a7..e7fc1c11 100644
--- a/es_VE/es_VE.go
+++ b/es_VE/es_VE.go
@@ -69,7 +69,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a. C.", "d. C."},
erasNarrow: []string{"", ""},
erasWide: []string{"antes de Cristo", "después de Cristo"},
- timezones: map[string]string{"CST": "hora estándar central", "BT": "hora de Bután", "CHADT": "hora de verano de Chatham", "WARST": "hora de verano de Argentina occidental", "PDT": "hora de verano del Pacífico", "CDT": "hora de verano central", "MEZ": "hora estándar de Europa central", "MST": "hora estándar de las Montañas", "∅∅∅": "hora de verano de Brasilia", "EDT": "hora de verano oriental", "IST": "hora estándar de la India", "TMT": "hora estándar de Turkmenistán", "LHST": "hora estándar de Lord Howe", "LHDT": "hora de verano de Lord Howe", "JDT": "hora de verano de Japón", "HKT": "hora estándar de Hong Kong", "WITA": "hora de Indonesia central", "WIB": "hora de Indonesia occidental", "SGT": "hora de Singapur", "OEZ": "hora estándar de Europa oriental", "GYT": "hora de Guyana", "MDT": "hora de verano de las Montañas", "WESZ": "hora de verano de Europa occidental", "HADT": "hora de verano de Hawái-Aleutiano", "NZDT": "hora de verano de Nueva Zelanda", "WAST": "hora de verano de África occidental", "AKST": "hora estándar de Alaska", "VET": "hora de Venezuela", "ACWDT": "hora de verano de Australia centroccidental", "HKST": "hora de verano de Hong Kong", "WAT": "hora estándar de África occidental", "UYT": "hora estándar de Uruguay", "CLT": "hora estándar de Chile", "CLST": "hora de verano de Chile", "PST": "hora estándar del Pacífico", "WEZ": "hora estándar de Europa occidental", "AEST": "hora estándar de Australia oriental", "WIT": "hora de Indonesia oriental", "ARST": "hora de verano de Argentina", "ACDT": "hora de verano de Australia central", "AEDT": "hora de verano de Australia oriental", "HAST": "hora estándar de Hawái-Aleutiano", "HAT": "hora de verano de Terranova", "HNT": "hora estándar de Terranova", "SAST": "hora de Sudáfrica", "EAT": "hora de África oriental", "ACST": "hora estándar de Australia central", "SRT": "hora de Surinam", "BOT": "hora de Bolivia", "ACWST": "hora estándar de Australia centroccidental", "COST": "hora de verano de Colombia", "WART": "hora estándar de Argentina occidental", "TMST": "hora de verano de Turkmenistán", "MYT": "hora de Malasia", "UYST": "hora de verano de Uruguay", "MESZ": "hora de verano de Europa central", "ADT": "hora de verano del Atlántico", "COT": "hora estándar de Colombia", "GMT": "hora del meridiano de Greenwich", "JST": "hora estándar de Japón", "AWST": "hora estándar de Australia occidental", "CHAST": "hora estándar de Chatham", "ECT": "hora de Ecuador", "OESZ": "hora de verano de Europa oriental", "AWDT": "hora de verano de Australia occidental", "ChST": "hora estándar de Chamorro", "GFT": "hora de la Guayana Francesa", "ART": "hora estándar de Argentina", "AST": "hora estándar del Atlántico", "AKDT": "hora de verano de Alaska", "NZST": "hora estándar de Nueva Zelanda", "CAT": "hora de África central", "EST": "hora estándar oriental"},
+ timezones: map[string]string{"WIT": "hora de Indonesia oriental", "EAT": "hora de África oriental", "WAT": "hora estándar de África occidental", "UYT": "hora estándar de Uruguay", "VET": "hora de Venezuela", "MESZ": "hora de verano de Europa central", "CHAST": "hora estándar de Chatham", "ARST": "hora de verano de Argentina", "WITA": "hora de Indonesia central", "AKST": "hora estándar de Alaska", "AKDT": "hora de verano de Alaska", "MEZ": "hora estándar de Europa central", "NZDT": "hora de verano de Nueva Zelanda", "GMT": "hora del meridiano de Greenwich", "ACWDT": "hora de verano de Australia centroccidental", "NZST": "hora estándar de Nueva Zelanda", "COT": "hora estándar de Colombia", "WIB": "hora de Indonesia occidental", "AWST": "hora estándar de Australia occidental", "JST": "hora estándar de Japón", "BOT": "hora de Bolivia", "ChST": "hora estándar de Chamorro", "GYT": "hora de Guyana", "ADT": "hora de verano del Atlántico", "LHDT": "hora de verano de Lord Howe", "MST": "hora estándar de las Montañas", "MYT": "hora de Malasia", "WARST": "hora de verano de Argentina occidental", "HAST": "hora estándar de Hawái-Aleutiano", "TMT": "hora estándar de Turkmenistán", "LHST": "hora estándar de Lord Howe", "∅∅∅": "hora de verano de Perú", "GFT": "hora de la Guayana Francesa", "HKT": "hora estándar de Hong Kong", "PDT": "hora de verano del Pacífico", "WAST": "hora de verano de África occidental", "COST": "hora de verano de Colombia", "CLST": "hora de verano de Chile", "WEZ": "hora estándar de Europa occidental", "ACST": "hora estándar de Australia central", "HKST": "hora de verano de Hong Kong", "AWDT": "hora de verano de Australia occidental", "HNT": "hora estándar de Terranova", "TMST": "hora de verano de Turkmenistán", "ACDT": "hora de verano de Australia central", "CST": "hora estándar central", "AEDT": "hora de verano de Australia oriental", "UYST": "hora de verano de Uruguay", "IST": "hora estándar de la India", "EDT": "hora de verano oriental", "MDT": "hora de verano de las Montañas", "SRT": "hora de Surinam", "CDT": "hora de verano central", "ART": "hora estándar de Argentina", "SAST": "hora de Sudáfrica", "WESZ": "hora de verano de Europa occidental", "HAT": "hora de verano de Terranova", "CAT": "hora de África central", "CLT": "hora estándar de Chile", "OESZ": "hora de verano de Europa oriental", "WART": "hora estándar de Argentina occidental", "PST": "hora estándar del Pacífico", "HADT": "hora de verano de Hawái-Aleutiano", "BT": "hora de Bután", "ECT": "hora de Ecuador", "AST": "hora estándar del Atlántico", "ACWST": "hora estándar de Australia centroccidental", "SGT": "hora de Singapur", "AEST": "hora estándar de Australia oriental", "OEZ": "hora estándar de Europa oriental", "CHADT": "hora de verano de Chatham", "EST": "hora estándar oriental", "JDT": "hora de verano de Japón"},
}
}
diff --git a/es_VE/es_VE_test.go b/es_VE/es_VE_test.go
new file mode 100644
index 00000000..9a5dfbbe
--- /dev/null
+++ b/es_VE/es_VE_test.go
@@ -0,0 +1,1120 @@
+package es_VE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "es_VE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/et/et.go b/et/et.go
index 8e7716fd..4b46b328 100644
--- a/et/et.go
+++ b/et/et.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"eKr", "pKr"},
erasNarrow: []string{"eKr", "pKr"},
erasWide: []string{"enne Kristust", "pärast Kristust"},
- timezones: map[string]string{"ChST": "Tšamorro standardaeg", "SRT": "Suriname aeg", "NZDT": "Uus-Meremaa suveaeg", "ARST": "Argentina suveaeg", "CST": "Kesk-Ameerika standardaeg", "CHAST": "Chathami standardaeg", "ACWDT": "Kesk-Lääne Austraalia suveaeg", "WAST": "Lääne-Aafrika suveaeg", "ACDT": "Kesk-Austraalia suveaeg", "MESZ": "Kesk-Euroopa suveaeg", "EAT": "Ida-Aafrika aeg", "AWDT": "Lääne-Austraalia suveaeg", "CDT": "Kesk-Ameerika suveaeg", "HNT": "Newfoundlandi standardaeg", "TMST": "Türkmenistani suveaeg", "ACST": "Kesk-Austraalia standardaeg", "MYT": "Malaisia \u200b\u200baeg", "JST": "Jaapani standardaeg", "LHST": "Lord Howe standardaeg", "UYST": "Uruguay suveaeg", "MEZ": "Kesk-Euroopa standardaeg", "IST": "India aeg", "TMT": "Türkmenistani standardaeg", "BOT": "Boliivia aeg", "PDT": "Vaikse ookeani suveaeg", "NZST": "Uus-Meremaa standardaeg", "CLST": "Tšiili suveaeg", "WEZ": "Lääne-Euroopa standardaeg", "SGT": "Singapuri standardaeg", "WAT": "Lääne-Aafrika standardaeg", "HKT": "Hongkongi standardaeg", "∅∅∅": "Amazonase suveaeg", "AKST": "Alaska standardaeg", "ACWST": "Kesk-Lääne Austraalia standardaeg", "COST": "Colombia suveaeg", "AST": "Atlandi standardaeg", "WART": "Lääne-Argentina standardaeg", "GMT": "Greenwichi aeg", "AKDT": "Alaska suveaeg", "COT": "Colombia standardaeg", "MDT": "MDT", "ART": "Argentina standardaeg", "VET": "Venezuela aeg", "WESZ": "Lääne-Euroopa suveaeg", "AEDT": "Ida-Austraalia suveaeg", "CAT": "Kesk-Aafrika aeg", "HADT": "Hawaii-Aleuudi suveaeg", "BT": "Bhutani aeg", "HKST": "Hongkongi suveaeg", "HAST": "Hawaii-Aleuudi standardaeg", "WARST": "Lääne-Argentina suveaeg", "WIT": "Ida-Indoneesia aeg", "GYT": "Guyana aeg", "AWST": "Lääne-Austraalia standardaeg", "CHADT": "Chathami suveaeg", "AEST": "Ida-Austraalia standardaeg", "WIB": "Lääne-Indoneesia aeg", "MST": "MST", "JDT": "Jaapani suveaeg", "EST": "Idaranniku standardaeg", "SAST": "Lõuna-Aafrika standardaeg", "GFT": "Prantsuse Guajaana aeg", "CLT": "Tšiili standardaeg", "ADT": "Atlandi suveaeg", "HAT": "Newfoundlandi suveaeg", "LHDT": "Lord Howe suveaeg", "ECT": "Ecuadori aeg", "WITA": "Kesk-Indoneesia aeg", "OEZ": "Ida-Euroopa standardaeg", "UYT": "Uruguay standardaeg", "EDT": "Idaranniku suveaeg", "OESZ": "Ida-Euroopa suveaeg", "PST": "Vaikse ookeani standardaeg"},
+ timezones: map[string]string{"CDT": "Kesk-Ameerika suveaeg", "LHST": "Lord Howe standardaeg", "WIT": "Ida-Indoneesia aeg", "COST": "Colombia suveaeg", "TMST": "Türkmenistani suveaeg", "AEDT": "Ida-Austraalia suveaeg", "ACST": "Kesk-Austraalia standardaeg", "HAT": "Newfoundlandi suveaeg", "AKST": "Alaska standardaeg", "CAT": "Kesk-Aafrika aeg", "ACWST": "Kesk-Lääne Austraalia standardaeg", "GMT": "Greenwichi aeg", "EDT": "Idaranniku suveaeg", "NZST": "Uus-Meremaa standardaeg", "UYT": "Uruguay standardaeg", "JDT": "Jaapani suveaeg", "ART": "Argentina standardaeg", "PDT": "Vaikse ookeani suveaeg", "SGT": "Singapuri standardaeg", "MDT": "Mäestikuvööndi suveaeg", "MYT": "Malaisia \u200b\u200baeg", "WARST": "Lääne-Argentina suveaeg", "ACWDT": "Kesk-Lääne Austraalia suveaeg", "NZDT": "Uus-Meremaa suveaeg", "WEZ": "Lääne-Euroopa standardaeg", "OESZ": "Ida-Euroopa suveaeg", "CLT": "Tšiili standardaeg", "WART": "Lääne-Argentina standardaeg", "CHAST": "Chathami standardaeg", "HAST": "Hawaii-Aleuudi standardaeg", "EST": "Idaranniku standardaeg", "HADT": "Hawaii-Aleuudi suveaeg", "WESZ": "Lääne-Euroopa suveaeg", "GFT": "Prantsuse Guajaana aeg", "JST": "Jaapani standardaeg", "AWDT": "Lääne-Austraalia suveaeg", "BOT": "Boliivia aeg", "∅∅∅": "Amazonase suveaeg", "BT": "Bhutani aeg", "CLST": "Tšiili suveaeg", "AWST": "Lääne-Austraalia standardaeg", "AEST": "Ida-Austraalia standardaeg", "MST": "Mäestikuvööndi standardaeg", "UYST": "Uruguay suveaeg", "AKDT": "Alaska suveaeg", "ARST": "Argentina suveaeg", "PST": "Vaikse ookeani standardaeg", "SRT": "Suriname aeg", "AST": "Atlandi standardaeg", "MESZ": "Kesk-Euroopa suveaeg", "SAST": "Lõuna-Aafrika standardaeg", "WAT": "Lääne-Aafrika standardaeg", "WAST": "Lääne-Aafrika suveaeg", "COT": "Colombia standardaeg", "LHDT": "Lord Howe suveaeg", "HKT": "Hongkongi standardaeg", "MEZ": "Kesk-Euroopa standardaeg", "CHADT": "Chathami suveaeg", "GYT": "Guyana aeg", "ACDT": "Kesk-Austraalia suveaeg", "HKST": "Hongkongi suveaeg", "ECT": "Ecuadori aeg", "VET": "Venezuela aeg", "TMT": "Türkmenistani standardaeg", "IST": "India aeg", "HNT": "Newfoundlandi standardaeg", "EAT": "Ida-Aafrika aeg", "WITA": "Kesk-Indoneesia aeg", "WIB": "Lääne-Indoneesia aeg", "ChST": "Tšamorro standardaeg", "OEZ": "Ida-Euroopa standardaeg", "CST": "Kesk-Ameerika standardaeg", "ADT": "Atlandi suveaeg"},
}
}
diff --git a/et/et_test.go b/et/et_test.go
new file mode 100644
index 00000000..f472b64e
--- /dev/null
+++ b/et/et_test.go
@@ -0,0 +1,1120 @@
+package et
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "et"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/et_EE/et_EE.go b/et_EE/et_EE.go
index 460e33a1..00f3e0e1 100644
--- a/et_EE/et_EE.go
+++ b/et_EE/et_EE.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"eKr", "pKr"},
erasNarrow: []string{"eKr", "pKr"},
erasWide: []string{"enne Kristust", "pärast Kristust"},
- timezones: map[string]string{"ACWDT": "Kesk-Lääne Austraalia suveaeg", "AEDT": "Ida-Austraalia suveaeg", "WARST": "Lääne-Argentina suveaeg", "GFT": "Prantsuse Guajaana aeg", "EAT": "Ida-Aafrika aeg", "TMST": "Türkmenistani suveaeg", "NZST": "Uus-Meremaa standardaeg", "SAST": "Lõuna-Aafrika standardaeg", "HNT": "Newfoundlandi standardaeg", "WIT": "Ida-Indoneesia aeg", "MST": "Mäestikuvööndi standardaeg", "ACWST": "Kesk-Lääne Austraalia standardaeg", "MDT": "Mäestikuvööndi suveaeg", "OEZ": "Ida-Euroopa standardaeg", "AKST": "Alaska standardaeg", "ARST": "Argentina suveaeg", "PDT": "Vaikse ookeani suveaeg", "SGT": "Singapuri standardaeg", "WAST": "Lääne-Aafrika suveaeg", "HKT": "Hongkongi standardaeg", "LHDT": "Lord Howe suveaeg", "∅∅∅": "Assooride suveaeg", "UYT": "Uruguay standardaeg", "ChST": "Tšamorro standardaeg", "HKST": "Hongkongi suveaeg", "GMT": "Greenwichi aeg", "TMT": "Türkmenistani standardaeg", "AWST": "Lääne-Austraalia standardaeg", "ART": "Argentina standardaeg", "SRT": "Suriname aeg", "JST": "Jaapani standardaeg", "MESZ": "Kesk-Euroopa suveaeg", "AEST": "Ida-Austraalia standardaeg", "CLT": "Tšiili standardaeg", "AST": "Atlandi standardaeg", "HAST": "Hawaii-Aleuudi standardaeg", "GYT": "Guyana aeg", "JDT": "Jaapani suveaeg", "CDT": "Kesk-Ameerika suveaeg", "MEZ": "Kesk-Euroopa standardaeg", "CHAST": "Chathami standardaeg", "CLST": "Tšiili suveaeg", "BT": "Bhutani aeg", "WART": "Lääne-Argentina standardaeg", "AWDT": "Lääne-Austraalia suveaeg", "VET": "Venezuela aeg", "COT": "Colombia standardaeg", "IST": "India aeg", "LHST": "Lord Howe standardaeg", "NZDT": "Uus-Meremaa suveaeg", "CAT": "Kesk-Aafrika aeg", "EDT": "Idaranniku suveaeg", "HAT": "Newfoundlandi suveaeg", "MYT": "Malaisia \u200b\u200baeg", "ECT": "Ecuadori aeg", "BOT": "Boliivia aeg", "WEZ": "Lääne-Euroopa standardaeg", "WAT": "Lääne-Aafrika standardaeg", "OESZ": "Ida-Euroopa suveaeg", "WITA": "Kesk-Indoneesia aeg", "UYST": "Uruguay suveaeg", "EST": "Idaranniku standardaeg", "COST": "Colombia suveaeg", "PST": "Vaikse ookeani standardaeg", "WESZ": "Lääne-Euroopa suveaeg", "CHADT": "Chathami suveaeg", "ADT": "Atlandi suveaeg", "WIB": "Lääne-Indoneesia aeg", "AKDT": "Alaska suveaeg", "HADT": "Hawaii-Aleuudi suveaeg", "ACST": "Kesk-Austraalia standardaeg", "ACDT": "Kesk-Austraalia suveaeg", "CST": "Kesk-Ameerika standardaeg"},
+ timezones: map[string]string{"COST": "Colombia suveaeg", "GYT": "Guyana aeg", "WARST": "Lääne-Argentina suveaeg", "PST": "Vaikse ookeani standardaeg", "WIB": "Lääne-Indoneesia aeg", "WEZ": "Lääne-Euroopa standardaeg", "HNT": "Newfoundlandi standardaeg", "SGT": "Singapuri standardaeg", "LHST": "Lord Howe standardaeg", "AWDT": "Lääne-Austraalia suveaeg", "NZDT": "Uus-Meremaa suveaeg", "HKST": "Hongkongi suveaeg", "WAT": "Lääne-Aafrika standardaeg", "GMT": "Greenwichi aeg", "UYT": "Uruguay standardaeg", "CST": "Kesk-Ameerika standardaeg", "OEZ": "Ida-Euroopa standardaeg", "∅∅∅": "Brasiilia suveaeg", "WART": "Lääne-Argentina standardaeg", "VET": "Venezuela aeg", "PDT": "Vaikse ookeani suveaeg", "HAST": "Hawaii-Aleuudi standardaeg", "COT": "Colombia standardaeg", "WIT": "Ida-Indoneesia aeg", "AKST": "Alaska standardaeg", "IST": "India aeg", "HAT": "Newfoundlandi suveaeg", "AWST": "Lääne-Austraalia standardaeg", "BOT": "Boliivia aeg", "LHDT": "Lord Howe suveaeg", "MDT": "Mäestikuvööndi suveaeg", "CLT": "Tšiili standardaeg", "ACST": "Kesk-Austraalia standardaeg", "ACDT": "Kesk-Austraalia suveaeg", "JST": "Jaapani standardaeg", "ADT": "Atlandi suveaeg", "WAST": "Lääne-Aafrika suveaeg", "ChST": "Tšamorro standardaeg", "SRT": "Suriname aeg", "JDT": "Jaapani suveaeg", "ACWDT": "Kesk-Lääne Austraalia suveaeg", "ARST": "Argentina suveaeg", "MESZ": "Kesk-Euroopa suveaeg", "CAT": "Kesk-Aafrika aeg", "GFT": "Prantsuse Guajaana aeg", "AST": "Atlandi standardaeg", "NZST": "Uus-Meremaa standardaeg", "MEZ": "Kesk-Euroopa standardaeg", "ECT": "Ecuadori aeg", "AKDT": "Alaska suveaeg", "ART": "Argentina standardaeg", "WESZ": "Lääne-Euroopa suveaeg", "AEST": "Ida-Austraalia standardaeg", "UYST": "Uruguay suveaeg", "MST": "Mäestikuvööndi standardaeg", "CHAST": "Chathami standardaeg", "SAST": "Lõuna-Aafrika standardaeg", "EST": "Idaranniku standardaeg", "BT": "Bhutani aeg", "CLST": "Tšiili suveaeg", "EDT": "Idaranniku suveaeg", "TMT": "Türkmenistani standardaeg", "AEDT": "Ida-Austraalia suveaeg", "CHADT": "Chathami suveaeg", "ACWST": "Kesk-Lääne Austraalia standardaeg", "TMST": "Türkmenistani suveaeg", "OESZ": "Ida-Euroopa suveaeg", "MYT": "Malaisia \u200b\u200baeg", "EAT": "Ida-Aafrika aeg", "CDT": "Kesk-Ameerika suveaeg", "HKT": "Hongkongi standardaeg", "WITA": "Kesk-Indoneesia aeg", "HADT": "Hawaii-Aleuudi suveaeg"},
}
}
diff --git a/et_EE/et_EE_test.go b/et_EE/et_EE_test.go
new file mode 100644
index 00000000..3d807f6f
--- /dev/null
+++ b/et_EE/et_EE_test.go
@@ -0,0 +1,1120 @@
+package et_EE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "et_EE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/eu/eu.go b/eu/eu.go
index bb5c0018..cd9d5880 100644
--- a/eu/eu.go
+++ b/eu/eu.go
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"K.a.", "K.o."},
erasNarrow: []string{"", ""},
erasWide: []string{"K.a.", "K.o."},
- timezones: map[string]string{"WITA": "Indonesia erdialdeko ordua", "ACST": "Australia erdialdeko ordu estandarra", "JDT": "Japoniako udako ordua", "LHST": "Lord Howeko ordu estandarra", "UYST": "Uruguayko udako ordua", "COST": "Kolonbiako udako ordua", "ECT": "Ekuadorreko ordua", "HADT": "Hawaii-Aleutiar uharteetako udako ordua", "WIT": "Indonesia ekialdeko ordua", "SRT": "Surinamgo ordua", "UYT": "Uruguayko ordu estandarra", "VET": "Venezuelako ordua", "CAT": "Afrika erdialdeko ordua", "ADT": "Atlantikoko udako ordua", "WAT": "Afrika mendebaldeko ordu estandarra", "WARST": "Argentina mendebaldeko udako ordua", "CLT": "Txileko ordu estandarra", "EST": "Ipar Amerikako ekialdeko ordu estandarra", "AKST": "Alaskako ordu estandarra", "AWDT": "Australia mendebaldeko udako ordua", "CHAST": "Chathamgo ordu estandarra", "CLST": "Txileko udako ordua", "EDT": "Ipar Amerikako ekialdeko udako ordua", "ACDT": "Australia erdialdeko udako ordua", "NZDT": "Zeelanda Berriko udako ordua", "CHADT": "Chathamgo udako ordua", "MST": "Ipar Amerikako mendialdeko ordu estandarra", "∅∅∅": "Brasiliako udako ordua", "SGT": "Singapurreko ordu estandarra", "HKT": "Hong Kongo ordu estandarra", "AEST": "Australia ekialdeko ordu estandarra", "OESZ": "Europa ekialdeko udako ordua", "WEZ": "Europa mendebaldeko ordu estandarra", "WIB": "Indonesia mendebaldeko ordua", "HAT": "Ternuako udako ordua", "PDT": "Ipar Amerikako Pazifikoko udako ordua", "MYT": "Malaysiako ordua", "WESZ": "Europa mendebaldeko udako ordua", "AEDT": "Australia ekialdeko udako ordua", "ChST": "Chamorroko ordu estandarra", "AST": "Atlantikoko ordu estandarra", "GMT": "Greenwich meridianoko ordua", "AKDT": "Alaskako udako ordua", "CST": "Ipar Amerikako erdialdeko ordu estandarra", "CDT": "Ipar Amerikako erdialdeko udako ordua", "ACWST": "Australia erdi-mendebaldeko ordu estandarra", "ACWDT": "Australia erdi-mendebaldeko udako ordua", "HAST": "Hawaii-Aleutiar uharteetako ordu estandarra", "BT": "Bhutango ordua", "ART": "Argentinako ordu estandarra", "SAST": "Afrika hegoaldeko ordua", "HKST": "Hong Kongo udako ordua", "AWST": "Australia mendebaldeko ordu estandarra", "MDT": "Ipar Amerikako mendialdeko udako ordua", "WART": "Argentina mendebaldeko ordu estandarra", "IST": "Indiako ordua", "OEZ": "Europa ekialdeko ordu estandarra", "EAT": "Afrika ekialdeko ordua", "NZST": "Zeelanda Berriko ordu estandarra", "HNT": "Ternuako ordu estandarra", "GFT": "Guyana Frantseseko ordua", "TMST": "Turkmenistango udako ordua", "JST": "Japoniako ordu estandarra", "MEZ": "Europa erdialdeko ordu estandarra", "WAST": "Afrika mendebaldeko udako ordua", "GYT": "Guyanako ordua", "COT": "Kolonbiako ordu estandarra", "TMT": "Turkmenistango ordu estandarra", "PST": "Ipar Amerikako Pazifikoko ordu estandarra", "LHDT": "Lord Howeko udako ordua", "BOT": "Boliviako ordua", "ARST": "Argentinako udako ordua", "MESZ": "Europa erdialdeko udako ordua"},
+ timezones: map[string]string{"CAT": "Afrika erdialdeko ordua", "SRT": "Surinamgo ordua", "CHAST": "Chathamgo ordu estandarra", "ACWST": "Australia erdi-mendebaldeko ordu estandarra", "WAT": "Afrika mendebaldeko ordu estandarra", "HNT": "Ternuako ordu estandarra", "OEZ": "Europa ekialdeko ordu estandarra", "GMT": "Greenwich meridianoko ordua", "CST": "Ipar Amerikako erdialdeko ordu estandarra", "JST": "Japoniako ordu estandarra", "AKST": "Alaskako ordu estandarra", "AKDT": "Alaskako udako ordua", "NZST": "Zeelanda Berriko ordu estandarra", "WIB": "Indonesia mendebaldeko ordua", "HKST": "Hong Kongo udako ordua", "ADT": "Atlantikoko udako ordua", "OESZ": "Europa ekialdeko udako ordua", "GYT": "Guyanako ordua", "UYT": "Uruguayko ordu estandarra", "WIT": "Indonesia ekialdeko ordua", "ECT": "Ekuadorreko ordua", "VET": "Venezuelako ordua", "EDT": "Ipar Amerikako ekialdeko udako ordua", "HAT": "Ternuako udako ordua", "CLST": "Txileko udako ordua", "HKT": "Hong Kongo ordu estandarra", "HAST": "Hawaii-Aleutiar uharteetako ordu estandarra", "AEST": "Australia ekialdeko ordu estandarra", "MYT": "Malaysiako ordua", "WITA": "Indonesia erdialdeko ordua", "WESZ": "Europa mendebaldeko udako ordua", "LHDT": "Lord Howeko udako ordua", "MST": "MST", "ACWDT": "Australia erdi-mendebaldeko udako ordua", "AWST": "Australia mendebaldeko ordu estandarra", "AWDT": "Australia mendebaldeko udako ordua", "MEZ": "Europa erdialdeko ordu estandarra", "SGT": "Singapurreko ordu estandarra", "AST": "Atlantikoko ordu estandarra", "ARST": "Argentinako udako ordua", "NZDT": "Zeelanda Berriko udako ordua", "SAST": "Afrika hegoaldeko ordua", "IST": "Indiako ordua", "HADT": "Hawaii-Aleutiar uharteetako udako ordua", "ChST": "Chamorroko ordu estandarra", "CDT": "Ipar Amerikako erdialdeko udako ordua", "ACST": "Australia erdialdeko ordu estandarra", "MDT": "MDT", "CHADT": "Chathamgo udako ordua", "MESZ": "Europa erdialdeko udako ordua", "WAST": "Afrika mendebaldeko udako ordua", "EAT": "Afrika ekialdeko ordua", "BT": "Bhutango ordua", "ACDT": "Australia erdialdeko udako ordua", "WART": "Argentina mendebaldeko ordu estandarra", "ART": "Argentinako ordu estandarra", "EST": "Ipar Amerikako ekialdeko ordu estandarra", "WEZ": "Europa mendebaldeko ordu estandarra", "WARST": "Argentina mendebaldeko udako ordua", "∅∅∅": "Azoreetako udako ordua", "JDT": "Japoniako udako ordua", "COT": "Kolonbiako ordu estandarra", "UYST": "Uruguayko udako ordua", "LHST": "Lord Howeko ordu estandarra", "PST": "Ipar Amerikako Pazifikoko ordu estandarra", "PDT": "Ipar Amerikako Pazifikoko udako ordua", "TMT": "Turkmenistango ordu estandarra", "TMST": "Turkmenistango udako ordua", "CLT": "Txileko ordu estandarra", "GFT": "Guyana Frantseseko ordua", "BOT": "Boliviako ordua", "COST": "Kolonbiako udako ordua", "AEDT": "Australia ekialdeko udako ordua"},
}
}
diff --git a/eu/eu_test.go b/eu/eu_test.go
new file mode 100644
index 00000000..457bae3f
--- /dev/null
+++ b/eu/eu_test.go
@@ -0,0 +1,1120 @@
+package eu
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "eu"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/eu_ES/eu_ES.go b/eu_ES/eu_ES.go
index f74c2267..ecf22ba1 100644
--- a/eu_ES/eu_ES.go
+++ b/eu_ES/eu_ES.go
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"K.a.", "K.o."},
erasNarrow: []string{"", ""},
erasWide: []string{"K.a.", "K.o."},
- timezones: map[string]string{"MEZ": "Europa erdialdeko ordu estandarra", "SAST": "Afrika hegoaldeko ordua", "CLT": "Txileko ordu estandarra", "AEST": "Australia ekialdeko ordu estandarra", "WAT": "Afrika mendebaldeko ordu estandarra", "MDT": "MDT", "PST": "Ipar Amerikako Pazifikoko ordu estandarra", "AST": "Atlantikoko ordu estandarra", "HADT": "Hawaii-Aleutiar uharteetako udako ordua", "∅∅∅": "Amazoniako udako ordua", "UYST": "Uruguayko udako ordua", "COT": "Kolonbiako ordu estandarra", "HKT": "Hong Kongo ordu estandarra", "BT": "Bhutango ordua", "MST": "MST", "LHDT": "Lord Howeko udako ordua", "CDT": "Ipar Amerikako erdialdeko udako ordua", "GYT": "Guyanako ordua", "AWDT": "Australia mendebaldeko udako ordua", "AEDT": "Australia ekialdeko udako ordua", "COST": "Kolonbiako udako ordua", "WARST": "Argentina mendebaldeko udako ordua", "ARST": "Argentinako udako ordua", "ACST": "Australia erdialdeko ordu estandarra", "LHST": "Lord Howeko ordu estandarra", "OESZ": "Europa ekialdeko udako ordua", "BOT": "Boliviako ordua", "CLST": "Txileko udako ordua", "WIT": "Indonesia ekialdeko ordua", "EAT": "Afrika ekialdeko ordua", "EST": "Ipar Amerikako ekialdeko ordu estandarra", "AWST": "Australia mendebaldeko ordu estandarra", "CST": "Ipar Amerikako erdialdeko ordu estandarra", "MESZ": "Europa erdialdeko udako ordua", "ACWST": "Australia erdi-mendebaldeko ordu estandarra", "HNT": "Ternuako ordu estandarra", "AKDT": "Alaskako udako ordua", "PDT": "Ipar Amerikako Pazifikoko udako ordua", "WESZ": "Europa mendebaldeko udako ordua", "WIB": "Indonesia mendebaldeko ordua", "GMT": "Greenwich meridianoko ordua", "NZST": "Zeelanda Berriko ordu estandarra", "ART": "Argentinako ordu estandarra", "JDT": "Japoniako udako ordua", "HAST": "Hawaii-Aleutiar uharteetako ordu estandarra", "ACWDT": "Australia erdi-mendebaldeko udako ordua", "CAT": "Afrika erdialdeko ordua", "EDT": "Ipar Amerikako ekialdeko udako ordua", "SGT": "Singapurreko ordu estandarra", "WAST": "Afrika mendebaldeko udako ordua", "IST": "Indiako ordua", "NZDT": "Zeelanda Berriko udako ordua", "WEZ": "Europa mendebaldeko ordu estandarra", "SRT": "Surinamgo ordua", "ChST": "Chamorroko ordu estandarra", "VET": "Venezuelako ordua", "HKST": "Hong Kongo udako ordua", "ACDT": "Australia erdialdeko udako ordua", "AKST": "Alaskako ordu estandarra", "ECT": "Ekuadorreko ordua", "MYT": "Malaysiako ordua", "ADT": "Atlantikoko udako ordua", "GFT": "Guyana Frantseseko ordua", "TMT": "Turkmenistango ordu estandarra", "TMST": "Turkmenistango udako ordua", "JST": "Japoniako ordu estandarra", "UYT": "Uruguayko ordu estandarra", "CHAST": "Chathamgo ordu estandarra", "CHADT": "Chathamgo udako ordua", "WART": "Argentina mendebaldeko ordu estandarra", "HAT": "Ternuako udako ordua", "WITA": "Indonesia erdialdeko ordua", "OEZ": "Europa ekialdeko ordu estandarra"},
+ timezones: map[string]string{"LHST": "Lord Howeko ordu estandarra", "CHAST": "Chathamgo ordu estandarra", "ACWDT": "Australia erdi-mendebaldeko udako ordua", "NZST": "Zeelanda Berriko ordu estandarra", "BOT": "Boliviako ordua", "HAST": "Hawaii-Aleutiar uharteetako ordu estandarra", "AKDT": "Alaskako udako ordua", "WEZ": "Europa mendebaldeko ordu estandarra", "OESZ": "Europa ekialdeko udako ordua", "AEDT": "Australia ekialdeko udako ordua", "AST": "Atlantikoko ordu estandarra", "AWDT": "Australia mendebaldeko udako ordua", "ARST": "Argentinako udako ordua", "WARST": "Argentina mendebaldeko udako ordua", "ADT": "Atlantikoko udako ordua", "ACWST": "Australia erdi-mendebaldeko ordu estandarra", "EST": "Ipar Amerikako ekialdeko ordu estandarra", "OEZ": "Europa ekialdeko ordu estandarra", "ACDT": "Australia erdialdeko udako ordua", "AKST": "Alaskako ordu estandarra", "BT": "Bhutango ordua", "NZDT": "Zeelanda Berriko udako ordua", "WAT": "Afrika mendebaldeko ordu estandarra", "GMT": "Greenwich meridianoko ordua", "AEST": "Australia ekialdeko ordu estandarra", "MESZ": "Europa erdialdeko udako ordua", "COST": "Kolonbiako udako ordua", "UYT": "Uruguayko ordu estandarra", "ACST": "Australia erdialdeko ordu estandarra", "HKST": "Hong Kongo udako ordua", "AWST": "Australia mendebaldeko ordu estandarra", "MEZ": "Europa erdialdeko ordu estandarra", "CHADT": "Chathamgo udako ordua", "WIB": "Indonesia mendebaldeko ordua", "TMT": "Turkmenistango ordu estandarra", "CAT": "Afrika erdialdeko ordua", "HAT": "Ternuako udako ordua", "UYST": "Uruguayko udako ordua", "LHDT": "Lord Howeko udako ordua", "MYT": "Malaysiako ordua", "TMST": "Turkmenistango udako ordua", "WESZ": "Europa mendebaldeko udako ordua", "EDT": "Ipar Amerikako ekialdeko udako ordua", "MST": "Ipar Amerikako mendialdeko ordu estandarra", "CDT": "Ipar Amerikako erdialdeko udako ordua", "WART": "Argentina mendebaldeko ordu estandarra", "JST": "Japoniako ordu estandarra", "SAST": "Afrika hegoaldeko ordua", "HADT": "Hawaii-Aleutiar uharteetako udako ordua", "IST": "Indiako ordua", "PST": "Ipar Amerikako Pazifikoko ordu estandarra", "CLT": "Txileko ordu estandarra", "∅∅∅": "Brasiliako udako ordua", "GFT": "Guyana Frantseseko ordua", "HKT": "Hong Kongo ordu estandarra", "ECT": "Ekuadorreko ordua", "WAST": "Afrika mendebaldeko udako ordua", "SGT": "Singapurreko ordu estandarra", "GYT": "Guyanako ordua", "WIT": "Indonesia ekialdeko ordua", "SRT": "Surinamgo ordua", "WITA": "Indonesia erdialdeko ordua", "EAT": "Afrika ekialdeko ordua", "JDT": "Japoniako udako ordua", "ART": "Argentinako ordu estandarra", "PDT": "Ipar Amerikako Pazifikoko udako ordua", "HNT": "Ternuako ordu estandarra", "ChST": "Chamorroko ordu estandarra", "CLST": "Txileko udako ordua", "MDT": "Ipar Amerikako mendialdeko udako ordua", "CST": "Ipar Amerikako erdialdeko ordu estandarra", "VET": "Venezuelako ordua", "COT": "Kolonbiako ordu estandarra"},
}
}
diff --git a/eu_ES/eu_ES_test.go b/eu_ES/eu_ES_test.go
new file mode 100644
index 00000000..85f0e3fe
--- /dev/null
+++ b/eu_ES/eu_ES_test.go
@@ -0,0 +1,1120 @@
+package eu_ES
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "eu_ES"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ewo/ewo.go b/ewo/ewo.go
index d0c2aaa5..a6faf8ec 100644
--- a/ewo/ewo.go
+++ b/ewo/ewo.go
@@ -65,7 +65,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"oyk", "ayk"},
erasNarrow: []string{"", ""},
erasWide: []string{"osúsúa Yésus kiri", "ámvus Yésus Kirís"},
- timezones: map[string]string{"MST": "MST", "EST": "EST", "CAT": "CAT", "SRT": "SRT", "∅∅∅": "∅∅∅", "MEZ": "MEZ", "WIT": "WIT", "PST": "PST", "CDT": "CDT", "BT": "BT", "ECT": "ECT", "OESZ": "OESZ", "PDT": "PDT", "CLT": "CLT", "ACWDT": "ACWDT", "CHADT": "CHADT", "WAT": "WAT", "EDT": "EDT", "ADT": "ADT", "HKST": "HKST", "CST": "CST", "CLST": "CLST", "ACWST": "ACWST", "ART": "ART", "JDT": "JDT", "ChST": "ChST", "HNT": "HNT", "COT": "COT", "ACST": "ACST", "MYT": "MYT", "LHDT": "LHDT", "BOT": "BOT", "AEST": "AEST", "HADT": "HADT", "WAST": "WAST", "IST": "IST", "GFT": "GFT", "AWDT": "AWDT", "CHAST": "CHAST", "WESZ": "WESZ", "TMST": "TMST", "AKST": "AKST", "VET": "VET", "HAST": "HAST", "SAST": "SAST", "AWST": "AWST", "NZDT": "NZDT", "UYST": "UYST", "WITA": "WITA", "HAT": "HAT", "TMT": "TMT", "EAT": "EAT", "NZST": "NZST", "SGT": "SGT", "WART": "WART", "COST": "COST", "HKT": "HKT", "JST": "JST", "GYT": "GYT", "AEDT": "AEDT", "ACDT": "ACDT", "AKDT": "AKDT", "UYT": "UYT", "AST": "AST", "OEZ": "OEZ", "GMT": "GMT", "MESZ": "MESZ", "WEZ": "WEZ", "MDT": "MDT", "ARST": "ARST", "LHST": "LHST", "WARST": "WARST", "WIB": "WIB"},
+ timezones: map[string]string{"ACWDT": "ACWDT", "SAST": "SAST", "EST": "EST", "MESZ": "MESZ", "HNT": "HNT", "NZDT": "NZDT", "WIB": "WIB", "SGT": "SGT", "OEZ": "OEZ", "ChST": "ChST", "CHADT": "CHADT", "JST": "JST", "NZST": "NZST", "WIT": "WIT", "ACDT": "ACDT", "HAT": "HAT", "MST": "MST", "VET": "VET", "AWDT": "AWDT", "PDT": "PDT", "CAT": "CAT", "HAST": "HAST", "WAT": "WAT", "WEZ": "WEZ", "GMT": "GMT", "UYT": "UYT", "BT": "BT", "AKDT": "AKDT", "ADT": "ADT", "OESZ": "OESZ", "CST": "CST", "HKT": "HKT", "CHAST": "CHAST", "COT": "COT", "AEST": "AEST", "ARST": "ARST", "WESZ": "WESZ", "LHDT": "LHDT", "SRT": "SRT", "COST": "COST", "WART": "WART", "WARST": "WARST", "AST": "AST", "ECT": "ECT", "AKST": "AKST", "ACWST": "ACWST", "PST": "PST", "BOT": "BOT", "HKST": "HKST", "TMT": "TMT", "WAST": "WAST", "AEDT": "AEDT", "GYT": "GYT", "CLST": "CLST", "LHST": "LHST", "GFT": "GFT", "IST": "IST", "EDT": "EDT", "MEZ": "MEZ", "CLT": "CLT", "CDT": "CDT", "JDT": "JDT", "AWST": "AWST", "HADT": "HADT", "∅∅∅": "∅∅∅", "ART": "ART", "MYT": "MYT", "ACST": "ACST", "WITA": "WITA", "TMST": "TMST", "UYST": "UYST", "EAT": "EAT", "MDT": "MDT"},
}
}
diff --git a/ewo/ewo_test.go b/ewo/ewo_test.go
new file mode 100644
index 00000000..0aabd74e
--- /dev/null
+++ b/ewo/ewo_test.go
@@ -0,0 +1,1120 @@
+package ewo
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ewo"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ewo_CM/ewo_CM.go b/ewo_CM/ewo_CM.go
index 23f48536..22f0cc51 100644
--- a/ewo_CM/ewo_CM.go
+++ b/ewo_CM/ewo_CM.go
@@ -65,7 +65,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"oyk", "ayk"},
erasNarrow: []string{"", ""},
erasWide: []string{"osúsúa Yésus kiri", "ámvus Yésus Kirís"},
- timezones: map[string]string{"WEZ": "WEZ", "ACWST": "ACWST", "AEDT": "AEDT", "ECT": "ECT", "HKT": "HKT", "OESZ": "OESZ", "WITA": "WITA", "NZDT": "NZDT", "TMT": "TMT", "WIT": "WIT", "HADT": "HADT", "CHADT": "CHADT", "ChST": "ChST", "SAST": "SAST", "OEZ": "OEZ", "GFT": "GFT", "AWDT": "AWDT", "CDT": "CDT", "HKST": "HKST", "TMST": "TMST", "AKST": "AKST", "LHDT": "LHDT", "∅∅∅": "∅∅∅", "VET": "VET", "SGT": "SGT", "WAST": "WAST", "BT": "BT", "WART": "WART", "UYT": "UYT", "MST": "MST", "ACWDT": "ACWDT", "ADT": "ADT", "WIB": "WIB", "MEZ": "MEZ", "IST": "IST", "EAT": "EAT", "ACST": "ACST", "ART": "ART", "CST": "CST", "WAT": "WAT", "MYT": "MYT", "JST": "JST", "CAT": "CAT", "UYST": "UYST", "ACDT": "ACDT", "ARST": "ARST", "BOT": "BOT", "COST": "COST", "HNT": "HNT", "MDT": "MDT", "AEST": "AEST", "EST": "EST", "COT": "COT", "AKDT": "AKDT", "PST": "PST", "MESZ": "MESZ", "CLST": "CLST", "EDT": "EDT", "WARST": "WARST", "HAT": "HAT", "PDT": "PDT", "AWST": "AWST", "GYT": "GYT", "NZST": "NZST", "JDT": "JDT", "CLT": "CLT", "HAST": "HAST", "GMT": "GMT", "SRT": "SRT", "LHST": "LHST", "CHAST": "CHAST", "AST": "AST", "WESZ": "WESZ"},
+ timezones: map[string]string{"ART": "ART", "BOT": "BOT", "MDT": "MDT", "WART": "WART", "HKT": "HKT", "CHADT": "CHADT", "AKST": "AKST", "HAST": "HAST", "OESZ": "OESZ", "MST": "MST", "AWST": "AWST", "PDT": "PDT", "TMST": "TMST", "ACDT": "ACDT", "SRT": "SRT", "ECT": "ECT", "MEZ": "MEZ", "ACWST": "ACWST", "WAST": "WAST", "AEST": "AEST", "CLST": "CLST", "WIT": "WIT", "CDT": "CDT", "AKDT": "AKDT", "LHST": "LHST", "CST": "CST", "GFT": "GFT", "MESZ": "MESZ", "PST": "PST", "MYT": "MYT", "WARST": "WARST", "WITA": "WITA", "ACWDT": "ACWDT", "ACST": "ACST", "COT": "COT", "HADT": "HADT", "EDT": "EDT", "TMT": "TMT", "HNT": "HNT", "UYT": "UYT", "∅∅∅": "∅∅∅", "HKST": "HKST", "ADT": "ADT", "WIB": "WIB", "OEZ": "OEZ", "UYST": "UYST", "NZST": "NZST", "EST": "EST", "SGT": "SGT", "CAT": "CAT", "GYT": "GYT", "AEDT": "AEDT", "CLT": "CLT", "CHAST": "CHAST", "JDT": "JDT", "AST": "AST", "COST": "COST", "WEZ": "WEZ", "WESZ": "WESZ", "BT": "BT", "VET": "VET", "JST": "JST", "AWDT": "AWDT", "LHDT": "LHDT", "SAST": "SAST", "EAT": "EAT", "IST": "IST", "ChST": "ChST", "NZDT": "NZDT", "GMT": "GMT", "ARST": "ARST", "WAT": "WAT", "HAT": "HAT"},
}
}
diff --git a/ewo_CM/ewo_CM_test.go b/ewo_CM/ewo_CM_test.go
new file mode 100644
index 00000000..d202e12d
--- /dev/null
+++ b/ewo_CM/ewo_CM_test.go
@@ -0,0 +1,1120 @@
+package ewo_CM
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ewo_CM"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fa/fa.go b/fa/fa.go
index e1cf0588..701f92d6 100644
--- a/fa/fa.go
+++ b/fa/fa.go
@@ -70,7 +70,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ق.م.", "م."},
erasNarrow: []string{"ق", "م"},
erasWide: []string{"قبل از میلاد", "میلادی"},
- timezones: map[string]string{"COT": "وقت عادی کلمبیا", "OEZ": "وقت عادی شرق اروپا", "EAT": "وقت شرق افریقا", "PST": "وقت عادی غرب امریکا", "JST": "وقت عادی ژاپن", "WAST": "وقت تابستانی غرب افریقا", "GMT": "وقت گرینویچ", "AKST": "وقت عادی آلاسکا", "JDT": "وقت تابستانی ژاپن", "ChST": "وقت عادی چامورو", "ECT": "وقت اکوادور", "SAST": "وقت عادی جنوب افریقا", "IST": "وقت هند", "HAT": "وقت تابستانی نیوفاندلند", "CLST": "وقت تابستانی شیلی", "ARST": "وقت تابستانی آرژانتین", "UYT": "وقت عادی اروگوئه", "EST": "وقت عادی شرق امریکا", "SGT": "وقت سنگاپور", "WAT": "وقت عادی غرب افریقا", "MST": "وقت عادی ماکائو", "AWST": "وقت عادی غرب استرالیا", "CST": "وقت عادی مرکز امریکا", "MESZ": "وقت تابستانی مرکز اروپا", "CAT": "وقت مرکز افریقا", "ADT": "وقت تابستانی آتلانتیک", "HKT": "وقت عادی هنگ\u200cکنگ", "ACDT": "وقت تابستانی مرکز استرالیا", "LHST": "وقت عادی لردهو", "MEZ": "وقت عادی مرکز اروپا", "UYST": "وقت تابستانی اروگوئه", "AEDT": "وقت تابستانی شرق استرالیا", "HNT": "وقت عادی نیوفاندلند", "WART": "وقت عادی غرب آرژانتین", "GYT": "وقت گویان", "WESZ": "وقت تابستانی غرب اروپا", "CLT": "وقت عادی شیلی", "HAST": "وقت عادی هاوایی‐الوشن", "TMST": "وقت تابستانی ترکمنستان", "AKDT": "وقت تابستانی آلاسکا", "WEZ": "وقت عادی غرب اروپا", "ACWST": "وقت عادی مرکز-غرب استرالیا", "COST": "وقت تابستانی کلمبیا", "AST": "وقت عادی آتلانتیک", "BT": "وقت بوتان", "PDT": "وقت تابستانی غرب امریکا", "MYT": "وقت مالزی", "ACWDT": "وقت تابستانی مرکز-غرب استرالیا", "CHADT": "وقت تابستانی چت\u200cهام", "SRT": "وقت سورینام", "NZST": "وقت عادی زلاند نو", "NZDT": "وقت تابستانی زلاند نو", "HKST": "وقت تابستانی هنگ\u200cکنگ", "OESZ": "وقت تابستانی شرق اروپا", "CDT": "وقت تابستانی مرکز امریکا", "HADT": "وقت تابستانی هاوایی‐الوشن", "WARST": "وقت تابستانی غرب آرژانتین", "ACST": "وقت عادی مرکز استرالیا", "AWDT": "وقت تابستانی غرب استرالیا", "BOT": "وقت بولیوی", "GFT": "وقت گویان فرانسه", "WIB": "وقت غرب اندونزی", "ART": "وقت عادی آرژانتین", "LHDT": "وقت تابستانی لردهو", "VET": "وقت ونزوئلا", "MDT": "وقت تابستانی ماکائو", "EDT": "وقت تابستانی شرق امریکا", "∅∅∅": "وقت تابستانی برازیلیا", "WITA": "وقت مرکز اندونزی", "WIT": "وقت شرق اندونزی", "TMT": "وقت عادی ترکمنستان", "AEST": "وقت عادی شرق استرالیا", "CHAST": "وقت عادی چت\u200cهام"},
+ timezones: map[string]string{"TMST": "وقت تابستانی ترکمنستان", "CAT": "وقت مرکز افریقا", "GMT": "وقت گرینویچ", "GYT": "وقت گویان", "∅∅∅": "وقت تابستانی برازیلیا", "ARST": "وقت تابستانی آرژانتین", "AWST": "وقت عادی غرب استرالیا", "WIB": "وقت غرب اندونزی", "TMT": "وقت عادی ترکمنستان", "COST": "وقت تابستانی کلمبیا", "AEDT": "وقت تابستانی شرق استرالیا", "UYT": "وقت عادی اروگوئه", "AKDT": "وقت تابستانی آلاسکا", "MST": "وقت عادی کوهستانی امریکا", "MDT": "وقت تابستانی کوهستانی امریکا", "JST": "وقت عادی ژاپن", "WARST": "وقت تابستانی غرب آرژانتین", "ACWST": "وقت عادی مرکز-غرب استرالیا", "PST": "وقت عادی غرب امریکا", "CLST": "وقت تابستانی شیلی", "ART": "وقت عادی آرژانتین", "WEZ": "وقت عادی غرب اروپا", "BT": "وقت بوتان", "LHDT": "وقت تابستانی لردهو", "VET": "وقت ونزوئلا", "ADT": "وقت تابستانی آتلانتیک", "NZDT": "وقت تابستانی زلاند نو", "CDT": "وقت تابستانی مرکز امریکا", "CHAST": "وقت عادی چت\u200cهام", "NZST": "وقت عادی زلاند نو", "BOT": "وقت بولیوی", "HADT": "وقت تابستانی هاوایی‐الوشن", "WAST": "وقت تابستانی غرب افریقا", "WESZ": "وقت تابستانی غرب اروپا", "HNT": "وقت عادی نیوفاندلند", "HAT": "وقت تابستانی نیوفاندلند", "ChST": "وقت عادی چامورو", "UYST": "وقت تابستانی اروگوئه", "WIT": "وقت شرق اندونزی", "EAT": "وقت شرق افریقا", "SAST": "وقت عادی جنوب افریقا", "CHADT": "وقت تابستانی چت\u200cهام", "AWDT": "وقت تابستانی غرب استرالیا", "EST": "وقت عادی شرق امریکا", "JDT": "وقت تابستانی ژاپن", "EDT": "وقت تابستانی شرق امریکا", "PDT": "وقت تابستانی غرب امریکا", "HAST": "وقت عادی هاوایی‐الوشن", "SGT": "وقت سنگاپور", "SRT": "وقت سورینام", "OEZ": "وقت عادی شرق اروپا", "CLT": "وقت عادی شیلی", "ACDT": "وقت تابستانی مرکز استرالیا", "HKT": "وقت عادی هنگ\u200cکنگ", "AKST": "وقت عادی آلاسکا", "OESZ": "وقت تابستانی شرق اروپا", "AEST": "وقت عادی شرق استرالیا", "GFT": "وقت گویان فرانسه", "ECT": "وقت اکوادور", "AST": "وقت عادی آتلانتیک", "MEZ": "وقت عادی مرکز اروپا", "ACWDT": "وقت تابستانی مرکز-غرب استرالیا", "IST": "وقت هند", "WAT": "وقت عادی غرب افریقا", "MYT": "وقت مالزی", "CST": "وقت عادی مرکز امریکا", "ACST": "وقت عادی مرکز استرالیا", "WART": "وقت عادی غرب آرژانتین", "HKST": "وقت تابستانی هنگ\u200cکنگ", "MESZ": "وقت تابستانی مرکز اروپا", "COT": "وقت عادی کلمبیا", "LHST": "وقت عادی لردهو", "WITA": "وقت مرکز اندونزی"},
}
}
diff --git a/fa/fa_test.go b/fa/fa_test.go
new file mode 100644
index 00000000..6131628e
--- /dev/null
+++ b/fa/fa_test.go
@@ -0,0 +1,1120 @@
+package fa
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fa"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fa_AF/fa_AF.go b/fa_AF/fa_AF.go
index 77d93241..c09e12a1 100644
--- a/fa_AF/fa_AF.go
+++ b/fa_AF/fa_AF.go
@@ -70,7 +70,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ق.م.", "م."},
erasNarrow: []string{"ق", "م"},
erasWide: []string{"قبل از میلاد", "میلادی"},
- timezones: map[string]string{"TMST": "وقت تابستانی ترکمنستان", "GYT": "وقت گویان", "CDT": "وقت تابستانی مرکز امریکا", "NZDT": "وقت تابستانی زلاند نو", "AEST": "وقت عادی شرق استرالیا", "HAST": "وقت عادی هاوایی‐الوشن", "HKT": "وقت عادی هنگ\u200cکنگ", "HAT": "وقت تابستانی نیوفاندلند", "AST": "وقت عادی آتلانتیک", "ADT": "وقت تابستانی آتلانتیک", "SAST": "وقت عادی جنوب افریقا", "EDT": "وقت تابستانی شرق امریکا", "HADT": "وقت تابستانی هاوایی‐الوشن", "MEZ": "وقت عادی مرکز اروپا", "BOT": "وقت بولیوی", "NZST": "وقت عادی زلاند نو", "GFT": "وقت گویان فرانسه", "ACST": "وقت عادی مرکز استرالیا", "AWDT": "وقت تابستانی غرب استرالیا", "WIT": "وقت شرق اندونزی", "LHST": "وقت عادی لردهو", "AWST": "وقت عادی غرب استرالیا", "UYST": "وقت تابستانی اروگوئه", "MDT": "وقت تابستانی کوهستانی امریکا", "CAT": "وقت مرکز افریقا", "WITA": "وقت مرکز اندونزی", "SGT": "وقت سنگاپور", "CHAST": "وقت عادی چت\u200cهام", "WEZ": "وقت عادی غرب اروپا", "EST": "وقت عادی شرق امریکا", "WAT": "وقت عادی غرب افریقا", "GMT": "وقت گرینویچ", "EAT": "وقت شرق افریقا", "MYT": "وقت مالزی", "VET": "وقت ونزوئلا", "COST": "وقت تابستانی کلمبیا", "WART": "وقت عادی غرب آرژانتین", "WAST": "وقت تابستانی غرب افریقا", "OEZ": "وقت عادی شرق اروپا", "TMT": "وقت عادی ترکمنستان", "CST": "وقت عادی مرکز امریکا", "CHADT": "وقت تابستانی چت\u200cهام", "ACWST": "وقت عادی مرکز-غرب استرالیا", "WARST": "وقت تابستانی غرب آرژانتین", "WIB": "وقت غرب اندونزی", "LHDT": "وقت تابستانی لردهو", "JDT": "وقت تابستانی ژاپن", "MESZ": "وقت تابستانی مرکز اروپا", "ChST": "وقت عادی چامورو", "COT": "وقت عادی کلمبیا", "BT": "وقت بوتان", "ACDT": "وقت تابستانی مرکز استرالیا", "AKST": "وقت عادی آلاسکا", "AEDT": "وقت تابستانی شرق استرالیا", "∅∅∅": "وقت تابستانی برازیلیا", "ART": "وقت عادی آرژانتین", "SRT": "وقت سورینام", "PST": "وقت عادی غرب امریکا", "PDT": "وقت تابستانی غرب امریکا", "MST": "وقت عادی کوهستانی امریکا", "ARST": "وقت تابستانی آرژانتین", "JST": "وقت عادی ژاپن", "ECT": "وقت اکوادور", "HKST": "وقت تابستانی هنگ\u200cکنگ", "ACWDT": "وقت تابستانی مرکز-غرب استرالیا", "HNT": "وقت عادی نیوفاندلند", "UYT": "وقت عادی اروگوئه", "CLT": "وقت عادی شیلی", "CLST": "وقت تابستانی شیلی", "IST": "وقت هند", "WESZ": "وقت تابستانی غرب اروپا", "OESZ": "وقت تابستانی شرق اروپا", "AKDT": "وقت تابستانی آلاسکا"},
+ timezones: map[string]string{"HAST": "وقت عادی هاوایی‐الوشن", "LHST": "وقت عادی لردهو", "HKST": "وقت تابستانی هنگ\u200cکنگ", "AST": "وقت عادی آتلانتیک", "JST": "وقت عادی ژاپن", "NZST": "وقت عادی زلاند نو", "TMST": "وقت تابستانی ترکمنستان", "AEDT": "وقت تابستانی شرق استرالیا", "BT": "وقت بوتان", "WARST": "وقت تابستانی غرب آرژانتین", "ARST": "وقت تابستانی آرژانتین", "EST": "وقت عادی شرق امریکا", "PST": "وقت عادی غرب امریکا", "MYT": "وقت مالزی", "GFT": "وقت گویان فرانسه", "CHAST": "وقت عادی چت\u200cهام", "ART": "وقت عادی آرژانتین", "HADT": "وقت تابستانی هاوایی‐الوشن", "ADT": "وقت تابستانی آتلانتیک", "EDT": "وقت تابستانی شرق امریکا", "BOT": "وقت بولیوی", "WAST": "وقت تابستانی غرب افریقا", "EAT": "وقت شرق افریقا", "SRT": "وقت سورینام", "∅∅∅": "وقت تابستانی آمازون", "COT": "وقت عادی کلمبیا", "ACDT": "وقت تابستانی مرکز استرالیا", "IST": "وقت هند", "CHADT": "وقت تابستانی چت\u200cهام", "AKST": "وقت عادی آلاسکا", "COST": "وقت تابستانی کلمبیا", "UYST": "وقت تابستانی اروگوئه", "ACWDT": "وقت تابستانی مرکز-غرب استرالیا", "AKDT": "وقت تابستانی آلاسکا", "SAST": "وقت عادی جنوب افریقا", "MEZ": "وقت عادی مرکز اروپا", "NZDT": "وقت تابستانی زلاند نو", "HAT": "وقت تابستانی نیوفاندلند", "AEST": "وقت عادی شرق استرالیا", "VET": "وقت ونزوئلا", "TMT": "وقت عادی ترکمنستان", "GMT": "وقت گرینویچ", "ChST": "وقت عادی چامورو", "LHDT": "وقت تابستانی لردهو", "ACST": "وقت عادی مرکز استرالیا", "AWST": "وقت عادی غرب استرالیا", "MESZ": "وقت تابستانی مرکز اروپا", "OEZ": "وقت عادی شرق اروپا", "ACWST": "وقت عادی مرکز-غرب استرالیا", "JDT": "وقت تابستانی ژاپن", "HKT": "وقت عادی هنگ\u200cکنگ", "ECT": "وقت اکوادور", "WEZ": "وقت عادی غرب اروپا", "OESZ": "وقت تابستانی شرق اروپا", "MST": "وقت عادی کوهستانی امریکا", "CLT": "وقت عادی شیلی", "UYT": "وقت عادی اروگوئه", "WART": "وقت عادی غرب آرژانتین", "AWDT": "وقت تابستانی غرب استرالیا", "CAT": "وقت مرکز افریقا", "WAT": "وقت عادی غرب افریقا", "MDT": "وقت تابستانی کوهستانی امریکا", "CLST": "وقت تابستانی شیلی", "PDT": "وقت تابستانی غرب امریکا", "WESZ": "وقت تابستانی غرب اروپا", "HNT": "وقت عادی نیوفاندلند", "WIT": "وقت شرق اندونزی", "CST": "وقت عادی مرکز امریکا", "WITA": "وقت مرکز اندونزی", "SGT": "وقت سنگاپور", "WIB": "وقت غرب اندونزی", "GYT": "وقت گویان", "CDT": "وقت تابستانی مرکز امریکا"},
}
}
diff --git a/fa_AF/fa_AF_test.go b/fa_AF/fa_AF_test.go
new file mode 100644
index 00000000..5f5e2473
--- /dev/null
+++ b/fa_AF/fa_AF_test.go
@@ -0,0 +1,1120 @@
+package fa_AF
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fa_AF"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fa_IR/fa_IR.go b/fa_IR/fa_IR.go
index cecfe825..ee5e02d5 100644
--- a/fa_IR/fa_IR.go
+++ b/fa_IR/fa_IR.go
@@ -70,7 +70,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ق.م.", "م."},
erasNarrow: []string{"ق", "م"},
erasWide: []string{"قبل از میلاد", "میلادی"},
- timezones: map[string]string{"HKT": "وقت عادی هنگ\u200cکنگ", "SRT": "وقت سورینام", "CLST": "وقت تابستانی شیلی", "TMST": "وقت تابستانی ترکمنستان", "MDT": "وقت تابستانی ماکائو", "EAT": "وقت شرق افریقا", "ACST": "وقت عادی مرکز استرالیا", "MYT": "وقت مالزی", "ACWDT": "وقت تابستانی مرکز-غرب استرالیا", "COST": "وقت تابستانی کلمبیا", "IST": "وقت هند", "OESZ": "وقت تابستانی شرق اروپا", "MST": "وقت عادی ماکائو", "MEZ": "وقت عادی مرکز اروپا", "AST": "وقت عادی آتلانتیک", "HADT": "وقت تابستانی هاوایی‐الوشن", "PST": "وقت عادی غرب امریکا", "BOT": "وقت بولیوی", "CLT": "وقت عادی شیلی", "AEDT": "وقت تابستانی شرق استرالیا", "ChST": "وقت عادی چامورو", "GMT": "وقت گرینویچ", "HAT": "وقت تابستانی نیوفاندلند", "JDT": "وقت تابستانی ژاپن", "AKDT": "وقت تابستانی آلاسکا", "CHADT": "وقت تابستانی چت\u200cهام", "∅∅∅": "وقت تابستانی برازیلیا", "WART": "وقت عادی غرب آرژانتین", "AWST": "وقت عادی غرب استرالیا", "AWDT": "وقت تابستانی غرب استرالیا", "GYT": "وقت گویان", "CDT": "وقت تابستانی مرکز امریکا", "EDT": "وقت تابستانی شرق امریکا", "HKST": "وقت تابستانی هنگ\u200cکنگ", "WITA": "وقت مرکز اندونزی", "GFT": "وقت گویان فرانسه", "AKST": "وقت عادی آلاسکا", "WESZ": "وقت تابستانی غرب اروپا", "WAT": "وقت عادی غرب افریقا", "LHDT": "وقت تابستانی لردهو", "VET": "وقت ونزوئلا", "ACWST": "وقت عادی مرکز-غرب استرالیا", "MESZ": "وقت تابستانی مرکز اروپا", "UYST": "وقت تابستانی اروگوئه", "EST": "وقت عادی شرق امریکا", "SGT": "وقت سنگاپور", "CAT": "وقت مرکز افریقا", "ECT": "وقت اکوادور", "BT": "وقت بوتان", "ARST": "وقت تابستانی آرژانتین", "PDT": "وقت تابستانی غرب امریکا", "ART": "وقت عادی آرژانتین", "UYT": "وقت عادی اروگوئه", "ADT": "وقت تابستانی آتلانتیک", "HAST": "وقت عادی هاوایی‐الوشن", "SAST": "وقت عادی جنوب افریقا", "WARST": "وقت تابستانی غرب آرژانتین", "WIT": "وقت شرق اندونزی", "CHAST": "وقت عادی چت\u200cهام", "AEST": "وقت عادی شرق استرالیا", "COT": "وقت عادی کلمبیا", "WIB": "وقت غرب اندونزی", "OEZ": "وقت عادی شرق اروپا", "LHST": "وقت عادی لردهو", "CST": "وقت عادی مرکز امریکا", "WAST": "وقت تابستانی غرب افریقا", "HNT": "وقت عادی نیوفاندلند", "JST": "وقت عادی ژاپن", "NZST": "وقت عادی زلاند نو", "WEZ": "وقت عادی غرب اروپا", "TMT": "وقت عادی ترکمنستان", "ACDT": "وقت تابستانی مرکز استرالیا", "NZDT": "وقت تابستانی زلاند نو"},
+ timezones: map[string]string{"COST": "وقت تابستانی کلمبیا", "OEZ": "وقت عادی شرق اروپا", "UYT": "وقت عادی اروگوئه", "CHAST": "وقت عادی چت\u200cهام", "NZDT": "وقت تابستانی زلاند نو", "EDT": "وقت تابستانی شرق امریکا", "GFT": "وقت گویان فرانسه", "HKT": "وقت عادی هنگ\u200cکنگ", "CHADT": "وقت تابستانی چت\u200cهام", "WAT": "وقت عادی غرب افریقا", "AKDT": "وقت تابستانی آلاسکا", "AST": "وقت عادی آتلانتیک", "AWST": "وقت عادی غرب استرالیا", "WIT": "وقت شرق اندونزی", "MST": "وقت عادی کوهستانی امریکا", "WARST": "وقت تابستانی غرب آرژانتین", "SRT": "وقت سورینام", "∅∅∅": "وقت تابستانی برازیلیا", "CDT": "وقت تابستانی مرکز امریکا", "WESZ": "وقت تابستانی غرب اروپا", "CST": "وقت عادی مرکز امریکا", "TMST": "وقت تابستانی ترکمنستان", "NZST": "وقت عادی زلاند نو", "IST": "وقت هند", "COT": "وقت عادی کلمبیا", "WAST": "وقت تابستانی غرب افریقا", "TMT": "وقت عادی ترکمنستان", "CAT": "وقت مرکز افریقا", "HNT": "وقت عادی نیوفاندلند", "UYST": "وقت تابستانی اروگوئه", "ACST": "وقت عادی مرکز استرالیا", "ACWDT": "وقت تابستانی مرکز-غرب استرالیا", "MESZ": "وقت تابستانی مرکز اروپا", "VET": "وقت ونزوئلا", "OESZ": "وقت تابستانی شرق اروپا", "LHST": "وقت عادی لردهو", "HADT": "وقت تابستانی هاوایی‐الوشن", "HAT": "وقت تابستانی نیوفاندلند", "LHDT": "وقت تابستانی لردهو", "BOT": "وقت بولیوی", "GMT": "وقت گرینویچ", "ECT": "وقت اکوادور", "EST": "وقت عادی شرق امریکا", "WIB": "وقت غرب اندونزی", "HKST": "وقت تابستانی هنگ\u200cکنگ", "ADT": "وقت تابستانی آتلانتیک", "CLT": "وقت عادی شیلی", "ART": "وقت عادی آرژانتین", "AKST": "وقت عادی آلاسکا", "AWDT": "وقت تابستانی غرب استرالیا", "AEDT": "وقت تابستانی شرق استرالیا", "CLST": "وقت تابستانی شیلی", "WART": "وقت عادی غرب آرژانتین", "JDT": "وقت تابستانی ژاپن", "AEST": "وقت عادی شرق استرالیا", "PST": "وقت عادی غرب امریکا", "WEZ": "وقت عادی غرب اروپا", "ChST": "وقت عادی چامورو", "MYT": "وقت مالزی", "JST": "وقت عادی ژاپن", "MEZ": "وقت عادی مرکز اروپا", "SAST": "وقت عادی جنوب افریقا", "ARST": "وقت تابستانی آرژانتین", "WITA": "وقت مرکز اندونزی", "ACWST": "وقت عادی مرکز-غرب استرالیا", "HAST": "وقت عادی هاوایی‐الوشن", "EAT": "وقت شرق افریقا", "BT": "وقت بوتان", "MDT": "وقت تابستانی کوهستانی امریکا", "ACDT": "وقت تابستانی مرکز استرالیا", "PDT": "وقت تابستانی غرب امریکا", "SGT": "وقت سنگاپور", "GYT": "وقت گویان"},
}
}
diff --git a/fa_IR/fa_IR_test.go b/fa_IR/fa_IR_test.go
new file mode 100644
index 00000000..1c47dff5
--- /dev/null
+++ b/fa_IR/fa_IR_test.go
@@ -0,0 +1,1120 @@
+package fa_IR
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fa_IR"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ff/ff.go b/ff/ff.go
index e7be010f..3243b4d6 100644
--- a/ff/ff.go
+++ b/ff/ff.go
@@ -65,7 +65,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"H-I", "C-I"},
erasNarrow: []string{"", ""},
erasWide: []string{"Hade Iisa", "Caggal Iisa"},
- timezones: map[string]string{"GFT": "GFT", "WESZ": "WESZ", "WART": "WART", "WAST": "WAST", "BT": "BT", "OESZ": "OESZ", "TMT": "TMT", "UYST": "UYST", "CHADT": "CHADT", "COST": "COST", "OEZ": "OEZ", "HNT": "HNT", "MESZ": "MESZ", "BOT": "BOT", "AEST": "AEST", "WIB": "WIB", "AWDT": "AWDT", "GYT": "GYT", "NZST": "NZST", "WITA": "WITA", "MDT": "MDT", "SRT": "SRT", "HADT": "HADT", "WAT": "WAT", "LHDT": "LHDT", "VET": "VET", "WEZ": "WEZ", "SAST": "SAST", "CLST": "CLST", "HKST": "HKST", "MST": "MST", "CST": "CST", "CHAST": "CHAST", "ACWST": "ACWST", "SGT": "SGT", "EAT": "EAT", "ACDT": "ACDT", "JST": "JST", "COT": "COT", "GMT": "GMT", "NZDT": "NZDT", "HKT": "HKT", "EST": "EST", "ARST": "ARST", "AKST": "AKST", "AKDT": "AKDT", "AWST": "AWST", "CAT": "CAT", "MYT": "MYT", "CDT": "CDT", "UYT": "UYT", "AEDT": "AEDT", "MEZ": "MEZ", "ECT": "ECT", "ADT": "ADT", "WIT": "WIT", "IST": "IST", "HAT": "HAT", "TMST": "TMST", "LHST": "LHST", "PST": "PST", "PDT": "PDT", "ACWDT": "ACWDT", "ChST": "ChST", "CLT": "CLT", "AST": "AST", "HAST": "HAST", "WARST": "WARST", "ACST": "ACST", "ART": "ART", "∅∅∅": "∅∅∅", "JDT": "JDT", "EDT": "EDT"},
+ timezones: map[string]string{"HKST": "HKST", "ECT": "ECT", "WESZ": "WESZ", "HNT": "HNT", "CAT": "CAT", "AEST": "AEST", "WARST": "WARST", "ACDT": "ACDT", "MST": "MST", "ACWST": "ACWST", "ART": "ART", "AKDT": "AKDT", "HAT": "HAT", "GMT": "GMT", "OEZ": "OEZ", "EDT": "EDT", "BOT": "BOT", "LHST": "LHST", "WIB": "WIB", "TMT": "TMT", "GYT": "GYT", "CDT": "CDT", "MDT": "MDT", "AST": "AST", "ADT": "ADT", "HADT": "HADT", "JST": "JST", "NZST": "NZST", "EAT": "EAT", "ACWDT": "ACWDT", "PDT": "PDT", "LHDT": "LHDT", "WART": "WART", "CST": "CST", "ARST": "ARST", "NZDT": "NZDT", "SGT": "SGT", "TMST": "TMST", "ChST": "ChST", "CHAST": "CHAST", "IST": "IST", "EST": "EST", "UYT": "UYT", "VET": "VET", "AWST": "AWST", "PST": "PST", "∅∅∅": "∅∅∅", "OESZ": "OESZ", "CLT": "CLT", "WAT": "WAT", "CLST": "CLST", "WIT": "WIT", "HAST": "HAST", "SAST": "SAST", "COT": "COT", "BT": "BT", "UYST": "UYST", "GFT": "GFT", "HKT": "HKT", "CHADT": "CHADT", "WITA": "WITA", "AKST": "AKST", "WEZ": "WEZ", "AWDT": "AWDT", "MEZ": "MEZ", "COST": "COST", "AEDT": "AEDT", "SRT": "SRT", "JDT": "JDT", "MESZ": "MESZ", "WAST": "WAST", "MYT": "MYT", "ACST": "ACST"},
}
}
diff --git a/ff/ff_test.go b/ff/ff_test.go
new file mode 100644
index 00000000..a05e8fef
--- /dev/null
+++ b/ff/ff_test.go
@@ -0,0 +1,1120 @@
+package ff
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ff"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ff_CM/ff_CM.go b/ff_CM/ff_CM.go
index aaa504db..71f298b2 100644
--- a/ff_CM/ff_CM.go
+++ b/ff_CM/ff_CM.go
@@ -65,7 +65,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"H-I", "C-I"},
erasNarrow: []string{"", ""},
erasWide: []string{"Hade Iisa", "Caggal Iisa"},
- timezones: map[string]string{"CHAST": "CHAST", "∅∅∅": "∅∅∅", "GFT": "GFT", "MST": "MST", "JDT": "JDT", "BOT": "BOT", "JST": "JST", "GYT": "GYT", "CST": "CST", "UYT": "UYT", "SGT": "SGT", "WAT": "WAT", "WIB": "WIB", "OESZ": "OESZ", "TMST": "TMST", "EST": "EST", "ACST": "ACST", "MYT": "MYT", "ChST": "ChST", "AEST": "AEST", "ECT": "ECT", "ADT": "ADT", "HKST": "HKST", "EAT": "EAT", "ACWDT": "ACWDT", "WITA": "WITA", "AKST": "AKST", "WESZ": "WESZ", "AEDT": "AEDT", "CLT": "CLT", "EDT": "EDT", "BT": "BT", "HNT": "HNT", "HAT": "HAT", "ACDT": "ACDT", "AWDT": "AWDT", "LHDT": "LHDT", "NZDT": "NZDT", "CAT": "CAT", "COT": "COT", "WIT": "WIT", "OEZ": "OEZ", "AKDT": "AKDT", "CLST": "CLST", "ACWST": "ACWST", "AST": "AST", "HKT": "HKT", "WARST": "WARST", "WEZ": "WEZ", "TMT": "TMT", "ART": "ART", "WART": "WART", "MDT": "MDT", "NZST": "NZST", "SAST": "SAST", "PST": "PST", "VET": "VET", "HAST": "HAST", "LHST": "LHST", "CDT": "CDT", "MESZ": "MESZ", "UYST": "UYST", "SRT": "SRT", "MEZ": "MEZ", "CHADT": "CHADT", "COST": "COST", "HADT": "HADT", "WAST": "WAST", "IST": "IST", "PDT": "PDT", "GMT": "GMT", "ARST": "ARST", "AWST": "AWST"},
+ timezones: map[string]string{"JDT": "JDT", "SAST": "SAST", "COT": "COT", "WAT": "WAT", "WAST": "WAST", "AEDT": "AEDT", "MDT": "MDT", "ACWST": "ACWST", "ART": "ART", "EAT": "EAT", "LHDT": "LHDT", "WARST": "WARST", "HADT": "HADT", "TMT": "TMT", "OEZ": "OEZ", "ACST": "ACST", "MST": "MST", "CHAST": "CHAST", "AWDT": "AWDT", "GYT": "GYT", "SRT": "SRT", "IST": "IST", "MESZ": "MESZ", "COST": "COST", "BT": "BT", "MYT": "MYT", "WART": "WART", "GFT": "GFT", "AKDT": "AKDT", "AST": "AST", "NZDT": "NZDT", "BOT": "BOT", "CST": "CST", "ECT": "ECT", "WITA": "WITA", "NZST": "NZST", "HNT": "HNT", "WIT": "WIT", "PDT": "PDT", "WIB": "WIB", "TMST": "TMST", "GMT": "GMT", "VET": "VET", "EST": "EST", "PST": "PST", "CDT": "CDT", "HKT": "HKT", "AKST": "AKST", "ADT": "ADT", "OESZ": "OESZ", "AEST": "AEST", "LHST": "LHST", "ACDT": "ACDT", "ACWDT": "ACWDT", "AWST": "AWST", "MEZ": "MEZ", "ARST": "ARST", "SGT": "SGT", "CLST": "CLST", "CHADT": "CHADT", "HAST": "HAST", "WESZ": "WESZ", "CAT": "CAT", "ChST": "ChST", "UYT": "UYT", "UYST": "UYST", "HKST": "HKST", "JST": "JST", "CLT": "CLT", "HAT": "HAT", "∅∅∅": "∅∅∅", "EDT": "EDT", "WEZ": "WEZ"},
}
}
diff --git a/ff_CM/ff_CM_test.go b/ff_CM/ff_CM_test.go
new file mode 100644
index 00000000..59965b04
--- /dev/null
+++ b/ff_CM/ff_CM_test.go
@@ -0,0 +1,1120 @@
+package ff_CM
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ff_CM"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ff_GN/ff_GN.go b/ff_GN/ff_GN.go
index d191fac4..5e86eb62 100644
--- a/ff_GN/ff_GN.go
+++ b/ff_GN/ff_GN.go
@@ -65,7 +65,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"H-I", "C-I"},
erasNarrow: []string{"", ""},
erasWide: []string{"Hade Iisa", "Caggal Iisa"},
- timezones: map[string]string{"CST": "CST", "CLT": "CLT", "ACWST": "ACWST", "GYT": "GYT", "CHADT": "CHADT", "CLST": "CLST", "TMT": "TMT", "ARST": "ARST", "AKDT": "AKDT", "AWST": "AWST", "AWDT": "AWDT", "ACWDT": "ACWDT", "ADT": "ADT", "BT": "BT", "LHST": "LHST", "COST": "COST", "ACST": "ACST", "BOT": "BOT", "WEZ": "WEZ", "EDT": "EDT", "WARST": "WARST", "MDT": "MDT", "WAST": "WAST", "COT": "COT", "ECT": "ECT", "AST": "AST", "∅∅∅": "∅∅∅", "UYST": "UYST", "WESZ": "WESZ", "AEST": "AEST", "ChST": "ChST", "SGT": "SGT", "IST": "IST", "OEZ": "OEZ", "JDT": "JDT", "PST": "PST", "NZDT": "NZDT", "CHAST": "CHAST", "AEDT": "AEDT", "HKST": "HKST", "OESZ": "OESZ", "HNT": "HNT", "AKST": "AKST", "NZST": "NZST", "VET": "VET", "CAT": "CAT", "EST": "EST", "ART": "ART", "PDT": "PDT", "LHDT": "LHDT", "MESZ": "MESZ", "WIB": "WIB", "ACDT": "ACDT", "JST": "JST", "WIT": "WIT", "EAT": "EAT", "MST": "MST", "MYT": "MYT", "SRT": "SRT", "WART": "WART", "HAST": "HAST", "HKT": "HKT", "GFT": "GFT", "WITA": "WITA", "TMST": "TMST", "WAT": "WAT", "HAT": "HAT", "CDT": "CDT", "MEZ": "MEZ", "UYT": "UYT", "HADT": "HADT", "SAST": "SAST", "GMT": "GMT"},
+ timezones: map[string]string{"SGT": "SGT", "CHAST": "CHAST", "WEZ": "WEZ", "UYST": "UYST", "BT": "BT", "GFT": "GFT", "AWST": "AWST", "EST": "EST", "HADT": "HADT", "ChST": "ChST", "OEZ": "OEZ", "HNT": "HNT", "WAST": "WAST", "WIT": "WIT", "JST": "JST", "AST": "AST", "ADT": "ADT", "SAST": "SAST", "TMST": "TMST", "ACDT": "ACDT", "ART": "ART", "WESZ": "WESZ", "ACWST": "ACWST", "NZST": "NZST", "CLT": "CLT", "UYT": "UYT", "CHADT": "CHADT", "HKST": "HKST", "COT": "COT", "OESZ": "OESZ", "LHDT": "LHDT", "GMT": "GMT", "MST": "MST", "ECT": "ECT", "MEZ": "MEZ", "NZDT": "NZDT", "AEST": "AEST", "AEDT": "AEDT", "ARST": "ARST", "PST": "PST", "PDT": "PDT", "IST": "IST", "TMT": "TMT", "CAT": "CAT", "EAT": "EAT", "AWDT": "AWDT", "EDT": "EDT", "MESZ": "MESZ", "HAT": "HAT", "WIB": "WIB", "WARST": "WARST", "ACST": "ACST", "WITA": "WITA", "CST": "CST", "ACWDT": "ACWDT", "COST": "COST", "WAT": "WAT", "CLST": "CLST", "HKT": "HKT", "AKDT": "AKDT", "SRT": "SRT", "JDT": "JDT", "AKST": "AKST", "∅∅∅": "∅∅∅", "CDT": "CDT", "WART": "WART", "HAST": "HAST", "GYT": "GYT", "LHST": "LHST", "VET": "VET", "BOT": "BOT", "MDT": "MDT", "MYT": "MYT"},
}
}
diff --git a/ff_GN/ff_GN_test.go b/ff_GN/ff_GN_test.go
new file mode 100644
index 00000000..88c318c7
--- /dev/null
+++ b/ff_GN/ff_GN_test.go
@@ -0,0 +1,1120 @@
+package ff_GN
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ff_GN"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ff_MR/ff_MR.go b/ff_MR/ff_MR.go
index 3a5b8a3f..eae185d0 100644
--- a/ff_MR/ff_MR.go
+++ b/ff_MR/ff_MR.go
@@ -65,7 +65,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"H-I", "C-I"},
erasNarrow: []string{"", ""},
erasWide: []string{"Hade Iisa", "Caggal Iisa"},
- timezones: map[string]string{"WARST": "WARST", "CST": "CST", "CDT": "CDT", "NZST": "NZST", "EST": "EST", "COST": "COST", "ADT": "ADT", "HADT": "HADT", "WIB": "WIB", "ChST": "ChST", "MST": "MST", "GYT": "GYT", "UYST": "UYST", "EDT": "EDT", "MYT": "MYT", "MESZ": "MESZ", "WART": "WART", "HAT": "HAT", "ACST": "ACST", "PST": "PST", "CHADT": "CHADT", "WITA": "WITA", "WIT": "WIT", "AKST": "AKST", "LHDT": "LHDT", "ACWST": "ACWST", "ACWDT": "ACWDT", "WAT": "WAT", "JDT": "JDT", "BOT": "BOT", "CLT": "CLT", "MDT": "MDT", "SRT": "SRT", "AEST": "AEST", "OESZ": "OESZ", "LHST": "LHST", "WAST": "WAST", "IST": "IST", "WEZ": "WEZ", "CHAST": "CHAST", "ECT": "ECT", "SAST": "SAST", "ART": "ART", "TMST": "TMST", "AST": "AST", "∅∅∅": "∅∅∅", "HKST": "HKST", "ACDT": "ACDT", "AKDT": "AKDT", "NZDT": "NZDT", "AEDT": "AEDT", "COT": "COT", "HKT": "HKT", "OEZ": "OEZ", "HNT": "HNT", "AWST": "AWST", "UYT": "UYT", "SGT": "SGT", "ARST": "ARST", "PDT": "PDT", "WESZ": "WESZ", "CLST": "CLST", "CAT": "CAT", "HAST": "HAST", "BT": "BT", "GMT": "GMT", "GFT": "GFT", "JST": "JST", "VET": "VET", "EAT": "EAT", "TMT": "TMT", "AWDT": "AWDT", "MEZ": "MEZ"},
+ timezones: map[string]string{"ACDT": "ACDT", "ARST": "ARST", "EST": "EST", "OEZ": "OEZ", "WIT": "WIT", "BOT": "BOT", "ChST": "ChST", "GYT": "GYT", "HKT": "HKT", "PDT": "PDT", "NZST": "NZST", "SAST": "SAST", "AEDT": "AEDT", "IST": "IST", "MEZ": "MEZ", "WEZ": "WEZ", "HAT": "HAT", "LHDT": "LHDT", "MST": "MST", "∅∅∅": "∅∅∅", "ACST": "ACST", "WARST": "WARST", "SGT": "SGT", "LHST": "LHST", "CDT": "CDT", "GFT": "GFT", "WITA": "WITA", "AKDT": "AKDT", "HADT": "HADT", "MDT": "MDT", "COT": "COT", "AWDT": "AWDT", "OESZ": "OESZ", "AWST": "AWST", "PST": "PST", "NZDT": "NZDT", "WAT": "WAT", "AEST": "AEST", "WART": "WART", "VET": "VET", "HAST": "HAST", "WAST": "WAST", "CLT": "CLT", "SRT": "SRT", "CST": "CST", "CHAST": "CHAST", "ART": "ART", "JST": "JST", "EDT": "EDT", "MESZ": "MESZ", "BT": "BT", "AKST": "AKST", "HNT": "HNT", "CLST": "CLST", "EAT": "EAT", "WESZ": "WESZ", "COST": "COST", "WIB": "WIB", "UYST": "UYST", "HKST": "HKST", "ECT": "ECT", "TMT": "TMT", "TMST": "TMST", "UYT": "UYT", "ADT": "ADT", "CHADT": "CHADT", "CAT": "CAT", "ACWST": "ACWST", "MYT": "MYT", "AST": "AST", "ACWDT": "ACWDT", "JDT": "JDT", "GMT": "GMT"},
}
}
diff --git a/ff_MR/ff_MR_test.go b/ff_MR/ff_MR_test.go
new file mode 100644
index 00000000..38661427
--- /dev/null
+++ b/ff_MR/ff_MR_test.go
@@ -0,0 +1,1120 @@
+package ff_MR
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ff_MR"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ff_SN/ff_SN.go b/ff_SN/ff_SN.go
index 94c97f5d..17f87ded 100644
--- a/ff_SN/ff_SN.go
+++ b/ff_SN/ff_SN.go
@@ -65,7 +65,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"H-I", "C-I"},
erasNarrow: []string{"", ""},
erasWide: []string{"Hade Iisa", "Caggal Iisa"},
- timezones: map[string]string{"AEST": "AEST", "ARST": "ARST", "LHDT": "LHDT", "NZDT": "NZDT", "MDT": "MDT", "CLT": "CLT", "JDT": "JDT", "TMT": "TMT", "CHAST": "CHAST", "HKT": "HKT", "UYT": "UYT", "AST": "AST", "IST": "IST", "GFT": "GFT", "ACST": "ACST", "ACDT": "ACDT", "ACWST": "ACWST", "ACWDT": "ACWDT", "TMST": "TMST", "CST": "CST", "MST": "MST", "CLST": "CLST", "CAT": "CAT", "HAT": "HAT", "JST": "JST", "CDT": "CDT", "BOT": "BOT", "ChST": "ChST", "EST": "EST", "WART": "WART", "HNT": "HNT", "MYT": "MYT", "GYT": "GYT", "HAST": "HAST", "SGT": "SGT", "AWDT": "AWDT", "AKDT": "AKDT", "LHST": "LHST", "∅∅∅": "∅∅∅", "MEZ": "MEZ", "MESZ": "MESZ", "VET": "VET", "EDT": "EDT", "AKST": "AKST", "WAT": "WAT", "WAST": "WAST", "WITA": "WITA", "ART": "ART", "HADT": "HADT", "UYST": "UYST", "ECT": "ECT", "HKST": "HKST", "WIB": "WIB", "GMT": "GMT", "EAT": "EAT", "NZST": "NZST", "OESZ": "OESZ", "WARST": "WARST", "AWST": "AWST", "WESZ": "WESZ", "AEDT": "AEDT", "OEZ": "OEZ", "WIT": "WIT", "SRT": "SRT", "COST": "COST", "SAST": "SAST", "BT": "BT", "COT": "COT", "PDT": "PDT", "WEZ": "WEZ", "CHADT": "CHADT", "PST": "PST", "ADT": "ADT"},
+ timezones: map[string]string{"ACST": "ACST", "MST": "MST", "ADT": "ADT", "PDT": "PDT", "OESZ": "OESZ", "EAT": "EAT", "ART": "ART", "AST": "AST", "SGT": "SGT", "WAST": "WAST", "HKT": "HKT", "HKST": "HKST", "AKST": "AKST", "HADT": "HADT", "CLT": "CLT", "BT": "BT", "VET": "VET", "CHAST": "CHAST", "HAST": "HAST", "NZDT": "NZDT", "GMT": "GMT", "WART": "WART", "GFT": "GFT", "NZST": "NZST", "∅∅∅": "∅∅∅", "UYT": "UYT", "UYST": "UYST", "CDT": "CDT", "ChST": "ChST", "LHST": "LHST", "CHADT": "CHADT", "AKDT": "AKDT", "ACWST": "ACWST", "COST": "COST", "WIB": "WIB", "AWST": "AWST", "JDT": "JDT", "TMT": "TMT", "CAT": "CAT", "LHDT": "LHDT", "WITA": "WITA", "WIT": "WIT", "CST": "CST", "WARST": "WARST", "AWDT": "AWDT", "ACWDT": "ACWDT", "HNT": "HNT", "WEZ": "WEZ", "AEDT": "AEDT", "ARST": "ARST", "IST": "IST", "CLST": "CLST", "WESZ": "WESZ", "MYT": "MYT", "MDT": "MDT", "JST": "JST", "MEZ": "MEZ", "SAST": "SAST", "COT": "COT", "ECT": "ECT", "MESZ": "MESZ", "EST": "EST", "ACDT": "ACDT", "EDT": "EDT", "HAT": "HAT", "OEZ": "OEZ", "TMST": "TMST", "PST": "PST", "BOT": "BOT", "WAT": "WAT", "GYT": "GYT", "SRT": "SRT", "AEST": "AEST"},
}
}
diff --git a/ff_SN/ff_SN_test.go b/ff_SN/ff_SN_test.go
new file mode 100644
index 00000000..a935b036
--- /dev/null
+++ b/ff_SN/ff_SN_test.go
@@ -0,0 +1,1120 @@
+package ff_SN
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ff_SN"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fi/fi.go b/fi/fi.go
index 6a1026a0..afb2e91c 100644
--- a/fi/fi.go
+++ b/fi/fi.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"eKr.", "jKr."},
erasNarrow: []string{"eK", "jK"},
erasWide: []string{"ennen Kristuksen syntymää", "jälkeen Kristuksen syntymän"},
- timezones: map[string]string{"UYT": "Uruguayn normaaliaika", "ACWDT": "Läntisen Keski-Australian kesäaika", "COT": "Kolumbian normaaliaika", "WAT": "Länsi-Afrikan normaaliaika", "BT": "Bhutanin aika", "LHST": "Lord Howen normaaliaika", "AKDT": "Alaskan kesäaika", "AWST": "Länsi-Australian normaaliaika", "AKST": "Alaskan normaaliaika", "GFT": "Ranskan Guayanan aika", "TMST": "Turkmenistanin kesäaika", "ACDT": "Keski-Australian kesäaika", "JST": "Japanin normaaliaika", "OESZ": "Itä-Euroopan kesäaika", "GMT": "Greenwichin normaaliaika", "ADT": "Kanadan Atlantin kesäaika", "WITA": "Keski-Indonesian aika", "OEZ": "Itä-Euroopan normaaliaika", "VET": "Venezuelan aika", "HAT": "Newfoundlandin kesäaika", "TMT": "Turkmenistanin normaaliaika", "MST": "Macaon normaaliaika", "MEZ": "Keski-Euroopan normaaliaika", "WESZ": "Länsi-Euroopan kesäaika", "AST": "Kanadan Atlantin normaaliaika", "HKT": "Hongkongin normaaliaika", "LHDT": "Lord Howen kesäaika", "SRT": "Surinamin aika", "CLST": "Chilen kesäaika", "WAST": "Länsi-Afrikan kesäaika", "CHAST": "Chathamin normaaliaika", "CAT": "Keski-Afrikan aika", "WARST": "Länsi-Argentiinan kesäaika", "WIB": "Länsi-Indonesian aika", "IST": "Intian aika", "∅∅∅": "Amazonin kesäaika", "PST": "Yhdysvaltain Tyynenmeren normaaliaika", "EST": "Yhdysvaltain itäinen normaaliaika", "CST": "Yhdysvaltain keskinen normaaliaika", "CDT": "Yhdysvaltain keskinen kesäaika", "EAT": "Itä-Afrikan aika", "GYT": "Guyanan aika", "AWDT": "Länsi-Australian kesäaika", "CLT": "Chilen normaaliaika", "EDT": "Yhdysvaltain itäinen kesäaika", "SGT": "Singaporen aika", "MYT": "Malesian aika", "NZST": "Uuden-Seelannin normaaliaika", "CHADT": "Chathamin kesäaika", "ACST": "Keski-Australian normaaliaika", "ACWST": "Läntisen Keski-Australian normaaliaika", "AEDT": "Itä-Australian kesäaika", "SAST": "Etelä-Afrikan aika", "HNT": "Newfoundlandin normaaliaika", "PDT": "Yhdysvaltain Tyynenmeren kesäaika", "BOT": "Bolivian aika", "ChST": "Tšamorron aika", "MDT": "Macaon kesäaika", "WIT": "Itä-Indonesian aika", "HAST": "Havaijin-Aleuttien normaaliaika", "ARST": "Argentiinan kesäaika", "NZDT": "Uuden-Seelannin kesäaika", "COST": "Kolumbian kesäaika", "WART": "Länsi-Argentiinan normaaliaika", "JDT": "Japanin kesäaika", "UYST": "Uruguayn kesäaika", "ECT": "Ecuadorin aika", "ART": "Argentiinan normaaliaika", "AEST": "Itä-Australian normaaliaika", "HADT": "Havaijin-Aleuttien kesäaika", "MESZ": "Keski-Euroopan kesäaika", "WEZ": "Länsi-Euroopan normaaliaika", "HKST": "Hongkongin kesäaika"},
+ timezones: map[string]string{"CLT": "Chilen normaaliaika", "WARST": "Länsi-Argentiinan kesäaika", "GFT": "Ranskan Guayanan aika", "VET": "Venezuelan aika", "MEZ": "Keski-Euroopan normaaliaika", "COT": "Kolumbian normaaliaika", "TMT": "Turkmenistanin normaaliaika", "EAT": "Itä-Afrikan aika", "CST": "Yhdysvaltain keskinen normaaliaika", "HKT": "Hongkongin normaaliaika", "JST": "Japanin normaaliaika", "NZDT": "Uuden-Seelannin kesäaika", "COST": "Kolumbian kesäaika", "WAST": "Länsi-Afrikan kesäaika", "CAT": "Keski-Afrikan aika", "WAT": "Länsi-Afrikan normaaliaika", "SRT": "Surinamin aika", "AKDT": "Alaskan kesäaika", "SGT": "Singaporen aika", "BT": "Bhutanin aika", "CHAST": "Chathamin normaaliaika", "AWST": "Länsi-Australian normaaliaika", "OEZ": "Itä-Euroopan normaaliaika", "LHDT": "Lord Howen kesäaika", "UYST": "Uruguayn kesäaika", "LHST": "Lord Howen normaaliaika", "MYT": "Malesian aika", "WITA": "Keski-Indonesian aika", "PDT": "Yhdysvaltain Tyynenmeren kesäaika", "HAT": "Newfoundlandin kesäaika", "ECT": "Ecuadorin aika", "AKST": "Alaskan normaaliaika", "HADT": "Havaijin-Aleuttien kesäaika", "NZST": "Uuden-Seelannin normaaliaika", "IST": "Intian aika", "SAST": "Etelä-Afrikan aika", "MESZ": "Keski-Euroopan kesäaika", "TMST": "Turkmenistanin kesäaika", "AEST": "Itä-Australian normaaliaika", "MST": "Macaon normaaliaika", "JDT": "Japanin kesäaika", "ART": "Argentiinan normaaliaika", "HAST": "Havaijin-Aleuttien normaaliaika", "WESZ": "Länsi-Euroopan kesäaika", "AEDT": "Itä-Australian kesäaika", "GYT": "Guyanan aika", "UYT": "Uruguayn normaaliaika", "ARST": "Argentiinan kesäaika", "BOT": "Bolivian aika", "EDT": "Yhdysvaltain itäinen kesäaika", "WIB": "Länsi-Indonesian aika", "WEZ": "Länsi-Euroopan normaaliaika", "WART": "Länsi-Argentiinan normaaliaika", "MDT": "Macaon kesäaika", "AST": "Kanadan Atlantin normaaliaika", "ADT": "Kanadan Atlantin kesäaika", "WIT": "Itä-Indonesian aika", "ACST": "Keski-Australian normaaliaika", "∅∅∅": "Azorien kesäaika", "CHADT": "Chathamin kesäaika", "AWDT": "Länsi-Australian kesäaika", "EST": "Yhdysvaltain itäinen normaaliaika", "PST": "Yhdysvaltain Tyynenmeren normaaliaika", "ACWST": "Läntisen Keski-Australian normaaliaika", "HNT": "Newfoundlandin normaaliaika", "OESZ": "Itä-Euroopan kesäaika", "GMT": "Greenwichin normaaliaika", "ChST": "Tšamorron aika", "ACWDT": "Läntisen Keski-Australian kesäaika", "CLST": "Chilen kesäaika", "CDT": "Yhdysvaltain keskinen kesäaika", "ACDT": "Keski-Australian kesäaika", "HKST": "Hongkongin kesäaika"},
}
}
diff --git a/fi/fi_test.go b/fi/fi_test.go
new file mode 100644
index 00000000..5176a0f3
--- /dev/null
+++ b/fi/fi_test.go
@@ -0,0 +1,1120 @@
+package fi
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fi"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fi_FI/fi_FI.go b/fi_FI/fi_FI.go
index d622c931..7ee45c43 100644
--- a/fi_FI/fi_FI.go
+++ b/fi_FI/fi_FI.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"eKr.", "jKr."},
erasNarrow: []string{"eK", "jK"},
erasWide: []string{"ennen Kristuksen syntymää", "jälkeen Kristuksen syntymän"},
- timezones: map[string]string{"WESZ": "Länsi-Euroopan kesäaika", "MYT": "Malesian aika", "JDT": "Japanin kesäaika", "CST": "Yhdysvaltain keskinen normaaliaika", "NZDT": "Uuden-Seelannin kesäaika", "BOT": "Bolivian aika", "SAST": "Etelä-Afrikan aika", "WAT": "Länsi-Afrikan normaaliaika", "WITA": "Keski-Indonesian aika", "WIT": "Itä-Indonesian aika", "ARST": "Argentiinan kesäaika", "MEZ": "Keski-Euroopan normaaliaika", "HAT": "Newfoundlandin kesäaika", "UYT": "Uruguayn normaaliaika", "ACWST": "Läntisen Keski-Australian normaaliaika", "CLST": "Chilen kesäaika", "ECT": "Ecuadorin aika", "HKT": "Hongkongin normaaliaika", "ART": "Argentiinan normaaliaika", "PDT": "Yhdysvaltain Tyynenmeren kesäaika", "NZST": "Uuden-Seelannin normaaliaika", "AST": "Kanadan Atlantin normaaliaika", "GMT": "Greenwichin normaaliaika", "HNT": "Newfoundlandin normaaliaika", "GFT": "Ranskan Guayanan aika", "MST": "Macaon normaaliaika", "AWDT": "Länsi-Australian kesäaika", "LHDT": "Lord Howen kesäaika", "WAST": "Länsi-Afrikan kesäaika", "IST": "Intian aika", "AKST": "Alaskan normaaliaika", "CDT": "Yhdysvaltain keskinen kesäaika", "CLT": "Chilen normaaliaika", "SGT": "Singaporen aika", "HKST": "Hongkongin kesäaika", "WIB": "Länsi-Indonesian aika", "TMST": "Turkmenistanin kesäaika", "PST": "Yhdysvaltain Tyynenmeren normaaliaika", "UYST": "Uruguayn kesäaika", "LHST": "Lord Howen normaaliaika", "GYT": "Guyanan aika", "AEDT": "Itä-Australian kesäaika", "CHAST": "Chathamin normaaliaika", "VET": "Venezuelan aika", "ADT": "Kanadan Atlantin kesäaika", "ACST": "Keski-Australian normaaliaika", "ACWDT": "Läntisen Keski-Australian kesäaika", "EST": "Yhdysvaltain itäinen normaaliaika", "COT": "Kolumbian normaaliaika", "WART": "Länsi-Argentiinan normaaliaika", "WARST": "Länsi-Argentiinan kesäaika", "HADT": "Havaijin-Aleuttien kesäaika", "EDT": "Yhdysvaltain itäinen kesäaika", "BT": "Bhutanin aika", "OESZ": "Itä-Euroopan kesäaika", "ACDT": "Keski-Australian kesäaika", "AWST": "Länsi-Australian normaaliaika", "AEST": "Itä-Australian normaaliaika", "CAT": "Keski-Afrikan aika", "OEZ": "Itä-Euroopan normaaliaika", "MDT": "Macaon kesäaika", "AKDT": "Alaskan kesäaika", "JST": "Japanin normaaliaika", "WEZ": "Länsi-Euroopan normaaliaika", "EAT": "Itä-Afrikan aika", "TMT": "Turkmenistanin normaaliaika", "SRT": "Surinamin aika", "MESZ": "Keski-Euroopan kesäaika", "HAST": "Havaijin-Aleuttien normaaliaika", "∅∅∅": "Amazonin kesäaika", "ChST": "Tšamorron aika", "CHADT": "Chathamin kesäaika", "COST": "Kolumbian kesäaika"},
+ timezones: map[string]string{"CLT": "Chilen normaaliaika", "CST": "Yhdysvaltain keskinen normaaliaika", "PDT": "Yhdysvaltain Tyynenmeren kesäaika", "TMST": "Turkmenistanin kesäaika", "AKDT": "Alaskan kesäaika", "ACWST": "Läntisen Keski-Australian normaaliaika", "ARST": "Argentiinan kesäaika", "BOT": "Bolivian aika", "TMT": "Turkmenistanin normaaliaika", "WIT": "Itä-Indonesian aika", "UYT": "Uruguayn normaaliaika", "ACDT": "Keski-Australian kesäaika", "HKT": "Hongkongin normaaliaika", "SGT": "Singaporen aika", "MDT": "Kalliovuorten kesäaika", "MYT": "Malesian aika", "∅∅∅": "Brasilian kesäaika", "AKST": "Alaskan normaaliaika", "WAT": "Länsi-Afrikan normaaliaika", "EST": "Yhdysvaltain itäinen normaaliaika", "WESZ": "Länsi-Euroopan kesäaika", "AEST": "Itä-Australian normaaliaika", "VET": "Venezuelan aika", "NZDT": "Uuden-Seelannin kesäaika", "WEZ": "Länsi-Euroopan normaaliaika", "COST": "Kolumbian kesäaika", "AEDT": "Itä-Australian kesäaika", "ACST": "Keski-Australian normaaliaika", "SRT": "Surinamin aika", "AWDT": "Länsi-Australian kesäaika", "JST": "Japanin normaaliaika", "HAT": "Newfoundlandin kesäaika", "COT": "Kolumbian normaaliaika", "ChST": "Tšamorron aika", "BT": "Bhutanin aika", "CLST": "Chilen kesäaika", "WARST": "Länsi-Argentiinan kesäaika", "HKST": "Hongkongin kesäaika", "SAST": "Etelä-Afrikan aika", "LHST": "Lord Howen normaaliaika", "UYST": "Uruguayn kesäaika", "CDT": "Yhdysvaltain keskinen kesäaika", "CHADT": "Chathamin kesäaika", "ADT": "Kanadan Atlantin kesäaika", "HAST": "Havaijin-Aleuttien normaaliaika", "WIB": "Länsi-Indonesian aika", "MEZ": "Keski-Euroopan normaaliaika", "OEZ": "Itä-Euroopan normaaliaika", "OESZ": "Itä-Euroopan kesäaika", "GYT": "Guyanan aika", "WART": "Länsi-Argentiinan normaaliaika", "CHAST": "Chathamin normaaliaika", "ECT": "Ecuadorin aika", "EDT": "Yhdysvaltain itäinen kesäaika", "HADT": "Havaijin-Aleuttien kesäaika", "MST": "Kalliovuorten normaaliaika", "NZST": "Uuden-Seelannin normaaliaika", "WAST": "Länsi-Afrikan kesäaika", "GFT": "Ranskan Guayanan aika", "AWST": "Länsi-Australian normaaliaika", "PST": "Yhdysvaltain Tyynenmeren normaaliaika", "CAT": "Keski-Afrikan aika", "EAT": "Itä-Afrikan aika", "AST": "Kanadan Atlantin normaaliaika", "JDT": "Japanin kesäaika", "HNT": "Newfoundlandin normaaliaika", "LHDT": "Lord Howen kesäaika", "WITA": "Keski-Indonesian aika", "MESZ": "Keski-Euroopan kesäaika", "GMT": "Greenwichin normaaliaika", "ACWDT": "Läntisen Keski-Australian kesäaika", "ART": "Argentiinan normaaliaika", "IST": "Intian aika"},
}
}
diff --git a/fi_FI/fi_FI_test.go b/fi_FI/fi_FI_test.go
new file mode 100644
index 00000000..7117b6d3
--- /dev/null
+++ b/fi_FI/fi_FI_test.go
@@ -0,0 +1,1120 @@
+package fi_FI
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fi_FI"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fil/fil.go b/fil/fil.go
index fa414ec3..a396ca9d 100644
--- a/fil/fil.go
+++ b/fil/fil.go
@@ -47,7 +47,7 @@ func New() locales.Translator {
locale: "fil",
pluralsCardinal: []locales.PluralRule{2, 6},
pluralsOrdinal: []locales.PluralRule{2, 6},
- pluralsRange: []locales.PluralRule{2, 6},
+ pluralsRange: []locales.PluralRule{6, 2},
decimal: ".",
group: ",",
minus: "-",
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"", ""},
erasWide: []string{"BC", "AD"},
- timezones: map[string]string{"WIT": "Oras ng Silangang Indonesiya", "VET": "Oras sa Venezuela", "COST": "Oras sa Tag-init ng Colombia", "WARST": "Oras sa Tag-init ng Kanlurang Argentina", "MYT": "Oras ng Malaysia", "NZDT": "Daylight Time sa New Zealand", "CLT": "Standard na Oras sa Chile", "AST": "Standard na Oras sa Atlantiko", "SGT": "Standard na Oras sa Singapore", "ACWST": "Standard Time ng Gitnang Kanluran ng Australya", "IST": "Standard na Oras sa Bhutan", "ACST": "Standard Time ng Gitnang Australya", "LHDT": "Daylight Time sa Lorde Howe", "UYST": "Oras sa Tag-init ng Uruguay", "CHADT": "Daylight Time sa Chatham", "HKT": "Standard na Oras sa Hong Kong", "BT": "Oras sa Bhutan", "TMST": "Oras sa Tag-init ng Turkmenistan", "∅∅∅": "Oras sa Tag-init ng Amazon", "AWDT": "Daylight Time sa Kanlurang Australya", "CST": "Sentral na Standard na Oras", "CAT": "Oras sa Gitnang Africa", "ACDT": "Daylight Time ng Gitnang Australya", "GYT": "Oras sa Guyana", "NZST": "Standard na Oras sa New Zealand", "HADT": "Oras sa Tag-init ng Hawaii-Aleutian", "WAT": "Standard na Oras sa Kanlurang Africa", "OESZ": "Oras sa Tag-init ng Silangang Europe", "WESZ": "Oras sa Tag-init ng Kanlurang Europe", "SAST": "Oras sa Timog Africa", "HAT": "Daylight Time sa Newfoundland", "JST": "Standard na Oras sa Japan", "MEZ": "Standard na Oras sa Gitnang Europe", "GFT": "Oras sa French Guiana", "EAT": "Oras sa Silangang Africa", "AEST": "Standard Time ng Silangang Australya", "HAST": "Standard na Oras sa Hawaii-Aleutian", "WAST": "Oras sa Tag-init ng Kanlurang Africa", "MESZ": "Oras sa Tag-init ng Gitnang Europe", "CLST": "Oras sa Tag-init ng Chile", "HKST": "Oras sa Tag-init ng Hong Kong", "WITA": "Oras ng Gitnang Indonesiya", "OEZ": "Standard na Oras sa Silangang Europe", "JDT": "Daylight Time sa Japan", "SRT": "Oras sa Suriname", "CDT": "Sentral na Daylight Time", "AKDT": "Daylight Time sa Alaska", "PST": "Standard na Oras sa Pasipiko", "CHAST": "Standard na Oras sa Chatham", "ACWDT": "Daylight Time ng Gitnang Kanluran ng Australya", "COT": "Standard na Oras sa Colombia", "EST": "Eastern na Standard na Oras", "EDT": "Eastern Daylight Time", "ADT": "Daylight Time sa Atlantiko", "WIB": "Oras ng Kanlurang Indonesiya", "TMT": "Standard na Oras sa Turkmenistan", "ARST": "Oras sa Tag-init ng Argentina", "AKST": "Standard na Oras sa Alaska", "UYT": "Standard na Oras sa Uruguay", "WART": "Standard na Oras sa Kanlurang Argentina", "AEDT": "Daylight Time ng Silangang Australya", "ChST": "Standard na Oras sa Chamorro", "GMT": "Greenwich Mean Time", "AWST": "Standard Time ng Kanlurang Australya", "BOT": "Oras sa Bolivia", "WEZ": "Standard na Oras sa Kanlurang Europe", "HNT": "Standard na Oras sa Newfoundland", "MST": "MST", "PDT": "Daylight Time sa Pasipiko", "LHST": "Standard na Oras sa Lord Howe", "ECT": "Oras sa Ecuador", "MDT": "MDT", "ART": "Standard na Oras sa Argentina"},
+ timezones: map[string]string{"ARST": "Oras sa Tag-init ng Argentina", "CAT": "Oras sa Gitnang Africa", "WIB": "Oras ng Kanlurang Indonesiya", "VET": "Oras sa Venezuela", "ART": "Standard na Oras sa Argentina", "LHST": "Standard na Oras sa Lord Howe", "MYT": "Oras ng Malaysia", "WARST": "Oras sa Tag-init ng Kanlurang Argentina", "HADT": "Oras sa Tag-init ng Hawaii-Aleutian", "ACDT": "Daylight Time ng Gitnang Australya", "CHADT": "Daylight Time sa Chatham", "ACWDT": "Daylight Time ng Gitnang Kanluran ng Australya", "TMT": "Standard na Oras sa Turkmenistan", "NZST": "Standard na Oras sa New Zealand", "EDT": "Eastern Daylight Time", "MESZ": "Oras sa Tag-init ng Gitnang Europe", "UYT": "Standard na Oras sa Uruguay", "AKST": "Standard na Oras sa Alaska", "GYT": "Oras sa Guyana", "EAT": "Oras sa Silangang Africa", "MDT": "Daylight Time sa Bundok", "WART": "Standard na Oras sa Kanlurang Argentina", "NZDT": "Daylight Time sa New Zealand", "AST": "Standard na Oras sa Atlantiko", "WITA": "Oras ng Gitnang Indonesiya", "JST": "Standard na Oras sa Japan", "PDT": "Daylight Time sa Pasipiko", "WESZ": "Oras sa Tag-init ng Kanlurang Europe", "SGT": "Standard na Oras sa Singapore", "LHDT": "Daylight Time sa Lorde Howe", "AKDT": "Daylight Time sa Alaska", "ACST": "Standard Time ng Gitnang Australya", "JDT": "Daylight Time sa Japan", "IST": "Standard na Oras sa Bhutan", "WAST": "Oras sa Tag-init ng Kanlurang Africa", "MST": "Standard na Oras sa Bundok", "ADT": "Daylight Time sa Atlantiko", "OEZ": "Standard na Oras sa Silangang Europe", "OESZ": "Oras sa Tag-init ng Silangang Europe", "AEST": "Standard Time ng Silangang Australya", "CLST": "Oras sa Tag-init ng Chile", "SRT": "Oras sa Suriname", "ACWST": "Standard Time ng Gitnang Kanluran ng Australya", "BT": "Oras sa Bhutan", "CLT": "Standard na Oras sa Chile", "HNT": "Standard na Oras sa Newfoundland", "EST": "Eastern na Standard na Oras", "HKST": "Oras sa Tag-init ng Hong Kong", "ECT": "Oras sa Ecuador", "AWST": "Standard Time ng Kanlurang Australya", "WAT": "Standard na Oras sa Kanlurang Africa", "GMT": "Greenwich Mean Time", "CST": "Sentral na Standard na Oras", "GFT": "Oras sa French Guiana", "CHAST": "Standard na Oras sa Chatham", "AWDT": "Daylight Time sa Kanlurang Australya", "PST": "Standard na Oras sa Pasipiko", "COT": "Standard na Oras sa Colombia", "UYST": "Oras sa Tag-init ng Uruguay", "BOT": "Oras sa Bolivia", "MEZ": "Standard na Oras sa Gitnang Europe", "∅∅∅": "Oras sa Tag-init ng Amazon", "TMST": "Oras sa Tag-init ng Turkmenistan", "WEZ": "Standard na Oras sa Kanlurang Europe", "SAST": "Oras sa Timog Africa", "ChST": "Standard na Oras sa Chamorro", "WIT": "Oras ng Silangang Indonesiya", "HKT": "Standard na Oras sa Hong Kong", "AEDT": "Daylight Time ng Silangang Australya", "HAT": "Daylight Time sa Newfoundland", "COST": "Oras sa Tag-init ng Colombia", "CDT": "Sentral na Daylight Time", "HAST": "Standard na Oras sa Hawaii-Aleutian"},
}
}
diff --git a/fil/fil_test.go b/fil/fil_test.go
new file mode 100644
index 00000000..93b85130
--- /dev/null
+++ b/fil/fil_test.go
@@ -0,0 +1,1120 @@
+package fil
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fil"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fil_PH/fil_PH.go b/fil_PH/fil_PH.go
index eef7525c..2baac9c4 100644
--- a/fil_PH/fil_PH.go
+++ b/fil_PH/fil_PH.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"", ""},
erasWide: []string{"BC", "AD"},
- timezones: map[string]string{"AWST": "Standard Time ng Kanlurang Australya", "CHAST": "Standard na Oras sa Chatham", "CLST": "Oras sa Tag-init ng Chile", "GYT": "Oras sa Guyana", "PDT": "Daylight Time sa Pasipiko", "UYT": "Standard na Oras sa Uruguay", "∅∅∅": "∅∅∅", "OEZ": "Standard na Oras sa Silangang Europe", "WIT": "Oras ng Silangang Indonesiya", "WIB": "Oras ng Kanlurang Indonesiya", "JDT": "Daylight Time sa Japan", "WART": "Standard na Oras sa Kanlurang Argentina", "BT": "Oras sa Bhutan", "GMT": "Greenwich Mean Time", "ACDT": "Daylight Time ng Gitnang Australya", "PST": "Standard na Oras sa Pasipiko", "HAT": "Daylight Time sa Newfoundland", "TMT": "Standard na Oras sa Turkmenistan", "TMST": "Oras sa Tag-init ng Turkmenistan", "AKDT": "Daylight Time sa Alaska", "CST": "Sentral na Standard na Oras", "WAT": "Standard na Oras sa Kanlurang Africa", "HNT": "Standard na Oras sa Newfoundland", "MST": "MST", "LHDT": "Daylight Time sa Lorde Howe", "NZST": "Standard na Oras sa New Zealand", "NZDT": "Daylight Time sa New Zealand", "AEST": "Standard Time ng Silangang Australya", "HKT": "Standard na Oras sa Hong Kong", "HKST": "Oras sa Tag-init ng Hong Kong", "ACWDT": "Daylight Time ng Gitnang Kanluran ng Australya", "ECT": "Oras sa Ecuador", "SGT": "Standard na Oras sa Singapore", "OESZ": "Oras sa Tag-init ng Silangang Europe", "AWDT": "Daylight Time sa Kanlurang Australya", "VET": "Oras sa Venezuela", "AEDT": "Daylight Time ng Silangang Australya", "COT": "Standard na Oras sa Colombia", "AST": "Standard na Oras sa Atlantiko", "ACST": "Standard Time ng Gitnang Australya", "BOT": "Oras sa Bolivia", "CLT": "Standard na Oras sa Chile", "WESZ": "Oras sa Tag-init ng Kanlurang Europe", "EST": "Eastern na Standard na Oras", "WAST": "Oras sa Tag-init ng Kanlurang Africa", "MEZ": "Standard na Oras sa Gitnang Europe", "MDT": "MDT", "SRT": "Oras sa Suriname", "CDT": "Sentral na Daylight Time", "MESZ": "Oras sa Tag-init ng Gitnang Europe", "ChST": "Standard na Oras sa Chamorro", "SAST": "Oras sa Timog Africa", "GFT": "Oras sa French Guiana", "AKST": "Standard na Oras sa Alaska", "HADT": "Oras sa Tag-init ng Hawaii-Aleutian", "MYT": "Oras ng Malaysia", "UYST": "Oras sa Tag-init ng Uruguay", "CHADT": "Daylight Time sa Chatham", "ACWST": "Standard Time ng Gitnang Kanluran ng Australya", "CAT": "Oras sa Gitnang Africa", "EDT": "Eastern Daylight Time", "HAST": "Standard na Oras sa Hawaii-Aleutian", "IST": "Standard na Oras sa Bhutan", "LHST": "Standard na Oras sa Lord Howe", "EAT": "Oras sa Silangang Africa", "ARST": "Oras sa Tag-init ng Argentina", "WARST": "Oras sa Tag-init ng Kanlurang Argentina", "WITA": "Oras ng Gitnang Indonesiya", "JST": "Standard na Oras sa Japan", "WEZ": "Standard na Oras sa Kanlurang Europe", "COST": "Oras sa Tag-init ng Colombia", "ADT": "Daylight Time sa Atlantiko", "ART": "Standard na Oras sa Argentina"},
+ timezones: map[string]string{"EST": "Eastern na Standard na Oras", "NZST": "Standard na Oras sa New Zealand", "WIB": "Oras ng Kanlurang Indonesiya", "OESZ": "Oras sa Tag-init ng Silangang Europe", "GMT": "Greenwich Mean Time", "SRT": "Oras sa Suriname", "ACWST": "Standard Time ng Gitnang Kanluran ng Australya", "AWDT": "Daylight Time sa Kanlurang Australya", "JST": "Standard na Oras sa Japan", "NZDT": "Daylight Time sa New Zealand", "BOT": "Oras sa Bolivia", "WAST": "Oras sa Tag-init ng Kanlurang Africa", "SGT": "Standard na Oras sa Singapore", "LHST": "Standard na Oras sa Lord Howe", "EDT": "Eastern Daylight Time", "WAT": "Standard na Oras sa Kanlurang Africa", "GYT": "Oras sa Guyana", "CLST": "Oras sa Tag-init ng Chile", "ECT": "Oras sa Ecuador", "AKST": "Standard na Oras sa Alaska", "MESZ": "Oras sa Tag-init ng Gitnang Europe", "HAT": "Daylight Time sa Newfoundland", "WIT": "Oras ng Silangang Indonesiya", "ADT": "Daylight Time sa Atlantiko", "JDT": "Daylight Time sa Japan", "WESZ": "Oras sa Tag-init ng Kanlurang Europe", "HNT": "Standard na Oras sa Newfoundland", "ChST": "Standard na Oras sa Chamorro", "UYT": "Standard na Oras sa Uruguay", "IST": "Standard na Oras sa Bhutan", "PST": "Standard na Oras sa Pasipiko", "BT": "Oras sa Bhutan", "WEZ": "Standard na Oras sa Kanlurang Europe", "AEST": "Standard Time ng Silangang Australya", "HKT": "Standard na Oras sa Hong Kong", "HKST": "Oras sa Tag-init ng Hong Kong", "ACDT": "Daylight Time ng Gitnang Australya", "AWST": "Standard Time ng Kanlurang Australya", "EAT": "Oras sa Silangang Africa", "CDT": "Sentral na Daylight Time", "CHAST": "Standard na Oras sa Chatham", "VET": "Oras sa Venezuela", "AKDT": "Daylight Time sa Alaska", "ACWDT": "Daylight Time ng Gitnang Kanluran ng Australya", "HAST": "Standard na Oras sa Hawaii-Aleutian", "CHADT": "Daylight Time sa Chatham", "SAST": "Oras sa Timog Africa", "MYT": "Oras ng Malaysia", "CST": "Sentral na Standard na Oras", "WART": "Standard na Oras sa Kanlurang Argentina", "ARST": "Oras sa Tag-init ng Argentina", "WITA": "Oras ng Gitnang Indonesiya", "TMST": "Oras sa Tag-init ng Turkmenistan", "MST": "Standard na Oras sa Bundok", "CLT": "Standard na Oras sa Chile", "ART": "Standard na Oras sa Argentina", "AST": "Standard na Oras sa Atlantiko", "MEZ": "Standard na Oras sa Gitnang Europe", "∅∅∅": "Oras sa Tag-init ng Amazon", "CAT": "Oras sa Gitnang Africa", "COT": "Standard na Oras sa Colombia", "COST": "Oras sa Tag-init ng Colombia", "TMT": "Standard na Oras sa Turkmenistan", "OEZ": "Standard na Oras sa Silangang Europe", "AEDT": "Daylight Time ng Silangang Australya", "MDT": "Daylight Time sa Bundok", "ACST": "Standard Time ng Gitnang Australya", "PDT": "Daylight Time sa Pasipiko", "HADT": "Oras sa Tag-init ng Hawaii-Aleutian", "LHDT": "Daylight Time sa Lorde Howe", "UYST": "Oras sa Tag-init ng Uruguay", "WARST": "Oras sa Tag-init ng Kanlurang Argentina", "GFT": "Oras sa French Guiana"},
}
}
diff --git a/fil_PH/fil_PH_test.go b/fil_PH/fil_PH_test.go
new file mode 100644
index 00000000..87704861
--- /dev/null
+++ b/fil_PH/fil_PH_test.go
@@ -0,0 +1,1120 @@
+package fil_PH
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fil_PH"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fo/fo.go b/fo/fo.go
index de4b4666..596de282 100644
--- a/fo/fo.go
+++ b/fo/fo.go
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"f.Kr.", "e.Kr."},
erasNarrow: []string{"fKr", "eKr"},
erasWide: []string{"fyri Krist", "eftir Krist"},
- timezones: map[string]string{"CDT": "Central summartíð", "NZST": "Nýsæland vanlig tíð", "ADT": "Atlantic summartíð", "HNT": "Newfoundland vanlig tíð", "PDT": "Pacific summartíð", "WEZ": "Vesturevropa vanlig tíð", "CLT": "Kili vanlig tíð", "WITA": "Mið Indonesia tíð", "GYT": "Gujana tíð", "MEZ": "Miðevropa vanlig tíð", "EST": "Eastern vanlig tíð", "HAST": "Hawaii-Aleutian vanlig tíð", "IST": "India tíð", "ART": "Argentina vanlig tíð", "TMT": "Turkmenistan vanlig tíð", "LHDT": "Lord Howe summartíð", "UYT": "Uruguai vanlig tíð", "CLST": "Kili summartíð", "ECT": "Ekvador tíð", "ACDT": "mið Avstralia summartíð", "TMST": "Turkmenistan summartíð", "JDT": "Japan summartíð", "MDT": "Mountain summartíð", "WAST": "Vesturafrika summartíð", "OEZ": "Eysturevropa vanlig tíð", "AKST": "Alaska vanlig tíð", "AWDT": "vestur Avstralia summartíð", "MYT": "Malaisia tíð", "WART": "Vestur Argentina vanlig tíð", "MESZ": "Miðevropa summartíð", "VET": "Venesuela tíð", "WESZ": "Vesturevropa summartíð", "ACWDT": "miðvestur Avstralia summartíð", "MST": "Mountain vanlig tíð", "AST": "Atlantic vanlig tíð", "BT": "Butan tíð", "COST": "Kolombia summartíð", "JST": "Japan vanlig tíð", "ACWST": "miðvestur Avstralia vanlig tíð", "ACST": "mið Avstralia vanlig tíð", "SRT": "Surinam tíð", "AKDT": "Alaska summartíð", "AWST": "vestur Avstralia vanlig tíð", "UYST": "Uruguai summartíð", "ChST": "Chamorro vanlig tíð", "EDT": "Eastern summartíð", "WAT": "Vesturafrika vanlig tíð", "BOT": "Bolivia tíð", "CHADT": "Chatham summartíð", "OESZ": "Eysturevropa summartíð", "EAT": "Eysturafrika tíð", "CAT": "Miðafrika tíð", "COT": "Kolombia vanlig tíð", "GFT": "Franska Gujana tíð", "CST": "Central vanlig tíð", "CHAST": "Chatham vanlig tíð", "HADT": "Hawaii-Aleutian summartíð", "HKT": "Hong Kong vanlig tíð", "HKST": "Hong Kong summartíð", "WARST": "Vestur Argentina summartíð", "WIB": "Vestur Indonesia tíð", "AEST": "eystur Avstralia vanlig tíð", "GMT": "Greenwich Mean tíð", "HAT": "Newfoundland summartíð", "LHST": "Lord Howe vanlig tíð", "NZDT": "Nýsæland summartíð", "∅∅∅": "Brasilia summartíð", "SAST": "Suðurafrika vanlig tíð", "SGT": "Singapor tíð", "ARST": "Argentina summartíð", "AEDT": "eystur Avstralia summartíð", "WIT": "Eystur Indonesia tíð", "PST": "Pacific vanlig tíð"},
+ timezones: map[string]string{"GMT": "Greenwich Mean tíð", "CST": "Central vanlig tíð", "WART": "Vestur Argentina vanlig tíð", "AWDT": "vestur Avstralia summartíð", "IST": "India tíð", "EDT": "Eastern summartíð", "MDT": "MDT", "AKST": "Alaska vanlig tíð", "ART": "Argentina vanlig tíð", "MEZ": "Miðevropa vanlig tíð", "WEZ": "Vesturevropa vanlig tíð", "MST": "MST", "WAST": "Vesturafrika summartíð", "BOT": "Bolivia tíð", "EST": "Eastern vanlig tíð", "AEDT": "eystur Avstralia summartíð", "∅∅∅": "Azorurnar summartíð", "JST": "Japan vanlig tíð", "JDT": "Japan summartíð", "AEST": "eystur Avstralia vanlig tíð", "CLST": "Kili summartíð", "LHDT": "Lord Howe summartíð", "HKST": "Hong Kong summartíð", "AST": "Atlantic vanlig tíð", "SGT": "Singapor tíð", "EAT": "Eysturafrika tíð", "BT": "Butan tíð", "WIB": "Vestur Indonesia tíð", "GYT": "Gujana tíð", "ACDT": "mið Avstralia summartíð", "WARST": "Vestur Argentina summartíð", "GFT": "Franska Gujana tíð", "ADT": "Atlantic summartíð", "ACWST": "miðvestur Avstralia vanlig tíð", "CAT": "Miðafrika tíð", "HNT": "Newfoundland vanlig tíð", "OEZ": "Eysturevropa vanlig tíð", "WIT": "Eystur Indonesia tíð", "CDT": "Central summartíð", "NZDT": "Nýsæland summartíð", "PST": "Pacific vanlig tíð", "PDT": "Pacific summartíð", "NZST": "Nýsæland vanlig tíð", "SAST": "Suðurafrika vanlig tíð", "TMST": "Turkmenistan summartíð", "COST": "Kolombia summartíð", "HAT": "Newfoundland summartíð", "OESZ": "Eysturevropa summartíð", "UYST": "Uruguai summartíð", "MYT": "Malaisia tíð", "ECT": "Ekvador tíð", "WITA": "Mið Indonesia tíð", "COT": "Kolombia vanlig tíð", "ACST": "mið Avstralia vanlig tíð", "SRT": "Surinam tíð", "AWST": "vestur Avstralia vanlig tíð", "HADT": "Hawaii-Aleutian summartíð", "TMT": "Turkmenistan vanlig tíð", "CLT": "Kili vanlig tíð", "CHAST": "Chatham vanlig tíð", "MESZ": "Miðevropa summartíð", "WAT": "Vesturafrika vanlig tíð", "CHADT": "Chatham summartíð", "HAST": "Hawaii-Aleutian vanlig tíð", "WESZ": "Vesturevropa summartíð", "ACWDT": "miðvestur Avstralia summartíð", "ARST": "Argentina summartíð", "ChST": "Chamorro vanlig tíð", "UYT": "Uruguai vanlig tíð", "LHST": "Lord Howe vanlig tíð", "HKT": "Hong Kong vanlig tíð", "VET": "Venesuela tíð", "AKDT": "Alaska summartíð"},
}
}
diff --git a/fo/fo_test.go b/fo/fo_test.go
new file mode 100644
index 00000000..705d6e95
--- /dev/null
+++ b/fo/fo_test.go
@@ -0,0 +1,1120 @@
+package fo
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fo"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fo_DK/fo_DK.go b/fo_DK/fo_DK.go
index bbd8d4e1..13e3c582 100644
--- a/fo_DK/fo_DK.go
+++ b/fo_DK/fo_DK.go
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"f.Kr.", "e.Kr."},
erasNarrow: []string{"fKr", "eKr"},
erasWide: []string{"fyri Krist", "eftir Krist"},
- timezones: map[string]string{"ChST": "Chamorro vanlig tíð", "WART": "Vestur Argentina vanlig tíð", "HADT": "Hawaii-Aleutian summartíð", "EAT": "Eysturafrika tíð", "EDT": "Eastern summartíð", "COST": "Kolombia summartíð", "GFT": "Franska Gujana tíð", "TMST": "Turkmenistan summartíð", "LHST": "Lord Howe vanlig tíð", "VET": "Venesuela tíð", "WARST": "Vestur Argentina summartíð", "NZDT": "Nýsæland summartíð", "LHDT": "Lord Howe summartíð", "GYT": "Gujana tíð", "MEZ": "Miðevropa vanlig tíð", "ACWST": "miðvestur Avstralia vanlig tíð", "CLT": "Kili vanlig tíð", "WITA": "Mið Indonesia tíð", "HNT": "Newfoundland vanlig tíð", "ACDT": "mið Avstralia summartíð", "SRT": "Surinam tíð", "AKDT": "Alaska summartíð", "NZST": "Nýsæland vanlig tíð", "WEZ": "Vesturevropa vanlig tíð", "WIB": "Vestur Indonesia tíð", "SAST": "Suðurafrika vanlig tíð", "MST": "MST", "MDT": "MDT", "AWST": "vestur Avstralia vanlig tíð", "MESZ": "Miðevropa summartíð", "UYST": "Uruguai summartíð", "∅∅∅": "∅∅∅", "MYT": "Malaisia tíð", "CHADT": "Chatham summartíð", "ECT": "Ekvador tíð", "WIT": "Eystur Indonesia tíð", "BT": "Butan tíð", "OEZ": "Eysturevropa vanlig tíð", "ARST": "Argentina summartíð", "TMT": "Turkmenistan vanlig tíð", "PST": "Pacific vanlig tíð", "JST": "Japan vanlig tíð", "CDT": "Central summartíð", "SGT": "Singapor tíð", "AEDT": "eystur Avstralia summartíð", "HKST": "Hong Kong summartíð", "IST": "India tíð", "OESZ": "Eysturevropa summartíð", "AWDT": "vestur Avstralia summartíð", "AEST": "eystur Avstralia vanlig tíð", "WAST": "Vesturafrika summartíð", "JDT": "Japan summartíð", "CHAST": "Chatham vanlig tíð", "CAT": "Miðafrika tíð", "ART": "Argentina vanlig tíð", "ACST": "mið Avstralia vanlig tíð", "AKST": "Alaska vanlig tíð", "CST": "Central vanlig tíð", "AST": "Atlantic vanlig tíð", "HAST": "Hawaii-Aleutian vanlig tíð", "HAT": "Newfoundland summartíð", "PDT": "Pacific summartíð", "WESZ": "Vesturevropa summartíð", "CLST": "Kili summartíð", "ADT": "Atlantic summartíð", "UYT": "Uruguai vanlig tíð", "EST": "Eastern vanlig tíð", "WAT": "Vesturafrika vanlig tíð", "GMT": "Greenwich Mean tíð", "BOT": "Bolivia tíð", "ACWDT": "miðvestur Avstralia summartíð", "COT": "Kolombia vanlig tíð", "HKT": "Hong Kong vanlig tíð"},
+ timezones: map[string]string{"LHDT": "Lord Howe summartíð", "UYST": "Uruguai summartíð", "AWDT": "vestur Avstralia summartíð", "CAT": "Miðafrika tíð", "CLST": "Kili summartíð", "ACDT": "mið Avstralia summartíð", "NZST": "Nýsæland vanlig tíð", "SAST": "Suðurafrika vanlig tíð", "COT": "Kolombia vanlig tíð", "TMT": "Turkmenistan vanlig tíð", "HKT": "Hong Kong vanlig tíð", "ART": "Argentina vanlig tíð", "∅∅∅": "∅∅∅", "OEZ": "Eysturevropa vanlig tíð", "ACWST": "miðvestur Avstralia vanlig tíð", "CHAST": "Chatham vanlig tíð", "PDT": "Pacific summartíð", "WIB": "Vestur Indonesia tíð", "EAT": "Eysturafrika tíð", "CDT": "Central summartíð", "WESZ": "Vesturevropa summartíð", "SGT": "Singapor tíð", "ARST": "Argentina summartíð", "TMST": "Turkmenistan summartíð", "GMT": "Greenwich Mean tíð", "GFT": "Franska Gujana tíð", "JDT": "Japan summartíð", "CHADT": "Chatham summartíð", "VET": "Venesuela tíð", "MEZ": "Miðevropa vanlig tíð", "WEZ": "Vesturevropa vanlig tíð", "MDT": "Mountain summartíð", "MYT": "Malaisia tíð", "WAST": "Vesturafrika summartíð", "WIT": "Eystur Indonesia tíð", "AKST": "Alaska vanlig tíð", "AKDT": "Alaska summartíð", "HADT": "Hawaii-Aleutian summartíð", "NZDT": "Nýsæland summartíð", "IST": "India tíð", "MST": "Mountain vanlig tíð", "HAT": "Newfoundland summartíð", "AEST": "eystur Avstralia vanlig tíð", "GYT": "Gujana tíð", "UYT": "Uruguai vanlig tíð", "EST": "Eastern vanlig tíð", "EDT": "Eastern summartíð", "MESZ": "Miðevropa summartíð", "BOT": "Bolivia tíð", "WITA": "Mið Indonesia tíð", "CST": "Central vanlig tíð", "ACST": "mið Avstralia vanlig tíð", "COST": "Kolombia summartíð", "OESZ": "Eysturevropa summartíð", "WARST": "Vestur Argentina summartíð", "SRT": "Surinam tíð", "JST": "Japan vanlig tíð", "ADT": "Atlantic summartíð", "CLT": "Kili vanlig tíð", "WART": "Vestur Argentina vanlig tíð", "ECT": "Ekvador tíð", "ACWDT": "miðvestur Avstralia summartíð", "ChST": "Chamorro vanlig tíð", "LHST": "Lord Howe vanlig tíð", "PST": "Pacific vanlig tíð", "HAST": "Hawaii-Aleutian vanlig tíð", "HNT": "Newfoundland vanlig tíð", "AEDT": "eystur Avstralia summartíð", "HKST": "Hong Kong summartíð", "AWST": "vestur Avstralia vanlig tíð", "AST": "Atlantic vanlig tíð", "WAT": "Vesturafrika vanlig tíð", "BT": "Butan tíð"},
}
}
diff --git a/fo_DK/fo_DK_test.go b/fo_DK/fo_DK_test.go
new file mode 100644
index 00000000..51fa3ae2
--- /dev/null
+++ b/fo_DK/fo_DK_test.go
@@ -0,0 +1,1120 @@
+package fo_DK
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fo_DK"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fo_FO/fo_FO.go b/fo_FO/fo_FO.go
index 58489a13..835c3cc8 100644
--- a/fo_FO/fo_FO.go
+++ b/fo_FO/fo_FO.go
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"f.Kr.", "e.Kr."},
erasNarrow: []string{"fKr", "eKr"},
erasWide: []string{"fyri Krist", "eftir Krist"},
- timezones: map[string]string{"EDT": "Eastern summartíð", "TMT": "Turkmenistan vanlig tíð", "AWDT": "vestur Avstralia summartíð", "HAST": "Hawaii-Aleutian vanlig tíð", "BT": "Butan tíð", "HNT": "Newfoundland vanlig tíð", "ARST": "Argentina summartíð", "EAT": "Eysturafrika tíð", "CDT": "Central summartíð", "NZST": "Nýsæland vanlig tíð", "WESZ": "Vesturevropa summartíð", "JST": "Japan vanlig tíð", "AWST": "vestur Avstralia vanlig tíð", "OESZ": "Eysturevropa summartíð", "ART": "Argentina vanlig tíð", "MESZ": "Miðevropa summartíð", "VET": "Venesuela tíð", "WAT": "Vesturafrika vanlig tíð", "WEZ": "Vesturevropa vanlig tíð", "ECT": "Ekvador tíð", "CLT": "Kili vanlig tíð", "EST": "Eastern vanlig tíð", "AKST": "Alaska vanlig tíð", "UYST": "Uruguai summartíð", "ADT": "Atlantic summartíð", "IST": "India tíð", "JDT": "Japan summartíð", "CHAST": "Chatham vanlig tíð", "HADT": "Hawaii-Aleutian summartíð", "WART": "Vestur Argentina vanlig tíð", "SGT": "Singapor tíð", "HKST": "Hong Kong summartíð", "AKDT": "Alaska summartíð", "WAST": "Vesturafrika summartíð", "ACDT": "mið Avstralia summartíð", "GYT": "Gujana tíð", "ACWST": "miðvestur Avstralia vanlig tíð", "∅∅∅": "Brasilia summartíð", "WITA": "Mið Indonesia tíð", "PDT": "Pacific summartíð", "CLST": "Kili summartíð", "COST": "Kolombia summartíð", "TMST": "Turkmenistan summartíð", "HKT": "Hong Kong vanlig tíð", "GMT": "Greenwich Mean tíð", "UYT": "Uruguai vanlig tíð", "CST": "Central vanlig tíð", "MST": "Mountain vanlig tíð", "ACST": "mið Avstralia vanlig tíð", "MYT": "Malaisia tíð", "MDT": "Mountain summartíð", "SAST": "Suðurafrika vanlig tíð", "OEZ": "Eysturevropa vanlig tíð", "HAT": "Newfoundland summartíð", "SRT": "Surinam tíð", "PST": "Pacific vanlig tíð", "NZDT": "Nýsæland summartíð", "ACWDT": "miðvestur Avstralia summartíð", "CAT": "Miðafrika tíð", "AEST": "eystur Avstralia vanlig tíð", "AEDT": "eystur Avstralia summartíð", "WARST": "Vestur Argentina summartíð", "WIT": "Eystur Indonesia tíð", "WIB": "Vestur Indonesia tíð", "MEZ": "Miðevropa vanlig tíð", "ChST": "Chamorro vanlig tíð", "CHADT": "Chatham summartíð", "LHST": "Lord Howe vanlig tíð", "LHDT": "Lord Howe summartíð", "GFT": "Franska Gujana tíð", "BOT": "Bolivia tíð", "COT": "Kolombia vanlig tíð", "AST": "Atlantic vanlig tíð"},
+ timezones: map[string]string{"NZST": "Nýsæland vanlig tíð", "AEDT": "eystur Avstralia summartíð", "MEZ": "Miðevropa vanlig tíð", "HAST": "Hawaii-Aleutian vanlig tíð", "HNT": "Newfoundland vanlig tíð", "SGT": "Singapor tíð", "OESZ": "Eysturevropa summartíð", "EAT": "Eysturafrika tíð", "BT": "Butan tíð", "JDT": "Japan summartíð", "SAST": "Suðurafrika vanlig tíð", "WIT": "Eystur Indonesia tíð", "IST": "India tíð", "WAST": "Vesturafrika summartíð", "WEZ": "Vesturevropa vanlig tíð", "GMT": "Greenwich Mean tíð", "UYT": "Uruguai vanlig tíð", "CLST": "Kili summartíð", "ADT": "Atlantic summartíð", "MYT": "Malaisia tíð", "CLT": "Kili vanlig tíð", "CDT": "Central summartíð", "MDT": "MDT", "AST": "Atlantic vanlig tíð", "HADT": "Hawaii-Aleutian summartíð", "WAT": "Vesturafrika vanlig tíð", "WART": "Vestur Argentina vanlig tíð", "MST": "MST", "VET": "Venesuela tíð", "ACWDT": "miðvestur Avstralia summartíð", "WITA": "Mið Indonesia tíð", "EST": "Eastern vanlig tíð", "EDT": "Eastern summartíð", "TMT": "Turkmenistan vanlig tíð", "TMST": "Turkmenistan summartíð", "ARST": "Argentina summartíð", "MESZ": "Miðevropa summartíð", "OEZ": "Eysturevropa vanlig tíð", "GYT": "Gujana tíð", "ACST": "mið Avstralia vanlig tíð", "ACDT": "mið Avstralia summartíð", "HKT": "Hong Kong vanlig tíð", "ECT": "Ekvador tíð", "ACWST": "miðvestur Avstralia vanlig tíð", "COST": "Kolombia summartíð", "CST": "Central vanlig tíð", "AWST": "vestur Avstralia vanlig tíð", "AWDT": "vestur Avstralia summartíð", "ART": "Argentina vanlig tíð", "PDT": "Pacific summartíð", "WIB": "Vestur Indonesia tíð", "COT": "Kolombia vanlig tíð", "GFT": "Franska Gujana tíð", "∅∅∅": "Azorurnar summartíð", "JST": "Japan vanlig tíð", "BOT": "Bolivia tíð", "UYST": "Uruguai summartíð", "WARST": "Vestur Argentina summartíð", "NZDT": "Nýsæland summartíð", "HAT": "Newfoundland summartíð", "ChST": "Chamorro vanlig tíð", "HKST": "Hong Kong summartíð", "AKDT": "Alaska summartíð", "CAT": "Miðafrika tíð", "WESZ": "Vesturevropa summartíð", "LHST": "Lord Howe vanlig tíð", "AKST": "Alaska vanlig tíð", "AEST": "eystur Avstralia vanlig tíð", "SRT": "Surinam tíð", "CHAST": "Chatham vanlig tíð", "CHADT": "Chatham summartíð", "PST": "Pacific vanlig tíð", "LHDT": "Lord Howe summartíð"},
}
}
diff --git a/fo_FO/fo_FO_test.go b/fo_FO/fo_FO_test.go
new file mode 100644
index 00000000..fea5ed9a
--- /dev/null
+++ b/fo_FO/fo_FO_test.go
@@ -0,0 +1,1120 @@
+package fo_FO
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fo_FO"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr/fr.go b/fr/fr.go
index c068319b..7badf236 100644
--- a/fr/fr.go
+++ b/fr/fr.go
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"SAST": "heure normale d’Afrique méridionale", "ARST": "heure d’été de l’Argentine", "CLST": "heure d’été du Chili", "ECT": "heure de l’Équateur", "SGT": "heure de Singapour", "HNT": "heure normale de Terre-Neuve", "TMST": "heure d’été du Turkménistan", "OEZ": "heure normale d’Europe de l’Est", "OESZ": "heure d’été d’Europe de l’Est", "CHADT": "heure d’été des îles Chatham", "CAT": "heure normale d’Afrique centrale", "HKST": "heure d’été de Hong Kong", "WAST": "heure d’été d’Afrique de l’Ouest", "AEST": "heure normale de l’Est de l’Australie", "VET": "heure du Venezuela", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "MST": "heure normale de Macao", "AWDT": "heure d’été de l’Ouest de l’Australie", "∅∅∅": "heure d’été de l’Amazonie", "EAT": "heure normale d’Afrique de l’Est", "NZST": "heure normale de la Nouvelle-Zélande", "UYT": "heure normale de l’Uruguay", "GMT": "heure moyenne de Greenwich", "WITA": "heure du Centre indonésien", "AKDT": "heure d’été de l’Alaska", "PDT": "heure d’été du Pacifique", "CDT": "heure d’été du Centre", "ChST": "heure des Chamorro", "WEZ": "heure normale d’Europe de l’Ouest", "COST": "heure d’été de Colombie", "IST": "heure de l’Inde", "JST": "heure normale du Japon", "AST": "heure normale de l’Atlantique", "BOT": "heure de Bolivie", "CST": "heure normale du centre nord-américain", "WIT": "heure de l’Est indonésien", "LHST": "heure normale de Lord Howe", "MDT": "heure d’été de Macao", "AWST": "heure normale de l’Ouest de l’Australie", "NZDT": "heure d’été de la Nouvelle-Zélande", "HAT": "heure d’été de Terre-Neuve", "WIB": "heure de l’Ouest indonésien", "SRT": "heure du Suriname", "UYST": "heure d’été de l’Uruguay", "WESZ": "heure d’été d’Europe de l’Ouest", "COT": "heure normale de Colombie", "HAST": "heure normale d’Hawaii - Aléoutiennes", "GYT": "heure du Guyana", "AKST": "heure normale de l’Alaska", "CHAST": "heure normale des îles Chatham", "ACWDT": "heure d’été du centre-ouest de l’Australie", "MESZ": "heure d’été d’Europe centrale", "EST": "heure normale de l’Est nord-américain", "TMT": "heure normale du Turkménistan", "LHDT": "heure d’été de Lord Howe", "GFT": "heure de la Guyane française", "MEZ": "heure normale d’Europe centrale", "BT": "heure du Bhoutan", "WAT": "heure normale d’Afrique de l’Ouest", "ART": "heure normale d’Argentine", "MYT": "heure de la Malaisie", "JDT": "heure d’été du Japon", "ACWST": "heure normale du centre-ouest de l’Australie", "EDT": "heure d’été de l’Est", "ACST": "heure normale du centre de l’Australie", "ACDT": "heure d’été du centre de l’Australie", "AEDT": "heure d’été de l’Est de l’Australie", "CLT": "heure normale du Chili", "ADT": "heure d’été de l’Atlantique", "HKT": "heure normale de Hong Kong", "PST": "heure normale du Pacifique nord-américain", "WART": "heure normale de l’Ouest argentin", "WARST": "heure d’été de l’Ouest argentin"},
+ timezones: map[string]string{"COST": "heure d’été de Colombie", "CST": "heure normale du centre nord-américain", "ACWST": "heure normale du centre-ouest de l’Australie", "IST": "heure de l’Inde", "AST": "heure normale de l’Atlantique", "NZST": "heure normale de la Nouvelle-Zélande", "EDT": "heure d’été de l’Est", "WIB": "heure de l’Ouest indonésien", "CAT": "heure normale d’Afrique centrale", "GYT": "heure du Guyana", "SRT": "heure du Suriname", "ART": "heure normale d’Argentine", "ACST": "heure normale du centre de l’Australie", "ADT": "heure d’été de l’Atlantique", "SAST": "heure normale d’Afrique méridionale", "TMST": "heure d’été du Turkménistan", "MYT": "heure de la Malaisie", "UYST": "heure d’été de l’Uruguay", "BT": "heure du Bhoutan", "AWST": "heure normale de l’Ouest de l’Australie", "WITA": "heure du Centre indonésien", "PDT": "heure d’été du Pacifique", "NZDT": "heure d’été de la Nouvelle-Zélande", "COT": "heure normale de Colombie", "AEST": "heure normale de l’Est de l’Australie", "LHDT": "heure d’été de Lord Howe", "ECT": "heure de l’Équateur", "HAT": "heure d’été de Terre-Neuve", "LHST": "heure normale de Lord Howe", "WARST": "heure d’été de l’Ouest argentin", "CHAST": "heure normale des îles Chatham", "ACWDT": "heure d’été du centre-ouest de l’Australie", "PST": "heure normale du Pacifique nord-américain", "OESZ": "heure d’été d’Europe de l’Est", "GMT": "heure moyenne de Greenwich", "GFT": "heure de la Guyane française", "SGT": "heure de Singapour", "AEDT": "heure d’été de l’Est de l’Australie", "ACDT": "heure d’été du centre de l’Australie", "HKST": "heure d’été de Hong Kong", "MEZ": "heure normale d’Europe centrale", "WART": "heure normale de l’Ouest argentin", "AWDT": "heure d’été de l’Ouest de l’Australie", "AKDT": "heure d’été de l’Alaska", "HAST": "heure normale d’Hawaii - Aléoutiennes", "HNT": "heure normale de Terre-Neuve", "WAT": "heure normale d’Afrique de l’Ouest", "CLT": "heure normale du Chili", "CHADT": "heure d’été des îles Chatham", "JST": "heure normale du Japon", "WAST": "heure d’été d’Afrique de l’Ouest", "ChST": "heure des Chamorro", "MST": "heure normale des Rocheuses", "EAT": "heure normale d’Afrique de l’Est", "HKT": "heure normale de Hong Kong", "JDT": "heure d’été du Japon", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "∅∅∅": "heure d’été de Brasilia", "AKST": "heure normale de l’Alaska", "CLST": "heure d’été du Chili", "UYT": "heure normale de l’Uruguay", "WIT": "heure de l’Est indonésien", "CDT": "heure d’été du Centre", "ARST": "heure d’été de l’Argentine", "OEZ": "heure normale d’Europe de l’Est", "MESZ": "heure d’été d’Europe centrale", "WESZ": "heure d’été d’Europe de l’Ouest", "EST": "heure normale de l’Est nord-américain", "TMT": "heure normale du Turkménistan", "WEZ": "heure normale d’Europe de l’Ouest", "MDT": "heure d’été des Rocheuses", "VET": "heure du Venezuela", "BOT": "heure de Bolivie"},
}
}
diff --git a/fr/fr_test.go b/fr/fr_test.go
new file mode 100644
index 00000000..4454d17f
--- /dev/null
+++ b/fr/fr_test.go
@@ -0,0 +1,1120 @@
+package fr
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr_BE/fr_BE.go b/fr_BE/fr_BE.go
index 077b01cc..a6544759 100644
--- a/fr_BE/fr_BE.go
+++ b/fr_BE/fr_BE.go
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"∅∅∅": "heure d’été de Brasilia", "HKST": "heure d’été de Hong Kong", "OEZ": "heure normale d’Europe de l’Est", "TMST": "heure d’été du Turkménistan", "AKST": "heure normale de l’Alaska", "CAT": "heure normale d’Afrique centrale", "MYT": "heure de la Malaisie", "PST": "heure normale du Pacifique nord-américain", "AWDT": "heure d’été de l’Ouest de l’Australie", "MDT": "heure d’été des Rocheuses", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "IST": "heure de l’Inde", "OESZ": "heure d’été d’Europe de l’Est", "GMT": "heure moyenne de Greenwich", "ART": "heure normale d’Argentine", "LHDT": "heure d’été de Lord Howe", "JST": "heure normale du Japon", "VET": "heure du Venezuela", "EST": "heure normale de l’Est nord-américain", "COT": "heure normale de Colombie", "SGT": "heure de Singapour", "WIB": "heure de l’Ouest indonésien", "NZDT": "heure d’été de la Nouvelle-Zélande", "CLST": "heure d’été du Chili", "EDT": "heure d’été de l’Est", "WITA": "heure du Centre indonésien", "AWST": "heure normale de l’Ouest de l’Australie", "BOT": "heure de Bolivie", "SAST": "heure normale d’Afrique méridionale", "WESZ": "heure d’été d’Europe de l’Ouest", "COST": "heure d’été de Colombie", "ACST": "heure normale du centre de l’Australie", "ACDT": "heure d’été du centre de l’Australie", "MEZ": "heure normale d’Europe centrale", "MST": "heure normale des Rocheuses", "AEST": "heure normale de l’Est de l’Australie", "BT": "heure du Bhoutan", "GFT": "heure de la Guyane française", "EAT": "heure normale d’Afrique de l’Est", "WAT": "heure normale d’Afrique de l’Ouest", "TMT": "heure normale du Turkménistan", "GYT": "heure du Guyana", "CHADT": "heure d’été des îles Chatham", "AST": "heure normale de l’Atlantique", "WART": "heure normale de l’Ouest argentin", "PDT": "heure d’été du Pacifique", "WEZ": "heure normale d’Europe de l’Ouest", "ADT": "heure d’été de l’Atlantique", "HKT": "heure normale de Hong Kong", "LHST": "heure normale de Lord Howe", "UYT": "heure normale de l’Uruguay", "JDT": "heure d’été du Japon", "CDT": "heure d’été du Centre", "WARST": "heure d’été de l’Ouest argentin", "WAST": "heure d’été d’Afrique de l’Ouest", "HNT": "heure normale de Terre-Neuve", "AKDT": "heure d’été de l’Alaska", "MESZ": "heure d’été d’Europe centrale", "NZST": "heure normale de la Nouvelle-Zélande", "ChST": "heure des Chamorro", "CLT": "heure normale du Chili", "ACWST": "heure normale du centre-ouest de l’Australie", "ECT": "heure de l’Équateur", "ARST": "heure d’été de l’Argentine", "HAST": "heure normale d’Hawaii - Aléoutiennes", "HAT": "heure d’été de Terre-Neuve", "UYST": "heure d’été de l’Uruguay", "CST": "heure normale du centre nord-américain", "CHAST": "heure normale des îles Chatham", "ACWDT": "heure d’été du centre-ouest de l’Australie", "AEDT": "heure d’été de l’Est de l’Australie", "WIT": "heure de l’Est indonésien", "SRT": "heure du Suriname"},
+ timezones: map[string]string{"LHST": "heure normale de Lord Howe", "CST": "heure normale du centre nord-américain", "WARST": "heure d’été de l’Ouest argentin", "SRT": "heure du Suriname", "ECT": "heure de l’Équateur", "VET": "heure du Venezuela", "PST": "heure normale du Pacifique nord-américain", "HAST": "heure normale d’Hawaii - Aléoutiennes", "TMST": "heure d’été du Turkménistan", "CAT": "heure normale d’Afrique centrale", "AEST": "heure normale de l’Est de l’Australie", "AEDT": "heure d’été de l’Est de l’Australie", "LHDT": "heure d’été de Lord Howe", "∅∅∅": "heure d’été de Brasilia", "ChST": "heure des Chamorro", "BT": "heure du Bhoutan", "AKST": "heure normale de l’Alaska", "HAT": "heure d’été de Terre-Neuve", "COT": "heure normale de Colombie", "OESZ": "heure d’été d’Europe de l’Est", "GMT": "heure moyenne de Greenwich", "MST": "heure normale des Rocheuses", "CHADT": "heure d’été des îles Chatham", "AST": "heure normale de l’Atlantique", "PDT": "heure d’été du Pacifique", "OEZ": "heure normale d’Europe de l’Est", "ADT": "heure d’été de l’Atlantique", "SAST": "heure normale d’Afrique méridionale", "EAT": "heure normale d’Afrique de l’Est", "MYT": "heure de la Malaisie", "WART": "heure normale de l’Ouest argentin", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "TMT": "heure normale du Turkménistan", "WAT": "heure normale d’Afrique de l’Ouest", "CLT": "heure normale du Chili", "CLST": "heure d’été du Chili", "CDT": "heure d’été du Centre", "ACWST": "heure normale du centre-ouest de l’Australie", "AWST": "heure normale de l’Ouest de l’Australie", "ARST": "heure d’été de l’Argentine", "WEZ": "heure normale d’Europe de l’Ouest", "JST": "heure normale du Japon", "JDT": "heure d’été du Japon", "AWDT": "heure d’été de l’Ouest de l’Australie", "GYT": "heure du Guyana", "AKDT": "heure d’été de l’Alaska", "ART": "heure normale d’Argentine", "BOT": "heure de Bolivie", "EST": "heure normale de l’Est nord-américain", "EDT": "heure d’été de l’Est", "MESZ": "heure d’été d’Europe centrale", "HNT": "heure normale de Terre-Neuve", "SGT": "heure de Singapour", "HKST": "heure d’été de Hong Kong", "UYT": "heure normale de l’Uruguay", "WIT": "heure de l’Est indonésien", "MDT": "heure d’été des Rocheuses", "ACST": "heure normale du centre de l’Australie", "IST": "heure de l’Inde", "ACDT": "heure d’été du centre de l’Australie", "WAST": "heure d’été d’Afrique de l’Ouest", "WESZ": "heure d’été d’Europe de l’Ouest", "COST": "heure d’été de Colombie", "UYST": "heure d’été de l’Uruguay", "GFT": "heure de la Guyane française", "ACWDT": "heure d’été du centre-ouest de l’Australie", "WITA": "heure du Centre indonésien", "HKT": "heure normale de Hong Kong", "CHAST": "heure normale des îles Chatham", "NZST": "heure normale de la Nouvelle-Zélande", "NZDT": "heure d’été de la Nouvelle-Zélande", "MEZ": "heure normale d’Europe centrale", "WIB": "heure de l’Ouest indonésien"},
}
}
diff --git a/fr_BE/fr_BE_test.go b/fr_BE/fr_BE_test.go
new file mode 100644
index 00000000..1fa66bb8
--- /dev/null
+++ b/fr_BE/fr_BE_test.go
@@ -0,0 +1,1120 @@
+package fr_BE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr_BE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr_BF/fr_BF.go b/fr_BF/fr_BF.go
index 0672c8b6..865195c7 100644
--- a/fr_BF/fr_BF.go
+++ b/fr_BF/fr_BF.go
@@ -49,7 +49,7 @@ func New() locales.Translator {
locale: "fr_BF",
pluralsCardinal: []locales.PluralRule{2, 6},
pluralsOrdinal: []locales.PluralRule{2, 6},
- pluralsRange: []locales.PluralRule{6, 2},
+ pluralsRange: []locales.PluralRule{2, 6},
decimal: "٫",
group: "٬",
minus: "‏−",
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"AWDT": "heure d’été de l’Ouest de l’Australie", "SGT": "heure de Singapour", "HKT": "heure normale de Hong Kong", "WIB": "heure de l’Ouest indonésien", "AST": "heure normale de l’Atlantique", "TMST": "heure d’été du Turkménistan", "MST": "heure normale de Macao", "LHST": "heure normale de Lord Howe", "BOT": "heure de Bolivie", "AEST": "heure normale de l’Est de l’Australie", "EDT": "heure d’été de l’Est", "COST": "heure d’été de Colombie", "GMT": "heure moyenne de Greenwich", "AEDT": "heure d’été de l’Est de l’Australie", "WARST": "heure d’été de l’Ouest argentin", "WITA": "heure du Centre indonésien", "ACDT": "heure d’été du centre de l’Australie", "AKDT": "heure d’été de l’Alaska", "PST": "heure normale du Pacifique nord-américain", "GYT": "heure du Guyana", "VET": "heure du Venezuela", "EST": "heure normale de l’Est nord-américain", "WART": "heure normale de l’Ouest argentin", "∅∅∅": "heure d’été de l’Amazonie", "AWST": "heure normale de l’Ouest de l’Australie", "CLST": "heure d’été du Chili", "ACWST": "heure normale du centre-ouest de l’Australie", "ACWDT": "heure d’été du centre-ouest de l’Australie", "MDT": "heure d’été de Macao", "LHDT": "heure d’été de Lord Howe", "UYST": "heure d’été de l’Uruguay", "ADT": "heure d’été de l’Atlantique", "GFT": "heure de la Guyane française", "AKST": "heure normale de l’Alaska", "MESZ": "heure d’été d’Europe centrale", "WESZ": "heure d’été d’Europe de l’Ouest", "ChST": "heure des Chamorro", "WIT": "heure de l’Est indonésien", "CHAST": "heure normale des îles Chatham", "HKST": "heure d’été de Hong Kong", "HAT": "heure d’été de Terre-Neuve", "ACST": "heure normale du centre de l’Australie", "CST": "heure normale du centre nord-américain", "NZDT": "heure d’été de la Nouvelle-Zélande", "WEZ": "heure normale d’Europe de l’Ouest", "WAST": "heure d’été d’Afrique de l’Ouest", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "TMT": "heure normale du Turkménistan", "JDT": "heure d’été du Japon", "CHADT": "heure d’été des îles Chatham", "CLT": "heure normale du Chili", "HAST": "heure normale d’Hawaii - Aléoutiennes", "ARST": "heure d’été de l’Argentine", "MEZ": "heure normale d’Europe centrale", "NZST": "heure normale de la Nouvelle-Zélande", "COT": "heure normale de Colombie", "OEZ": "heure normale d’Europe de l’Est", "MYT": "heure de la Malaisie", "PDT": "heure d’été du Pacifique", "CDT": "heure d’été du Centre", "BT": "heure du Bhoutan", "OESZ": "heure d’été d’Europe de l’Est", "EAT": "heure normale d’Afrique de l’Est", "ART": "heure normale d’Argentine", "JST": "heure normale du Japon", "SRT": "heure du Suriname", "WAT": "heure normale d’Afrique de l’Ouest", "CAT": "heure normale d’Afrique centrale", "ECT": "heure de l’Équateur", "HNT": "heure normale de Terre-Neuve", "UYT": "heure normale de l’Uruguay", "SAST": "heure normale d’Afrique méridionale", "IST": "heure de l’Inde"},
+ timezones: map[string]string{"WIT": "heure de l’Est indonésien", "WEZ": "heure normale d’Europe de l’Ouest", "MST": "heure normale des Rocheuses", "ART": "heure normale d’Argentine", "JST": "heure normale du Japon", "AKST": "heure normale de l’Alaska", "ADT": "heure d’été de l’Atlantique", "ACWST": "heure normale du centre-ouest de l’Australie", "GYT": "heure du Guyana", "BT": "heure du Bhoutan", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "MYT": "heure de la Malaisie", "UYT": "heure normale de l’Uruguay", "CDT": "heure d’été du Centre", "WITA": "heure du Centre indonésien", "AWST": "heure normale de l’Ouest de l’Australie", "NZDT": "heure d’été de la Nouvelle-Zélande", "TMT": "heure normale du Turkménistan", "WESZ": "heure d’été d’Europe de l’Ouest", "IST": "heure de l’Inde", "AST": "heure normale de l’Atlantique", "PST": "heure normale du Pacifique nord-américain", "OESZ": "heure d’été d’Europe de l’Est", "CHAST": "heure normale des îles Chatham", "CAT": "heure normale d’Afrique centrale", "GFT": "heure de la Guyane française", "LHST": "heure normale de Lord Howe", "LHDT": "heure d’été de Lord Howe", "BOT": "heure de Bolivie", "TMST": "heure d’été du Turkménistan", "GMT": "heure moyenne de Greenwich", "HAST": "heure normale d’Hawaii - Aléoutiennes", "HAT": "heure d’été de Terre-Neuve", "CST": "heure normale du centre nord-américain", "ACWDT": "heure d’été du centre-ouest de l’Australie", "AWDT": "heure d’été de l’Ouest de l’Australie", "SGT": "heure de Singapour", "ChST": "heure des Chamorro", "WART": "heure normale de l’Ouest argentin", "EST": "heure normale de l’Est nord-américain", "OEZ": "heure normale d’Europe de l’Est", "CLST": "heure d’été du Chili", "EAT": "heure normale d’Afrique de l’Est", "MDT": "heure d’été des Rocheuses", "WARST": "heure d’été de l’Ouest argentin", "COT": "heure normale de Colombie", "COST": "heure d’été de Colombie", "∅∅∅": "heure d’été de Brasilia", "ACST": "heure normale du centre de l’Australie", "ARST": "heure d’été de l’Argentine", "MEZ": "heure normale d’Europe centrale", "MESZ": "heure d’été d’Europe centrale", "NZST": "heure normale de la Nouvelle-Zélande", "WAT": "heure normale d’Afrique de l’Ouest", "WAST": "heure d’été d’Afrique de l’Ouest", "SAST": "heure normale d’Afrique méridionale", "EDT": "heure d’été de l’Est", "ACDT": "heure d’été du centre de l’Australie", "HKT": "heure normale de Hong Kong", "CHADT": "heure d’été des îles Chatham", "ECT": "heure de l’Équateur", "PDT": "heure d’été du Pacifique", "HNT": "heure normale de Terre-Neuve", "AEDT": "heure d’été de l’Est de l’Australie", "AKDT": "heure d’été de l’Alaska", "AEST": "heure normale de l’Est de l’Australie", "HKST": "heure d’été de Hong Kong", "UYST": "heure d’été de l’Uruguay", "SRT": "heure du Suriname", "VET": "heure du Venezuela", "JDT": "heure d’été du Japon", "WIB": "heure de l’Ouest indonésien", "CLT": "heure normale du Chili"},
}
}
diff --git a/fr_BF/fr_BF_test.go b/fr_BF/fr_BF_test.go
new file mode 100644
index 00000000..48971885
--- /dev/null
+++ b/fr_BF/fr_BF_test.go
@@ -0,0 +1,1120 @@
+package fr_BF
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr_BF"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr_BI/fr_BI.go b/fr_BI/fr_BI.go
index 83639290..dfec4a31 100644
--- a/fr_BI/fr_BI.go
+++ b/fr_BI/fr_BI.go
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"HAT": "heure d’été de Terre-Neuve", "TMT": "heure normale du Turkménistan", "GYT": "heure du Guyana", "NZDT": "heure d’été de la Nouvelle-Zélande", "COT": "heure normale de Colombie", "BT": "heure du Bhoutan", "BOT": "heure de Bolivie", "WITA": "heure du Centre indonésien", "ACWST": "heure normale du centre-ouest de l’Australie", "SRT": "heure du Suriname", "UYT": "heure normale de l’Uruguay", "ChST": "heure des Chamorro", "ADT": "heure d’été de l’Atlantique", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "WAT": "heure normale d’Afrique de l’Ouest", "HKT": "heure normale de Hong Kong", "JST": "heure normale du Japon", "LHDT": "heure d’été de Lord Howe", "∅∅∅": "heure d’été du Pérou", "WARST": "heure d’été de l’Ouest argentin", "MYT": "heure de la Malaisie", "MESZ": "heure d’été d’Europe centrale", "ACWDT": "heure d’été du centre-ouest de l’Australie", "EDT": "heure d’été de l’Est", "HAST": "heure normale d’Hawaii - Aléoutiennes", "SAST": "heure normale d’Afrique méridionale", "WIB": "heure de l’Ouest indonésien", "ACDT": "heure d’été du centre de l’Australie", "PDT": "heure d’été du Pacifique", "ECT": "heure de l’Équateur", "OEZ": "heure normale d’Europe de l’Est", "GMT": "heure moyenne de Greenwich", "HNT": "heure normale de Terre-Neuve", "AKDT": "heure d’été de l’Alaska", "WEZ": "heure normale d’Europe de l’Ouest", "UYST": "heure d’été de l’Uruguay", "CHADT": "heure d’été des îles Chatham", "AST": "heure normale de l’Atlantique", "WIT": "heure de l’Est indonésien", "MDT": "heure d’été de Macao", "CST": "heure normale du centre nord-américain", "MEZ": "heure normale d’Europe centrale", "VET": "heure du Venezuela", "WAST": "heure d’été d’Afrique de l’Ouest", "HKST": "heure d’été de Hong Kong", "OESZ": "heure d’été d’Europe de l’Est", "AWST": "heure normale de l’Ouest de l’Australie", "CHAST": "heure normale des îles Chatham", "AEDT": "heure d’été de l’Est de l’Australie", "ACST": "heure normale du centre de l’Australie", "ARST": "heure d’été de l’Argentine", "JDT": "heure d’été du Japon", "LHST": "heure normale de Lord Howe", "AEST": "heure normale de l’Est de l’Australie", "IST": "heure de l’Inde", "WESZ": "heure d’été d’Europe de l’Ouest", "EST": "heure normale de l’Est nord-américain", "WART": "heure normale de l’Ouest argentin", "ART": "heure normale d’Argentine", "AKST": "heure normale de l’Alaska", "CLT": "heure normale du Chili", "CAT": "heure normale d’Afrique centrale", "EAT": "heure normale d’Afrique de l’Est", "MST": "heure normale de Macao", "AWDT": "heure d’été de l’Ouest de l’Australie", "CDT": "heure d’été du Centre", "CLST": "heure d’été du Chili", "COST": "heure d’été de Colombie", "SGT": "heure de Singapour", "GFT": "heure de la Guyane française", "TMST": "heure d’été du Turkménistan", "PST": "heure normale du Pacifique nord-américain", "NZST": "heure normale de la Nouvelle-Zélande"},
+ timezones: map[string]string{"MST": "heure normale des Rocheuses", "WART": "heure normale de l’Ouest argentin", "NZDT": "heure d’été de la Nouvelle-Zélande", "HKST": "heure d’été de Hong Kong", "EST": "heure normale de l’Est nord-américain", "PDT": "heure d’été du Pacifique", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "NZST": "heure normale de la Nouvelle-Zélande", "BOT": "heure de Bolivie", "WIB": "heure de l’Ouest indonésien", "EAT": "heure normale d’Afrique de l’Est", "ACDT": "heure d’été du centre de l’Australie", "ARST": "heure d’été de l’Argentine", "IST": "heure de l’Inde", "HAST": "heure normale d’Hawaii - Aléoutiennes", "GMT": "heure moyenne de Greenwich", "AEDT": "heure d’été de l’Est de l’Australie", "MDT": "heure d’été des Rocheuses", "TMT": "heure normale du Turkménistan", "LHDT": "heure d’été de Lord Howe", "CLST": "heure d’été du Chili", "UYT": "heure normale de l’Uruguay", "SAST": "heure normale d’Afrique méridionale", "CHAST": "heure normale des îles Chatham", "JST": "heure normale du Japon", "WAST": "heure d’été d’Afrique de l’Ouest", "BT": "heure du Bhoutan", "CHADT": "heure d’été des îles Chatham", "ECT": "heure de l’Équateur", "ADT": "heure d’été de l’Atlantique", "AKDT": "heure d’été de l’Alaska", "MEZ": "heure normale d’Europe centrale", "HAT": "heure d’été de Terre-Neuve", "GFT": "heure de la Guyane française", "AST": "heure normale de l’Atlantique", "ACWST": "heure normale du centre-ouest de l’Australie", "WAT": "heure normale d’Afrique de l’Ouest", "GYT": "heure du Guyana", "LHST": "heure normale de Lord Howe", "WIT": "heure de l’Est indonésien", "ACWDT": "heure d’été du centre-ouest de l’Australie", "HNT": "heure normale de Terre-Neuve", "AEST": "heure normale de l’Est de l’Australie", "CLT": "heure normale du Chili", "UYST": "heure d’été de l’Uruguay", "AWST": "heure normale de l’Ouest de l’Australie", "ART": "heure normale d’Argentine", "AKST": "heure normale de l’Alaska", "MYT": "heure de la Malaisie", "VET": "heure du Venezuela", "JDT": "heure d’été du Japon", "COST": "heure d’été de Colombie", "COT": "heure normale de Colombie", "OEZ": "heure normale d’Europe de l’Est", "OESZ": "heure d’été d’Europe de l’Est", "ACST": "heure normale du centre de l’Australie", "CDT": "heure d’été du Centre", "HKT": "heure normale de Hong Kong", "AWDT": "heure d’été de l’Ouest de l’Australie", "WITA": "heure du Centre indonésien", "TMST": "heure d’été du Turkménistan", "∅∅∅": "heure d’été du Pérou", "SRT": "heure du Suriname", "WARST": "heure d’été de l’Ouest argentin", "CST": "heure normale du centre nord-américain", "SGT": "heure de Singapour", "CAT": "heure normale d’Afrique centrale", "ChST": "heure des Chamorro", "MESZ": "heure d’été d’Europe centrale", "EDT": "heure d’été de l’Est", "PST": "heure normale du Pacifique nord-américain", "WEZ": "heure normale d’Europe de l’Ouest", "WESZ": "heure d’été d’Europe de l’Ouest"},
}
}
diff --git a/fr_BI/fr_BI_test.go b/fr_BI/fr_BI_test.go
new file mode 100644
index 00000000..30666b8a
--- /dev/null
+++ b/fr_BI/fr_BI_test.go
@@ -0,0 +1,1120 @@
+package fr_BI
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr_BI"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr_BJ/fr_BJ.go b/fr_BJ/fr_BJ.go
index f6d2c234..5e3124b8 100644
--- a/fr_BJ/fr_BJ.go
+++ b/fr_BJ/fr_BJ.go
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"CLT": "heure normale du Chili", "VET": "heure du Venezuela", "SGT": "heure de Singapour", "HAST": "heure normale d’Hawaii - Aléoutiennes", "NZDT": "heure d’été de la Nouvelle-Zélande", "CDT": "heure d’été du Centre", "SRT": "heure du Suriname", "UYT": "heure normale de l’Uruguay", "CST": "heure normale du centre nord-américain", "ECT": "heure de l’Équateur", "MDT": "heure d’été de Macao", "GYT": "heure du Guyana", "CLST": "heure d’été du Chili", "ART": "heure normale d’Argentine", "BOT": "heure de Bolivie", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "HKT": "heure normale de Hong Kong", "MYT": "heure de la Malaisie", "PDT": "heure d’été du Pacifique", "AEDT": "heure d’été de l’Est de l’Australie", "WART": "heure normale de l’Ouest argentin", "ACST": "heure normale du centre de l’Australie", "MST": "heure normale de Macao", "EAT": "heure normale d’Afrique de l’Est", "HKST": "heure d’été de Hong Kong", "GFT": "heure de la Guyane française", "ARST": "heure d’été de l’Argentine", "JDT": "heure d’été du Japon", "AKST": "heure normale de l’Alaska", "WEZ": "heure normale d’Europe de l’Ouest", "COT": "heure normale de Colombie", "ADT": "heure d’été de l’Atlantique", "WIT": "heure de l’Est indonésien", "OEZ": "heure normale d’Europe de l’Est", "AEST": "heure normale de l’Est de l’Australie", "WIB": "heure de l’Ouest indonésien", "AWST": "heure normale de l’Ouest de l’Australie", "AKDT": "heure d’été de l’Alaska", "WARST": "heure d’été de l’Ouest argentin", "WITA": "heure du Centre indonésien", "∅∅∅": "heure d’été de l’Amazonie", "LHST": "heure normale de Lord Howe", "UYST": "heure d’été de l’Uruguay", "MESZ": "heure d’été d’Europe centrale", "WESZ": "heure d’été d’Europe de l’Ouest", "EST": "heure normale de l’Est nord-américain", "AST": "heure normale de l’Atlantique", "GMT": "heure moyenne de Greenwich", "TMT": "heure normale du Turkménistan", "CHAST": "heure normale des îles Chatham", "CAT": "heure normale d’Afrique centrale", "WAT": "heure normale d’Afrique de l’Ouest", "WAST": "heure d’été d’Afrique de l’Ouest", "PST": "heure normale du Pacifique nord-américain", "ChST": "heure des Chamorro", "CHADT": "heure d’été des îles Chatham", "EDT": "heure d’été de l’Est", "TMST": "heure d’été du Turkménistan", "NZST": "heure normale de la Nouvelle-Zélande", "MEZ": "heure normale d’Europe centrale", "ACWST": "heure normale du centre-ouest de l’Australie", "HAT": "heure d’été de Terre-Neuve", "LHDT": "heure d’été de Lord Howe", "SAST": "heure normale d’Afrique méridionale", "IST": "heure de l’Inde", "ACWDT": "heure d’été du centre-ouest de l’Australie", "AWDT": "heure d’été de l’Ouest de l’Australie", "COST": "heure d’été de Colombie", "BT": "heure du Bhoutan", "OESZ": "heure d’été d’Europe de l’Est", "ACDT": "heure d’été du centre de l’Australie", "HNT": "heure normale de Terre-Neuve", "JST": "heure normale du Japon"},
+ timezones: map[string]string{"GMT": "heure moyenne de Greenwich", "WART": "heure normale de l’Ouest argentin", "HAST": "heure normale d’Hawaii - Aléoutiennes", "PST": "heure normale du Pacifique nord-américain", "∅∅∅": "heure d’été de l’Amazonie", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "JDT": "heure d’été du Japon", "WITA": "heure du Centre indonésien", "ARST": "heure d’été de l’Argentine", "CHADT": "heure d’été des îles Chatham", "ADT": "heure d’été de l’Atlantique", "NZDT": "heure d’été de la Nouvelle-Zélande", "CLT": "heure normale du Chili", "HKT": "heure normale de Hong Kong", "EDT": "heure d’été de l’Est", "HNT": "heure normale de Terre-Neuve", "AST": "heure normale de l’Atlantique", "ACWST": "heure normale du centre-ouest de l’Australie", "BOT": "heure de Bolivie", "TMST": "heure d’été du Turkménistan", "UYST": "heure d’été de l’Uruguay", "WESZ": "heure d’été d’Europe de l’Ouest", "UYT": "heure normale de l’Uruguay", "ART": "heure normale d’Argentine", "ACST": "heure normale du centre de l’Australie", "SRT": "heure du Suriname", "AWST": "heure normale de l’Ouest de l’Australie", "SAST": "heure normale d’Afrique méridionale", "AEST": "heure normale de l’Est de l’Australie", "WIT": "heure de l’Est indonésien", "LHDT": "heure d’été de Lord Howe", "ACDT": "heure d’été du centre de l’Australie", "OEZ": "heure normale d’Europe de l’Est", "AEDT": "heure d’été de l’Est de l’Australie", "EAT": "heure normale d’Afrique de l’Est", "MDT": "heure d’été des Rocheuses", "MYT": "heure de la Malaisie", "ECT": "heure de l’Équateur", "NZST": "heure normale de la Nouvelle-Zélande", "PDT": "heure d’été du Pacifique", "GYT": "heure du Guyana", "CHAST": "heure normale des îles Chatham", "AKST": "heure normale de l’Alaska", "AKDT": "heure d’été de l’Alaska", "COT": "heure normale de Colombie", "WAT": "heure normale d’Afrique de l’Ouest", "WARST": "heure d’été de l’Ouest argentin", "LHST": "heure normale de Lord Howe", "VET": "heure du Venezuela", "JST": "heure normale du Japon", "HAT": "heure d’été de Terre-Neuve", "SGT": "heure de Singapour", "BT": "heure du Bhoutan", "WEZ": "heure normale d’Europe de l’Ouest", "CDT": "heure d’été du Centre", "EST": "heure normale de l’Est nord-américain", "MEZ": "heure normale d’Europe centrale", "CAT": "heure normale d’Afrique centrale", "HKST": "heure d’été de Hong Kong", "WAST": "heure d’été d’Afrique de l’Ouest", "CLST": "heure d’été du Chili", "MST": "heure normale des Rocheuses", "WIB": "heure de l’Ouest indonésien", "TMT": "heure normale du Turkménistan", "OESZ": "heure d’été d’Europe de l’Est", "ChST": "heure des Chamorro", "CST": "heure normale du centre nord-américain", "IST": "heure de l’Inde", "MESZ": "heure d’été d’Europe centrale", "COST": "heure d’été de Colombie", "GFT": "heure de la Guyane française", "ACWDT": "heure d’été du centre-ouest de l’Australie", "AWDT": "heure d’été de l’Ouest de l’Australie"},
}
}
diff --git a/fr_BJ/fr_BJ_test.go b/fr_BJ/fr_BJ_test.go
new file mode 100644
index 00000000..c4ebc884
--- /dev/null
+++ b/fr_BJ/fr_BJ_test.go
@@ -0,0 +1,1120 @@
+package fr_BJ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr_BJ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr_BL/fr_BL.go b/fr_BL/fr_BL.go
index 54e6a39f..a320fca1 100644
--- a/fr_BL/fr_BL.go
+++ b/fr_BL/fr_BL.go
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"JDT": "heure d’été du Japon", "PST": "heure normale du Pacifique nord-américain", "UYST": "heure d’été de l’Uruguay", "CST": "heure normale du centre nord-américain", "ChST": "heure des Chamorro", "TMST": "heure d’été du Turkménistan", "WIT": "heure de l’Est indonésien", "UYT": "heure normale de l’Uruguay", "CDT": "heure d’été du Centre", "BT": "heure du Bhoutan", "ACDT": "heure d’été du centre de l’Australie", "LHST": "heure normale de Lord Howe", "NZST": "heure normale de la Nouvelle-Zélande", "HKST": "heure d’été de Hong Kong", "OESZ": "heure d’été d’Europe de l’Est", "HNT": "heure normale de Terre-Neuve", "ART": "heure normale d’Argentine", "EAT": "heure normale d’Afrique de l’Est", "PDT": "heure d’été du Pacifique", "LHDT": "heure d’été de Lord Howe", "AEDT": "heure d’été de l’Est de l’Australie", "WART": "heure normale de l’Ouest argentin", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "ACST": "heure normale du centre de l’Australie", "TMT": "heure normale du Turkménistan", "MYT": "heure de la Malaisie", "AKDT": "heure d’été de l’Alaska", "EST": "heure normale de l’Est nord-américain", "SGT": "heure de Singapour", "AST": "heure normale de l’Atlantique", "WITA": "heure du Centre indonésien", "MDT": "heure d’été de Macao", "ARST": "heure d’été de l’Argentine", "AWST": "heure normale de l’Ouest de l’Australie", "SRT": "heure du Suriname", "COT": "heure normale de Colombie", "WEZ": "heure normale d’Europe de l’Ouest", "CHAST": "heure normale des îles Chatham", "HKT": "heure normale de Hong Kong", "HAT": "heure d’été de Terre-Neuve", "AEST": "heure normale de l’Est de l’Australie", "ADT": "heure d’été de l’Atlantique", "CAT": "heure normale d’Afrique centrale", "WAT": "heure normale d’Afrique de l’Ouest", "WIB": "heure de l’Ouest indonésien", "MESZ": "heure d’été d’Europe centrale", "∅∅∅": "heure d’été de Brasilia", "IST": "heure de l’Inde", "COST": "heure d’été de Colombie", "CLST": "heure d’été du Chili", "JST": "heure normale du Japon", "VET": "heure du Venezuela", "WESZ": "heure d’été d’Europe de l’Ouest", "OEZ": "heure normale d’Europe de l’Est", "GMT": "heure moyenne de Greenwich", "GYT": "heure du Guyana", "AKST": "heure normale de l’Alaska", "MEZ": "heure normale d’Europe centrale", "SAST": "heure normale d’Afrique méridionale", "GFT": "heure de la Guyane française", "MST": "heure normale de Macao", "AWDT": "heure d’été de l’Ouest de l’Australie", "NZDT": "heure d’été de la Nouvelle-Zélande", "ACWDT": "heure d’été du centre-ouest de l’Australie", "CHADT": "heure d’été des îles Chatham", "WAST": "heure d’été d’Afrique de l’Ouest", "ACWST": "heure normale du centre-ouest de l’Australie", "CLT": "heure normale du Chili", "ECT": "heure de l’Équateur", "HAST": "heure normale d’Hawaii - Aléoutiennes", "WARST": "heure d’été de l’Ouest argentin", "BOT": "heure de Bolivie", "EDT": "heure d’été de l’Est"},
+ timezones: map[string]string{"ChST": "heure des Chamorro", "GYT": "heure du Guyana", "JST": "heure normale du Japon", "ACWST": "heure normale du centre-ouest de l’Australie", "ART": "heure normale d’Argentine", "AST": "heure normale de l’Atlantique", "HAST": "heure normale d’Hawaii - Aléoutiennes", "HNT": "heure normale de Terre-Neuve", "GFT": "heure de la Guyane française", "BOT": "heure de Bolivie", "COST": "heure d’été de Colombie", "TMST": "heure d’été du Turkménistan", "AEDT": "heure d’été de l’Est de l’Australie", "ACST": "heure normale du centre de l’Australie", "LHDT": "heure d’été de Lord Howe", "MDT": "heure d’été des Rocheuses", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "MEZ": "heure normale d’Europe centrale", "WESZ": "heure d’été d’Europe de l’Ouest", "CHAST": "heure normale des îles Chatham", "NZST": "heure normale de la Nouvelle-Zélande", "JDT": "heure d’été du Japon", "HAT": "heure d’été de Terre-Neuve", "CST": "heure normale du centre nord-américain", "ACDT": "heure d’été du centre de l’Australie", "CHADT": "heure d’été des îles Chatham", "VET": "heure du Venezuela", "WEZ": "heure normale d’Europe de l’Ouest", "SGT": "heure de Singapour", "MYT": "heure de la Malaisie", "HKST": "heure d’été de Hong Kong", "MESZ": "heure d’été d’Europe centrale", "AWST": "heure normale de l’Ouest de l’Australie", "GMT": "heure moyenne de Greenwich", "UYT": "heure normale de l’Uruguay", "LHST": "heure normale de Lord Howe", "CDT": "heure d’été du Centre", "HKT": "heure normale de Hong Kong", "CLST": "heure d’été du Chili", "PDT": "heure d’été du Pacifique", "AKDT": "heure d’été de l’Alaska", "ACWDT": "heure d’été du centre-ouest de l’Australie", "SAST": "heure normale d’Afrique méridionale", "PST": "heure normale du Pacifique nord-américain", "WAT": "heure normale d’Afrique de l’Ouest", "AEST": "heure normale de l’Est de l’Australie", "SRT": "heure du Suriname", "WITA": "heure du Centre indonésien", "ADT": "heure d’été de l’Atlantique", "EST": "heure normale de l’Est nord-américain", "TMT": "heure normale du Turkménistan", "WAST": "heure d’été d’Afrique de l’Ouest", "OESZ": "heure d’été d’Europe de l’Est", "ECT": "heure de l’Équateur", "IST": "heure de l’Inde", "EAT": "heure normale d’Afrique de l’Est", "WART": "heure normale de l’Ouest argentin", "AKST": "heure normale de l’Alaska", "COT": "heure normale de Colombie", "CAT": "heure normale d’Afrique centrale", "OEZ": "heure normale d’Europe de l’Est", "UYST": "heure d’été de l’Uruguay", "WIT": "heure de l’Est indonésien", "ARST": "heure d’été de l’Argentine", "EDT": "heure d’été de l’Est", "AWDT": "heure d’été de l’Ouest de l’Australie", "NZDT": "heure d’été de la Nouvelle-Zélande", "WIB": "heure de l’Ouest indonésien", "CLT": "heure normale du Chili", "BT": "heure du Bhoutan", "MST": "heure normale des Rocheuses", "∅∅∅": "heure d’été de Brasilia", "WARST": "heure d’été de l’Ouest argentin"},
}
}
diff --git a/fr_BL/fr_BL_test.go b/fr_BL/fr_BL_test.go
new file mode 100644
index 00000000..1dcfc495
--- /dev/null
+++ b/fr_BL/fr_BL_test.go
@@ -0,0 +1,1120 @@
+package fr_BL
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr_BL"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr_CA/fr_CA.go b/fr_CA/fr_CA.go
index d5ff81b5..36d4719d 100644
--- a/fr_CA/fr_CA.go
+++ b/fr_CA/fr_CA.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"MDT": "heure avancée des Rocheuses", "ACWST": "heure normale du centre-ouest de l’Australie", "EDT": "heure avancée de l’Est", "GFT": "heure de Guyane française", "ARST": "heure avancée de l’Argentine", "MYT": "heure de la Malaisie", "JDT": "heure avancée du Japon", "PST": "heure normale du Pacifique", "MESZ": "heure avancée d’Europe centrale", "MST": "heure normale des Rocheuses", "WIT": "heure de l’Est indonésien", "IST": "heure de l’Inde", "AWST": "heure normale de l’Ouest de l’Australie", "HKT": "heure normale de Hong Kong", "OEZ": "heure normale d’Europe de l’Est", "AWDT": "heure avancée de l’Ouest de l’Australie", "LHDT": "heure avancée de Lord Howe", "CHADT": "heure avancée des Îles Chatham", "COST": "heure avancée de Colombie", "ECT": "heure de l’Équateur", "WAT": "heure normale d’Afrique de l’Ouest", "HADT": "heure avancée d’Hawaï-Aléoutiennes", "WART": "heure normale de l’Ouest argentin", "BT": "heure du Bhoutan", "ART": "heure normale d’Argentine", "JST": "heure normale du Japon", "SRT": "heure du Suriname", "NZDT": "heure avancée de la Nouvelle-Zélande", "OESZ": "heure avancée d’Europe de l’Est", "HKST": "heure avancée de Hong Kong", "AKDT": "heure avancée de l’Alaska", "TMST": "heure avancée du Turkménistan", "EAT": "Heure d’Afrique orientale", "MEZ": "heure normale d’Europe centrale", "CHAST": "heure normale des Îles Chatham", "WEZ": "heure normale d’Europe de l’Ouest", "HAST": "heure normale d’Hawaï-Aléoutiennes", "CST": "heure normale du Centre", "BOT": "heure de Bolivie", "WAST": "heure avancée d’Afrique de l’Ouest", "GMT": "heure moyenne de Greenwich", "VET": "heure du Venezuela", "AST": "heure normale de l’Atlantique", "HNT": "heure normale de Terre-Neuve", "TMT": "heure normale du Turkménistan", "AEDT": "heure avancée de l’Est de l’Australie", "CAT": "heure d’Afrique centrale", "SAST": "heure normale d’Afrique du Sud", "WITA": "heure du Centre indonésien", "UYST": "heure avancée de l’Uruguay", "CDT": "heure avancée du Centre", "ACWDT": "heure avancée du centre-ouest de l’Australie", "AEST": "heure normale de l’Est de l’Australie", "HAT": "heure avancée de Terre-Neuve", "GYT": "heure du Guyana", "AKST": "heure normale de l’Alaska", "PDT": "heure avancée du Pacifique", "WESZ": "heure avancée d’Europe de l’Ouest", "∅∅∅": "heure avancée de Brasilia", "ADT": "heure avancée de l’Atlantique", "UYT": "heure normale de l’Uruguay", "LHST": "heure normale de Lord Howe", "NZST": "heure normale de la Nouvelle-Zélande", "COT": "heure normale de Colombie", "SGT": "heure de Singapour", "WARST": "heure avancée de l’Ouest argentin", "WIB": "heure de l’Ouest indonésien", "ACST": "heure normale du centre de l’Australie", "ACDT": "heure avancée du centre de l’Australie", "CLT": "heure normale du Chili", "CLST": "heure avancée du Chili", "ChST": "heure des Chamorro", "EST": "heure normale de l’Est"},
+ timezones: map[string]string{"WITA": "heure du Centre indonésien", "HNT": "heure normale de Terre-Neuve", "SGT": "heure de Singapour", "WAST": "heure avancée d’Afrique de l’Ouest", "OESZ": "heure avancée d’Europe de l’Est", "WIT": "heure de l’Est indonésien", "ACDT": "heure avancée du centre de l’Australie", "GFT": "heure de Guyane française", "WARST": "heure avancée de l’Ouest argentin", "MEZ": "heure normale d’Europe centrale", "NZDT": "heure avancée de la Nouvelle-Zélande", "WEZ": "heure normale d’Europe de l’Ouest", "HAT": "heure avancée de Terre-Neuve", "LHST": "heure normale de Lord Howe", "CLST": "heure avancée du Chili", "WART": "heure normale de l’Ouest argentin", "CHADT": "heure avancée des Îles Chatham", "AKDT": "heure avancée de l’Alaska", "LHDT": "heure avancée de Lord Howe", "ACWDT": "heure avancée du centre-ouest de l’Australie", "AST": "heure normale de l’Atlantique", "TMT": "heure normale du Turkménistan", "CST": "heure normale du Centre", "CDT": "heure avancée du Centre", "NZST": "heure normale de la Nouvelle-Zélande", "WESZ": "heure avancée d’Europe de l’Ouest", "OEZ": "heure normale d’Europe de l’Est", "ART": "heure normale d’Argentine", "JDT": "heure avancée du Japon", "ACWST": "heure normale du centre-ouest de l’Australie", "BOT": "heure de Bolivie", "COT": "heure normale de Colombie", "CAT": "heure d’Afrique centrale", "MST": "heure normale des Rocheuses", "UYT": "heure normale de l’Uruguay", "EAT": "Heure d’Afrique orientale", "VET": "heure du Venezuela", "AWST": "heure normale de l’Ouest de l’Australie", "SAST": "heure normale d’Afrique du Sud", "IST": "heure de l’Inde", "COST": "heure avancée de Colombie", "CLT": "heure normale du Chili", "HKST": "heure avancée de Hong Kong", "AEST": "heure normale de l’Est de l’Australie", "AEDT": "heure avancée de l’Est de l’Australie", "SRT": "heure du Suriname", "HAST": "heure normale d’Hawaï-Aléoutiennes", "HADT": "heure avancée d’Hawaï-Aléoutiennes", "BT": "heure du Bhoutan", "ADT": "heure avancée de l’Atlantique", "EDT": "heure avancée de l’Est", "∅∅∅": "heure avancée de l’Acre", "AWDT": "heure avancée de l’Ouest de l’Australie", "EST": "heure normale de l’Est", "WIB": "heure de l’Ouest indonésien", "MDT": "heure avancée des Rocheuses", "HKT": "heure normale de Hong Kong", "ARST": "heure avancée de l’Argentine", "JST": "heure normale du Japon", "PST": "heure normale du Pacifique", "PDT": "heure avancée du Pacifique", "ChST": "heure des Chamorro", "GYT": "heure du Guyana", "UYST": "heure avancée de l’Uruguay", "ECT": "heure de l’Équateur", "MYT": "heure de la Malaisie", "ACST": "heure normale du centre de l’Australie", "MESZ": "heure avancée d’Europe centrale", "WAT": "heure normale d’Afrique de l’Ouest", "GMT": "heure moyenne de Greenwich", "CHAST": "heure normale des Îles Chatham", "AKST": "heure normale de l’Alaska", "TMST": "heure avancée du Turkménistan"},
}
}
diff --git a/fr_CA/fr_CA_test.go b/fr_CA/fr_CA_test.go
new file mode 100644
index 00000000..8e9f0fa3
--- /dev/null
+++ b/fr_CA/fr_CA_test.go
@@ -0,0 +1,1120 @@
+package fr_CA
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr_CA"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr_CD/fr_CD.go b/fr_CD/fr_CD.go
index ab7e56f7..904e0f8f 100644
--- a/fr_CD/fr_CD.go
+++ b/fr_CD/fr_CD.go
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"HADT": "heure d’été d’Hawaii - Aléoutiennes", "ART": "heure normale d’Argentine", "CHAST": "heure normale des îles Chatham", "CHADT": "heure d’été des îles Chatham", "CAT": "heure normale d’Afrique centrale", "JDT": "heure d’été du Japon", "CLST": "heure d’été du Chili", "WEZ": "heure normale d’Europe de l’Ouest", "HKST": "heure d’été de Hong Kong", "WAT": "heure normale d’Afrique de l’Ouest", "GMT": "heure moyenne de Greenwich", "ACST": "heure normale du centre de l’Australie", "LHST": "heure normale de Lord Howe", "LHDT": "heure d’été de Lord Howe", "PST": "heure normale du Pacifique nord-américain", "ChST": "heure des Chamorro", "WESZ": "heure d’été d’Europe de l’Ouest", "AEST": "heure normale de l’Est de l’Australie", "EST": "heure normale de l’Est nord-américain", "CDT": "heure d’été du Centre", "WIT": "heure de l’Est indonésien", "TMT": "heure normale du Turkménistan", "EAT": "heure normale d’Afrique de l’Est", "ECT": "heure de l’Équateur", "ACDT": "heure d’été du centre de l’Australie", "UYT": "heure normale de l’Uruguay", "CST": "heure normale du centre nord-américain", "ADT": "heure d’été de l’Atlantique", "HAST": "heure normale d’Hawaii - Aléoutiennes", "SGT": "heure de Singapour", "WART": "heure normale de l’Ouest argentin", "BT": "heure du Bhoutan", "ARST": "heure d’été de l’Argentine", "NZDT": "heure d’été de la Nouvelle-Zélande", "COST": "heure d’été de Colombie", "JST": "heure normale du Japon", "UYST": "heure d’été de l’Uruguay", "MEZ": "heure normale d’Europe centrale", "EDT": "heure d’été de l’Est", "GFT": "heure de la Guyane française", "IST": "heure de l’Inde", "MDT": "heure d’été de Macao", "WAST": "heure d’été d’Afrique de l’Ouest", "BOT": "heure de Bolivie", "VET": "heure du Venezuela", "WARST": "heure d’été de l’Ouest argentin", "AST": "heure normale de l’Atlantique", "PDT": "heure d’été du Pacifique", "AWDT": "heure d’été de l’Ouest de l’Australie", "NZST": "heure normale de la Nouvelle-Zélande", "AWST": "heure normale de l’Ouest de l’Australie", "COT": "heure normale de Colombie", "GYT": "heure du Guyana", "SRT": "heure du Suriname", "AKDT": "heure d’été de l’Alaska", "MST": "heure normale de Macao", "MYT": "heure de la Malaisie", "AKST": "heure normale de l’Alaska", "HAT": "heure d’été de Terre-Neuve", "∅∅∅": "heure d’été de l’Amazonie", "HKT": "heure normale de Hong Kong", "ACWDT": "heure d’été du centre-ouest de l’Australie", "AEDT": "heure d’été de l’Est de l’Australie", "WITA": "heure du Centre indonésien", "WIB": "heure de l’Ouest indonésien", "TMST": "heure d’été du Turkménistan", "MESZ": "heure d’été d’Europe centrale", "CLT": "heure normale du Chili", "ACWST": "heure normale du centre-ouest de l’Australie", "SAST": "heure normale d’Afrique méridionale", "HNT": "heure normale de Terre-Neuve", "OEZ": "heure normale d’Europe de l’Est", "OESZ": "heure d’été d’Europe de l’Est"},
+ timezones: map[string]string{"CHADT": "heure d’été des îles Chatham", "AKST": "heure normale de l’Alaska", "ACWDT": "heure d’été du centre-ouest de l’Australie", "WIB": "heure de l’Ouest indonésien", "WAST": "heure d’été d’Afrique de l’Ouest", "COST": "heure d’été de Colombie", "CLST": "heure d’été du Chili", "ACWST": "heure normale du centre-ouest de l’Australie", "NZDT": "heure d’été de la Nouvelle-Zélande", "HAT": "heure d’été de Terre-Neuve", "BT": "heure du Bhoutan", "LHST": "heure normale de Lord Howe", "ADT": "heure d’été de l’Atlantique", "ART": "heure normale d’Argentine", "EST": "heure normale de l’Est nord-américain", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "GMT": "heure moyenne de Greenwich", "WITA": "heure du Centre indonésien", "ACDT": "heure d’été du centre de l’Australie", "OEZ": "heure normale d’Europe de l’Est", "AEDT": "heure d’été de l’Est de l’Australie", "ChST": "heure des Chamorro", "MEZ": "heure normale d’Europe centrale", "CLT": "heure normale du Chili", "WART": "heure normale de l’Ouest argentin", "MYT": "heure de la Malaisie", "WARST": "heure d’été de l’Ouest argentin", "SRT": "heure du Suriname", "JST": "heure normale du Japon", "BOT": "heure de Bolivie", "SAST": "heure normale d’Afrique méridionale", "IST": "heure de l’Inde", "∅∅∅": "heure d’été de l’Amazonie", "TMT": "heure normale du Turkménistan", "SGT": "heure de Singapour", "OESZ": "heure d’été d’Europe de l’Est", "GFT": "heure de la Guyane française", "AKDT": "heure d’été de l’Alaska", "AWDT": "heure d’été de l’Ouest de l’Australie", "ARST": "heure d’été de l’Argentine", "WESZ": "heure d’été d’Europe de l’Ouest", "LHDT": "heure d’été de Lord Howe", "CDT": "heure d’été du Centre", "MDT": "heure d’été de Macao", "NZST": "heure normale de la Nouvelle-Zélande", "HAST": "heure normale d’Hawaii - Aléoutiennes", "GYT": "heure du Guyana", "UYT": "heure normale de l’Uruguay", "HKT": "heure normale de Hong Kong", "HKST": "heure d’été de Hong Kong", "HNT": "heure normale de Terre-Neuve", "MST": "heure normale de Macao", "CHAST": "heure normale des îles Chatham", "VET": "heure du Venezuela", "AWST": "heure normale de l’Ouest de l’Australie", "TMST": "heure d’été du Turkménistan", "WIT": "heure de l’Est indonésien", "EAT": "heure normale d’Afrique de l’Est", "CST": "heure normale du centre nord-américain", "ECT": "heure de l’Équateur", "JDT": "heure d’été du Japon", "PST": "heure normale du Pacifique nord-américain", "WAT": "heure normale d’Afrique de l’Ouest", "AEST": "heure normale de l’Est de l’Australie", "PDT": "heure d’été du Pacifique", "CAT": "heure normale d’Afrique centrale", "WEZ": "heure normale d’Europe de l’Ouest", "COT": "heure normale de Colombie", "ACST": "heure normale du centre de l’Australie", "AST": "heure normale de l’Atlantique", "MESZ": "heure d’été d’Europe centrale", "EDT": "heure d’été de l’Est", "UYST": "heure d’été de l’Uruguay"},
}
}
diff --git a/fr_CD/fr_CD_test.go b/fr_CD/fr_CD_test.go
new file mode 100644
index 00000000..2cf58704
--- /dev/null
+++ b/fr_CD/fr_CD_test.go
@@ -0,0 +1,1120 @@
+package fr_CD
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr_CD"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr_CF/fr_CF.go b/fr_CF/fr_CF.go
index 17a4c589..2f44a5ae 100644
--- a/fr_CF/fr_CF.go
+++ b/fr_CF/fr_CF.go
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"WIB": "heure de l’Ouest indonésien", "GFT": "heure de la Guyane française", "ART": "heure normale d’Argentine", "NZDT": "heure d’été de la Nouvelle-Zélande", "CLT": "heure normale du Chili", "MESZ": "heure d’été d’Europe centrale", "NZST": "heure normale de la Nouvelle-Zélande", "LHDT": "heure d’été de Lord Howe", "MEZ": "heure normale d’Europe centrale", "CHADT": "heure d’été des îles Chatham", "ECT": "heure de l’Équateur", "SGT": "heure de Singapour", "GMT": "heure moyenne de Greenwich", "AWDT": "heure d’été de l’Ouest de l’Australie", "ACWST": "heure normale du centre-ouest de l’Australie", "OESZ": "heure d’été d’Europe de l’Est", "HNT": "heure normale de Terre-Neuve", "TMT": "heure normale du Turkménistan", "UYT": "heure normale de l’Uruguay", "WEZ": "heure normale d’Europe de l’Ouest", "ChST": "heure des Chamorro", "∅∅∅": "heure d’été de Brasilia", "EDT": "heure d’été de l’Est", "HKT": "heure normale de Hong Kong", "AST": "heure normale de l’Atlantique", "AKDT": "heure d’été de l’Alaska", "BOT": "heure de Bolivie", "AEDT": "heure d’été de l’Est de l’Australie", "ADT": "heure d’été de l’Atlantique", "WIT": "heure de l’Est indonésien", "EAT": "heure normale d’Afrique de l’Est", "ACST": "heure normale du centre de l’Australie", "MST": "heure normale des Rocheuses", "ACDT": "heure d’été du centre de l’Australie", "JST": "heure normale du Japon", "PDT": "heure d’été du Pacifique", "LHST": "heure normale de Lord Howe", "VET": "heure du Venezuela", "MDT": "heure d’été des Rocheuses", "BT": "heure du Bhoutan", "CDT": "heure d’été du Centre", "SAST": "heure normale d’Afrique méridionale", "UYST": "heure d’été de l’Uruguay", "JDT": "heure d’été du Japon", "SRT": "heure du Suriname", "ACWDT": "heure d’été du centre-ouest de l’Australie", "HAST": "heure normale d’Hawaii - Aléoutiennes", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "IST": "heure de l’Inde", "ARST": "heure d’été de l’Argentine", "AEST": "heure normale de l’Est de l’Australie", "CAT": "heure normale d’Afrique centrale", "COST": "heure d’été de Colombie", "OEZ": "heure normale d’Europe de l’Est", "AWST": "heure normale de l’Ouest de l’Australie", "MYT": "heure de la Malaisie", "CST": "heure normale du centre nord-américain", "CLST": "heure d’été du Chili", "WESZ": "heure d’été d’Europe de l’Ouest", "COT": "heure normale de Colombie", "WARST": "heure d’été de l’Ouest argentin", "WITA": "heure du Centre indonésien", "AKST": "heure normale de l’Alaska", "PST": "heure normale du Pacifique nord-américain", "EST": "heure normale de l’Est nord-américain", "WAT": "heure normale d’Afrique de l’Ouest", "HKST": "heure d’été de Hong Kong", "WART": "heure normale de l’Ouest argentin", "HAT": "heure d’été de Terre-Neuve", "CHAST": "heure normale des îles Chatham", "WAST": "heure d’été d’Afrique de l’Ouest", "TMST": "heure d’été du Turkménistan", "GYT": "heure du Guyana"},
+ timezones: map[string]string{"WAT": "heure normale d’Afrique de l’Ouest", "WAST": "heure d’été d’Afrique de l’Ouest", "UYST": "heure d’été de l’Uruguay", "AST": "heure normale de l’Atlantique", "WITA": "heure du Centre indonésien", "WEZ": "heure normale d’Europe de l’Ouest", "ChST": "heure des Chamorro", "VET": "heure du Venezuela", "ARST": "heure d’été de l’Argentine", "JST": "heure normale du Japon", "WARST": "heure d’été de l’Ouest argentin", "EST": "heure normale de l’Est nord-américain", "PST": "heure normale du Pacifique nord-américain", "WESZ": "heure d’été d’Europe de l’Ouest", "SGT": "heure de Singapour", "GYT": "heure du Guyana", "CLST": "heure d’été du Chili", "EDT": "heure d’été de l’Est", "MYT": "heure de la Malaisie", "WIT": "heure de l’Est indonésien", "WART": "heure normale de l’Ouest argentin", "CHAST": "heure normale des îles Chatham", "ACWDT": "heure d’été du centre-ouest de l’Australie", "IST": "heure de l’Inde", "MESZ": "heure d’été d’Europe centrale", "BOT": "heure de Bolivie", "GFT": "heure de la Guyane française", "AWST": "heure normale de l’Ouest de l’Australie", "SAST": "heure normale d’Afrique méridionale", "AEST": "heure normale de l’Est de l’Australie", "ACDT": "heure d’été du centre de l’Australie", "ART": "heure normale d’Argentine", "CAT": "heure normale d’Afrique centrale", "COST": "heure d’été de Colombie", "TMST": "heure d’été du Turkménistan", "OESZ": "heure d’été d’Europe de l’Est", "EAT": "heure normale d’Afrique de l’Est", "AKDT": "heure d’été de l’Alaska", "HAST": "heure normale d’Hawaii - Aléoutiennes", "MST": "heure normale des Rocheuses", "GMT": "heure moyenne de Greenwich", "CLT": "heure normale du Chili", "WIB": "heure de l’Ouest indonésien", "AEDT": "heure d’été de l’Est de l’Australie", "AWDT": "heure d’été de l’Ouest de l’Australie", "BT": "heure du Bhoutan", "SRT": "heure du Suriname", "HAT": "heure d’été de Terre-Neuve", "AKST": "heure normale de l’Alaska", "HNT": "heure normale de Terre-Neuve", "OEZ": "heure normale d’Europe de l’Est", "HKT": "heure normale de Hong Kong", "HKST": "heure d’été de Hong Kong", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "NZST": "heure normale de la Nouvelle-Zélande", "∅∅∅": "heure d’été de l’Amazonie", "COT": "heure normale de Colombie", "LHDT": "heure d’été de Lord Howe", "MDT": "heure d’été des Rocheuses", "ADT": "heure d’été de l’Atlantique", "PDT": "heure d’été du Pacifique", "MEZ": "heure normale d’Europe centrale", "CST": "heure normale du centre nord-américain", "CDT": "heure d’été du Centre", "ACST": "heure normale du centre de l’Australie", "ACWST": "heure normale du centre-ouest de l’Australie", "JDT": "heure d’été du Japon", "NZDT": "heure d’été de la Nouvelle-Zélande", "TMT": "heure normale du Turkménistan", "LHST": "heure normale de Lord Howe", "UYT": "heure normale de l’Uruguay", "CHADT": "heure d’été des îles Chatham", "ECT": "heure de l’Équateur"},
}
}
diff --git a/fr_CF/fr_CF_test.go b/fr_CF/fr_CF_test.go
new file mode 100644
index 00000000..c56b0d4f
--- /dev/null
+++ b/fr_CF/fr_CF_test.go
@@ -0,0 +1,1120 @@
+package fr_CF
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr_CF"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr_CG/fr_CG.go b/fr_CG/fr_CG.go
index ac551367..1ec3cdc7 100644
--- a/fr_CG/fr_CG.go
+++ b/fr_CG/fr_CG.go
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"ACST": "heure normale du centre de l’Australie", "UYST": "heure d’été de l’Uruguay", "ADT": "heure d’été de l’Atlantique", "CAT": "heure normale d’Afrique centrale", "NZDT": "heure d’été de la Nouvelle-Zélande", "UYT": "heure normale de l’Uruguay", "WEZ": "heure normale d’Europe de l’Ouest", "GMT": "heure moyenne de Greenwich", "ARST": "heure d’été de l’Argentine", "MYT": "heure de la Malaisie", "SAST": "heure normale d’Afrique méridionale", "CHAST": "heure normale des îles Chatham", "EDT": "heure d’été de l’Est", "TMT": "heure normale du Turkménistan", "ACWST": "heure normale du centre-ouest de l’Australie", "SGT": "heure de Singapour", "OESZ": "heure d’été d’Europe de l’Est", "EAT": "heure normale d’Afrique de l’Est", "ART": "heure normale d’Argentine", "LHDT": "heure d’été de Lord Howe", "CLST": "heure d’été du Chili", "CHADT": "heure d’été des îles Chatham", "ECT": "heure de l’Équateur", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "MST": "heure normale des Rocheuses", "COT": "heure normale de Colombie", "WAT": "heure normale d’Afrique de l’Ouest", "BT": "heure du Bhoutan", "OEZ": "heure normale d’Europe de l’Est", "WITA": "heure du Centre indonésien", "MEZ": "heure normale d’Europe centrale", "MDT": "heure d’été des Rocheuses", "ChST": "heure des Chamorro", "WART": "heure normale de l’Ouest argentin", "AKDT": "heure d’été de l’Alaska", "AEDT": "heure d’été de l’Est de l’Australie", "COST": "heure d’été de Colombie", "∅∅∅": "heure d’été de Brasilia", "WIB": "heure de l’Ouest indonésien", "AWDT": "heure d’été de l’Ouest de l’Australie", "LHST": "heure normale de Lord Howe", "WESZ": "heure d’été d’Europe de l’Ouest", "AST": "heure normale de l’Atlantique", "GYT": "heure du Guyana", "MESZ": "heure d’été d’Europe centrale", "NZST": "heure normale de la Nouvelle-Zélande", "AEST": "heure normale de l’Est de l’Australie", "HAST": "heure normale d’Hawaii - Aléoutiennes", "ACDT": "heure d’été du centre de l’Australie", "PST": "heure normale du Pacifique nord-américain", "PDT": "heure d’été du Pacifique", "AWST": "heure normale de l’Ouest de l’Australie", "CDT": "heure d’été du Centre", "CLT": "heure normale du Chili", "WAST": "heure d’été d’Afrique de l’Ouest", "HKT": "heure normale de Hong Kong", "HAT": "heure d’été de Terre-Neuve", "AKST": "heure normale de l’Alaska", "JST": "heure normale du Japon", "VET": "heure du Venezuela", "HKST": "heure d’été de Hong Kong", "WARST": "heure d’été de l’Ouest argentin", "TMST": "heure d’été du Turkménistan", "JDT": "heure d’été du Japon", "CST": "heure normale du centre nord-américain", "EST": "heure normale de l’Est nord-américain", "IST": "heure de l’Inde", "HNT": "heure normale de Terre-Neuve", "GFT": "heure de la Guyane française", "SRT": "heure du Suriname", "ACWDT": "heure d’été du centre-ouest de l’Australie", "BOT": "heure de Bolivie", "WIT": "heure de l’Est indonésien"},
+ timezones: map[string]string{"CAT": "heure normale d’Afrique centrale", "WEZ": "heure normale d’Europe de l’Ouest", "AEDT": "heure d’été de l’Est de l’Australie", "ChST": "heure des Chamorro", "LHDT": "heure d’été de Lord Howe", "CST": "heure normale du centre nord-américain", "MST": "heure normale des Rocheuses", "HKST": "heure d’été de Hong Kong", "CHADT": "heure d’été des îles Chatham", "HAST": "heure normale d’Hawaii - Aléoutiennes", "AKST": "heure normale de l’Alaska", "JDT": "heure d’été du Japon", "AEST": "heure normale de l’Est de l’Australie", "CLST": "heure d’été du Chili", "WARST": "heure d’été de l’Ouest argentin", "AWDT": "heure d’été de l’Ouest de l’Australie", "SAST": "heure normale d’Afrique méridionale", "IST": "heure de l’Inde", "WAST": "heure d’été d’Afrique de l’Ouest", "GFT": "heure de la Guyane française", "VET": "heure du Venezuela", "WESZ": "heure d’été d’Europe de l’Ouest", "COST": "heure d’été de Colombie", "WIB": "heure de l’Ouest indonésien", "TMST": "heure d’été du Turkménistan", "MYT": "heure de la Malaisie", "CLT": "heure normale du Chili", "HKT": "heure normale de Hong Kong", "ACWST": "heure normale du centre-ouest de l’Australie", "AWST": "heure normale de l’Ouest de l’Australie", "PDT": "heure d’été du Pacifique", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "HNT": "heure normale de Terre-Neuve", "WIT": "heure de l’Est indonésien", "∅∅∅": "heure d’été de Brasilia", "ACST": "heure normale du centre de l’Australie", "ARST": "heure d’été de l’Argentine", "EDT": "heure d’été de l’Est", "GMT": "heure moyenne de Greenwich", "ACDT": "heure d’été du centre de l’Australie", "BOT": "heure de Bolivie", "MDT": "heure d’été des Rocheuses", "ECT": "heure de l’Équateur", "ADT": "heure d’été de l’Atlantique", "PST": "heure normale du Pacifique nord-américain", "NZDT": "heure d’été de la Nouvelle-Zélande", "LHST": "heure normale de Lord Howe", "UYT": "heure normale de l’Uruguay", "CDT": "heure d’été du Centre", "JST": "heure normale du Japon", "MESZ": "heure d’été d’Europe centrale", "HAT": "heure d’été de Terre-Neuve", "SGT": "heure de Singapour", "WART": "heure normale de l’Ouest argentin", "MEZ": "heure normale d’Europe centrale", "NZST": "heure normale de la Nouvelle-Zélande", "COT": "heure normale de Colombie", "GYT": "heure du Guyana", "SRT": "heure du Suriname", "ART": "heure normale d’Argentine", "OEZ": "heure normale d’Europe de l’Est", "BT": "heure du Bhoutan", "UYST": "heure d’été de l’Uruguay", "AST": "heure normale de l’Atlantique", "EST": "heure normale de l’Est nord-américain", "WAT": "heure normale d’Afrique de l’Ouest", "TMT": "heure normale du Turkménistan", "OESZ": "heure d’été d’Europe de l’Est", "CHAST": "heure normale des îles Chatham", "AKDT": "heure d’été de l’Alaska", "WITA": "heure du Centre indonésien", "EAT": "heure normale d’Afrique de l’Est", "ACWDT": "heure d’été du centre-ouest de l’Australie"},
}
}
diff --git a/fr_CG/fr_CG_test.go b/fr_CG/fr_CG_test.go
new file mode 100644
index 00000000..a2106c40
--- /dev/null
+++ b/fr_CG/fr_CG_test.go
@@ -0,0 +1,1120 @@
+package fr_CG
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr_CG"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr_CH/fr_CH.go b/fr_CH/fr_CH.go
index 26a92bb7..219dc373 100644
--- a/fr_CH/fr_CH.go
+++ b/fr_CH/fr_CH.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"OEZ": "heure normale d’Europe de l’Est", "HNT": "heure normale de Terre-Neuve", "AWST": "heure normale de l’Ouest de l’Australie", "LHST": "heure normale de Lord Howe", "LHDT": "heure d’été de Lord Howe", "AEDT": "heure d’été de l’Est de l’Australie", "HAT": "heure d’été de Terre-Neuve", "WESZ": "heure d’été d’Europe de l’Ouest", "MDT": "heure d’été des Rocheuses", "COST": "heure d’été de Colombie", "OESZ": "heure d’été d’Europe de l’Est", "GFT": "heure de la Guyane française", "ACST": "heure normale du centre de l’Australie", "ADT": "heure d’été de l’Atlantique", "WAST": "heure d’été d’Afrique de l’Ouest", "PST": "heure normale du Pacifique nord-américain", "ACWST": "heure normale du centre-ouest de l’Australie", "EST": "heure normale de l’Est nord-américain", "HAST": "heure normale d’Hawaii - Aléoutiennes", "WAT": "heure normale d’Afrique de l’Ouest", "GMT": "heure moyenne de Greenwich", "GYT": "heure du Guyana", "MYT": "heure de la Malaisie", "EDT": "heure d’été de l’Est", "HKT": "heure normale de Hong Kong", "WART": "heure normale de l’Ouest argentin", "WIB": "heure de l’Ouest indonésien", "JDT": "heure d’été du Japon", "AKDT": "heure d’été de l’Alaska", "CLST": "heure d’été du Chili", "CAT": "heure normale d’Afrique centrale", "ECT": "heure de l’Équateur", "WIT": "heure de l’Est indonésien", "WITA": "heure du Centre indonésien", "ART": "heure normale d’Argentine", "JST": "heure normale du Japon", "AWDT": "heure d’été de l’Ouest de l’Australie", "BT": "heure du Bhoutan", "EAT": "heure normale d’Afrique de l’Est", "TMST": "heure d’été du Turkménistan", "CDT": "heure d’été du Centre", "MEZ": "heure normale d’Europe centrale", "NZST": "heure normale de la Nouvelle-Zélande", "UYT": "heure normale de l’Uruguay", "CLT": "heure normale du Chili", "SAST": "heure normale d’Afrique méridionale", "TMT": "heure normale du Turkménistan", "NZDT": "heure d’été de la Nouvelle-Zélande", "AEST": "heure normale de l’Est de l’Australie", "HKST": "heure d’été de Hong Kong", "IST": "heure de l’Inde", "AKST": "heure normale de l’Alaska", "PDT": "heure d’été du Pacifique", "WARST": "heure d’été de l’Ouest argentin", "CST": "heure normale du centre nord-américain", "VET": "heure du Venezuela", "ACWDT": "heure d’été du centre-ouest de l’Australie", "MST": "heure normale des Rocheuses", "COT": "heure normale de Colombie", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "BOT": "heure de Bolivie", "UYST": "heure d’été de l’Uruguay", "ChST": "heure des Chamorro", "ACDT": "heure d’été du centre de l’Australie", "SRT": "heure du Suriname", "MESZ": "heure d’été d’Europe centrale", "CHAST": "heure normale des îles Chatham", "AST": "heure normale de l’Atlantique", "SGT": "heure de Singapour", "ARST": "heure d’été de l’Argentine", "∅∅∅": "heure d’été des Açores", "WEZ": "heure normale d’Europe de l’Ouest", "CHADT": "heure d’été des îles Chatham"},
+ timezones: map[string]string{"WESZ": "heure d’été d’Europe de l’Ouest", "AEDT": "heure d’été de l’Est de l’Australie", "∅∅∅": "heure d’été des Açores", "MST": "heure normale de Macao", "AKST": "heure normale de l’Alaska", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "WEZ": "heure normale d’Europe de l’Ouest", "GFT": "heure de la Guyane française", "AKDT": "heure d’été de l’Alaska", "MEZ": "heure normale d’Europe centrale", "AWST": "heure normale de l’Ouest de l’Australie", "WAST": "heure d’été d’Afrique de l’Ouest", "BT": "heure du Bhoutan", "ACST": "heure normale du centre de l’Australie", "JST": "heure normale du Japon", "NZDT": "heure d’été de la Nouvelle-Zélande", "SGT": "heure de Singapour", "WIT": "heure de l’Est indonésien", "LHST": "heure normale de Lord Howe", "HKT": "heure normale de Hong Kong", "HNT": "heure normale de Terre-Neuve", "MYT": "heure de la Malaisie", "CLST": "heure d’été du Chili", "GMT": "heure moyenne de Greenwich", "CLT": "heure normale du Chili", "WARST": "heure d’été de l’Ouest argentin", "VET": "heure du Venezuela", "ARST": "heure d’été de l’Argentine", "ACWST": "heure normale du centre-ouest de l’Australie", "PDT": "heure d’été du Pacifique", "EST": "heure normale de l’Est nord-américain", "CHAST": "heure normale des îles Chatham", "UYT": "heure normale de l’Uruguay", "CST": "heure normale du centre nord-américain", "PST": "heure normale du Pacifique nord-américain", "NZST": "heure normale de la Nouvelle-Zélande", "WAT": "heure normale d’Afrique de l’Ouest", "CDT": "heure d’été du Centre", "AEST": "heure normale de l’Est de l’Australie", "ACDT": "heure d’été du centre de l’Australie", "AWDT": "heure d’été de l’Ouest de l’Australie", "AST": "heure normale de l’Atlantique", "ADT": "heure d’été de l’Atlantique", "HAT": "heure d’été de Terre-Neuve", "OEZ": "heure normale d’Europe de l’Est", "CHADT": "heure d’été des îles Chatham", "IST": "heure de l’Inde", "ChST": "heure des Chamorro", "WART": "heure normale de l’Ouest argentin", "MESZ": "heure d’été d’Europe centrale", "HAST": "heure normale d’Hawaii - Aléoutiennes", "TMT": "heure normale du Turkménistan", "SRT": "heure du Suriname", "ACWDT": "heure d’été du centre-ouest de l’Australie", "BOT": "heure de Bolivie", "TMST": "heure d’été du Turkménistan", "CAT": "heure normale d’Afrique centrale", "OESZ": "heure d’été d’Europe de l’Est", "ECT": "heure de l’Équateur", "ART": "heure normale d’Argentine", "WITA": "heure du Centre indonésien", "JDT": "heure d’été du Japon", "HKST": "heure d’été de Hong Kong", "SAST": "heure normale d’Afrique méridionale", "WIB": "heure de l’Ouest indonésien", "MDT": "heure d’été de Macao", "UYST": "heure d’été de l’Uruguay", "EAT": "heure normale d’Afrique de l’Est", "LHDT": "heure d’été de Lord Howe", "EDT": "heure d’été de l’Est", "COT": "heure normale de Colombie", "COST": "heure d’été de Colombie", "GYT": "heure du Guyana"},
}
}
diff --git a/fr_CH/fr_CH_test.go b/fr_CH/fr_CH_test.go
new file mode 100644
index 00000000..17006548
--- /dev/null
+++ b/fr_CH/fr_CH_test.go
@@ -0,0 +1,1120 @@
+package fr_CH
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr_CH"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr_CI/fr_CI.go b/fr_CI/fr_CI.go
index 6818bf05..e98ce6b5 100644
--- a/fr_CI/fr_CI.go
+++ b/fr_CI/fr_CI.go
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"SRT": "heure du Suriname", "PST": "heure normale du Pacifique nord-américain", "CHAST": "heure normale des îles Chatham", "WESZ": "heure d’été d’Europe de l’Ouest", "COT": "heure normale de Colombie", "WIT": "heure de l’Est indonésien", "ACST": "heure normale du centre de l’Australie", "∅∅∅": "heure d’été de l’Amazonie", "CAT": "heure normale d’Afrique centrale", "WAT": "heure normale d’Afrique de l’Ouest", "CDT": "heure d’été du Centre", "BOT": "heure de Bolivie", "AKDT": "heure d’été de l’Alaska", "AWST": "heure normale de l’Ouest de l’Australie", "LHDT": "heure d’été de Lord Howe", "CHADT": "heure d’été des îles Chatham", "EDT": "heure d’été de l’Est", "WART": "heure normale de l’Ouest argentin", "IST": "heure de l’Inde", "JST": "heure normale du Japon", "BT": "heure du Bhoutan", "TMT": "heure normale du Turkménistan", "AKST": "heure normale de l’Alaska", "CLT": "heure normale du Chili", "WAST": "heure d’été d’Afrique de l’Ouest", "WITA": "heure du Centre indonésien", "HNT": "heure normale de Terre-Neuve", "ACWDT": "heure d’été du centre-ouest de l’Australie", "ADT": "heure d’été de l’Atlantique", "ChST": "heure des Chamorro", "EAT": "heure normale d’Afrique de l’Est", "JDT": "heure d’été du Japon", "NZDT": "heure d’été de la Nouvelle-Zélande", "MYT": "heure de la Malaisie", "UYT": "heure normale de l’Uruguay", "MDT": "heure d’été de Macao", "AWDT": "heure d’été de l’Ouest de l’Australie", "VET": "heure du Venezuela", "GMT": "heure moyenne de Greenwich", "GYT": "heure du Guyana", "UYST": "heure d’été de l’Uruguay", "AST": "heure normale de l’Atlantique", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "SAST": "heure normale d’Afrique méridionale", "HKST": "heure d’été de Hong Kong", "WARST": "heure d’été de l’Ouest argentin", "EST": "heure normale de l’Est nord-américain", "MST": "heure normale de Macao", "WEZ": "heure normale d’Europe de l’Ouest", "AEDT": "heure d’été de l’Est de l’Australie", "HAST": "heure normale d’Hawaii - Aléoutiennes", "HKT": "heure normale de Hong Kong", "CST": "heure normale du centre nord-américain", "MEZ": "heure normale d’Europe centrale", "TMST": "heure d’été du Turkménistan", "ARST": "heure d’été de l’Argentine", "MESZ": "heure d’été d’Europe centrale", "NZST": "heure normale de la Nouvelle-Zélande", "WIB": "heure de l’Ouest indonésien", "OEZ": "heure normale d’Europe de l’Est", "GFT": "heure de la Guyane française", "ACWST": "heure normale du centre-ouest de l’Australie", "COST": "heure d’été de Colombie", "ECT": "heure de l’Équateur", "ACDT": "heure d’été du centre de l’Australie", "ART": "heure normale d’Argentine", "CLST": "heure d’été du Chili", "SGT": "heure de Singapour", "OESZ": "heure d’été d’Europe de l’Est", "HAT": "heure d’été de Terre-Neuve", "PDT": "heure d’été du Pacifique", "LHST": "heure normale de Lord Howe", "AEST": "heure normale de l’Est de l’Australie"},
+ timezones: map[string]string{"MEZ": "heure normale d’Europe centrale", "HNT": "heure normale de Terre-Neuve", "ACDT": "heure d’été du centre de l’Australie", "ECT": "heure de l’Équateur", "HKT": "heure normale de Hong Kong", "AST": "heure normale de l’Atlantique", "HAST": "heure normale d’Hawaii - Aléoutiennes", "OEZ": "heure normale d’Europe de l’Est", "MDT": "heure d’été des Rocheuses", "UYT": "heure normale de l’Uruguay", "CAT": "heure normale d’Afrique centrale", "GYT": "heure du Guyana", "AEDT": "heure d’été de l’Est de l’Australie", "EDT": "heure d’été de l’Est", "WAST": "heure d’été d’Afrique de l’Ouest", "WART": "heure normale de l’Ouest argentin", "CHADT": "heure d’été des îles Chatham", "MESZ": "heure d’été d’Europe centrale", "NZDT": "heure d’été de la Nouvelle-Zélande", "COST": "heure d’été de Colombie", "WAT": "heure normale d’Afrique de l’Ouest", "CLST": "heure d’été du Chili", "UYST": "heure d’été de l’Uruguay", "CDT": "heure d’été du Centre", "COT": "heure normale de Colombie", "LHST": "heure normale de Lord Howe", "AKST": "heure normale de l’Alaska", "PST": "heure normale du Pacifique nord-américain", "NZST": "heure normale de la Nouvelle-Zélande", "LHDT": "heure d’été de Lord Howe", "AWST": "heure normale de l’Ouest de l’Australie", "ACST": "heure normale du centre de l’Australie", "VET": "heure du Venezuela", "HKST": "heure d’été de Hong Kong", "AWDT": "heure d’été de l’Ouest de l’Australie", "WIB": "heure de l’Ouest indonésien", "EAT": "heure normale d’Afrique de l’Est", "AEST": "heure normale de l’Est de l’Australie", "ACWST": "heure normale du centre-ouest de l’Australie", "ARST": "heure d’été de l’Argentine", "JDT": "heure d’été du Japon", "BOT": "heure de Bolivie", "TMT": "heure normale du Turkménistan", "WARST": "heure d’été de l’Ouest argentin", "∅∅∅": "heure d’été de Brasilia", "CST": "heure normale du centre nord-américain", "JST": "heure normale du Japon", "WEZ": "heure normale d’Europe de l’Ouest", "ChST": "heure des Chamorro", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "HAT": "heure d’été de Terre-Neuve", "SRT": "heure du Suriname", "ART": "heure normale d’Argentine", "WITA": "heure du Centre indonésien", "AKDT": "heure d’été de l’Alaska", "ADT": "heure d’été de l’Atlantique", "SAST": "heure normale d’Afrique méridionale", "IST": "heure de l’Inde", "GMT": "heure moyenne de Greenwich", "WIT": "heure de l’Est indonésien", "CLT": "heure normale du Chili", "BT": "heure du Bhoutan", "GFT": "heure de la Guyane française", "SGT": "heure de Singapour", "TMST": "heure d’été du Turkménistan", "EST": "heure normale de l’Est nord-américain", "MST": "heure normale des Rocheuses", "MYT": "heure de la Malaisie", "CHAST": "heure normale des îles Chatham", "ACWDT": "heure d’été du centre-ouest de l’Australie", "PDT": "heure d’été du Pacifique", "WESZ": "heure d’été d’Europe de l’Ouest", "OESZ": "heure d’été d’Europe de l’Est"},
}
}
diff --git a/fr_CI/fr_CI_test.go b/fr_CI/fr_CI_test.go
new file mode 100644
index 00000000..c9fc12f4
--- /dev/null
+++ b/fr_CI/fr_CI_test.go
@@ -0,0 +1,1120 @@
+package fr_CI
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr_CI"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr_CM/fr_CM.go b/fr_CM/fr_CM.go
index cc803aac..7d9ea8d8 100644
--- a/fr_CM/fr_CM.go
+++ b/fr_CM/fr_CM.go
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"AWST": "heure normale de l’Ouest de l’Australie", "PDT": "heure d’été du Pacifique", "NZDT": "heure d’été de la Nouvelle-Zélande", "ACWST": "heure normale du centre-ouest de l’Australie", "EST": "heure normale de l’Est nord-américain", "OESZ": "heure d’été d’Europe de l’Est", "CLST": "heure d’été du Chili", "ADT": "heure d’été de l’Atlantique", "IST": "heure de l’Inde", "TMST": "heure d’été du Turkménistan", "AST": "heure normale de l’Atlantique", "JDT": "heure d’été du Japon", "CDT": "heure d’été du Centre", "BOT": "heure de Bolivie", "WEZ": "heure normale d’Europe de l’Ouest", "ChST": "heure des Chamorro", "WITA": "heure du Centre indonésien", "GYT": "heure du Guyana", "SRT": "heure du Suriname", "AKST": "heure normale de l’Alaska", "NZST": "heure normale de la Nouvelle-Zélande", "VET": "heure du Venezuela", "AEDT": "heure d’été de l’Est de l’Australie", "SAST": "heure normale d’Afrique méridionale", "TMT": "heure normale du Turkménistan", "MDT": "heure d’été des Rocheuses", "CLT": "heure normale du Chili", "WART": "heure normale de l’Ouest argentin", "OEZ": "heure normale d’Europe de l’Est", "HAST": "heure normale d’Hawaii - Aléoutiennes", "WIT": "heure de l’Est indonésien", "AWDT": "heure d’été de l’Ouest de l’Australie", "CHADT": "heure d’été des îles Chatham", "∅∅∅": "heure d’été de Brasilia", "CAT": "heure normale d’Afrique centrale", "COT": "heure normale de Colombie", "UYST": "heure d’été de l’Uruguay", "ARST": "heure d’été de l’Argentine", "WIB": "heure de l’Ouest indonésien", "HAT": "heure d’été de Terre-Neuve", "ACST": "heure normale du centre de l’Australie", "CHAST": "heure normale des îles Chatham", "WESZ": "heure d’été d’Europe de l’Ouest", "COST": "heure d’été de Colombie", "SGT": "heure de Singapour", "AEST": "heure normale de l’Est de l’Australie", "WAST": "heure d’été d’Afrique de l’Ouest", "MST": "heure normale des Rocheuses", "GMT": "heure moyenne de Greenwich", "ACDT": "heure d’été du centre de l’Australie", "JST": "heure normale du Japon", "PST": "heure normale du Pacifique nord-américain", "MESZ": "heure d’été d’Europe centrale", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "WARST": "heure d’été de l’Ouest argentin", "ART": "heure normale d’Argentine", "EDT": "heure d’été de l’Est", "ECT": "heure de l’Équateur", "CST": "heure normale du centre nord-américain", "EAT": "heure normale d’Afrique de l’Est", "LHST": "heure normale de Lord Howe", "LHDT": "heure d’été de Lord Howe", "MYT": "heure de la Malaisie", "ACWDT": "heure d’été du centre-ouest de l’Australie", "WAT": "heure normale d’Afrique de l’Ouest", "HKST": "heure d’été de Hong Kong", "GFT": "heure de la Guyane française", "HNT": "heure normale de Terre-Neuve", "AKDT": "heure d’été de l’Alaska", "UYT": "heure normale de l’Uruguay", "MEZ": "heure normale d’Europe centrale", "BT": "heure du Bhoutan", "HKT": "heure normale de Hong Kong"},
+ timezones: map[string]string{"ACWDT": "heure d’été du centre-ouest de l’Australie", "PDT": "heure d’été du Pacifique", "SGT": "heure de Singapour", "CAT": "heure normale d’Afrique centrale", "WAT": "heure normale d’Afrique de l’Ouest", "AWDT": "heure d’été de l’Ouest de l’Australie", "ARST": "heure d’été de l’Argentine", "JDT": "heure d’été du Japon", "EAT": "heure normale d’Afrique de l’Est", "AEDT": "heure d’été de l’Est de l’Australie", "ACWST": "heure normale du centre-ouest de l’Australie", "MEZ": "heure normale d’Europe centrale", "HAST": "heure normale d’Hawaii - Aléoutiennes", "GFT": "heure de la Guyane française", "HAT": "heure d’été de Terre-Neuve", "WAST": "heure d’été d’Afrique de l’Ouest", "BT": "heure du Bhoutan", "SRT": "heure du Suriname", "EST": "heure normale de l’Est nord-américain", "WIB": "heure de l’Ouest indonésien", "CLST": "heure d’été du Chili", "UYT": "heure normale de l’Uruguay", "UYST": "heure d’été de l’Uruguay", "WARST": "heure d’été de l’Ouest argentin", "AWST": "heure normale de l’Ouest de l’Australie", "TMT": "heure normale du Turkménistan", "MESZ": "heure d’été d’Europe centrale", "WESZ": "heure d’été d’Europe de l’Ouest", "OESZ": "heure d’été d’Europe de l’Est", "MDT": "heure d’été de Macao", "AEST": "heure normale de l’Est de l’Australie", "NZDT": "heure d’été de la Nouvelle-Zélande", "IST": "heure de l’Inde", "HNT": "heure normale de Terre-Neuve", "TMST": "heure d’été du Turkménistan", "GYT": "heure du Guyana", "VET": "heure du Venezuela", "WITA": "heure du Centre indonésien", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "CST": "heure normale du centre nord-américain", "COST": "heure d’été de Colombie", "WEZ": "heure normale d’Europe de l’Ouest", "PST": "heure normale du Pacifique nord-américain", "BOT": "heure de Bolivie", "COT": "heure normale de Colombie", "ACST": "heure normale du centre de l’Australie", "WART": "heure normale de l’Ouest argentin", "CHAST": "heure normale des îles Chatham", "NZST": "heure normale de la Nouvelle-Zélande", "CLT": "heure normale du Chili", "MYT": "heure de la Malaisie", "LHST": "heure normale de Lord Howe", "∅∅∅": "heure d’été des Açores", "CHADT": "heure d’été des îles Chatham", "SAST": "heure normale d’Afrique méridionale", "GMT": "heure moyenne de Greenwich", "WIT": "heure de l’Est indonésien", "LHDT": "heure d’été de Lord Howe", "HKST": "heure d’été de Hong Kong", "ADT": "heure d’été de l’Atlantique", "ChST": "heure des Chamorro", "AST": "heure normale de l’Atlantique", "OEZ": "heure normale d’Europe de l’Est", "CDT": "heure d’été du Centre", "MST": "heure normale de Macao", "HKT": "heure normale de Hong Kong", "ECT": "heure de l’Équateur", "AKDT": "heure d’été de l’Alaska", "EDT": "heure d’été de l’Est", "AKST": "heure normale de l’Alaska", "ACDT": "heure d’été du centre de l’Australie", "ART": "heure normale d’Argentine", "JST": "heure normale du Japon"},
}
}
diff --git a/fr_CM/fr_CM_test.go b/fr_CM/fr_CM_test.go
new file mode 100644
index 00000000..3ced2325
--- /dev/null
+++ b/fr_CM/fr_CM_test.go
@@ -0,0 +1,1120 @@
+package fr_CM
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr_CM"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr_DJ/fr_DJ.go b/fr_DJ/fr_DJ.go
index 2dad95a4..5dd4e010 100644
--- a/fr_DJ/fr_DJ.go
+++ b/fr_DJ/fr_DJ.go
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"WIT": "heure de l’Est indonésien", "MST": "heure normale de Macao", "ARST": "heure d’été de l’Argentine", "JDT": "heure d’été du Japon", "UYT": "heure normale de l’Uruguay", "MEZ": "heure normale d’Europe centrale", "COT": "heure normale de Colombie", "WAT": "heure normale d’Afrique de l’Ouest", "WART": "heure normale de l’Ouest argentin", "WAST": "heure d’été d’Afrique de l’Ouest", "HKST": "heure d’été de Hong Kong", "SRT": "heure du Suriname", "CHAST": "heure normale des îles Chatham", "COST": "heure d’été de Colombie", "ADT": "heure d’été de l’Atlantique", "NZST": "heure normale de la Nouvelle-Zélande", "CHADT": "heure d’été des îles Chatham", "MYT": "heure de la Malaisie", "LHST": "heure normale de Lord Howe", "VET": "heure du Venezuela", "CDT": "heure d’été du Centre", "MESZ": "heure d’été d’Europe centrale", "MDT": "heure d’été de Macao", "AWST": "heure normale de l’Ouest de l’Australie", "OESZ": "heure d’été d’Europe de l’Est", "GMT": "heure moyenne de Greenwich", "PDT": "heure d’été du Pacifique", "ACWST": "heure normale du centre-ouest de l’Australie", "AEST": "heure normale de l’Est de l’Australie", "ART": "heure normale d’Argentine", "JST": "heure normale du Japon", "IST": "heure de l’Inde", "CLT": "heure normale du Chili", "HAST": "heure normale d’Hawaii - Aléoutiennes", "SAST": "heure normale d’Afrique méridionale", "WITA": "heure du Centre indonésien", "AKST": "heure normale de l’Alaska", "HNT": "heure normale de Terre-Neuve", "AKDT": "heure d’été de l’Alaska", "LHDT": "heure d’été de Lord Howe", "∅∅∅": "heure d’été de Brasilia", "CAT": "heure normale d’Afrique centrale", "NZDT": "heure d’été de la Nouvelle-Zélande", "HAT": "heure d’été de Terre-Neuve", "GYT": "heure du Guyana", "AWDT": "heure d’été de l’Ouest de l’Australie", "CST": "heure normale du centre nord-américain", "CLST": "heure d’été du Chili", "WIB": "heure de l’Ouest indonésien", "OEZ": "heure normale d’Europe de l’Est", "EDT": "heure d’été de l’Est", "TMST": "heure d’été du Turkménistan", "EAT": "heure normale d’Afrique de l’Est", "ACST": "heure normale du centre de l’Australie", "PST": "heure normale du Pacifique nord-américain", "BOT": "heure de Bolivie", "WEZ": "heure normale d’Europe de l’Ouest", "WESZ": "heure d’été d’Europe de l’Ouest", "AST": "heure normale de l’Atlantique", "WARST": "heure d’été de l’Ouest argentin", "EST": "heure normale de l’Est nord-américain", "ACWDT": "heure d’été du centre-ouest de l’Australie", "GFT": "heure de la Guyane française", "TMT": "heure normale du Turkménistan", "AEDT": "heure d’été de l’Est de l’Australie", "ChST": "heure des Chamorro", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "BT": "heure du Bhoutan", "HKT": "heure normale de Hong Kong", "ACDT": "heure d’été du centre de l’Australie", "UYST": "heure d’été de l’Uruguay", "ECT": "heure de l’Équateur", "SGT": "heure de Singapour"},
+ timezones: map[string]string{"BT": "heure du Bhoutan", "CST": "heure normale du centre nord-américain", "CDT": "heure d’été du Centre", "NZST": "heure normale de la Nouvelle-Zélande", "COST": "heure d’été de Colombie", "ChST": "heure des Chamorro", "EDT": "heure d’été de l’Est", "HNT": "heure normale de Terre-Neuve", "COT": "heure normale de Colombie", "WAT": "heure normale d’Afrique de l’Ouest", "UYST": "heure d’été de l’Uruguay", "WARST": "heure d’été de l’Ouest argentin", "AKST": "heure normale de l’Alaska", "MEZ": "heure normale d’Europe centrale", "NZDT": "heure d’été de la Nouvelle-Zélande", "BOT": "heure de Bolivie", "PST": "heure normale du Pacifique nord-américain", "MDT": "heure d’été des Rocheuses", "JDT": "heure d’été du Japon", "AKDT": "heure d’été de l’Alaska", "VET": "heure du Venezuela", "ARST": "heure d’été de l’Argentine", "TMT": "heure normale du Turkménistan", "ACDT": "heure d’été du centre de l’Australie", "ECT": "heure de l’Équateur", "AWDT": "heure d’été de l’Ouest de l’Australie", "AEDT": "heure d’été de l’Est de l’Australie", "TMST": "heure d’été du Turkménistan", "WIT": "heure de l’Est indonésien", "GFT": "heure de la Guyane française", "HAST": "heure normale d’Hawaii - Aléoutiennes", "WIB": "heure de l’Ouest indonésien", "CLST": "heure d’été du Chili", "LHDT": "heure d’été de Lord Howe", "CHADT": "heure d’été des îles Chatham", "IST": "heure de l’Inde", "∅∅∅": "heure d’été de l’Amazonie", "WESZ": "heure d’été d’Europe de l’Ouest", "HAT": "heure d’été de Terre-Neuve", "GMT": "heure moyenne de Greenwich", "MST": "heure normale des Rocheuses", "SRT": "heure du Suriname", "HKST": "heure d’été de Hong Kong", "ACWST": "heure normale du centre-ouest de l’Australie", "PDT": "heure d’été du Pacifique", "HKT": "heure normale de Hong Kong", "AEST": "heure normale de l’Est de l’Australie", "CLT": "heure normale du Chili", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "SAST": "heure normale d’Afrique méridionale", "EAT": "heure normale d’Afrique de l’Est", "ACWDT": "heure d’été du centre-ouest de l’Australie", "AWST": "heure normale de l’Ouest de l’Australie", "CAT": "heure normale d’Afrique centrale", "WEZ": "heure normale d’Europe de l’Ouest", "OEZ": "heure normale d’Europe de l’Est", "MYT": "heure de la Malaisie", "ACST": "heure normale du centre de l’Australie", "CHAST": "heure normale des îles Chatham", "JST": "heure normale du Japon", "AST": "heure normale de l’Atlantique", "OESZ": "heure d’été d’Europe de l’Est", "MESZ": "heure d’été d’Europe centrale", "GYT": "heure du Guyana", "SGT": "heure de Singapour", "UYT": "heure normale de l’Uruguay", "WITA": "heure du Centre indonésien", "EST": "heure normale de l’Est nord-américain", "WAST": "heure d’été d’Afrique de l’Ouest", "LHST": "heure normale de Lord Howe", "WART": "heure normale de l’Ouest argentin", "ART": "heure normale d’Argentine", "ADT": "heure d’été de l’Atlantique"},
}
}
diff --git a/fr_DJ/fr_DJ_test.go b/fr_DJ/fr_DJ_test.go
new file mode 100644
index 00000000..3344b79c
--- /dev/null
+++ b/fr_DJ/fr_DJ_test.go
@@ -0,0 +1,1120 @@
+package fr_DJ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr_DJ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr_DZ/fr_DZ.go b/fr_DZ/fr_DZ.go
index 7e57ecdf..37564303 100644
--- a/fr_DZ/fr_DZ.go
+++ b/fr_DZ/fr_DZ.go
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"MDT": "heure d’été de Macao", "ChST": "heure des Chamorro", "CHADT": "heure d’été des îles Chatham", "COT": "heure normale de Colombie", "TMT": "heure normale du Turkménistan", "NZDT": "heure d’été de la Nouvelle-Zélande", "AEST": "heure normale de l’Est de l’Australie", "ECT": "heure de l’Équateur", "AWST": "heure normale de l’Ouest de l’Australie", "WESZ": "heure d’été d’Europe de l’Ouest", "WAT": "heure normale d’Afrique de l’Ouest", "GMT": "heure moyenne de Greenwich", "HNT": "heure normale de Terre-Neuve", "AKST": "heure normale de l’Alaska", "BOT": "heure de Bolivie", "WEZ": "heure normale d’Europe de l’Ouest", "MYT": "heure de la Malaisie", "MESZ": "heure d’été d’Europe centrale", "CHAST": "heure normale des îles Chatham", "WAST": "heure d’été d’Afrique de l’Ouest", "ART": "heure normale d’Argentine", "GYT": "heure du Guyana", "NZST": "heure normale de la Nouvelle-Zélande", "UYT": "heure normale de l’Uruguay", "ACWST": "heure normale du centre-ouest de l’Australie", "SAST": "heure normale d’Afrique méridionale", "IST": "heure de l’Inde", "OESZ": "heure d’été d’Europe de l’Est", "LHST": "heure normale de Lord Howe", "JDT": "heure d’été du Japon", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "ACST": "heure normale du centre de l’Australie", "∅∅∅": "heure d’été de l’Amazonie", "PDT": "heure d’été du Pacifique", "CLST": "heure d’été du Chili", "CAT": "heure normale d’Afrique centrale", "ACDT": "heure d’été du centre de l’Australie", "VET": "heure du Venezuela", "EST": "heure normale de l’Est nord-américain", "EDT": "heure d’été de l’Est", "SGT": "heure de Singapour", "BT": "heure du Bhoutan", "GFT": "heure de la Guyane française", "WIT": "heure de l’Est indonésien", "EAT": "heure normale d’Afrique de l’Est", "PST": "heure normale du Pacifique nord-américain", "COST": "heure d’été de Colombie", "ACWDT": "heure d’été du centre-ouest de l’Australie", "WARST": "heure d’été de l’Ouest argentin", "WIB": "heure de l’Ouest indonésien", "MST": "heure normale de Macao", "AKDT": "heure d’été de l’Alaska", "JST": "heure normale du Japon", "CST": "heure normale du centre nord-américain", "ARST": "heure d’été de l’Argentine", "TMST": "heure d’été du Turkménistan", "UYST": "heure d’été de l’Uruguay", "CLT": "heure normale du Chili", "HAST": "heure normale d’Hawaii - Aléoutiennes", "HKT": "heure normale de Hong Kong", "WITA": "heure du Centre indonésien", "SRT": "heure du Suriname", "OEZ": "heure normale d’Europe de l’Est", "AWDT": "heure d’été de l’Ouest de l’Australie", "LHDT": "heure d’été de Lord Howe", "CDT": "heure d’été du Centre", "AEDT": "heure d’été de l’Est de l’Australie", "ADT": "heure d’été de l’Atlantique", "HKST": "heure d’été de Hong Kong", "WART": "heure normale de l’Ouest argentin", "HAT": "heure d’été de Terre-Neuve", "MEZ": "heure normale d’Europe centrale", "AST": "heure normale de l’Atlantique"},
+ timezones: map[string]string{"HKT": "heure normale de Hong Kong", "EAT": "heure normale d’Afrique de l’Est", "CLT": "heure normale du Chili", "HAST": "heure normale d’Hawaii - Aléoutiennes", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "GYT": "heure du Guyana", "WART": "heure normale de l’Ouest argentin", "JDT": "heure d’été du Japon", "ACWST": "heure normale du centre-ouest de l’Australie", "AWDT": "heure d’été de l’Ouest de l’Australie", "OESZ": "heure d’été d’Europe de l’Est", "GFT": "heure de la Guyane française", "ECT": "heure de l’Équateur", "PDT": "heure d’été du Pacifique", "WEZ": "heure normale d’Europe de l’Ouest", "AEST": "heure normale de l’Est de l’Australie", "SGT": "heure de Singapour", "CST": "heure normale du centre nord-américain", "CHADT": "heure d’été des îles Chatham", "NZDT": "heure d’été de la Nouvelle-Zélande", "ACST": "heure normale du centre de l’Australie", "IST": "heure de l’Inde", "TMT": "heure normale du Turkménistan", "HNT": "heure normale de Terre-Neuve", "MESZ": "heure d’été d’Europe centrale", "TMST": "heure d’été du Turkménistan", "WESZ": "heure d’été d’Europe de l’Ouest", "AKDT": "heure d’été de l’Alaska", "AWST": "heure normale de l’Ouest de l’Australie", "ARST": "heure d’été de l’Argentine", "EST": "heure normale de l’Est nord-américain", "EDT": "heure d’été de l’Est", "BT": "heure du Bhoutan", "MDT": "heure d’été des Rocheuses", "AKST": "heure normale de l’Alaska", "WITA": "heure du Centre indonésien", "WIT": "heure de l’Est indonésien", "COT": "heure normale de Colombie", "ChST": "heure des Chamorro", "CLST": "heure d’été du Chili", "SAST": "heure normale d’Afrique méridionale", "CAT": "heure normale d’Afrique centrale", "OEZ": "heure normale d’Europe de l’Est", "AEDT": "heure d’été de l’Est de l’Australie", "JST": "heure normale du Japon", "MEZ": "heure normale d’Europe centrale", "WAST": "heure d’été d’Afrique de l’Ouest", "LHST": "heure normale de Lord Howe", "LHDT": "heure d’été de Lord Howe", "MST": "heure normale des Rocheuses", "CDT": "heure d’été du Centre", "CHAST": "heure normale des îles Chatham", "HAT": "heure d’été de Terre-Neuve", "COST": "heure d’été de Colombie", "WIB": "heure de l’Ouest indonésien", "WAT": "heure normale d’Afrique de l’Ouest", "UYST": "heure d’été de l’Uruguay", "∅∅∅": "heure d’été de Brasilia", "SRT": "heure du Suriname", "AST": "heure normale de l’Atlantique", "PST": "heure normale du Pacifique nord-américain", "UYT": "heure normale de l’Uruguay", "ACDT": "heure d’été du centre de l’Australie", "VET": "heure du Venezuela", "ACWDT": "heure d’été du centre-ouest de l’Australie", "NZST": "heure normale de la Nouvelle-Zélande", "BOT": "heure de Bolivie", "GMT": "heure moyenne de Greenwich", "MYT": "heure de la Malaisie", "WARST": "heure d’été de l’Ouest argentin", "HKST": "heure d’été de Hong Kong", "ADT": "heure d’été de l’Atlantique", "ART": "heure normale d’Argentine"},
}
}
diff --git a/fr_DZ/fr_DZ_test.go b/fr_DZ/fr_DZ_test.go
new file mode 100644
index 00000000..41a75064
--- /dev/null
+++ b/fr_DZ/fr_DZ_test.go
@@ -0,0 +1,1120 @@
+package fr_DZ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr_DZ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr_FR/fr_FR.go b/fr_FR/fr_FR.go
index ed5ab5e1..20327b9b 100644
--- a/fr_FR/fr_FR.go
+++ b/fr_FR/fr_FR.go
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"PDT": "heure d’été du Pacifique", "ADT": "heure d’été de l’Atlantique", "AWST": "heure normale de l’Ouest de l’Australie", "ACWDT": "heure d’été du centre-ouest de l’Australie", "CHAST": "heure normale des îles Chatham", "EST": "heure normale de l’Est nord-américain", "WAST": "heure d’été d’Afrique de l’Ouest", "BT": "heure du Bhoutan", "LHST": "heure normale de Lord Howe", "GYT": "heure du Guyana", "NZDT": "heure d’été de la Nouvelle-Zélande", "UYST": "heure d’été de l’Uruguay", "ACWST": "heure normale du centre-ouest de l’Australie", "COT": "heure normale de Colombie", "HAT": "heure d’été de Terre-Neuve", "BOT": "heure de Bolivie", "VET": "heure du Venezuela", "ECT": "heure de l’Équateur", "SGT": "heure de Singapour", "GFT": "heure de la Guyane française", "WESZ": "heure d’été d’Europe de l’Ouest", "AST": "heure normale de l’Atlantique", "WIT": "heure de l’Est indonésien", "TMST": "heure d’été du Turkménistan", "JDT": "heure d’été du Japon", "WART": "heure normale de l’Ouest argentin", "WITA": "heure du Centre indonésien", "ACST": "heure normale du centre de l’Australie", "AEST": "heure normale de l’Est de l’Australie", "ChST": "heure des Chamorro", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "HKT": "heure normale de Hong Kong", "PST": "heure normale du Pacifique nord-américain", "UYT": "heure normale de l’Uruguay", "CLST": "heure d’été du Chili", "WAT": "heure normale d’Afrique de l’Ouest", "WEZ": "heure normale d’Europe de l’Ouest", "COST": "heure d’été de Colombie", "ARST": "heure d’été de l’Argentine", "SRT": "heure du Suriname", "MEZ": "heure normale d’Europe centrale", "OESZ": "heure d’été d’Europe de l’Est", "AKDT": "heure d’été de l’Alaska", "LHDT": "heure d’été de Lord Howe", "∅∅∅": "heure d’été des Açores", "MESZ": "heure d’été d’Europe centrale", "CLT": "heure normale du Chili", "AEDT": "heure d’été de l’Est de l’Australie", "MDT": "heure d’été des Rocheuses", "SAST": "heure normale d’Afrique méridionale", "OEZ": "heure normale d’Europe de l’Est", "GMT": "heure moyenne de Greenwich", "EAT": "heure normale d’Afrique de l’Est", "ART": "heure normale d’Argentine", "TMT": "heure normale du Turkménistan", "AKST": "heure normale de l’Alaska", "CAT": "heure normale d’Afrique centrale", "EDT": "heure d’été de l’Est", "JST": "heure normale du Japon", "HNT": "heure normale de Terre-Neuve", "AWDT": "heure d’été de l’Ouest de l’Australie", "MYT": "heure de la Malaisie", "MST": "heure normale des Rocheuses", "HKST": "heure d’été de Hong Kong", "WIB": "heure de l’Ouest indonésien", "ACDT": "heure d’été du centre de l’Australie", "CST": "heure normale du centre nord-américain", "CDT": "heure d’été du Centre", "CHADT": "heure d’été des îles Chatham", "IST": "heure de l’Inde", "NZST": "heure normale de la Nouvelle-Zélande", "HAST": "heure normale d’Hawaii - Aléoutiennes", "WARST": "heure d’été de l’Ouest argentin"},
+ timezones: map[string]string{"EAT": "heure normale d’Afrique de l’Est", "WART": "heure normale de l’Ouest argentin", "VET": "heure du Venezuela", "TMST": "heure d’été du Turkménistan", "WAT": "heure normale d’Afrique de l’Ouest", "GYT": "heure du Guyana", "UYT": "heure normale de l’Uruguay", "ARST": "heure d’été de l’Argentine", "WIT": "heure de l’Est indonésien", "LHST": "heure normale de Lord Howe", "ACDT": "heure d’été du centre de l’Australie", "HKST": "heure d’été de Hong Kong", "JDT": "heure d’été du Japon", "AWDT": "heure d’été de l’Ouest de l’Australie", "WIB": "heure de l’Ouest indonésien", "WAST": "heure d’été d’Afrique de l’Ouest", "LHDT": "heure d’été de Lord Howe", "MESZ": "heure d’été d’Europe centrale", "GFT": "heure de la Guyane française", "NZDT": "heure d’été de la Nouvelle-Zélande", "CAT": "heure normale d’Afrique centrale", "SGT": "heure de Singapour", "MYT": "heure de la Malaisie", "WARST": "heure d’été de l’Ouest argentin", "AKST": "heure normale de l’Alaska", "ACWST": "heure normale du centre-ouest de l’Australie", "HNT": "heure normale de Terre-Neuve", "CDT": "heure d’été du Centre", "NZST": "heure normale de la Nouvelle-Zélande", "AEST": "heure normale de l’Est de l’Australie", "UYST": "heure d’été de l’Uruguay", "AKDT": "heure d’été de l’Alaska", "BOT": "heure de Bolivie", "COST": "heure d’été de Colombie", "OESZ": "heure d’été d’Europe de l’Est", "WEZ": "heure normale d’Europe de l’Ouest", "ACWDT": "heure d’été du centre-ouest de l’Australie", "EDT": "heure d’été de l’Est", "ART": "heure normale d’Argentine", "HAT": "heure d’été de Terre-Neuve", "COT": "heure normale de Colombie", "OEZ": "heure normale d’Europe de l’Est", "MDT": "heure d’été des Rocheuses", "JST": "heure normale du Japon", "AWST": "heure normale de l’Ouest de l’Australie", "AEDT": "heure d’été de l’Est de l’Australie", "CLT": "heure normale du Chili", "ACST": "heure normale du centre de l’Australie", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "WESZ": "heure d’été d’Europe de l’Ouest", "ChST": "heure des Chamorro", "BT": "heure du Bhoutan", "MST": "heure normale des Rocheuses", "HKT": "heure normale de Hong Kong", "HAST": "heure normale d’Hawaii - Aléoutiennes", "∅∅∅": "heure d’été de Brasilia", "ECT": "heure de l’Équateur", "SAST": "heure normale d’Afrique méridionale", "IST": "heure de l’Inde", "PST": "heure normale du Pacifique nord-américain", "EST": "heure normale de l’Est nord-américain", "PDT": "heure d’été du Pacifique", "TMT": "heure normale du Turkménistan", "GMT": "heure moyenne de Greenwich", "CLST": "heure d’été du Chili", "CST": "heure normale du centre nord-américain", "SRT": "heure du Suriname", "CHAST": "heure normale des îles Chatham", "MEZ": "heure normale d’Europe centrale", "CHADT": "heure d’été des îles Chatham", "AST": "heure normale de l’Atlantique", "ADT": "heure d’été de l’Atlantique", "WITA": "heure du Centre indonésien"},
}
}
diff --git a/fr_FR/fr_FR_test.go b/fr_FR/fr_FR_test.go
new file mode 100644
index 00000000..5bf4dbbb
--- /dev/null
+++ b/fr_FR/fr_FR_test.go
@@ -0,0 +1,1120 @@
+package fr_FR
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr_FR"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr_GA/fr_GA.go b/fr_GA/fr_GA.go
index b4f916d0..92d1742d 100644
--- a/fr_GA/fr_GA.go
+++ b/fr_GA/fr_GA.go
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"SAST": "heure normale d’Afrique méridionale", "BT": "heure du Bhoutan", "WART": "heure normale de l’Ouest argentin", "AKST": "heure normale de l’Alaska", "AKDT": "heure d’été de l’Alaska", "AWST": "heure normale de l’Ouest de l’Australie", "EDT": "heure d’été de l’Est", "MDT": "heure d’été de Macao", "LHST": "heure normale de Lord Howe", "CDT": "heure d’été du Centre", "BOT": "heure de Bolivie", "ChST": "heure des Chamorro", "CAT": "heure normale d’Afrique centrale", "ART": "heure normale d’Argentine", "PST": "heure normale du Pacifique nord-américain", "GYT": "heure du Guyana", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "WAT": "heure normale d’Afrique de l’Ouest", "EAT": "heure normale d’Afrique de l’Est", "∅∅∅": "heure d’été de l’Amazonie", "LHDT": "heure d’été de Lord Howe", "MEZ": "heure normale d’Europe centrale", "EST": "heure normale de l’Est nord-américain", "TMT": "heure normale du Turkménistan", "UYT": "heure normale de l’Uruguay", "HKT": "heure normale de Hong Kong", "HKST": "heure d’été de Hong Kong", "WARST": "heure d’été de l’Ouest argentin", "IST": "heure de l’Inde", "OESZ": "heure d’été d’Europe de l’Est", "GFT": "heure de la Guyane française", "ADT": "heure d’été de l’Atlantique", "WAST": "heure d’été d’Afrique de l’Ouest", "OEZ": "heure normale d’Europe de l’Est", "AWDT": "heure d’été de l’Ouest de l’Australie", "CLT": "heure normale du Chili", "SGT": "heure de Singapour", "WITA": "heure du Centre indonésien", "SRT": "heure du Suriname", "CST": "heure normale du centre nord-américain", "WESZ": "heure d’été d’Europe de l’Ouest", "CHAST": "heure normale des îles Chatham", "AST": "heure normale de l’Atlantique", "AEST": "heure normale de l’Est de l’Australie", "CLST": "heure d’été du Chili", "ECT": "heure de l’Équateur", "HAT": "heure d’été de Terre-Neuve", "TMST": "heure d’été du Turkménistan", "JDT": "heure d’été du Japon", "NZDT": "heure d’été de la Nouvelle-Zélande", "ACST": "heure normale du centre de l’Australie", "ACDT": "heure d’été du centre de l’Australie", "JST": "heure normale du Japon", "ACWDT": "heure d’été du centre-ouest de l’Australie", "ACWST": "heure normale du centre-ouest de l’Australie", "VET": "heure du Venezuela", "CHADT": "heure d’été des îles Chatham", "MST": "heure normale de Macao", "ARST": "heure d’été de l’Argentine", "PDT": "heure d’été du Pacifique", "MYT": "heure de la Malaisie", "NZST": "heure normale de la Nouvelle-Zélande", "UYST": "heure d’été de l’Uruguay", "WIB": "heure de l’Ouest indonésien", "MESZ": "heure d’été d’Europe centrale", "WEZ": "heure normale d’Europe de l’Ouest", "HAST": "heure normale d’Hawaii - Aléoutiennes", "GMT": "heure moyenne de Greenwich", "HNT": "heure normale de Terre-Neuve", "WIT": "heure de l’Est indonésien", "AEDT": "heure d’été de l’Est de l’Australie", "COT": "heure normale de Colombie", "COST": "heure d’été de Colombie"},
+ timezones: map[string]string{"CHAST": "heure normale des îles Chatham", "CHADT": "heure d’été des îles Chatham", "NZDT": "heure d’été de la Nouvelle-Zélande", "MDT": "heure d’été des Rocheuses", "WART": "heure normale de l’Ouest argentin", "HKST": "heure d’été de Hong Kong", "BT": "heure du Bhoutan", "∅∅∅": "heure d’été de Brasilia", "AKST": "heure normale de l’Alaska", "AST": "heure normale de l’Atlantique", "ADT": "heure d’été de l’Atlantique", "HNT": "heure normale de Terre-Neuve", "HAT": "heure d’été de Terre-Neuve", "CLST": "heure d’été du Chili", "MEZ": "heure normale d’Europe centrale", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "EST": "heure normale de l’Est nord-américain", "EDT": "heure d’été de l’Est", "WESZ": "heure d’été d’Europe de l’Ouest", "OESZ": "heure d’été d’Europe de l’Est", "MESZ": "heure d’été d’Europe centrale", "GYT": "heure du Guyana", "UYST": "heure d’été de l’Uruguay", "AWDT": "heure d’été de l’Ouest de l’Australie", "CDT": "heure d’été du Centre", "ACST": "heure normale du centre de l’Australie", "TMT": "heure normale du Turkménistan", "WAT": "heure normale d’Afrique de l’Ouest", "MST": "heure normale des Rocheuses", "IST": "heure de l’Inde", "GMT": "heure moyenne de Greenwich", "ARST": "heure d’été de l’Argentine", "HAST": "heure normale d’Hawaii - Aléoutiennes", "SGT": "heure de Singapour", "JST": "heure normale du Japon", "WARST": "heure d’été de l’Ouest argentin", "GFT": "heure de la Guyane française", "AWST": "heure normale de l’Ouest de l’Australie", "BOT": "heure de Bolivie", "ChST": "heure des Chamorro", "AEST": "heure normale de l’Est de l’Australie", "CST": "heure normale du centre nord-américain", "HKT": "heure normale de Hong Kong", "AKDT": "heure d’été de l’Alaska", "PST": "heure normale du Pacifique nord-américain", "TMST": "heure d’été du Turkménistan", "WAST": "heure d’été d’Afrique de l’Ouest", "CLT": "heure normale du Chili", "ACWDT": "heure d’été du centre-ouest de l’Australie", "PDT": "heure d’été du Pacifique", "WIT": "heure de l’Est indonésien", "SRT": "heure du Suriname", "VET": "heure du Venezuela", "NZST": "heure normale de la Nouvelle-Zélande", "ART": "heure normale d’Argentine", "CAT": "heure normale d’Afrique centrale", "MYT": "heure de la Malaisie", "UYT": "heure normale de l’Uruguay", "ACWST": "heure normale du centre-ouest de l’Australie", "AEDT": "heure d’été de l’Est de l’Australie", "EAT": "heure normale d’Afrique de l’Est", "LHDT": "heure d’été de Lord Howe", "WITA": "heure du Centre indonésien", "COT": "heure normale de Colombie", "WEZ": "heure normale d’Europe de l’Ouest", "ECT": "heure de l’Équateur", "LHST": "heure normale de Lord Howe", "JDT": "heure d’été du Japon", "ACDT": "heure d’été du centre de l’Australie", "SAST": "heure normale d’Afrique méridionale", "COST": "heure d’été de Colombie", "WIB": "heure de l’Ouest indonésien", "OEZ": "heure normale d’Europe de l’Est"},
}
}
diff --git a/fr_GA/fr_GA_test.go b/fr_GA/fr_GA_test.go
new file mode 100644
index 00000000..4d141455
--- /dev/null
+++ b/fr_GA/fr_GA_test.go
@@ -0,0 +1,1120 @@
+package fr_GA
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr_GA"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr_GF/fr_GF.go b/fr_GF/fr_GF.go
index 779f1092..3e3b6d11 100644
--- a/fr_GF/fr_GF.go
+++ b/fr_GF/fr_GF.go
@@ -49,7 +49,7 @@ func New() locales.Translator {
locale: "fr_GF",
pluralsCardinal: []locales.PluralRule{2, 6},
pluralsOrdinal: []locales.PluralRule{2, 6},
- pluralsRange: []locales.PluralRule{6, 2},
+ pluralsRange: []locales.PluralRule{2, 6},
decimal: "٫",
group: "٬",
minus: "‏−",
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"CLST": "heure d’été du Chili", "WESZ": "heure d’été d’Europe de l’Ouest", "TMST": "heure d’été du Turkménistan", "CST": "heure normale du centre nord-américain", "BOT": "heure de Bolivie", "WEZ": "heure normale d’Europe de l’Ouest", "AST": "heure normale de l’Atlantique", "ADT": "heure d’été de l’Atlantique", "WITA": "heure du Centre indonésien", "LHDT": "heure d’été de Lord Howe", "MEZ": "heure normale d’Europe centrale", "CHADT": "heure d’été des îles Chatham", "ChST": "heure des Chamorro", "ACST": "heure normale du centre de l’Australie", "JDT": "heure d’été du Japon", "GFT": "heure de la Guyane française", "WIB": "heure de l’Ouest indonésien", "NZST": "heure normale de la Nouvelle-Zélande", "∅∅∅": "heure d’été de Brasilia", "PDT": "heure d’été du Pacifique", "WARST": "heure d’été de l’Ouest argentin", "HKT": "heure normale de Hong Kong", "ARST": "heure d’été de l’Argentine", "NZDT": "heure d’été de la Nouvelle-Zélande", "HKST": "heure d’été de Hong Kong", "IST": "heure de l’Inde", "MST": "heure normale des Rocheuses", "ACWDT": "heure d’été du centre-ouest de l’Australie", "CAT": "heure normale d’Afrique centrale", "SAST": "heure normale d’Afrique méridionale", "SRT": "heure du Suriname", "MDT": "heure d’été des Rocheuses", "AEDT": "heure d’été de l’Est de l’Australie", "WAST": "heure d’été d’Afrique de l’Ouest", "HAT": "heure d’été de Terre-Neuve", "UYT": "heure normale de l’Uruguay", "CDT": "heure d’été du Centre", "CHAST": "heure normale des îles Chatham", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "OEZ": "heure normale d’Europe de l’Est", "ACDT": "heure d’été du centre de l’Australie", "HAST": "heure normale d’Hawaii - Aléoutiennes", "EAT": "heure normale d’Afrique de l’Est", "JST": "heure normale du Japon", "AKST": "heure normale de l’Alaska", "AWDT": "heure d’été de l’Ouest de l’Australie", "WART": "heure normale de l’Ouest argentin", "BT": "heure du Bhoutan", "GMT": "heure moyenne de Greenwich", "MYT": "heure de la Malaisie", "CLT": "heure normale du Chili", "EST": "heure normale de l’Est nord-américain", "COT": "heure normale de Colombie", "OESZ": "heure d’été d’Europe de l’Est", "UYST": "heure d’été de l’Uruguay", "ACWST": "heure normale du centre-ouest de l’Australie", "EDT": "heure d’été de l’Est", "ECT": "heure de l’Équateur", "SGT": "heure de Singapour", "LHST": "heure normale de Lord Howe", "MESZ": "heure d’été d’Europe centrale", "VET": "heure du Venezuela", "WAT": "heure normale d’Afrique de l’Ouest", "ART": "heure normale d’Argentine", "PST": "heure normale du Pacifique nord-américain", "AKDT": "heure d’été de l’Alaska", "AWST": "heure normale de l’Ouest de l’Australie", "COST": "heure d’été de Colombie", "WIT": "heure de l’Est indonésien", "HNT": "heure normale de Terre-Neuve", "GYT": "heure du Guyana", "AEST": "heure normale de l’Est de l’Australie", "TMT": "heure normale du Turkménistan"},
+ timezones: map[string]string{"ACWDT": "heure d’été du centre-ouest de l’Australie", "WITA": "heure du Centre indonésien", "EST": "heure normale de l’Est nord-américain", "EDT": "heure d’été de l’Est", "OEZ": "heure normale d’Europe de l’Est", "GYT": "heure du Guyana", "UYST": "heure d’été de l’Uruguay", "ACST": "heure normale du centre de l’Australie", "AWDT": "heure d’été de l’Ouest de l’Australie", "MEZ": "heure normale d’Europe centrale", "WESZ": "heure d’été d’Europe de l’Ouest", "MST": "heure normale des Rocheuses", "HKT": "heure normale de Hong Kong", "CHADT": "heure d’été des îles Chatham", "WEZ": "heure normale d’Europe de l’Ouest", "UYT": "heure normale de l’Uruguay", "CHAST": "heure normale des îles Chatham", "MESZ": "heure d’été d’Europe centrale", "WIB": "heure de l’Ouest indonésien", "ChST": "heure des Chamorro", "EAT": "heure normale d’Afrique de l’Est", "ARST": "heure d’été de l’Argentine", "∅∅∅": "heure d’été de l’Amazonie", "AEST": "heure normale de l’Est de l’Australie", "AEDT": "heure d’été de l’Est de l’Australie", "BT": "heure du Bhoutan", "WARST": "heure d’été de l’Ouest argentin", "WAST": "heure d’été d’Afrique de l’Ouest", "CST": "heure normale du centre nord-américain", "GFT": "heure de la Guyane française", "TMT": "heure normale du Turkménistan", "WART": "heure normale de l’Ouest argentin", "AKST": "heure normale de l’Alaska", "GMT": "heure moyenne de Greenwich", "HKST": "heure d’été de Hong Kong", "ECT": "heure de l’Équateur", "AKDT": "heure d’été de l’Alaska", "PST": "heure normale du Pacifique nord-américain", "TMST": "heure d’été du Turkménistan", "OESZ": "heure d’été d’Europe de l’Est", "SRT": "heure du Suriname", "AST": "heure normale de l’Atlantique", "BOT": "heure de Bolivie", "NZST": "heure normale de la Nouvelle-Zélande", "IST": "heure de l’Inde", "CAT": "heure normale d’Afrique centrale", "HNT": "heure normale de Terre-Neuve", "ADT": "heure d’été de l’Atlantique", "ACWST": "heure normale du centre-ouest de l’Australie", "AWST": "heure normale de l’Ouest de l’Australie", "NZDT": "heure d’été de la Nouvelle-Zélande", "SAST": "heure normale d’Afrique méridionale", "HAST": "heure normale d’Hawaii - Aléoutiennes", "HAT": "heure d’été de Terre-Neuve", "COT": "heure normale de Colombie", "CLST": "heure d’été du Chili", "ACDT": "heure d’été du centre de l’Australie", "LHDT": "heure d’été de Lord Howe", "CDT": "heure d’été du Centre", "ART": "heure normale d’Argentine", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "WAT": "heure normale d’Afrique de l’Ouest", "COST": "heure d’été de Colombie", "JST": "heure normale du Japon", "SGT": "heure de Singapour", "LHST": "heure normale de Lord Howe", "MYT": "heure de la Malaisie", "CLT": "heure normale du Chili", "JDT": "heure d’été du Japon", "PDT": "heure d’été du Pacifique", "WIT": "heure de l’Est indonésien", "MDT": "heure d’été des Rocheuses", "VET": "heure du Venezuela"},
}
}
diff --git a/fr_GF/fr_GF_test.go b/fr_GF/fr_GF_test.go
new file mode 100644
index 00000000..b7f207b8
--- /dev/null
+++ b/fr_GF/fr_GF_test.go
@@ -0,0 +1,1120 @@
+package fr_GF
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr_GF"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr_GN/fr_GN.go b/fr_GN/fr_GN.go
index 108cfd04..0976ce5e 100644
--- a/fr_GN/fr_GN.go
+++ b/fr_GN/fr_GN.go
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"CST": "heure normale du centre nord-américain", "HAT": "heure d’été de Terre-Neuve", "GFT": "heure de la Guyane française", "IST": "heure de l’Inde", "MYT": "heure de la Malaisie", "JDT": "heure d’été du Japon", "NZST": "heure normale de la Nouvelle-Zélande", "ACWST": "heure normale du centre-ouest de l’Australie", "TMT": "heure normale du Turkménistan", "MDT": "heure d’été de Macao", "GYT": "heure du Guyana", "EDT": "heure d’été de l’Est", "MST": "heure normale de Macao", "JST": "heure normale du Japon", "UYST": "heure d’été de l’Uruguay", "HKT": "heure normale de Hong Kong", "TMST": "heure d’été du Turkménistan", "CLT": "heure normale du Chili", "WEZ": "heure normale d’Europe de l’Ouest", "COT": "heure normale de Colombie", "WAST": "heure d’été d’Afrique de l’Ouest", "WIB": "heure de l’Ouest indonésien", "GMT": "heure moyenne de Greenwich", "HNT": "heure normale de Terre-Neuve", "AWDT": "heure d’été de l’Ouest de l’Australie", "LHDT": "heure d’été de Lord Howe", "COST": "heure d’été de Colombie", "AST": "heure normale de l’Atlantique", "PDT": "heure d’été du Pacifique", "LHST": "heure normale de Lord Howe", "NZDT": "heure d’été de la Nouvelle-Zélande", "CLST": "heure d’été du Chili", "ART": "heure normale d’Argentine", "CHADT": "heure d’été des îles Chatham", "EST": "heure normale de l’Est nord-américain", "ADT": "heure d’été de l’Atlantique", "EAT": "heure normale d’Afrique de l’Est", "AWST": "heure normale de l’Ouest de l’Australie", "SAST": "heure normale d’Afrique méridionale", "HKST": "heure d’été de Hong Kong", "WIT": "heure de l’Est indonésien", "SRT": "heure du Suriname", "AKDT": "heure d’été de l’Alaska", "WAT": "heure normale d’Afrique de l’Ouest", "WITA": "heure du Centre indonésien", "AKST": "heure normale de l’Alaska", "ChST": "heure des Chamorro", "ACWDT": "heure d’été du centre-ouest de l’Australie", "HAST": "heure normale d’Hawaii - Aléoutiennes", "WART": "heure normale de l’Ouest argentin", "BT": "heure du Bhoutan", "∅∅∅": "heure d’été de l’Amazonie", "MESZ": "heure d’été d’Europe centrale", "BOT": "heure de Bolivie", "CHAST": "heure normale des îles Chatham", "OEZ": "heure normale d’Europe de l’Est", "OESZ": "heure d’été d’Europe de l’Est", "ACST": "heure normale du centre de l’Australie", "AEDT": "heure d’été de l’Est de l’Australie", "CAT": "heure normale d’Afrique centrale", "PST": "heure normale du Pacifique nord-américain", "MEZ": "heure normale d’Europe centrale", "WESZ": "heure d’été d’Europe de l’Ouest", "AEST": "heure normale de l’Est de l’Australie", "ECT": "heure de l’Équateur", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "ACDT": "heure d’été du centre de l’Australie", "ARST": "heure d’été de l’Argentine", "UYT": "heure normale de l’Uruguay", "CDT": "heure d’été du Centre", "VET": "heure du Venezuela", "SGT": "heure de Singapour", "WARST": "heure d’été de l’Ouest argentin"},
+ timezones: map[string]string{"AWDT": "heure d’été de l’Ouest de l’Australie", "UYST": "heure d’été de l’Uruguay", "OESZ": "heure d’été d’Europe de l’Est", "BT": "heure du Bhoutan", "WART": "heure normale de l’Ouest argentin", "WESZ": "heure d’été d’Europe de l’Ouest", "OEZ": "heure normale d’Europe de l’Est", "JDT": "heure d’été du Japon", "PST": "heure normale du Pacifique nord-américain", "COST": "heure d’été de Colombie", "ARST": "heure d’été de l’Argentine", "JST": "heure normale du Japon", "MYT": "heure de la Malaisie", "SRT": "heure du Suriname", "MESZ": "heure d’été d’Europe centrale", "ChST": "heure des Chamorro", "TMST": "heure d’été du Turkménistan", "MST": "heure normale de Macao", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "UYT": "heure normale de l’Uruguay", "ADT": "heure d’été de l’Atlantique", "HAST": "heure normale d’Hawaii - Aléoutiennes", "GYT": "heure du Guyana", "AEST": "heure normale de l’Est de l’Australie", "EAT": "heure normale d’Afrique de l’Est", "EDT": "heure d’été de l’Est", "HNT": "heure normale de Terre-Neuve", "CAT": "heure normale d’Afrique centrale", "WAST": "heure d’été d’Afrique de l’Ouest", "HAT": "heure d’été de Terre-Neuve", "AEDT": "heure d’été de l’Est de l’Australie", "VET": "heure du Venezuela", "CHADT": "heure d’été des îles Chatham", "ACWDT": "heure d’été du centre-ouest de l’Australie", "BOT": "heure de Bolivie", "COT": "heure normale de Colombie", "LHST": "heure normale de Lord Howe", "CDT": "heure d’été du Centre", "∅∅∅": "heure d’été des Açores", "AKDT": "heure d’été de l’Alaska", "AWST": "heure normale de l’Ouest de l’Australie", "EST": "heure normale de l’Est nord-américain", "WIB": "heure de l’Ouest indonésien", "ACDT": "heure d’été du centre de l’Australie", "ART": "heure normale d’Argentine", "WITA": "heure du Centre indonésien", "CLST": "heure d’été du Chili", "LHDT": "heure d’été de Lord Howe", "ACWST": "heure normale du centre-ouest de l’Australie", "SAST": "heure normale d’Afrique méridionale", "AKST": "heure normale de l’Alaska", "IST": "heure de l’Inde", "MDT": "heure d’été de Macao", "HKT": "heure normale de Hong Kong", "NZDT": "heure d’été de la Nouvelle-Zélande", "WARST": "heure d’été de l’Ouest argentin", "AST": "heure normale de l’Atlantique", "MEZ": "heure normale d’Europe centrale", "TMT": "heure normale du Turkménistan", "WAT": "heure normale d’Afrique de l’Ouest", "WEZ": "heure normale d’Europe de l’Ouest", "CST": "heure normale du centre nord-américain", "GFT": "heure de la Guyane française", "ECT": "heure de l’Équateur", "PDT": "heure d’été du Pacifique", "SGT": "heure de Singapour", "GMT": "heure moyenne de Greenwich", "HKST": "heure d’été de Hong Kong", "CHAST": "heure normale des îles Chatham", "WIT": "heure de l’Est indonésien", "ACST": "heure normale du centre de l’Australie", "NZST": "heure normale de la Nouvelle-Zélande", "CLT": "heure normale du Chili"},
}
}
diff --git a/fr_GN/fr_GN_test.go b/fr_GN/fr_GN_test.go
new file mode 100644
index 00000000..e3373bd6
--- /dev/null
+++ b/fr_GN/fr_GN_test.go
@@ -0,0 +1,1120 @@
+package fr_GN
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr_GN"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr_GP/fr_GP.go b/fr_GP/fr_GP.go
index db6a9a3c..f547b760 100644
--- a/fr_GP/fr_GP.go
+++ b/fr_GP/fr_GP.go
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"MEZ": "heure normale d’Europe centrale", "WESZ": "heure d’été d’Europe de l’Ouest", "CAT": "heure normale d’Afrique centrale", "WITA": "heure du Centre indonésien", "EST": "heure normale de l’Est nord-américain", "WARST": "heure d’été de l’Ouest argentin", "CLST": "heure d’été du Chili", "EDT": "heure d’été de l’Est", "HAST": "heure normale d’Hawaii - Aléoutiennes", "JST": "heure normale du Japon", "GFT": "heure de la Guyane française", "WIB": "heure de l’Ouest indonésien", "WART": "heure normale de l’Ouest argentin", "CST": "heure normale du centre nord-américain", "NZDT": "heure d’été de la Nouvelle-Zélande", "BOT": "heure de Bolivie", "CHAST": "heure normale des îles Chatham", "CLT": "heure normale du Chili", "BT": "heure du Bhoutan", "LHDT": "heure d’été de Lord Howe", "GYT": "heure du Guyana", "ECT": "heure de l’Équateur", "AST": "heure normale de l’Atlantique", "ACDT": "heure d’été du centre de l’Australie", "AWST": "heure normale de l’Ouest de l’Australie", "JDT": "heure d’été du Japon", "ACWST": "heure normale du centre-ouest de l’Australie", "ACWDT": "heure d’été du centre-ouest de l’Australie", "ADT": "heure d’été de l’Atlantique", "GMT": "heure moyenne de Greenwich", "PST": "heure normale du Pacifique nord-américain", "UYT": "heure normale de l’Uruguay", "IST": "heure de l’Inde", "OEZ": "heure normale d’Europe de l’Est", "ACST": "heure normale du centre de l’Australie", "AKDT": "heure d’été de l’Alaska", "PDT": "heure d’été du Pacifique", "LHST": "heure normale de Lord Howe", "MESZ": "heure d’été d’Europe centrale", "AEST": "heure normale de l’Est de l’Australie", "ChST": "heure des Chamorro", "SGT": "heure de Singapour", "SAST": "heure normale d’Afrique méridionale", "WAT": "heure normale d’Afrique de l’Ouest", "TMT": "heure normale du Turkménistan", "TMST": "heure d’été du Turkménistan", "SRT": "heure du Suriname", "WEZ": "heure normale d’Europe de l’Ouest", "COT": "heure normale de Colombie", "HNT": "heure normale de Terre-Neuve", "AKST": "heure normale de l’Alaska", "CDT": "heure d’été du Centre", "MST": "heure normale des Rocheuses", "COST": "heure d’été de Colombie", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "WAST": "heure d’été d’Afrique de l’Ouest", "HKST": "heure d’été de Hong Kong", "MYT": "heure de la Malaisie", "∅∅∅": "heure d’été des Açores", "UYST": "heure d’été de l’Uruguay", "AEDT": "heure d’été de l’Est de l’Australie", "MDT": "heure d’été des Rocheuses", "HKT": "heure normale de Hong Kong", "VET": "heure du Venezuela", "EAT": "heure normale d’Afrique de l’Est", "ART": "heure normale d’Argentine", "AWDT": "heure d’été de l’Ouest de l’Australie", "NZST": "heure normale de la Nouvelle-Zélande", "CHADT": "heure d’été des îles Chatham", "OESZ": "heure d’été d’Europe de l’Est", "HAT": "heure d’été de Terre-Neuve", "WIT": "heure de l’Est indonésien", "ARST": "heure d’été de l’Argentine"},
+ timezones: map[string]string{"AWDT": "heure d’été de l’Ouest de l’Australie", "PST": "heure normale du Pacifique nord-américain", "ACST": "heure normale du centre de l’Australie", "WARST": "heure d’été de l’Ouest argentin", "GFT": "heure de la Guyane française", "AKST": "heure normale de l’Alaska", "EDT": "heure d’été de l’Est", "WAT": "heure normale d’Afrique de l’Ouest", "OEZ": "heure normale d’Europe de l’Est", "GMT": "heure moyenne de Greenwich", "COT": "heure normale de Colombie", "TMST": "heure d’été du Turkménistan", "AEDT": "heure d’été de l’Est de l’Australie", "OESZ": "heure d’été d’Europe de l’Est", "ACWST": "heure normale du centre-ouest de l’Australie", "ACWDT": "heure d’été du centre-ouest de l’Australie", "WART": "heure normale de l’Ouest argentin", "SRT": "heure du Suriname", "ART": "heure normale d’Argentine", "MEZ": "heure normale d’Europe centrale", "SAST": "heure normale d’Afrique méridionale", "NZDT": "heure d’été de la Nouvelle-Zélande", "HNT": "heure normale de Terre-Neuve", "LHDT": "heure d’été de Lord Howe", "MYT": "heure de la Malaisie", "UYST": "heure d’été de l’Uruguay", "WIT": "heure de l’Est indonésien", "CHADT": "heure d’été des îles Chatham", "AST": "heure normale de l’Atlantique", "ADT": "heure d’été de l’Atlantique", "EST": "heure normale de l’Est nord-américain", "JDT": "heure d’été du Japon", "∅∅∅": "heure d’été de l’Acre", "SGT": "heure de Singapour", "EAT": "heure normale d’Afrique de l’Est", "LHST": "heure normale de Lord Howe", "BT": "heure du Bhoutan", "MST": "heure normale de Macao", "WITA": "heure du Centre indonésien", "PDT": "heure d’été du Pacifique", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "VET": "heure du Venezuela", "WESZ": "heure d’été d’Europe de l’Ouest", "CST": "heure normale du centre nord-américain", "AEST": "heure normale de l’Est de l’Australie", "CLT": "heure normale du Chili", "HKST": "heure d’été de Hong Kong", "AWST": "heure normale de l’Ouest de l’Australie", "MESZ": "heure d’été d’Europe centrale", "COST": "heure d’été de Colombie", "MDT": "heure d’été de Macao", "CAT": "heure normale d’Afrique centrale", "WAST": "heure d’été d’Afrique de l’Ouest", "ECT": "heure de l’Équateur", "HKT": "heure normale de Hong Kong", "ARST": "heure d’été de l’Argentine", "ChST": "heure des Chamorro", "ACDT": "heure d’été du centre de l’Australie", "NZST": "heure normale de la Nouvelle-Zélande", "BOT": "heure de Bolivie", "IST": "heure de l’Inde", "TMT": "heure normale du Turkménistan", "CLST": "heure d’été du Chili", "JST": "heure normale du Japon", "AKDT": "heure d’été de l’Alaska", "HAST": "heure normale d’Hawaii - Aléoutiennes", "HAT": "heure d’été de Terre-Neuve", "UYT": "heure normale de l’Uruguay", "CDT": "heure d’été du Centre", "CHAST": "heure normale des îles Chatham", "WEZ": "heure normale d’Europe de l’Ouest", "WIB": "heure de l’Ouest indonésien", "GYT": "heure du Guyana"},
}
}
diff --git a/fr_GP/fr_GP_test.go b/fr_GP/fr_GP_test.go
new file mode 100644
index 00000000..d39501da
--- /dev/null
+++ b/fr_GP/fr_GP_test.go
@@ -0,0 +1,1120 @@
+package fr_GP
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr_GP"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr_GQ/fr_GQ.go b/fr_GQ/fr_GQ.go
index b28f9e20..12837091 100644
--- a/fr_GQ/fr_GQ.go
+++ b/fr_GQ/fr_GQ.go
@@ -49,7 +49,7 @@ func New() locales.Translator {
locale: "fr_GQ",
pluralsCardinal: []locales.PluralRule{2, 6},
pluralsOrdinal: []locales.PluralRule{2, 6},
- pluralsRange: []locales.PluralRule{2, 6},
+ pluralsRange: []locales.PluralRule{6, 2},
decimal: "٫",
group: "٬",
minus: "‏−",
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"MDT": "heure d’été de Macao", "ARST": "heure d’été de l’Argentine", "JST": "heure normale du Japon", "MEZ": "heure normale d’Europe centrale", "HAT": "heure d’été de Terre-Neuve", "SGT": "heure de Singapour", "TMST": "heure d’été du Turkménistan", "GYT": "heure du Guyana", "AKST": "heure normale de l’Alaska", "HAST": "heure normale d’Hawaii - Aléoutiennes", "AWST": "heure normale de l’Ouest de l’Australie", "LHDT": "heure d’été de Lord Howe", "JDT": "heure d’été du Japon", "OEZ": "heure normale d’Europe de l’Est", "HKT": "heure normale de Hong Kong", "WART": "heure normale de l’Ouest argentin", "SAST": "heure normale d’Afrique méridionale", "IST": "heure de l’Inde", "SRT": "heure du Suriname", "BOT": "heure de Bolivie", "ChST": "heure des Chamorro", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "EST": "heure normale de l’Est nord-américain", "MESZ": "heure d’été d’Europe centrale", "LHST": "heure normale de Lord Howe", "AEST": "heure normale de l’Est de l’Australie", "AWDT": "heure d’été de l’Ouest de l’Australie", "WEZ": "heure normale d’Europe de l’Ouest", "BT": "heure du Bhoutan", "GFT": "heure de la Guyane française", "ACWDT": "heure d’été du centre-ouest de l’Australie", "VET": "heure du Venezuela", "CAT": "heure normale d’Afrique centrale", "∅∅∅": "heure d’été de l’Acre", "HNT": "heure normale de Terre-Neuve", "NZST": "heure normale de la Nouvelle-Zélande", "CST": "heure normale du centre nord-américain", "AEDT": "heure d’été de l’Est de l’Australie", "ECT": "heure de l’Équateur", "WAST": "heure d’été d’Afrique de l’Ouest", "MST": "heure normale de Macao", "COT": "heure normale de Colombie", "WIB": "heure de l’Ouest indonésien", "OESZ": "heure d’été d’Europe de l’Est", "CLST": "heure d’été du Chili", "WAT": "heure normale d’Afrique de l’Ouest", "TMT": "heure normale du Turkménistan", "COST": "heure d’été de Colombie", "GMT": "heure moyenne de Greenwich", "HKST": "heure d’été de Hong Kong", "UYT": "heure normale de l’Uruguay", "UYST": "heure d’été de l’Uruguay", "CDT": "heure d’été du Centre", "AST": "heure normale de l’Atlantique", "PST": "heure normale du Pacifique nord-américain", "PDT": "heure d’été du Pacifique", "CHAST": "heure normale des îles Chatham", "CLT": "heure normale du Chili", "WESZ": "heure d’été d’Europe de l’Ouest", "ACST": "heure normale du centre de l’Australie", "WARST": "heure d’été de l’Ouest argentin", "WIT": "heure de l’Est indonésien", "ACDT": "heure d’été du centre de l’Australie", "ART": "heure normale d’Argentine", "EAT": "heure normale d’Afrique de l’Est", "MYT": "heure de la Malaisie", "AKDT": "heure d’été de l’Alaska", "ADT": "heure d’été de l’Atlantique", "EDT": "heure d’été de l’Est", "CHADT": "heure d’été des îles Chatham", "NZDT": "heure d’été de la Nouvelle-Zélande", "ACWST": "heure normale du centre-ouest de l’Australie", "WITA": "heure du Centre indonésien"},
+ timezones: map[string]string{"MEZ": "heure normale d’Europe centrale", "WAST": "heure d’été d’Afrique de l’Ouest", "WESZ": "heure d’été d’Europe de l’Ouest", "AEST": "heure normale de l’Est de l’Australie", "ACDT": "heure d’été du centre de l’Australie", "WART": "heure normale de l’Ouest argentin", "ARST": "heure d’été de l’Argentine", "AKST": "heure normale de l’Alaska", "HKST": "heure d’été de Hong Kong", "MDT": "heure d’été de Macao", "WITA": "heure du Centre indonésien", "LHDT": "heure d’été de Lord Howe", "ECT": "heure de l’Équateur", "UYT": "heure normale de l’Uruguay", "WARST": "heure d’été de l’Ouest argentin", "CHADT": "heure d’été des îles Chatham", "COT": "heure normale de Colombie", "OESZ": "heure d’été d’Europe de l’Est", "CST": "heure normale du centre nord-américain", "ART": "heure normale d’Argentine", "BOT": "heure de Bolivie", "ACWST": "heure normale du centre-ouest de l’Australie", "AWDT": "heure d’été de l’Ouest de l’Australie", "IST": "heure de l’Inde", "MESZ": "heure d’été d’Europe centrale", "TMT": "heure normale du Turkménistan", "BT": "heure du Bhoutan", "CLST": "heure d’été du Chili", "CHAST": "heure normale des îles Chatham", "GMT": "heure moyenne de Greenwich", "MYT": "heure de la Malaisie", "EAT": "heure normale d’Afrique de l’Est", "JDT": "heure d’été du Japon", "PDT": "heure d’été du Pacifique", "HAST": "heure normale d’Hawaii - Aléoutiennes", "NZST": "heure normale de la Nouvelle-Zélande", "NZDT": "heure d’été de la Nouvelle-Zélande", "WAT": "heure normale d’Afrique de l’Ouest", "ChST": "heure des Chamorro", "CLT": "heure normale du Chili", "HKT": "heure normale de Hong Kong", "EDT": "heure d’été de l’Est", "HNT": "heure normale de Terre-Neuve", "COST": "heure d’été de Colombie", "GYT": "heure du Guyana", "UYST": "heure d’été de l’Uruguay", "SRT": "heure du Suriname", "ACWDT": "heure d’été du centre-ouest de l’Australie", "EST": "heure normale de l’Est nord-américain", "WIT": "heure de l’Est indonésien", "GFT": "heure de la Guyane française", "JST": "heure normale du Japon", "SAST": "heure normale d’Afrique méridionale", "AWST": "heure normale de l’Ouest de l’Australie", "AST": "heure normale de l’Atlantique", "ADT": "heure d’été de l’Atlantique", "AKDT": "heure d’été de l’Alaska", "∅∅∅": "heure d’été de l’Amazonie", "HAT": "heure d’été de Terre-Neuve", "SGT": "heure de Singapour", "WIB": "heure de l’Ouest indonésien", "VET": "heure du Venezuela", "WEZ": "heure normale d’Europe de l’Ouest", "TMST": "heure d’été du Turkménistan", "OEZ": "heure normale d’Europe de l’Est", "CDT": "heure d’été du Centre", "MST": "heure normale de Macao", "LHST": "heure normale de Lord Howe", "ACST": "heure normale du centre de l’Australie", "AEDT": "heure d’été de l’Est de l’Australie", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "CAT": "heure normale d’Afrique centrale", "PST": "heure normale du Pacifique nord-américain"},
}
}
diff --git a/fr_GQ/fr_GQ_test.go b/fr_GQ/fr_GQ_test.go
new file mode 100644
index 00000000..985fc8e6
--- /dev/null
+++ b/fr_GQ/fr_GQ_test.go
@@ -0,0 +1,1120 @@
+package fr_GQ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr_GQ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr_HT/fr_HT.go b/fr_HT/fr_HT.go
index 49f6d3cb..b411cf7c 100644
--- a/fr_HT/fr_HT.go
+++ b/fr_HT/fr_HT.go
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"∅∅∅": "heure d’été de Brasilia", "WART": "heure normale de l’Ouest argentin", "WIT": "heure de l’Est indonésien", "OESZ": "heure d’été d’Europe de l’Est", "NZST": "heure normale de la Nouvelle-Zélande", "ChST": "heure des Chamorro", "COT": "heure normale de Colombie", "ECT": "heure de l’Équateur", "JDT": "heure d’été du Japon", "AKDT": "heure d’été de l’Alaska", "TMT": "heure normale du Turkménistan", "LHST": "heure normale de Lord Howe", "WIB": "heure de l’Ouest indonésien", "COST": "heure d’été de Colombie", "GFT": "heure de la Guyane française", "HAT": "heure d’été de Terre-Neuve", "ACST": "heure normale du centre de l’Australie", "AWST": "heure normale de l’Ouest de l’Australie", "LHDT": "heure d’été de Lord Howe", "AST": "heure normale de l’Atlantique", "BT": "heure du Bhoutan", "MEZ": "heure normale d’Europe centrale", "ACDT": "heure d’été du centre de l’Australie", "CST": "heure normale du centre nord-américain", "AEST": "heure normale de l’Est de l’Australie", "VET": "heure du Venezuela", "EDT": "heure d’été de l’Est", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "WAT": "heure normale d’Afrique de l’Ouest", "MESZ": "heure d’été d’Europe centrale", "SGT": "heure de Singapour", "AKST": "heure normale de l’Alaska", "AWDT": "heure d’été de l’Ouest de l’Australie", "NZDT": "heure d’été de la Nouvelle-Zélande", "BOT": "heure de Bolivie", "UYST": "heure d’été de l’Uruguay", "AEDT": "heure d’été de l’Est de l’Australie", "CHAST": "heure normale des îles Chatham", "EST": "heure normale de l’Est nord-américain", "HAST": "heure normale d’Hawaii - Aléoutiennes", "WESZ": "heure d’été d’Europe de l’Ouest", "ACWST": "heure normale du centre-ouest de l’Australie", "UYT": "heure normale de l’Uruguay", "CLT": "heure normale du Chili", "OEZ": "heure normale d’Europe de l’Est", "PDT": "heure d’été du Pacifique", "ACWDT": "heure d’été du centre-ouest de l’Australie", "WAST": "heure d’été d’Afrique de l’Ouest", "CLST": "heure d’été du Chili", "HNT": "heure normale de Terre-Neuve", "MYT": "heure de la Malaisie", "HKT": "heure normale de Hong Kong", "HKST": "heure d’été de Hong Kong", "GMT": "heure moyenne de Greenwich", "SRT": "heure du Suriname", "PST": "heure normale du Pacifique nord-américain", "CDT": "heure d’été du Centre", "WEZ": "heure normale d’Europe de l’Ouest", "ADT": "heure d’été de l’Atlantique", "WARST": "heure d’été de l’Ouest argentin", "TMST": "heure d’été du Turkménistan", "GYT": "heure du Guyana", "CHADT": "heure d’été des îles Chatham", "CAT": "heure normale d’Afrique centrale", "WITA": "heure du Centre indonésien", "ARST": "heure d’été de l’Argentine", "EAT": "heure normale d’Afrique de l’Est", "MST": "heure normale de Macao", "MDT": "heure d’été de Macao", "SAST": "heure normale d’Afrique méridionale", "IST": "heure de l’Inde", "ART": "heure normale d’Argentine", "JST": "heure normale du Japon"},
+ timezones: map[string]string{"CHAST": "heure normale des îles Chatham", "NZDT": "heure d’été de la Nouvelle-Zélande", "AEDT": "heure d’été de l’Est de l’Australie", "GFT": "heure de la Guyane française", "MEZ": "heure normale d’Europe centrale", "MESZ": "heure d’été d’Europe centrale", "HAST": "heure normale d’Hawaii - Aléoutiennes", "WAST": "heure d’été d’Afrique de l’Ouest", "HAT": "heure d’été de Terre-Neuve", "OESZ": "heure d’été d’Europe de l’Est", "ARST": "heure d’été de l’Argentine", "NZST": "heure normale de la Nouvelle-Zélande", "CAT": "heure normale d’Afrique centrale", "WIT": "heure de l’Est indonésien", "WART": "heure normale de l’Ouest argentin", "JDT": "heure d’été du Japon", "AST": "heure normale de l’Atlantique", "ACWST": "heure normale du centre-ouest de l’Australie", "WAT": "heure normale d’Afrique de l’Ouest", "GYT": "heure du Guyana", "UYST": "heure d’été de l’Uruguay", "EAT": "heure normale d’Afrique de l’Est", "SRT": "heure du Suriname", "∅∅∅": "heure d’été des Açores", "MDT": "heure d’été de Macao", "ACWDT": "heure d’été du centre-ouest de l’Australie", "SAST": "heure normale d’Afrique méridionale", "UYT": "heure normale de l’Uruguay", "CST": "heure normale du centre nord-américain", "VET": "heure du Venezuela", "WESZ": "heure d’été d’Europe de l’Ouest", "AWST": "heure normale de l’Ouest de l’Australie", "ART": "heure normale d’Argentine", "ACDT": "heure d’été du centre de l’Australie", "ECT": "heure de l’Équateur", "AWDT": "heure d’été de l’Ouest de l’Australie", "ChST": "heure des Chamorro", "OEZ": "heure normale d’Europe de l’Est", "ADT": "heure d’été de l’Atlantique", "AKST": "heure normale de l’Alaska", "EDT": "heure d’été de l’Est", "BOT": "heure de Bolivie", "TMT": "heure normale du Turkménistan", "WARST": "heure d’été de l’Ouest argentin", "MST": "heure normale de Macao", "LHDT": "heure d’été de Lord Howe", "BT": "heure du Bhoutan", "PDT": "heure d’été du Pacifique", "WIB": "heure de l’Ouest indonésien", "ACST": "heure normale du centre de l’Australie", "IST": "heure de l’Inde", "AKDT": "heure d’été de l’Alaska", "COT": "heure normale de Colombie", "GMT": "heure moyenne de Greenwich", "WITA": "heure du Centre indonésien", "CHADT": "heure d’été des îles Chatham", "JST": "heure normale du Japon", "PST": "heure normale du Pacifique nord-américain", "HKT": "heure normale de Hong Kong", "EST": "heure normale de l’Est nord-américain", "HNT": "heure normale de Terre-Neuve", "AEST": "heure normale de l’Est de l’Australie", "HKST": "heure d’été de Hong Kong", "SGT": "heure de Singapour", "MYT": "heure de la Malaisie", "CLT": "heure normale du Chili", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "COST": "heure d’été de Colombie", "TMST": "heure d’été du Turkménistan", "LHST": "heure normale de Lord Howe", "CLST": "heure d’été du Chili", "CDT": "heure d’été du Centre", "WEZ": "heure normale d’Europe de l’Ouest"},
}
}
diff --git a/fr_HT/fr_HT_test.go b/fr_HT/fr_HT_test.go
new file mode 100644
index 00000000..2afcf84c
--- /dev/null
+++ b/fr_HT/fr_HT_test.go
@@ -0,0 +1,1120 @@
+package fr_HT
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr_HT"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr_KM/fr_KM.go b/fr_KM/fr_KM.go
index 2d6169d4..12c9d312 100644
--- a/fr_KM/fr_KM.go
+++ b/fr_KM/fr_KM.go
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"WARST": "heure d’été de l’Ouest argentin", "BOT": "heure de Bolivie", "NZDT": "heure d’été de la Nouvelle-Zélande", "ACST": "heure normale du centre de l’Australie", "MYT": "heure de la Malaisie", "JDT": "heure d’été du Japon", "ChST": "heure des Chamorro", "ACWST": "heure normale du centre-ouest de l’Australie", "EDT": "heure d’été de l’Est", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "HKST": "heure d’été de Hong Kong", "SRT": "heure du Suriname", "AKDT": "heure d’été de l’Alaska", "AEST": "heure normale de l’Est de l’Australie", "CST": "heure normale du centre nord-américain", "AEDT": "heure d’été de l’Est de l’Australie", "AST": "heure normale de l’Atlantique", "HAT": "heure d’été de Terre-Neuve", "ARST": "heure d’été de l’Argentine", "MESZ": "heure d’été d’Europe centrale", "∅∅∅": "heure d’été de Brasilia", "WAT": "heure normale d’Afrique de l’Ouest", "HNT": "heure normale de Terre-Neuve", "MDT": "heure d’été des Rocheuses", "OESZ": "heure d’été d’Europe de l’Est", "AWDT": "heure d’été de l’Ouest de l’Australie", "MEZ": "heure normale d’Europe centrale", "CHADT": "heure d’été des îles Chatham", "CLT": "heure normale du Chili", "SGT": "heure de Singapour", "WIT": "heure de l’Est indonésien", "CDT": "heure d’été du Centre", "TMST": "heure d’été du Turkménistan", "LHDT": "heure d’été de Lord Howe", "CHAST": "heure normale des îles Chatham", "VET": "heure du Venezuela", "SAST": "heure normale d’Afrique méridionale", "BT": "heure du Bhoutan", "IST": "heure de l’Inde", "WEZ": "heure normale d’Europe de l’Ouest", "COST": "heure d’été de Colombie", "HKT": "heure normale de Hong Kong", "WIB": "heure de l’Ouest indonésien", "ECT": "heure de l’Équateur", "EST": "heure normale de l’Est nord-américain", "HAST": "heure normale d’Hawaii - Aléoutiennes", "TMT": "heure normale du Turkménistan", "UYT": "heure normale de l’Uruguay", "PST": "heure normale du Pacifique nord-américain", "CLST": "heure d’été du Chili", "WITA": "heure du Centre indonésien", "GMT": "heure moyenne de Greenwich", "ART": "heure normale d’Argentine", "EAT": "heure normale d’Afrique de l’Est", "WESZ": "heure d’été d’Europe de l’Ouest", "ACDT": "heure d’été du centre de l’Australie", "AKST": "heure normale de l’Alaska", "MST": "heure normale des Rocheuses", "WAST": "heure d’été d’Afrique de l’Ouest", "JST": "heure normale du Japon", "ACWDT": "heure d’été du centre-ouest de l’Australie", "ADT": "heure d’été de l’Atlantique", "WART": "heure normale de l’Ouest argentin", "GFT": "heure de la Guyane française", "OEZ": "heure normale d’Europe de l’Est", "CAT": "heure normale d’Afrique centrale", "LHST": "heure normale de Lord Howe", "NZST": "heure normale de la Nouvelle-Zélande", "COT": "heure normale de Colombie", "GYT": "heure du Guyana", "PDT": "heure d’été du Pacifique", "AWST": "heure normale de l’Ouest de l’Australie", "UYST": "heure d’été de l’Uruguay"},
+ timezones: map[string]string{"WARST": "heure d’été de l’Ouest argentin", "VET": "heure du Venezuela", "HAST": "heure normale d’Hawaii - Aléoutiennes", "WIB": "heure de l’Ouest indonésien", "TMST": "heure d’été du Turkménistan", "CAT": "heure normale d’Afrique centrale", "AEST": "heure normale de l’Est de l’Australie", "EDT": "heure d’été de l’Est", "MESZ": "heure d’été d’Europe centrale", "OEZ": "heure normale d’Europe de l’Est", "OESZ": "heure d’été d’Europe de l’Est", "ADT": "heure d’été de l’Atlantique", "SAST": "heure normale d’Afrique méridionale", "EST": "heure normale de l’Est nord-américain", "COT": "heure normale de Colombie", "LHDT": "heure d’été de Lord Howe", "MYT": "heure de la Malaisie", "MST": "heure normale de Macao", "CHADT": "heure d’été des îles Chatham", "ECT": "heure de l’Équateur", "NZDT": "heure d’été de la Nouvelle-Zélande", "SGT": "heure de Singapour", "SRT": "heure du Suriname", "JST": "heure normale du Japon", "BOT": "heure de Bolivie", "HNT": "heure normale de Terre-Neuve", "JDT": "heure d’été du Japon", "GMT": "heure moyenne de Greenwich", "ART": "heure normale d’Argentine", "PST": "heure normale du Pacifique nord-américain", "BT": "heure du Bhoutan", "MDT": "heure d’été de Macao", "HKT": "heure normale de Hong Kong", "HKST": "heure d’été de Hong Kong", "ACWST": "heure normale du centre-ouest de l’Australie", "ARST": "heure d’été de l’Argentine", "WITA": "heure du Centre indonésien", "COST": "heure d’été de Colombie", "GYT": "heure du Guyana", "UYT": "heure normale de l’Uruguay", "LHST": "heure normale de Lord Howe", "ACST": "heure normale du centre de l’Australie", "GFT": "heure de la Guyane française", "AKDT": "heure d’été de l’Alaska", "MEZ": "heure normale d’Europe centrale", "TMT": "heure normale du Turkménistan", "WAST": "heure d’été d’Afrique de l’Ouest", "UYST": "heure d’été de l’Uruguay", "EAT": "heure normale d’Afrique de l’Est", "AST": "heure normale de l’Atlantique", "AWDT": "heure d’été de l’Ouest de l’Australie", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "WEZ": "heure normale d’Europe de l’Ouest", "HAT": "heure d’été de Terre-Neuve", "CST": "heure normale du centre nord-américain", "AKST": "heure normale de l’Alaska", "ACDT": "heure d’été du centre de l’Australie", "CHAST": "heure normale des îles Chatham", "WIT": "heure de l’Est indonésien", "CLST": "heure d’été du Chili", "CDT": "heure d’été du Centre", "AWST": "heure normale de l’Ouest de l’Australie", "NZST": "heure normale de la Nouvelle-Zélande", "∅∅∅": "heure d’été de l’Amazonie", "WESZ": "heure d’été d’Europe de l’Ouest", "ChST": "heure des Chamorro", "CLT": "heure normale du Chili", "WART": "heure normale de l’Ouest argentin", "ACWDT": "heure d’été du centre-ouest de l’Australie", "IST": "heure de l’Inde", "PDT": "heure d’été du Pacifique", "WAT": "heure normale d’Afrique de l’Ouest", "AEDT": "heure d’été de l’Est de l’Australie"},
}
}
diff --git a/fr_KM/fr_KM_test.go b/fr_KM/fr_KM_test.go
new file mode 100644
index 00000000..9249ac4b
--- /dev/null
+++ b/fr_KM/fr_KM_test.go
@@ -0,0 +1,1120 @@
+package fr_KM
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr_KM"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr_LU/fr_LU.go b/fr_LU/fr_LU.go
index 2da9b09c..bce70194 100644
--- a/fr_LU/fr_LU.go
+++ b/fr_LU/fr_LU.go
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"MDT": "heure d’été de Macao", "SGT": "heure de Singapour", "GFT": "heure de la Guyane française", "EAT": "heure normale d’Afrique de l’Est", "ACDT": "heure d’été du centre de l’Australie", "ARST": "heure d’été de l’Argentine", "JST": "heure normale du Japon", "SRT": "heure du Suriname", "AWDT": "heure d’été de l’Ouest de l’Australie", "COT": "heure normale de Colombie", "OEZ": "heure normale d’Europe de l’Est", "TMT": "heure normale du Turkménistan", "PST": "heure normale du Pacifique nord-américain", "NZDT": "heure d’été de la Nouvelle-Zélande", "ACWST": "heure normale du centre-ouest de l’Australie", "CHAST": "heure normale des îles Chatham", "ADT": "heure d’été de l’Atlantique", "ACST": "heure normale du centre de l’Australie", "GYT": "heure du Guyana", "WESZ": "heure d’été d’Europe de l’Ouest", "HKT": "heure normale de Hong Kong", "AKST": "heure normale de l’Alaska", "LHST": "heure normale de Lord Howe", "CDT": "heure d’été du Centre", "MEZ": "heure normale d’Europe centrale", "BOT": "heure de Bolivie", "UYT": "heure normale de l’Uruguay", "CLST": "heure d’été du Chili", "HAST": "heure normale d’Hawaii - Aléoutiennes", "WIT": "heure de l’Est indonésien", "PDT": "heure d’été du Pacifique", "CLT": "heure normale du Chili", "EST": "heure normale de l’Est nord-américain", "ECT": "heure de l’Équateur", "WAST": "heure d’été d’Afrique de l’Ouest", "GMT": "heure moyenne de Greenwich", "WEZ": "heure normale d’Europe de l’Ouest", "AEST": "heure normale de l’Est de l’Australie", "WAT": "heure normale d’Afrique de l’Ouest", "∅∅∅": "heure d’été de l’Amazonie", "LHDT": "heure d’été de Lord Howe", "HKST": "heure d’été de Hong Kong", "WIB": "heure de l’Ouest indonésien", "HNT": "heure normale de Terre-Neuve", "IST": "heure de l’Inde", "ART": "heure normale d’Argentine", "CST": "heure normale du centre nord-américain", "WARST": "heure d’été de l’Ouest argentin", "OESZ": "heure d’été d’Europe de l’Est", "WITA": "heure du Centre indonésien", "MST": "heure normale de Macao", "MESZ": "heure d’été d’Europe centrale", "NZST": "heure normale de la Nouvelle-Zélande", "VET": "heure du Venezuela", "CAT": "heure normale d’Afrique centrale", "TMST": "heure d’été du Turkménistan", "ChST": "heure des Chamorro", "EDT": "heure d’été de l’Est", "SAST": "heure normale d’Afrique méridionale", "JDT": "heure d’été du Japon", "UYST": "heure d’été de l’Uruguay", "CHADT": "heure d’été des îles Chatham", "COST": "heure d’été de Colombie", "AST": "heure normale de l’Atlantique", "BT": "heure du Bhoutan", "AKDT": "heure d’été de l’Alaska", "MYT": "heure de la Malaisie", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "WART": "heure normale de l’Ouest argentin", "HAT": "heure d’été de Terre-Neuve", "AWST": "heure normale de l’Ouest de l’Australie", "ACWDT": "heure d’été du centre-ouest de l’Australie", "AEDT": "heure d’été de l’Est de l’Australie"},
+ timezones: map[string]string{"OEZ": "heure normale d’Europe de l’Est", "CLT": "heure normale du Chili", "UYST": "heure d’été de l’Uruguay", "PST": "heure normale du Pacifique nord-américain", "NZST": "heure normale de la Nouvelle-Zélande", "∅∅∅": "heure d’été de Brasilia", "ACWST": "heure normale du centre-ouest de l’Australie", "MYT": "heure de la Malaisie", "MEZ": "heure normale d’Europe centrale", "TMT": "heure normale du Turkménistan", "WAST": "heure d’été d’Afrique de l’Ouest", "COT": "heure normale de Colombie", "COST": "heure d’été de Colombie", "HAST": "heure normale d’Hawaii - Aléoutiennes", "AEST": "heure normale de l’Est de l’Australie", "GYT": "heure du Guyana", "AKST": "heure normale de l’Alaska", "AST": "heure normale de l’Atlantique", "ADT": "heure d’été de l’Atlantique", "ART": "heure normale d’Argentine", "MDT": "heure d’été des Rocheuses", "ECT": "heure de l’Équateur", "EDT": "heure d’été de l’Est", "MESZ": "heure d’été d’Europe centrale", "WEZ": "heure normale d’Europe de l’Ouest", "OESZ": "heure d’été d’Europe de l’Est", "CLST": "heure d’été du Chili", "ACDT": "heure d’été du centre de l’Australie", "HKT": "heure normale de Hong Kong", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "HNT": "heure normale de Terre-Neuve", "SGT": "heure de Singapour", "HKST": "heure d’été de Hong Kong", "AWST": "heure normale de l’Ouest de l’Australie", "BOT": "heure de Bolivie", "WESZ": "heure d’été d’Europe de l’Ouest", "ChST": "heure des Chamorro", "WART": "heure normale de l’Ouest argentin", "VET": "heure du Venezuela", "ARST": "heure d’été de l’Argentine", "EST": "heure normale de l’Est nord-américain", "TMST": "heure d’été du Turkménistan", "LHDT": "heure d’été de Lord Howe", "GFT": "heure de la Guyane française", "JST": "heure normale du Japon", "SAST": "heure normale d’Afrique méridionale", "HAT": "heure d’été de Terre-Neuve", "LHST": "heure normale de Lord Howe", "SRT": "heure du Suriname", "WAT": "heure normale d’Afrique de l’Ouest", "CHAST": "heure normale des îles Chatham", "CHADT": "heure d’été des îles Chatham", "WITA": "heure du Centre indonésien", "PDT": "heure d’été du Pacifique", "WARST": "heure d’été de l’Ouest argentin", "ACWDT": "heure d’été du centre-ouest de l’Australie", "IST": "heure de l’Inde", "NZDT": "heure d’été de la Nouvelle-Zélande", "GMT": "heure moyenne de Greenwich", "BT": "heure du Bhoutan", "MST": "heure normale des Rocheuses", "UYT": "heure normale de l’Uruguay", "CDT": "heure d’été du Centre", "AKDT": "heure d’été de l’Alaska", "AEDT": "heure d’été de l’Est de l’Australie", "EAT": "heure normale d’Afrique de l’Est", "ACST": "heure normale du centre de l’Australie", "CAT": "heure normale d’Afrique centrale", "WIT": "heure de l’Est indonésien", "CST": "heure normale du centre nord-américain", "AWDT": "heure d’été de l’Ouest de l’Australie", "JDT": "heure d’été du Japon", "WIB": "heure de l’Ouest indonésien"},
}
}
diff --git a/fr_LU/fr_LU_test.go b/fr_LU/fr_LU_test.go
new file mode 100644
index 00000000..207eb86c
--- /dev/null
+++ b/fr_LU/fr_LU_test.go
@@ -0,0 +1,1120 @@
+package fr_LU
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr_LU"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr_MA/fr_MA.go b/fr_MA/fr_MA.go
index 7dc5956b..7af7f2cd 100644
--- a/fr_MA/fr_MA.go
+++ b/fr_MA/fr_MA.go
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"OESZ": "heure d’été d’Europe de l’Est", "TMST": "heure d’été du Turkménistan", "GYT": "heure du Guyana", "NZST": "heure normale de la Nouvelle-Zélande", "COT": "heure normale de Colombie", "SGT": "heure de Singapour", "HKT": "heure normale de Hong Kong", "MDT": "heure d’été de Macao", "TMT": "heure normale du Turkménistan", "JST": "heure normale du Japon", "SRT": "heure du Suriname", "COST": "heure d’été de Colombie", "WAT": "heure normale d’Afrique de l’Ouest", "WAST": "heure d’été d’Afrique de l’Ouest", "AKDT": "heure d’été de l’Alaska", "AEST": "heure normale de l’Est de l’Australie", "EAT": "heure normale d’Afrique de l’Est", "ACST": "heure normale du centre de l’Australie", "ART": "heure normale d’Argentine", "MYT": "heure de la Malaisie", "UYST": "heure d’été de l’Uruguay", "WART": "heure normale de l’Ouest argentin", "WIB": "heure de l’Ouest indonésien", "CST": "heure normale du centre nord-américain", "MST": "heure normale de Macao", "PST": "heure normale du Pacifique nord-américain", "MESZ": "heure d’été d’Europe centrale", "BOT": "heure de Bolivie", "WEZ": "heure normale d’Europe de l’Ouest", "IST": "heure de l’Inde", "OEZ": "heure normale d’Europe de l’Est", "ARST": "heure d’été de l’Argentine", "AKST": "heure normale de l’Alaska", "LHDT": "heure d’été de Lord Howe", "JDT": "heure d’été du Japon", "ACWDT": "heure d’été du centre-ouest de l’Australie", "ADT": "heure d’été de l’Atlantique", "HAST": "heure normale d’Hawaii - Aléoutiennes", "CDT": "heure d’été du Centre", "ACWST": "heure normale du centre-ouest de l’Australie", "CHADT": "heure d’été des îles Chatham", "HNT": "heure normale de Terre-Neuve", "EST": "heure normale de l’Est nord-américain", "GMT": "heure moyenne de Greenwich", "HAT": "heure d’été de Terre-Neuve", "ACDT": "heure d’été du centre de l’Australie", "PDT": "heure d’été du Pacifique", "MEZ": "heure normale d’Europe centrale", "ChST": "heure des Chamorro", "CHAST": "heure normale des îles Chatham", "VET": "heure du Venezuela", "SAST": "heure normale d’Afrique méridionale", "BT": "heure du Bhoutan", "GFT": "heure de la Guyane française", "WIT": "heure de l’Est indonésien", "AWST": "heure normale de l’Ouest de l’Australie", "UYT": "heure normale de l’Uruguay", "ECT": "heure de l’Équateur", "LHST": "heure normale de Lord Howe", "CLST": "heure d’été du Chili", "AST": "heure normale de l’Atlantique", "WITA": "heure du Centre indonésien", "AWDT": "heure d’été de l’Ouest de l’Australie", "EDT": "heure d’été de l’Est", "∅∅∅": "heure d’été de l’Amazonie", "NZDT": "heure d’été de la Nouvelle-Zélande", "CAT": "heure normale d’Afrique centrale", "HKST": "heure d’été de Hong Kong", "WARST": "heure d’été de l’Ouest argentin", "WESZ": "heure d’été d’Europe de l’Ouest", "AEDT": "heure d’été de l’Est de l’Australie", "CLT": "heure normale du Chili", "HADT": "heure d’été d’Hawaii - Aléoutiennes"},
+ timezones: map[string]string{"HKT": "heure normale de Hong Kong", "VET": "heure du Venezuela", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "UYT": "heure normale de l’Uruguay", "WIT": "heure de l’Est indonésien", "LHST": "heure normale de Lord Howe", "MYT": "heure de la Malaisie", "AWST": "heure normale de l’Ouest de l’Australie", "ART": "heure normale d’Argentine", "WAST": "heure d’été d’Afrique de l’Ouest", "WEZ": "heure normale d’Europe de l’Ouest", "WAT": "heure normale d’Afrique de l’Ouest", "COST": "heure d’été de Colombie", "GMT": "heure moyenne de Greenwich", "ADT": "heure d’été de l’Atlantique", "SAST": "heure normale d’Afrique méridionale", "PDT": "heure d’été du Pacifique", "EAT": "heure normale d’Afrique de l’Est", "∅∅∅": "heure d’été de Brasilia", "SRT": "heure du Suriname", "GFT": "heure de la Guyane française", "CHADT": "heure d’été des îles Chatham", "ECT": "heure de l’Équateur", "TMST": "heure d’été du Turkménistan", "AEDT": "heure d’été de l’Est de l’Australie", "CLT": "heure normale du Chili", "JST": "heure normale du Japon", "MEZ": "heure normale d’Europe centrale", "SGT": "heure de Singapour", "MST": "heure normale des Rocheuses", "ACST": "heure normale du centre de l’Australie", "ACDT": "heure d’été du centre de l’Australie", "BOT": "heure de Bolivie", "HAST": "heure normale d’Hawaii - Aléoutiennes", "HNT": "heure normale de Terre-Neuve", "UYST": "heure d’été de l’Uruguay", "HKST": "heure d’été de Hong Kong", "EDT": "heure d’été de l’Est", "CLST": "heure d’été du Chili", "CST": "heure normale du centre nord-américain", "ACWST": "heure normale du centre-ouest de l’Australie", "NZDT": "heure d’été de la Nouvelle-Zélande", "OEZ": "heure normale d’Europe de l’Est", "CDT": "heure d’été du Centre", "WARST": "heure d’été de l’Ouest argentin", "AWDT": "heure d’été de l’Ouest de l’Australie", "TMT": "heure normale du Turkménistan", "CAT": "heure normale d’Afrique centrale", "ChST": "heure des Chamorro", "BT": "heure du Bhoutan", "MDT": "heure d’été des Rocheuses", "WART": "heure normale de l’Ouest argentin", "AST": "heure normale de l’Atlantique", "EST": "heure normale de l’Est nord-américain", "PST": "heure normale du Pacifique nord-américain", "WIB": "heure de l’Ouest indonésien", "AEST": "heure normale de l’Est de l’Australie", "GYT": "heure du Guyana", "WITA": "heure du Centre indonésien", "WESZ": "heure d’été d’Europe de l’Ouest", "AKST": "heure normale de l’Alaska", "ACWDT": "heure d’été du centre-ouest de l’Australie", "NZST": "heure normale de la Nouvelle-Zélande", "OESZ": "heure d’été d’Europe de l’Est", "HAT": "heure d’été de Terre-Neuve", "LHDT": "heure d’été de Lord Howe", "CHAST": "heure normale des îles Chatham", "ARST": "heure d’été de l’Argentine", "IST": "heure de l’Inde", "COT": "heure normale de Colombie", "JDT": "heure d’été du Japon", "AKDT": "heure d’été de l’Alaska", "MESZ": "heure d’été d’Europe centrale"},
}
}
diff --git a/fr_MA/fr_MA_test.go b/fr_MA/fr_MA_test.go
new file mode 100644
index 00000000..4ac696b9
--- /dev/null
+++ b/fr_MA/fr_MA_test.go
@@ -0,0 +1,1120 @@
+package fr_MA
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr_MA"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr_MC/fr_MC.go b/fr_MC/fr_MC.go
index 7c9d7ca3..3c7984fb 100644
--- a/fr_MC/fr_MC.go
+++ b/fr_MC/fr_MC.go
@@ -49,7 +49,7 @@ func New() locales.Translator {
locale: "fr_MC",
pluralsCardinal: []locales.PluralRule{2, 6},
pluralsOrdinal: []locales.PluralRule{2, 6},
- pluralsRange: []locales.PluralRule{2, 6},
+ pluralsRange: []locales.PluralRule{6, 2},
decimal: "٫",
group: "٬",
minus: "‏−",
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"CDT": "heure d’été du Centre", "NZDT": "heure d’été de la Nouvelle-Zélande", "UYST": "heure d’été de l’Uruguay", "MDT": "heure d’été des Rocheuses", "WAST": "heure d’été d’Afrique de l’Ouest", "GMT": "heure moyenne de Greenwich", "GFT": "heure de la Guyane française", "ACST": "heure normale du centre de l’Australie", "ART": "heure normale d’Argentine", "SRT": "heure du Suriname", "BT": "heure du Bhoutan", "EAT": "heure normale d’Afrique de l’Est", "MESZ": "heure d’été d’Europe centrale", "NZST": "heure normale de la Nouvelle-Zélande", "COT": "heure normale de Colombie", "WART": "heure normale de l’Ouest argentin", "TMST": "heure d’été du Turkménistan", "GYT": "heure du Guyana", "JDT": "heure d’été du Japon", "VET": "heure du Venezuela", "WITA": "heure du Centre indonésien", "TMT": "heure normale du Turkménistan", "WEZ": "heure normale d’Europe de l’Ouest", "AEST": "heure normale de l’Est de l’Australie", "CST": "heure normale du centre nord-américain", "MEZ": "heure normale d’Europe centrale", "UYT": "heure normale de l’Uruguay", "AEDT": "heure d’été de l’Est de l’Australie", "ChST": "heure des Chamorro", "EDT": "heure d’été de l’Est", "COST": "heure d’été de Colombie", "ARST": "heure d’été de l’Argentine", "LHDT": "heure d’été de Lord Howe", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "OEZ": "heure normale d’Europe de l’Est", "HNT": "heure normale de Terre-Neuve", "WIB": "heure de l’Ouest indonésien", "JST": "heure normale du Japon", "BOT": "heure de Bolivie", "CLT": "heure normale du Chili", "ECT": "heure de l’Équateur", "AST": "heure normale de l’Atlantique", "SAST": "heure normale d’Afrique méridionale", "WAT": "heure normale d’Afrique de l’Ouest", "IST": "heure de l’Inde", "WESZ": "heure d’été d’Europe de l’Ouest", "CHADT": "heure d’été des îles Chatham", "EST": "heure normale de l’Est nord-américain", "HKT": "heure normale de Hong Kong", "∅∅∅": "heure d’été des Açores", "ACWST": "heure normale du centre-ouest de l’Australie", "ACWDT": "heure d’été du centre-ouest de l’Australie", "WIT": "heure de l’Est indonésien", "PST": "heure normale du Pacifique nord-américain", "AKST": "heure normale de l’Alaska", "PDT": "heure d’été du Pacifique", "CAT": "heure normale d’Afrique centrale", "LHST": "heure normale de Lord Howe", "CHAST": "heure normale des îles Chatham", "CLST": "heure d’été du Chili", "HAT": "heure d’été de Terre-Neuve", "AWST": "heure normale de l’Ouest de l’Australie", "AWDT": "heure d’été de l’Ouest de l’Australie", "MST": "heure normale des Rocheuses", "HKST": "heure d’été de Hong Kong", "OESZ": "heure d’été d’Europe de l’Est", "ACDT": "heure d’été du centre de l’Australie", "MYT": "heure de la Malaisie", "ADT": "heure d’été de l’Atlantique", "SGT": "heure de Singapour", "WARST": "heure d’été de l’Ouest argentin", "AKDT": "heure d’été de l’Alaska", "HAST": "heure normale d’Hawaii - Aléoutiennes"},
+ timezones: map[string]string{"NZST": "heure normale de la Nouvelle-Zélande", "WEZ": "heure normale d’Europe de l’Ouest", "GYT": "heure du Guyana", "CLST": "heure d’été du Chili", "HKT": "heure normale de Hong Kong", "MESZ": "heure d’été d’Europe centrale", "ART": "heure normale d’Argentine", "OESZ": "heure d’été d’Europe de l’Est", "ECT": "heure de l’Équateur", "COST": "heure d’été de Colombie", "CAT": "heure normale d’Afrique centrale", "WAT": "heure normale d’Afrique de l’Ouest", "WITA": "heure du Centre indonésien", "JST": "heure normale du Japon", "AKST": "heure normale de l’Alaska", "HAT": "heure d’été de Terre-Neuve", "ACWDT": "heure d’été du centre-ouest de l’Australie", "ARST": "heure d’été de l’Argentine", "EDT": "heure d’été de l’Est", "WIB": "heure de l’Ouest indonésien", "WART": "heure normale de l’Ouest argentin", "CHADT": "heure d’été des îles Chatham", "MST": "heure normale de Macao", "TMST": "heure d’été du Turkménistan", "LHDT": "heure d’été de Lord Howe", "BOT": "heure de Bolivie", "SGT": "heure de Singapour", "WARST": "heure d’été de l’Ouest argentin", "SRT": "heure du Suriname", "ACST": "heure normale du centre de l’Australie", "ACDT": "heure d’été du centre de l’Australie", "COT": "heure normale de Colombie", "WAST": "heure d’été d’Afrique de l’Ouest", "GFT": "heure de la Guyane française", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "ADT": "heure d’été de l’Atlantique", "NZDT": "heure d’été de la Nouvelle-Zélande", "HNT": "heure normale de Terre-Neuve", "ChST": "heure des Chamorro", "CLT": "heure normale du Chili", "BT": "heure du Bhoutan", "JDT": "heure d’été du Japon", "AKDT": "heure d’été de l’Alaska", "TMT": "heure normale du Turkménistan", "CHAST": "heure normale des îles Chatham", "SAST": "heure normale d’Afrique méridionale", "AWST": "heure normale de l’Ouest de l’Australie", "EST": "heure normale de l’Est nord-américain", "OEZ": "heure normale d’Europe de l’Est", "LHST": "heure normale de Lord Howe", "EAT": "heure normale d’Afrique de l’Est", "CST": "heure normale du centre nord-américain", "MDT": "heure d’été de Macao", "ACWST": "heure normale du centre-ouest de l’Australie", "AST": "heure normale de l’Atlantique", "MEZ": "heure normale d’Europe centrale", "AEST": "heure normale de l’Est de l’Australie", "MYT": "heure de la Malaisie", "WIT": "heure de l’Est indonésien", "CDT": "heure d’été du Centre", "∅∅∅": "heure d’été des Açores", "AWDT": "heure d’été de l’Ouest de l’Australie", "IST": "heure de l’Inde", "UYST": "heure d’été de l’Uruguay", "VET": "heure du Venezuela", "HAST": "heure normale d’Hawaii - Aléoutiennes", "WESZ": "heure d’été d’Europe de l’Ouest", "AEDT": "heure d’été de l’Est de l’Australie", "GMT": "heure moyenne de Greenwich", "UYT": "heure normale de l’Uruguay", "HKST": "heure d’été de Hong Kong", "PST": "heure normale du Pacifique nord-américain", "PDT": "heure d’été du Pacifique"},
}
}
diff --git a/fr_MC/fr_MC_test.go b/fr_MC/fr_MC_test.go
new file mode 100644
index 00000000..d45fd8d6
--- /dev/null
+++ b/fr_MC/fr_MC_test.go
@@ -0,0 +1,1120 @@
+package fr_MC
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr_MC"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr_MF/fr_MF.go b/fr_MF/fr_MF.go
index caecedc4..91515a9c 100644
--- a/fr_MF/fr_MF.go
+++ b/fr_MF/fr_MF.go
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"SGT": "heure de Singapour", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "WAST": "heure d’été d’Afrique de l’Ouest", "GMT": "heure moyenne de Greenwich", "WIT": "heure de l’Est indonésien", "MESZ": "heure d’été d’Europe centrale", "AEDT": "heure d’été de l’Est de l’Australie", "EST": "heure normale de l’Est nord-américain", "COST": "heure d’été de Colombie", "WAT": "heure normale d’Afrique de l’Ouest", "GYT": "heure du Guyana", "NZST": "heure normale de la Nouvelle-Zélande", "NZDT": "heure d’été de la Nouvelle-Zélande", "UYT": "heure normale de l’Uruguay", "CLST": "heure d’été du Chili", "WIB": "heure de l’Ouest indonésien", "GFT": "heure de la Guyane française", "TMST": "heure d’été du Turkménistan", "LHDT": "heure d’été de Lord Howe", "CHAST": "heure normale des îles Chatham", "BT": "heure du Bhoutan", "OEZ": "heure normale d’Europe de l’Est", "PDT": "heure d’été du Pacifique", "∅∅∅": "heure d’été de Brasilia", "COT": "heure normale de Colombie", "OESZ": "heure d’été d’Europe de l’Est", "HNT": "heure normale de Terre-Neuve", "ACDT": "heure d’été du centre de l’Australie", "MYT": "heure de la Malaisie", "EDT": "heure d’été de l’Est", "HKST": "heure d’été de Hong Kong", "SRT": "heure du Suriname", "CDT": "heure d’été du Centre", "ChST": "heure des Chamorro", "PST": "heure normale du Pacifique nord-américain", "MEZ": "heure normale d’Europe centrale", "WEZ": "heure normale d’Europe de l’Ouest", "CAT": "heure normale d’Afrique centrale", "HKT": "heure normale de Hong Kong", "WART": "heure normale de l’Ouest argentin", "VET": "heure du Venezuela", "AEST": "heure normale de l’Est de l’Australie", "MST": "heure normale des Rocheuses", "AST": "heure normale de l’Atlantique", "SAST": "heure normale d’Afrique méridionale", "HAT": "heure d’été de Terre-Neuve", "ART": "heure normale d’Argentine", "AKST": "heure normale de l’Alaska", "WESZ": "heure d’été d’Europe de l’Ouest", "AKDT": "heure d’été de l’Alaska", "AWST": "heure normale de l’Ouest de l’Australie", "AWDT": "heure d’été de l’Ouest de l’Australie", "UYST": "heure d’été de l’Uruguay", "ACWDT": "heure d’été du centre-ouest de l’Australie", "EAT": "heure normale d’Afrique de l’Est", "ACWST": "heure normale du centre-ouest de l’Australie", "ADT": "heure d’été de l’Atlantique", "WITA": "heure du Centre indonésien", "JST": "heure normale du Japon", "CST": "heure normale du centre nord-américain", "BOT": "heure de Bolivie", "CHADT": "heure d’été des îles Chatham", "HAST": "heure normale d’Hawaii - Aléoutiennes", "ACST": "heure normale du centre de l’Australie", "MDT": "heure d’été des Rocheuses", "IST": "heure de l’Inde", "LHST": "heure normale de Lord Howe", "WARST": "heure d’été de l’Ouest argentin", "ECT": "heure de l’Équateur", "ARST": "heure d’été de l’Argentine", "TMT": "heure normale du Turkménistan", "JDT": "heure d’été du Japon", "CLT": "heure normale du Chili"},
+ timezones: map[string]string{"OESZ": "heure d’été d’Europe de l’Est", "UYT": "heure normale de l’Uruguay", "CDT": "heure d’été du Centre", "GFT": "heure de la Guyane française", "HKT": "heure normale de Hong Kong", "AKST": "heure normale de l’Alaska", "PDT": "heure d’été du Pacifique", "TMT": "heure normale du Turkménistan", "COST": "heure d’été de Colombie", "WIB": "heure de l’Ouest indonésien", "ACDT": "heure d’été du centre de l’Australie", "ACWST": "heure normale du centre-ouest de l’Australie", "MESZ": "heure d’été d’Europe centrale", "MEZ": "heure normale d’Europe centrale", "WESZ": "heure d’été d’Europe de l’Ouest", "OEZ": "heure normale d’Europe de l’Est", "AEDT": "heure d’été de l’Est de l’Australie", "ChST": "heure des Chamorro", "AKDT": "heure d’été de l’Alaska", "AWDT": "heure d’été de l’Ouest de l’Australie", "PST": "heure normale du Pacifique nord-américain", "MYT": "heure de la Malaisie", "HAST": "heure normale d’Hawaii - Aléoutiennes", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "WEZ": "heure normale d’Europe de l’Ouest", "CLT": "heure normale du Chili", "ACWDT": "heure d’été du centre-ouest de l’Australie", "AWST": "heure normale de l’Ouest de l’Australie", "ARST": "heure d’été de l’Argentine", "HNT": "heure normale de Terre-Neuve", "GYT": "heure du Guyana", "WART": "heure normale de l’Ouest argentin", "CHADT": "heure d’été des îles Chatham", "JDT": "heure d’été du Japon", "TMST": "heure d’été du Turkménistan", "SGT": "heure de Singapour", "GMT": "heure moyenne de Greenwich", "VET": "heure du Venezuela", "NZST": "heure normale de la Nouvelle-Zélande", "MDT": "heure d’été des Rocheuses", "WAST": "heure d’été d’Afrique de l’Ouest", "AEST": "heure normale de l’Est de l’Australie", "EAT": "heure normale d’Afrique de l’Est", "CHAST": "heure normale des îles Chatham", "BOT": "heure de Bolivie", "IST": "heure de l’Inde", "WITA": "heure du Centre indonésien", "COT": "heure normale de Colombie", "WIT": "heure de l’Est indonésien", "LHST": "heure normale de Lord Howe", "WARST": "heure d’été de l’Ouest argentin", "SRT": "heure du Suriname", "ADT": "heure d’été de l’Atlantique", "ART": "heure normale d’Argentine", "LHDT": "heure d’été de Lord Howe", "AST": "heure normale de l’Atlantique", "BT": "heure du Bhoutan", "CLST": "heure d’été du Chili", "HKST": "heure d’été de Hong Kong", "EDT": "heure d’été de l’Est", "ECT": "heure de l’Équateur", "JST": "heure normale du Japon", "EST": "heure normale de l’Est nord-américain", "HAT": "heure d’été de Terre-Neuve", "MST": "heure normale des Rocheuses", "CAT": "heure normale d’Afrique centrale", "WAT": "heure normale d’Afrique de l’Ouest", "UYST": "heure d’été de l’Uruguay", "∅∅∅": "heure d’été de Brasilia", "CST": "heure normale du centre nord-américain", "ACST": "heure normale du centre de l’Australie", "SAST": "heure normale d’Afrique méridionale", "NZDT": "heure d’été de la Nouvelle-Zélande"},
}
}
diff --git a/fr_MF/fr_MF_test.go b/fr_MF/fr_MF_test.go
new file mode 100644
index 00000000..f902b215
--- /dev/null
+++ b/fr_MF/fr_MF_test.go
@@ -0,0 +1,1120 @@
+package fr_MF
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr_MF"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr_MG/fr_MG.go b/fr_MG/fr_MG.go
index 92c2275c..789c1415 100644
--- a/fr_MG/fr_MG.go
+++ b/fr_MG/fr_MG.go
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"GMT": "heure moyenne de Greenwich", "WITA": "heure du Centre indonésien", "COST": "heure d’été de Colombie", "SAST": "heure normale d’Afrique méridionale", "IST": "heure de l’Inde", "ARST": "heure d’été de l’Argentine", "GYT": "heure du Guyana", "CDT": "heure d’été du Centre", "UYT": "heure normale de l’Uruguay", "∅∅∅": "heure d’été de Brasilia", "OEZ": "heure normale d’Europe de l’Est", "AKST": "heure normale de l’Alaska", "AKDT": "heure d’été de l’Alaska", "AWST": "heure normale de l’Ouest de l’Australie", "COT": "heure normale de Colombie", "MDT": "heure d’été de Macao", "PDT": "heure d’été du Pacifique", "NZDT": "heure d’été de la Nouvelle-Zélande", "EST": "heure normale de l’Est nord-américain", "BT": "heure du Bhoutan", "HAT": "heure d’été de Terre-Neuve", "ACDT": "heure d’été du centre de l’Australie", "CST": "heure normale du centre nord-américain", "MEZ": "heure normale d’Europe centrale", "WEZ": "heure normale d’Europe de l’Ouest", "AST": "heure normale de l’Atlantique", "ECT": "heure de l’Équateur", "WIB": "heure de l’Ouest indonésien", "SRT": "heure du Suriname", "LHST": "heure normale de Lord Howe", "CLT": "heure normale du Chili", "CLST": "heure d’été du Chili", "CAT": "heure normale d’Afrique centrale", "HKT": "heure normale de Hong Kong", "VET": "heure du Venezuela", "CHADT": "heure d’été des îles Chatham", "JDT": "heure d’été du Japon", "AWDT": "heure d’été de l’Ouest de l’Australie", "MYT": "heure de la Malaisie", "NZST": "heure normale de la Nouvelle-Zélande", "AEDT": "heure d’été de l’Est de l’Australie", "WART": "heure normale de l’Ouest argentin", "ACWST": "heure normale du centre-ouest de l’Australie", "HKST": "heure d’été de Hong Kong", "HNT": "heure normale de Terre-Neuve", "MST": "heure normale de Macao", "WESZ": "heure d’été d’Europe de l’Ouest", "AEST": "heure normale de l’Est de l’Australie", "EDT": "heure d’été de l’Est", "OESZ": "heure d’été d’Europe de l’Est", "GFT": "heure de la Guyane française", "EAT": "heure normale d’Afrique de l’Est", "TMST": "heure d’été du Turkménistan", "JST": "heure normale du Japon", "CHAST": "heure normale des îles Chatham", "HAST": "heure normale d’Hawaii - Aléoutiennes", "ART": "heure normale d’Argentine", "TMT": "heure normale du Turkménistan", "PST": "heure normale du Pacifique nord-américain", "WAST": "heure d’été d’Afrique de l’Ouest", "WARST": "heure d’été de l’Ouest argentin", "LHDT": "heure d’été de Lord Howe", "UYST": "heure d’été de l’Uruguay", "ADT": "heure d’été de l’Atlantique", "WIT": "heure de l’Est indonésien", "MESZ": "heure d’été d’Europe centrale", "BOT": "heure de Bolivie", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "WAT": "heure normale d’Afrique de l’Ouest", "ACST": "heure normale du centre de l’Australie", "ACWDT": "heure d’été du centre-ouest de l’Australie", "ChST": "heure des Chamorro", "SGT": "heure de Singapour"},
+ timezones: map[string]string{"AWST": "heure normale de l’Ouest de l’Australie", "ChST": "heure des Chamorro", "MYT": "heure de la Malaisie", "BT": "heure du Bhoutan", "MST": "heure normale de Macao", "AST": "heure normale de l’Atlantique", "VET": "heure du Venezuela", "LHDT": "heure d’été de Lord Howe", "UYT": "heure normale de l’Uruguay", "UYST": "heure d’été de l’Uruguay", "AEDT": "heure d’été de l’Est de l’Australie", "CHADT": "heure d’été des îles Chatham", "PDT": "heure d’été du Pacifique", "ARST": "heure d’été de l’Argentine", "AWDT": "heure d’été de l’Ouest de l’Australie", "MESZ": "heure d’été d’Europe centrale", "TMST": "heure d’été du Turkménistan", "CLT": "heure normale du Chili", "SRT": "heure du Suriname", "MDT": "heure d’été de Macao", "ACWDT": "heure d’été du centre-ouest de l’Australie", "MEZ": "heure normale d’Europe centrale", "∅∅∅": "heure d’été des Açores", "ACWST": "heure normale du centre-ouest de l’Australie", "GFT": "heure de la Guyane française", "AKDT": "heure d’été de l’Alaska", "ADT": "heure d’été de l’Atlantique", "CAT": "heure normale d’Afrique centrale", "WAST": "heure d’été d’Afrique de l’Ouest", "WESZ": "heure d’été d’Europe de l’Ouest", "CDT": "heure d’été du Centre", "ACDT": "heure d’été du centre de l’Australie", "AEST": "heure normale de l’Est de l’Australie", "HAT": "heure d’été de Terre-Neuve", "GYT": "heure du Guyana", "IST": "heure de l’Inde", "EAT": "heure normale d’Afrique de l’Est", "CHAST": "heure normale des îles Chatham", "JDT": "heure d’été du Japon", "JST": "heure normale du Japon", "EDT": "heure d’été de l’Est", "COT": "heure normale de Colombie", "OESZ": "heure d’été d’Europe de l’Est", "GMT": "heure moyenne de Greenwich", "WIT": "heure de l’Est indonésien", "WART": "heure normale de l’Ouest argentin", "WARST": "heure d’été de l’Ouest argentin", "SAST": "heure normale d’Afrique méridionale", "EST": "heure normale de l’Est nord-américain", "SGT": "heure de Singapour", "CLST": "heure d’été du Chili", "CST": "heure normale du centre nord-américain", "AKST": "heure normale de l’Alaska", "OEZ": "heure normale d’Europe de l’Est", "HAST": "heure normale d’Hawaii - Aléoutiennes", "WAT": "heure normale d’Afrique de l’Ouest", "LHST": "heure normale de Lord Howe", "WEZ": "heure normale d’Europe de l’Ouest", "HNT": "heure normale de Terre-Neuve", "WIB": "heure de l’Ouest indonésien", "ART": "heure normale d’Argentine", "WITA": "heure du Centre indonésien", "HKT": "heure normale de Hong Kong", "TMT": "heure normale du Turkménistan", "BOT": "heure de Bolivie", "ECT": "heure de l’Équateur", "NZST": "heure normale de la Nouvelle-Zélande", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "NZDT": "heure d’été de la Nouvelle-Zélande", "PST": "heure normale du Pacifique nord-américain", "COST": "heure d’été de Colombie", "ACST": "heure normale du centre de l’Australie", "HKST": "heure d’été de Hong Kong"},
}
}
diff --git a/fr_MG/fr_MG_test.go b/fr_MG/fr_MG_test.go
new file mode 100644
index 00000000..d9083d01
--- /dev/null
+++ b/fr_MG/fr_MG_test.go
@@ -0,0 +1,1120 @@
+package fr_MG
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr_MG"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr_ML/fr_ML.go b/fr_ML/fr_ML.go
index 8643d94b..bb94a927 100644
--- a/fr_ML/fr_ML.go
+++ b/fr_ML/fr_ML.go
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"EAT": "heure normale d’Afrique de l’Est", "∅∅∅": "heure d’été de l’Amazonie", "AWST": "heure normale de l’Ouest de l’Australie", "ACWDT": "heure d’été du centre-ouest de l’Australie", "GMT": "heure moyenne de Greenwich", "AEDT": "heure d’été de l’Est de l’Australie", "HAT": "heure d’été de Terre-Neuve", "WITA": "heure du Centre indonésien", "MDT": "heure d’été de Macao", "UYT": "heure normale de l’Uruguay", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "ADT": "heure d’été de l’Atlantique", "WIT": "heure de l’Est indonésien", "MST": "heure normale de Macao", "ACDT": "heure d’été du centre de l’Australie", "TMST": "heure d’été du Turkménistan", "AWDT": "heure d’été de l’Ouest de l’Australie", "LHST": "heure normale de Lord Howe", "CHADT": "heure d’été des îles Chatham", "IST": "heure de l’Inde", "PST": "heure normale du Pacifique nord-américain", "UYST": "heure d’été de l’Uruguay", "WEZ": "heure normale d’Europe de l’Ouest", "WESZ": "heure d’été d’Europe de l’Ouest", "ChST": "heure des Chamorro", "COT": "heure normale de Colombie", "LHDT": "heure d’été de Lord Howe", "CLT": "heure normale du Chili", "ECT": "heure de l’Équateur", "MEZ": "heure normale d’Europe centrale", "MESZ": "heure d’été d’Europe centrale", "NZDT": "heure d’été de la Nouvelle-Zélande", "AEST": "heure normale de l’Est de l’Australie", "EST": "heure normale de l’Est nord-américain", "HKST": "heure d’été de Hong Kong", "SRT": "heure du Suriname", "WART": "heure normale de l’Ouest argentin", "WIB": "heure de l’Ouest indonésien", "NZST": "heure normale de la Nouvelle-Zélande", "ACWST": "heure normale du centre-ouest de l’Australie", "WAST": "heure d’été d’Afrique de l’Ouest", "OESZ": "heure d’été d’Europe de l’Est", "TMT": "heure normale du Turkménistan", "JDT": "heure d’été du Japon", "VET": "heure du Venezuela", "COST": "heure d’été de Colombie", "HAST": "heure normale d’Hawaii - Aléoutiennes", "HKT": "heure normale de Hong Kong", "MYT": "heure de la Malaisie", "CDT": "heure d’été du Centre", "CAT": "heure normale d’Afrique centrale", "HNT": "heure normale de Terre-Neuve", "ART": "heure normale d’Argentine", "GYT": "heure du Guyana", "CST": "heure normale du centre nord-américain", "CHAST": "heure normale des îles Chatham", "SAST": "heure normale d’Afrique méridionale", "BT": "heure du Bhoutan", "AKST": "heure normale de l’Alaska", "PDT": "heure d’été du Pacifique", "WAT": "heure normale d’Afrique de l’Ouest", "ACST": "heure normale du centre de l’Australie", "CLST": "heure d’été du Chili", "GFT": "heure de la Guyane française", "ARST": "heure d’été de l’Argentine", "AKDT": "heure d’été de l’Alaska", "AST": "heure normale de l’Atlantique", "SGT": "heure de Singapour", "WARST": "heure d’été de l’Ouest argentin", "JST": "heure normale du Japon", "BOT": "heure de Bolivie", "EDT": "heure d’été de l’Est", "OEZ": "heure normale d’Europe de l’Est"},
+ timezones: map[string]string{"HKT": "heure normale de Hong Kong", "ACWDT": "heure d’été du centre-ouest de l’Australie", "ARST": "heure d’été de l’Argentine", "JST": "heure normale du Japon", "HAST": "heure normale d’Hawaii - Aléoutiennes", "GMT": "heure moyenne de Greenwich", "LHST": "heure normale de Lord Howe", "AST": "heure normale de l’Atlantique", "PST": "heure normale du Pacifique nord-américain", "PDT": "heure d’été du Pacifique", "LHDT": "heure d’été de Lord Howe", "UYT": "heure normale de l’Uruguay", "∅∅∅": "heure d’été de Brasilia", "BOT": "heure de Bolivie", "WEZ": "heure normale d’Europe de l’Ouest", "COT": "heure normale de Colombie", "AKST": "heure normale de l’Alaska", "MESZ": "heure d’été d’Europe centrale", "TMST": "heure d’été du Turkménistan", "AEST": "heure normale de l’Est de l’Australie", "JDT": "heure d’été du Japon", "TMT": "heure normale du Turkménistan", "MDT": "heure d’été des Rocheuses", "UYST": "heure d’été de l’Uruguay", "WIT": "heure de l’Est indonésien", "CHAST": "heure normale des îles Chatham", "IST": "heure de l’Inde", "CAT": "heure normale d’Afrique centrale", "ACDT": "heure d’été du centre de l’Australie", "WART": "heure normale de l’Ouest argentin", "SRT": "heure du Suriname", "MEZ": "heure normale d’Europe centrale", "HNT": "heure normale de Terre-Neuve", "COST": "heure d’été de Colombie", "CDT": "heure d’été du Centre", "GFT": "heure de la Guyane française", "HAT": "heure d’été de Terre-Neuve", "OESZ": "heure d’été d’Europe de l’Est", "AEDT": "heure d’été de l’Est de l’Australie", "MYT": "heure de la Malaisie", "WARST": "heure d’été de l’Ouest argentin", "HKST": "heure d’été de Hong Kong", "BT": "heure du Bhoutan", "ACWST": "heure normale du centre-ouest de l’Australie", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "WAST": "heure d’été d’Afrique de l’Ouest", "CLST": "heure d’été du Chili", "AWST": "heure normale de l’Ouest de l’Australie", "OEZ": "heure normale d’Europe de l’Est", "ACST": "heure normale du centre de l’Australie", "AWDT": "heure d’été de l’Ouest de l’Australie", "EDT": "heure d’été de l’Est", "CLT": "heure normale du Chili", "ECT": "heure de l’Équateur", "VET": "heure du Venezuela", "WAT": "heure normale d’Afrique de l’Ouest", "GYT": "heure du Guyana", "MST": "heure normale des Rocheuses", "AKDT": "heure d’été de l’Alaska", "ART": "heure normale d’Argentine", "NZDT": "heure d’été de la Nouvelle-Zélande", "WESZ": "heure d’été d’Europe de l’Ouest", "SGT": "heure de Singapour", "EAT": "heure normale d’Afrique de l’Est", "ADT": "heure d’été de l’Atlantique", "WITA": "heure du Centre indonésien", "SAST": "heure normale d’Afrique méridionale", "ChST": "heure des Chamorro", "CST": "heure normale du centre nord-américain", "CHADT": "heure d’été des îles Chatham", "EST": "heure normale de l’Est nord-américain", "NZST": "heure normale de la Nouvelle-Zélande", "WIB": "heure de l’Ouest indonésien"},
}
}
diff --git a/fr_ML/fr_ML_test.go b/fr_ML/fr_ML_test.go
new file mode 100644
index 00000000..b7a1c31f
--- /dev/null
+++ b/fr_ML/fr_ML_test.go
@@ -0,0 +1,1120 @@
+package fr_ML
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr_ML"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr_MQ/fr_MQ.go b/fr_MQ/fr_MQ.go
index 3cfae190..ba7d5f0a 100644
--- a/fr_MQ/fr_MQ.go
+++ b/fr_MQ/fr_MQ.go
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"ACWDT": "heure d’été du centre-ouest de l’Australie", "EAT": "heure normale d’Afrique de l’Est", "AKDT": "heure d’été de l’Alaska", "MEZ": "heure normale d’Europe centrale", "UYST": "heure d’été de l’Uruguay", "CHADT": "heure d’été des îles Chatham", "COST": "heure d’été de Colombie", "ARST": "heure d’été de l’Argentine", "JST": "heure normale du Japon", "NZDT": "heure d’été de la Nouvelle-Zélande", "UYT": "heure normale de l’Uruguay", "BT": "heure du Bhoutan", "WITA": "heure du Centre indonésien", "AWST": "heure normale de l’Ouest de l’Australie", "LHDT": "heure d’été de Lord Howe", "WEZ": "heure normale d’Europe de l’Ouest", "AEDT": "heure d’été de l’Est de l’Australie", "CLST": "heure d’été du Chili", "WAT": "heure normale d’Afrique de l’Ouest", "PST": "heure normale du Pacifique nord-américain", "CAT": "heure normale d’Afrique centrale", "AST": "heure normale de l’Atlantique", "ADT": "heure d’été de l’Atlantique", "SGT": "heure de Singapour", "OESZ": "heure d’été d’Europe de l’Est", "HNT": "heure normale de Terre-Neuve", "BOT": "heure de Bolivie", "WARST": "heure d’été de l’Ouest argentin", "TMT": "heure normale du Turkménistan", "PDT": "heure d’été du Pacifique", "GYT": "heure du Guyana", "AEST": "heure normale de l’Est de l’Australie", "SAST": "heure normale d’Afrique méridionale", "HKT": "heure normale de Hong Kong", "HKST": "heure d’été de Hong Kong", "GFT": "heure de la Guyane française", "LHST": "heure normale de Lord Howe", "MST": "heure normale des Rocheuses", "HAT": "heure d’été de Terre-Neuve", "GMT": "heure moyenne de Greenwich", "WESZ": "heure d’été d’Europe de l’Ouest", "ACWST": "heure normale du centre-ouest de l’Australie", "CHAST": "heure normale des îles Chatham", "EDT": "heure d’été de l’Est", "COT": "heure normale de Colombie", "HAST": "heure normale d’Hawaii - Aléoutiennes", "NZST": "heure normale de la Nouvelle-Zélande", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "TMST": "heure d’été du Turkménistan", "∅∅∅": "heure d’été de Brasilia", "ACST": "heure normale du centre de l’Australie", "ART": "heure normale d’Argentine", "CST": "heure normale du centre nord-américain", "ChST": "heure des Chamorro", "WART": "heure normale de l’Ouest argentin", "MESZ": "heure d’été d’Europe centrale", "VET": "heure du Venezuela", "ECT": "heure de l’Équateur", "IST": "heure de l’Inde", "WIB": "heure de l’Ouest indonésien", "JDT": "heure d’été du Japon", "AKST": "heure normale de l’Alaska", "AWDT": "heure d’été de l’Ouest de l’Australie", "MDT": "heure d’été des Rocheuses", "WIT": "heure de l’Est indonésien", "ACDT": "heure d’été du centre de l’Australie", "SRT": "heure du Suriname", "CDT": "heure d’été du Centre", "CLT": "heure normale du Chili", "EST": "heure normale de l’Est nord-américain", "WAST": "heure d’été d’Afrique de l’Ouest", "OEZ": "heure normale d’Europe de l’Est", "MYT": "heure de la Malaisie"},
+ timezones: map[string]string{"CHADT": "heure d’été des îles Chatham", "ECT": "heure de l’Équateur", "COST": "heure d’été de Colombie", "WIB": "heure de l’Ouest indonésien", "LHDT": "heure d’été de Lord Howe", "AST": "heure normale de l’Atlantique", "AWST": "heure normale de l’Ouest de l’Australie", "ARST": "heure d’été de l’Argentine", "JDT": "heure d’été du Japon", "PDT": "heure d’été du Pacifique", "WITA": "heure du Centre indonésien", "HNT": "heure normale de Terre-Neuve", "MST": "heure normale de Macao", "CHAST": "heure normale des îles Chatham", "AKST": "heure normale de l’Alaska", "IST": "heure de l’Inde", "HAST": "heure normale d’Hawaii - Aléoutiennes", "MYT": "heure de la Malaisie", "ACDT": "heure d’été du centre de l’Australie", "MDT": "heure d’été de Macao", "MEZ": "heure normale d’Europe centrale", "NZDT": "heure d’été de la Nouvelle-Zélande", "WESZ": "heure d’été d’Europe de l’Ouest", "TMST": "heure d’été du Turkménistan", "CLT": "heure normale du Chili", "UYST": "heure d’été de l’Uruguay", "WIT": "heure de l’Est indonésien", "AWDT": "heure d’été de l’Ouest de l’Australie", "JST": "heure normale du Japon", "UYT": "heure normale de l’Uruguay", "CST": "heure normale du centre nord-américain", "GFT": "heure de la Guyane française", "HKT": "heure normale de Hong Kong", "VET": "heure du Venezuela", "AKDT": "heure d’été de l’Alaska", "SGT": "heure de Singapour", "GMT": "heure moyenne de Greenwich", "EST": "heure normale de l’Est nord-américain", "EDT": "heure d’été de l’Est", "HAT": "heure d’été de Terre-Neuve", "ChST": "heure des Chamorro", "EAT": "heure normale d’Afrique de l’Est", "SRT": "heure du Suriname", "HKST": "heure d’été de Hong Kong", "ADT": "heure d’été de l’Atlantique", "WEZ": "heure normale d’Europe de l’Ouest", "OEZ": "heure normale d’Europe de l’Est", "LHST": "heure normale de Lord Howe", "CLST": "heure d’été du Chili", "PST": "heure normale du Pacifique nord-américain", "WAST": "heure d’été d’Afrique de l’Ouest", "COT": "heure normale de Colombie", "AEDT": "heure d’été de l’Est de l’Australie", "CDT": "heure d’été du Centre", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "BOT": "heure de Bolivie", "BT": "heure du Bhoutan", "WARST": "heure d’été de l’Ouest argentin", "ACWDT": "heure d’été du centre-ouest de l’Australie", "∅∅∅": "heure d’été de l’Amazonie", "TMT": "heure normale du Turkménistan", "GYT": "heure du Guyana", "WART": "heure normale de l’Ouest argentin", "ACWST": "heure normale du centre-ouest de l’Australie", "AEST": "heure normale de l’Est de l’Australie", "ACST": "heure normale du centre de l’Australie", "SAST": "heure normale d’Afrique méridionale", "CAT": "heure normale d’Afrique centrale", "OESZ": "heure d’été d’Europe de l’Est", "ART": "heure normale d’Argentine", "MESZ": "heure d’été d’Europe centrale", "NZST": "heure normale de la Nouvelle-Zélande", "WAT": "heure normale d’Afrique de l’Ouest"},
}
}
diff --git a/fr_MQ/fr_MQ_test.go b/fr_MQ/fr_MQ_test.go
new file mode 100644
index 00000000..8f2fa4ae
--- /dev/null
+++ b/fr_MQ/fr_MQ_test.go
@@ -0,0 +1,1120 @@
+package fr_MQ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr_MQ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr_MR/fr_MR.go b/fr_MR/fr_MR.go
index f3598517..cc64e6c2 100644
--- a/fr_MR/fr_MR.go
+++ b/fr_MR/fr_MR.go
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"NZST": "heure normale de la Nouvelle-Zélande", "ACWST": "heure normale du centre-ouest de l’Australie", "HAST": "heure normale d’Hawaii - Aléoutiennes", "HKT": "heure normale de Hong Kong", "OESZ": "heure d’été d’Europe de l’Est", "CLST": "heure d’été du Chili", "GMT": "heure moyenne de Greenwich", "OEZ": "heure normale d’Europe de l’Est", "GFT": "heure de la Guyane française", "MDT": "heure d’été de Macao", "ARST": "heure d’été de l’Argentine", "LHST": "heure normale de Lord Howe", "MYT": "heure de la Malaisie", "CST": "heure normale du centre nord-américain", "AST": "heure normale de l’Atlantique", "COST": "heure d’été de Colombie", "WARST": "heure d’été de l’Ouest argentin", "ACDT": "heure d’été du centre de l’Australie", "ART": "heure normale d’Argentine", "AWST": "heure normale de l’Ouest de l’Australie", "CHAST": "heure normale des îles Chatham", "CHADT": "heure d’été des îles Chatham", "EST": "heure normale de l’Est nord-américain", "WIB": "heure de l’Ouest indonésien", "PDT": "heure d’été du Pacifique", "JST": "heure normale du Japon", "MEZ": "heure normale d’Europe centrale", "CAT": "heure normale d’Afrique centrale", "IST": "heure de l’Inde", "AKDT": "heure d’été de l’Alaska", "CLT": "heure normale du Chili", "HAT": "heure d’été de Terre-Neuve", "TMST": "heure d’été du Turkménistan", "MESZ": "heure d’été d’Europe centrale", "AEST": "heure normale de l’Est de l’Australie", "WAST": "heure d’été d’Afrique de l’Ouest", "WART": "heure normale de l’Ouest argentin", "MST": "heure normale de Macao", "SGT": "heure de Singapour", "WAT": "heure normale d’Afrique de l’Ouest", "HNT": "heure normale de Terre-Neuve", "TMT": "heure normale du Turkménistan", "SRT": "heure du Suriname", "BOT": "heure de Bolivie", "UYT": "heure normale de l’Uruguay", "WESZ": "heure d’été d’Europe de l’Ouest", "EDT": "heure d’été de l’Est", "AKST": "heure normale de l’Alaska", "LHDT": "heure d’été de Lord Howe", "NZDT": "heure d’été de la Nouvelle-Zélande", "VET": "heure du Venezuela", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "HKST": "heure d’été de Hong Kong", "CDT": "heure d’été du Centre", "AEDT": "heure d’été de l’Est de l’Australie", "ChST": "heure des Chamorro", "ADT": "heure d’été de l’Atlantique", "WITA": "heure du Centre indonésien", "UYST": "heure d’été de l’Uruguay", "AWDT": "heure d’été de l’Ouest de l’Australie", "ACWDT": "heure d’été du centre-ouest de l’Australie", "COT": "heure normale de Colombie", "ECT": "heure de l’Équateur", "SAST": "heure normale d’Afrique méridionale", "EAT": "heure normale d’Afrique de l’Est", "ACST": "heure normale du centre de l’Australie", "∅∅∅": "heure d’été de l’Amazonie", "PST": "heure normale du Pacifique nord-américain", "JDT": "heure d’été du Japon", "WEZ": "heure normale d’Europe de l’Ouest", "GYT": "heure du Guyana", "BT": "heure du Bhoutan", "WIT": "heure de l’Est indonésien"},
+ timezones: map[string]string{"WAST": "heure d’été d’Afrique de l’Ouest", "LHST": "heure normale de Lord Howe", "CHAST": "heure normale des îles Chatham", "ART": "heure normale d’Argentine", "EDT": "heure d’été de l’Est", "NZDT": "heure d’été de la Nouvelle-Zélande", "CLST": "heure d’été du Chili", "CHADT": "heure d’été des îles Chatham", "AWST": "heure normale de l’Ouest de l’Australie", "AWDT": "heure d’été de l’Ouest de l’Australie", "COST": "heure d’été de Colombie", "WART": "heure normale de l’Ouest argentin", "AEDT": "heure d’été de l’Est de l’Australie", "ChST": "heure des Chamorro", "WIT": "heure de l’Est indonésien", "ARST": "heure d’été de l’Argentine", "JST": "heure normale du Japon", "EST": "heure normale de l’Est nord-américain", "OESZ": "heure d’été d’Europe de l’Est", "AEST": "heure normale de l’Est de l’Australie", "HKST": "heure d’été de Hong Kong", "WITA": "heure du Centre indonésien", "EAT": "heure normale d’Afrique de l’Est", "UYT": "heure normale de l’Uruguay", "WARST": "heure d’été de l’Ouest argentin", "SRT": "heure du Suriname", "ACWST": "heure normale du centre-ouest de l’Australie", "SAST": "heure normale d’Afrique méridionale", "BOT": "heure de Bolivie", "CAT": "heure normale d’Afrique centrale", "UYST": "heure d’été de l’Uruguay", "ACST": "heure normale du centre de l’Australie", "ADT": "heure d’été de l’Atlantique", "HAT": "heure d’été de Terre-Neuve", "TMST": "heure d’été du Turkménistan", "CLT": "heure normale du Chili", "WESZ": "heure d’été d’Europe de l’Ouest", "HNT": "heure normale de Terre-Neuve", "TMT": "heure normale du Turkménistan", "GYT": "heure du Guyana", "AKST": "heure normale de l’Alaska", "PST": "heure normale du Pacifique nord-américain", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "NZST": "heure normale de la Nouvelle-Zélande", "COT": "heure normale de Colombie", "HKT": "heure normale de Hong Kong", "VET": "heure du Venezuela", "AKDT": "heure d’été de l’Alaska", "MEZ": "heure normale d’Europe centrale", "BT": "heure du Bhoutan", "MST": "heure normale des Rocheuses", "CST": "heure normale du centre nord-américain", "CDT": "heure d’été du Centre", "ACDT": "heure d’été du centre de l’Australie", "ECT": "heure de l’Équateur", "AST": "heure normale de l’Atlantique", "JDT": "heure d’été du Japon", "IST": "heure de l’Inde", "MESZ": "heure d’été d’Europe centrale", "SGT": "heure de Singapour", "WAT": "heure normale d’Afrique de l’Ouest", "OEZ": "heure normale d’Europe de l’Est", "GMT": "heure moyenne de Greenwich", "MDT": "heure d’été des Rocheuses", "∅∅∅": "heure d’été de Brasilia", "PDT": "heure d’été du Pacifique", "WEZ": "heure normale d’Europe de l’Ouest", "WIB": "heure de l’Ouest indonésien", "ACWDT": "heure d’été du centre-ouest de l’Australie", "LHDT": "heure d’été de Lord Howe", "MYT": "heure de la Malaisie", "GFT": "heure de la Guyane française", "HAST": "heure normale d’Hawaii - Aléoutiennes"},
}
}
diff --git a/fr_MR/fr_MR_test.go b/fr_MR/fr_MR_test.go
new file mode 100644
index 00000000..aaf8a9c2
--- /dev/null
+++ b/fr_MR/fr_MR_test.go
@@ -0,0 +1,1120 @@
+package fr_MR
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr_MR"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr_MU/fr_MU.go b/fr_MU/fr_MU.go
index a752a805..1c90fe7a 100644
--- a/fr_MU/fr_MU.go
+++ b/fr_MU/fr_MU.go
@@ -49,7 +49,7 @@ func New() locales.Translator {
locale: "fr_MU",
pluralsCardinal: []locales.PluralRule{2, 6},
pluralsOrdinal: []locales.PluralRule{2, 6},
- pluralsRange: []locales.PluralRule{2, 6},
+ pluralsRange: []locales.PluralRule{6, 2},
decimal: "٫",
group: "٬",
minus: "‏−",
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"HADT": "heure d’été d’Hawaii - Aléoutiennes", "WITA": "heure du Centre indonésien", "IST": "heure de l’Inde", "SRT": "heure du Suriname", "NZDT": "heure d’été de la Nouvelle-Zélande", "AEDT": "heure d’été de l’Est de l’Australie", "ADT": "heure d’été de l’Atlantique", "SGT": "heure de Singapour", "HAST": "heure normale d’Hawaii - Aléoutiennes", "HNT": "heure normale de Terre-Neuve", "AKDT": "heure d’été de l’Alaska", "ChST": "heure des Chamorro", "WART": "heure normale de l’Ouest argentin", "CAT": "heure normale d’Afrique centrale", "SAST": "heure normale d’Afrique méridionale", "BT": "heure du Bhoutan", "OEZ": "heure normale d’Europe de l’Est", "OESZ": "heure d’été d’Europe de l’Est", "∅∅∅": "heure d’été des Açores", "UYST": "heure d’été de l’Uruguay", "EDT": "heure d’été de l’Est", "WIT": "heure de l’Est indonésien", "TMT": "heure normale du Turkménistan", "ART": "heure normale d’Argentine", "WIB": "heure de l’Ouest indonésien", "ACST": "heure normale du centre de l’Australie", "CLST": "heure d’été du Chili", "ACWDT": "heure d’été du centre-ouest de l’Australie", "COT": "heure normale de Colombie", "WAST": "heure d’été d’Afrique de l’Ouest", "HKST": "heure d’été de Hong Kong", "GFT": "heure de la Guyane française", "TMST": "heure d’été du Turkménistan", "PDT": "heure d’été du Pacifique", "CDT": "heure d’été du Centre", "UYT": "heure normale de l’Uruguay", "WEZ": "heure normale d’Europe de l’Ouest", "WESZ": "heure d’été d’Europe de l’Ouest", "AST": "heure normale de l’Atlantique", "WARST": "heure d’été de l’Ouest argentin", "AKST": "heure normale de l’Alaska", "CST": "heure normale du centre nord-américain", "NZST": "heure normale de la Nouvelle-Zélande", "BOT": "heure de Bolivie", "ECT": "heure de l’Équateur", "MYT": "heure de la Malaisie", "MESZ": "heure d’été d’Europe centrale", "VET": "heure du Venezuela", "EST": "heure normale de l’Est nord-américain", "LHDT": "heure d’été de Lord Howe", "GYT": "heure du Guyana", "GMT": "heure moyenne de Greenwich", "EAT": "heure normale d’Afrique de l’Est", "JST": "heure normale du Japon", "JDT": "heure d’été du Japon", "LHST": "heure normale de Lord Howe", "CLT": "heure normale du Chili", "HKT": "heure normale de Hong Kong", "ACWST": "heure normale du centre-ouest de l’Australie", "COST": "heure d’été de Colombie", "WAT": "heure normale d’Afrique de l’Ouest", "ARST": "heure d’été de l’Argentine", "AWST": "heure normale de l’Ouest de l’Australie", "CHAST": "heure normale des îles Chatham", "AEST": "heure normale de l’Est de l’Australie", "MST": "heure normale des Rocheuses", "HAT": "heure d’été de Terre-Neuve", "ACDT": "heure d’été du centre de l’Australie", "PST": "heure normale du Pacifique nord-américain", "AWDT": "heure d’été de l’Ouest de l’Australie", "MEZ": "heure normale d’Europe centrale", "CHADT": "heure d’été des îles Chatham", "MDT": "heure d’été des Rocheuses"},
+ timezones: map[string]string{"WESZ": "heure d’été d’Europe de l’Ouest", "WART": "heure normale de l’Ouest argentin", "HKT": "heure normale de Hong Kong", "HKST": "heure d’été de Hong Kong", "ARST": "heure d’été de l’Argentine", "SGT": "heure de Singapour", "BT": "heure du Bhoutan", "ACDT": "heure d’été du centre de l’Australie", "PDT": "heure d’été du Pacifique", "MEZ": "heure normale d’Europe centrale", "CAT": "heure normale d’Afrique centrale", "ACST": "heure normale du centre de l’Australie", "CLST": "heure d’été du Chili", "GFT": "heure de la Guyane française", "NZST": "heure normale de la Nouvelle-Zélande", "COST": "heure d’été de Colombie", "ChST": "heure des Chamorro", "TMT": "heure normale du Turkménistan", "CST": "heure normale du centre nord-américain", "JST": "heure normale du Japon", "AST": "heure normale de l’Atlantique", "BOT": "heure de Bolivie", "JDT": "heure d’été du Japon", "CLT": "heure normale du Chili", "MESZ": "heure d’été d’Europe centrale", "TMST": "heure d’été du Turkménistan", "OEZ": "heure normale d’Europe de l’Est", "GMT": "heure moyenne de Greenwich", "UYST": "heure d’été de l’Uruguay", "MDT": "heure d’été de Macao", "WITA": "heure du Centre indonésien", "AWDT": "heure d’été de l’Ouest de l’Australie", "WIT": "heure de l’Est indonésien", "EAT": "heure normale d’Afrique de l’Est", "WARST": "heure d’été de l’Ouest argentin", "WAT": "heure normale d’Afrique de l’Ouest", "WEZ": "heure normale d’Europe de l’Ouest", "OESZ": "heure d’été d’Europe de l’Est", "LHDT": "heure d’été de Lord Howe", "CHAST": "heure normale des îles Chatham", "AWST": "heure normale de l’Ouest de l’Australie", "COT": "heure normale de Colombie", "LHST": "heure normale de Lord Howe", "SAST": "heure normale d’Afrique méridionale", "EST": "heure normale de l’Est nord-américain", "HNT": "heure normale de Terre-Neuve", "IST": "heure de l’Inde", "EDT": "heure d’été de l’Est", "GYT": "heure du Guyana", "MYT": "heure de la Malaisie", "SRT": "heure du Suriname", "NZDT": "heure d’été de la Nouvelle-Zélande", "WAST": "heure d’été d’Afrique de l’Ouest", "AEST": "heure normale de l’Est de l’Australie", "ECT": "heure de l’Équateur", "AEDT": "heure d’été de l’Est de l’Australie", "PST": "heure normale du Pacifique nord-américain", "WIB": "heure de l’Ouest indonésien", "CHADT": "heure d’été des îles Chatham", "AKDT": "heure d’été de l’Alaska", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "HAT": "heure d’été de Terre-Neuve", "CDT": "heure d’été du Centre", "ADT": "heure d’été de l’Atlantique", "ACWDT": "heure d’été du centre-ouest de l’Australie", "HAST": "heure normale d’Hawaii - Aléoutiennes", "ACWST": "heure normale du centre-ouest de l’Australie", "∅∅∅": "heure d’été de l’Amazonie", "UYT": "heure normale de l’Uruguay", "ART": "heure normale d’Argentine", "MST": "heure normale de Macao", "VET": "heure du Venezuela", "AKST": "heure normale de l’Alaska"},
}
}
diff --git a/fr_MU/fr_MU_test.go b/fr_MU/fr_MU_test.go
new file mode 100644
index 00000000..dbcb9534
--- /dev/null
+++ b/fr_MU/fr_MU_test.go
@@ -0,0 +1,1120 @@
+package fr_MU
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr_MU"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr_NC/fr_NC.go b/fr_NC/fr_NC.go
index 02023b11..d9c67496 100644
--- a/fr_NC/fr_NC.go
+++ b/fr_NC/fr_NC.go
@@ -49,7 +49,7 @@ func New() locales.Translator {
locale: "fr_NC",
pluralsCardinal: []locales.PluralRule{2, 6},
pluralsOrdinal: []locales.PluralRule{2, 6},
- pluralsRange: []locales.PluralRule{6, 2},
+ pluralsRange: []locales.PluralRule{2, 6},
decimal: "٫",
group: "٬",
minus: "‏−",
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"UYST": "heure d’été de l’Uruguay", "VET": "heure du Venezuela", "BOT": "heure de Bolivie", "ChST": "heure des Chamorro", "TMST": "heure d’été du Turkménistan", "AWST": "heure normale de l’Ouest de l’Australie", "HNT": "heure normale de Terre-Neuve", "JST": "heure normale du Japon", "MST": "heure normale des Rocheuses", "CHADT": "heure d’été des îles Chatham", "EDT": "heure d’été de l’Est", "HAST": "heure normale d’Hawaii - Aléoutiennes", "WARST": "heure d’été de l’Ouest argentin", "WIT": "heure de l’Est indonésien", "AKST": "heure normale de l’Alaska", "NZST": "heure normale de la Nouvelle-Zélande", "WESZ": "heure d’été d’Europe de l’Ouest", "ECT": "heure de l’Équateur", "∅∅∅": "heure d’été de Brasilia", "MYT": "heure de la Malaisie", "AKDT": "heure d’été de l’Alaska", "HKT": "heure normale de Hong Kong", "HKST": "heure d’été de Hong Kong", "OEZ": "heure normale d’Europe de l’Est", "TMT": "heure normale du Turkménistan", "SRT": "heure du Suriname", "CHAST": "heure normale des îles Chatham", "ACWDT": "heure d’été du centre-ouest de l’Australie", "ADT": "heure d’été de l’Atlantique", "GMT": "heure moyenne de Greenwich", "AST": "heure normale de l’Atlantique", "SAST": "heure normale d’Afrique méridionale", "ARST": "heure d’été de l’Argentine", "PST": "heure normale du Pacifique nord-américain", "WAST": "heure d’été d’Afrique de l’Ouest", "HAT": "heure d’été de Terre-Neuve", "WIB": "heure de l’Ouest indonésien", "ACDT": "heure d’été du centre de l’Australie", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "BT": "heure du Bhoutan", "JDT": "heure d’été du Japon", "OESZ": "heure d’été d’Europe de l’Est", "MEZ": "heure normale d’Europe centrale", "WEZ": "heure normale d’Europe de l’Ouest", "COST": "heure d’été de Colombie", "WART": "heure normale de l’Ouest argentin", "UYT": "heure normale de l’Uruguay", "COT": "heure normale de Colombie", "GYT": "heure du Guyana", "EAT": "heure normale d’Afrique de l’Est", "MESZ": "heure d’été d’Europe centrale", "MDT": "heure d’été des Rocheuses", "CAT": "heure normale d’Afrique centrale", "WAT": "heure normale d’Afrique de l’Ouest", "CST": "heure normale du centre nord-américain", "AEST": "heure normale de l’Est de l’Australie", "ACST": "heure normale du centre de l’Australie", "AWDT": "heure d’été de l’Ouest de l’Australie", "IST": "heure de l’Inde", "ART": "heure normale d’Argentine", "LHST": "heure normale de Lord Howe", "LHDT": "heure d’été de Lord Howe", "CLST": "heure d’été du Chili", "ACWST": "heure normale du centre-ouest de l’Australie", "SGT": "heure de Singapour", "GFT": "heure de la Guyane française", "PDT": "heure d’été du Pacifique", "EST": "heure normale de l’Est nord-américain", "WITA": "heure du Centre indonésien", "NZDT": "heure d’été de la Nouvelle-Zélande", "CDT": "heure d’été du Centre", "AEDT": "heure d’été de l’Est de l’Australie", "CLT": "heure normale du Chili"},
+ timezones: map[string]string{"COT": "heure normale de Colombie", "GMT": "heure moyenne de Greenwich", "MDT": "heure d’été des Rocheuses", "ARST": "heure d’été de l’Argentine", "EDT": "heure d’été de l’Est", "HAT": "heure d’été de Terre-Neuve", "OESZ": "heure d’été d’Europe de l’Est", "CDT": "heure d’été du Centre", "ACST": "heure normale du centre de l’Australie", "SRT": "heure du Suriname", "GFT": "heure de la Guyane française", "WEZ": "heure normale d’Europe de l’Ouest", "AEDT": "heure d’été de l’Est de l’Australie", "MST": "heure normale des Rocheuses", "BT": "heure du Bhoutan", "AKDT": "heure d’été de l’Alaska", "AWST": "heure normale de l’Ouest de l’Australie", "AWDT": "heure d’été de l’Ouest de l’Australie", "ART": "heure normale d’Argentine", "NZST": "heure normale de la Nouvelle-Zélande", "NZDT": "heure d’été de la Nouvelle-Zélande", "EAT": "heure normale d’Afrique de l’Est", "WITA": "heure du Centre indonésien", "∅∅∅": "heure d’été de l’Amazonie", "TMST": "heure d’été du Turkménistan", "CHADT": "heure d’été des îles Chatham", "WAST": "heure d’été d’Afrique de l’Ouest", "MYT": "heure de la Malaisie", "JDT": "heure d’été du Japon", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "BOT": "heure de Bolivie", "COST": "heure d’été de Colombie", "EST": "heure normale de l’Est nord-américain", "HKST": "heure d’été de Hong Kong", "AKST": "heure normale de l’Alaska", "WARST": "heure d’été de l’Ouest argentin", "WIB": "heure de l’Ouest indonésien", "CAT": "heure normale d’Afrique centrale", "HNT": "heure normale de Terre-Neuve", "AST": "heure normale de l’Atlantique", "PDT": "heure d’été du Pacifique", "WAT": "heure normale d’Afrique de l’Ouest", "WART": "heure normale de l’Ouest argentin", "ACWST": "heure normale du centre-ouest de l’Australie", "ACWDT": "heure d’été du centre-ouest de l’Australie", "MESZ": "heure d’été d’Europe centrale", "AEST": "heure normale de l’Est de l’Australie", "ECT": "heure de l’Équateur", "UYST": "heure d’été de l’Uruguay", "HKT": "heure normale de Hong Kong", "ADT": "heure d’été de l’Atlantique", "PST": "heure normale du Pacifique nord-américain", "TMT": "heure normale du Turkménistan", "WESZ": "heure d’été d’Europe de l’Ouest", "LHST": "heure normale de Lord Howe", "LHDT": "heure d’été de Lord Howe", "ACDT": "heure d’été du centre de l’Australie", "VET": "heure du Venezuela", "OEZ": "heure normale d’Europe de l’Est", "CLST": "heure d’été du Chili", "WIT": "heure de l’Est indonésien", "CST": "heure normale du centre nord-américain", "CHAST": "heure normale des îles Chatham", "JST": "heure normale du Japon", "ChST": "heure des Chamorro", "GYT": "heure du Guyana", "UYT": "heure normale de l’Uruguay", "SAST": "heure normale d’Afrique méridionale", "IST": "heure de l’Inde", "MEZ": "heure normale d’Europe centrale", "HAST": "heure normale d’Hawaii - Aléoutiennes", "SGT": "heure de Singapour", "CLT": "heure normale du Chili"},
}
}
diff --git a/fr_NC/fr_NC_test.go b/fr_NC/fr_NC_test.go
new file mode 100644
index 00000000..64fa4a3f
--- /dev/null
+++ b/fr_NC/fr_NC_test.go
@@ -0,0 +1,1120 @@
+package fr_NC
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr_NC"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr_NE/fr_NE.go b/fr_NE/fr_NE.go
index efa9339a..57d14747 100644
--- a/fr_NE/fr_NE.go
+++ b/fr_NE/fr_NE.go
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"∅∅∅": "heure d’été de Brasilia", "ART": "heure normale d’Argentine", "JDT": "heure d’été du Japon", "UYST": "heure d’été de l’Uruguay", "CLST": "heure d’été du Chili", "AST": "heure normale de l’Atlantique", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "TMT": "heure normale du Turkménistan", "MYT": "heure de la Malaisie", "UYT": "heure normale de l’Uruguay", "WESZ": "heure d’été d’Europe de l’Ouest", "WAST": "heure d’été d’Afrique de l’Ouest", "WART": "heure normale de l’Ouest argentin", "HNT": "heure normale de Terre-Neuve", "TMST": "heure d’été du Turkménistan", "NZDT": "heure d’été de la Nouvelle-Zélande", "IST": "heure de l’Inde", "CHAST": "heure normale des îles Chatham", "HKT": "heure normale de Hong Kong", "BOT": "heure de Bolivie", "CHADT": "heure d’été des îles Chatham", "COST": "heure d’été de Colombie", "EAT": "heure normale d’Afrique de l’Est", "SRT": "heure du Suriname", "AWDT": "heure d’été de l’Ouest de l’Australie", "LHDT": "heure d’été de Lord Howe", "OESZ": "heure d’été d’Europe de l’Est", "MST": "heure normale de Macao", "ACST": "heure normale du centre de l’Australie", "VET": "heure du Venezuela", "ChST": "heure des Chamorro", "PST": "heure normale du Pacifique nord-américain", "CDT": "heure d’été du Centre", "NZST": "heure normale de la Nouvelle-Zélande", "MEZ": "heure normale d’Europe centrale", "CAT": "heure normale d’Afrique centrale", "HAST": "heure normale d’Hawaii - Aléoutiennes", "BT": "heure du Bhoutan", "GFT": "heure de la Guyane française", "ACDT": "heure d’été du centre de l’Australie", "CST": "heure normale du centre nord-américain", "WARST": "heure d’été de l’Ouest argentin", "OEZ": "heure normale d’Europe de l’Est", "GYT": "heure du Guyana", "AEST": "heure normale de l’Est de l’Australie", "ADT": "heure d’été de l’Atlantique", "HKST": "heure d’été de Hong Kong", "AKDT": "heure d’été de l’Alaska", "AWST": "heure normale de l’Ouest de l’Australie", "ACWST": "heure normale du centre-ouest de l’Australie", "WEZ": "heure normale d’Europe de l’Ouest", "COT": "heure normale de Colombie", "SGT": "heure de Singapour", "WIT": "heure de l’Est indonésien", "WITA": "heure du Centre indonésien", "ARST": "heure d’été de l’Argentine", "CLT": "heure normale du Chili", "ECT": "heure de l’Équateur", "SAST": "heure normale d’Afrique méridionale", "WIB": "heure de l’Ouest indonésien", "GMT": "heure moyenne de Greenwich", "EDT": "heure d’été de l’Est", "HAT": "heure d’été de Terre-Neuve", "MDT": "heure d’été de Macao", "AKST": "heure normale de l’Alaska", "LHST": "heure normale de Lord Howe", "AEDT": "heure d’été de l’Est de l’Australie", "EST": "heure normale de l’Est nord-américain", "WAT": "heure normale d’Afrique de l’Ouest", "JST": "heure normale du Japon", "PDT": "heure d’été du Pacifique", "MESZ": "heure d’été d’Europe centrale", "ACWDT": "heure d’été du centre-ouest de l’Australie"},
+ timezones: map[string]string{"ART": "heure normale d’Argentine", "GYT": "heure du Guyana", "ACST": "heure normale du centre de l’Australie", "VET": "heure du Venezuela", "MESZ": "heure d’été d’Europe centrale", "∅∅∅": "heure d’été de l’Amazonie", "TMT": "heure normale du Turkménistan", "OEZ": "heure normale d’Europe de l’Est", "WART": "heure normale de l’Ouest argentin", "WARST": "heure d’été de l’Ouest argentin", "SRT": "heure du Suriname", "CHADT": "heure d’été des îles Chatham", "ARST": "heure d’été de l’Argentine", "NZDT": "heure d’été de la Nouvelle-Zélande", "COT": "heure normale de Colombie", "ACWDT": "heure d’été du centre-ouest de l’Australie", "AWDT": "heure d’été de l’Ouest de l’Australie", "WAST": "heure d’été d’Afrique de l’Ouest", "OESZ": "heure d’été d’Europe de l’Est", "CLST": "heure d’été du Chili", "AKDT": "heure d’été de l’Alaska", "MEZ": "heure normale d’Europe centrale", "ACDT": "heure d’été du centre de l’Australie", "JDT": "heure d’été du Japon", "PDT": "heure d’été du Pacifique", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "WIB": "heure de l’Ouest indonésien", "WIT": "heure de l’Est indonésien", "MYT": "heure de la Malaisie", "GFT": "heure de la Guyane française", "MST": "heure normale de Macao", "AEST": "heure normale de l’Est de l’Australie", "AEDT": "heure d’été de l’Est de l’Australie", "CLT": "heure normale du Chili", "WEZ": "heure normale d’Europe de l’Ouest", "HAST": "heure normale d’Hawaii - Aléoutiennes", "LHDT": "heure d’été de Lord Howe", "BOT": "heure de Bolivie", "ACWST": "heure normale du centre-ouest de l’Australie", "AWST": "heure normale de l’Ouest de l’Australie", "CHAST": "heure normale des îles Chatham", "WESZ": "heure d’été d’Europe de l’Ouest", "GMT": "heure moyenne de Greenwich", "UYT": "heure normale de l’Uruguay", "CST": "heure normale du centre nord-américain", "SAST": "heure normale d’Afrique méridionale", "AKST": "heure normale de l’Alaska", "COST": "heure d’été de Colombie", "EAT": "heure normale d’Afrique de l’Est", "MDT": "heure d’été de Macao", "CAT": "heure normale d’Afrique centrale", "EST": "heure normale de l’Est nord-américain", "NZST": "heure normale de la Nouvelle-Zélande", "HAT": "heure d’été de Terre-Neuve", "SGT": "heure de Singapour", "BT": "heure du Bhoutan", "UYST": "heure d’été de l’Uruguay", "CDT": "heure d’été du Centre", "IST": "heure de l’Inde", "EDT": "heure d’été de l’Est", "PST": "heure normale du Pacifique nord-américain", "WAT": "heure normale d’Afrique de l’Ouest", "HNT": "heure normale de Terre-Neuve", "ChST": "heure des Chamorro", "ECT": "heure de l’Équateur", "HKST": "heure d’été de Hong Kong", "AST": "heure normale de l’Atlantique", "ADT": "heure d’été de l’Atlantique", "WITA": "heure du Centre indonésien", "JST": "heure normale du Japon", "TMST": "heure d’été du Turkménistan", "LHST": "heure normale de Lord Howe", "HKT": "heure normale de Hong Kong"},
}
}
diff --git a/fr_NE/fr_NE_test.go b/fr_NE/fr_NE_test.go
new file mode 100644
index 00000000..88926a83
--- /dev/null
+++ b/fr_NE/fr_NE_test.go
@@ -0,0 +1,1120 @@
+package fr_NE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr_NE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr_PF/fr_PF.go b/fr_PF/fr_PF.go
index 3fd7f026..7540a466 100644
--- a/fr_PF/fr_PF.go
+++ b/fr_PF/fr_PF.go
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"AWDT": "heure d’été de l’Ouest de l’Australie", "CHADT": "heure d’été des îles Chatham", "WEZ": "heure normale d’Europe de l’Ouest", "AEST": "heure normale de l’Est de l’Australie", "WART": "heure normale de l’Ouest argentin", "SRT": "heure du Suriname", "CLT": "heure normale du Chili", "WIB": "heure de l’Ouest indonésien", "CAT": "heure normale d’Afrique centrale", "BT": "heure du Bhoutan", "AKDT": "heure d’été de l’Alaska", "LHDT": "heure d’été de Lord Howe", "BOT": "heure de Bolivie", "COT": "heure normale de Colombie", "ADT": "heure d’été de l’Atlantique", "ACST": "heure normale du centre de l’Australie", "AKST": "heure normale de l’Alaska", "ChST": "heure des Chamorro", "AST": "heure normale de l’Atlantique", "UYT": "heure normale de l’Uruguay", "VET": "heure du Venezuela", "WIT": "heure de l’Est indonésien", "HAT": "heure d’été de Terre-Neuve", "∅∅∅": "heure d’été de l’Amazonie", "MYT": "heure de la Malaisie", "SAST": "heure normale d’Afrique méridionale", "NZST": "heure normale de la Nouvelle-Zélande", "WESZ": "heure d’été d’Europe de l’Ouest", "WARST": "heure d’été de l’Ouest argentin", "OEZ": "heure normale d’Europe de l’Est", "GMT": "heure moyenne de Greenwich", "TMT": "heure normale du Turkménistan", "TMST": "heure d’été du Turkménistan", "GFT": "heure de la Guyane française", "EDT": "heure d’été de l’Est", "ECT": "heure de l’Équateur", "CHAST": "heure normale des îles Chatham", "GYT": "heure du Guyana", "CST": "heure normale du centre nord-américain", "LHST": "heure normale de Lord Howe", "MEZ": "heure normale d’Europe centrale", "COST": "heure d’été de Colombie", "MDT": "heure d’été de Macao", "ACDT": "heure d’été du centre de l’Australie", "NZDT": "heure d’été de la Nouvelle-Zélande", "EST": "heure normale de l’Est nord-américain", "SGT": "heure de Singapour", "UYST": "heure d’été de l’Uruguay", "MESZ": "heure d’été d’Europe centrale", "CDT": "heure d’été du Centre", "HAST": "heure normale d’Hawaii - Aléoutiennes", "WAT": "heure normale d’Afrique de l’Ouest", "JST": "heure normale du Japon", "PDT": "heure d’été du Pacifique", "CLST": "heure d’été du Chili", "ACWST": "heure normale du centre-ouest de l’Australie", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "WAST": "heure d’été d’Afrique de l’Ouest", "HKT": "heure normale de Hong Kong", "WITA": "heure du Centre indonésien", "MST": "heure normale de Macao", "PST": "heure normale du Pacifique nord-américain", "OESZ": "heure d’été d’Europe de l’Est", "HNT": "heure normale de Terre-Neuve", "JDT": "heure d’été du Japon", "ACWDT": "heure d’été du centre-ouest de l’Australie", "ARST": "heure d’été de l’Argentine", "AWST": "heure normale de l’Ouest de l’Australie", "AEDT": "heure d’été de l’Est de l’Australie", "HKST": "heure d’été de Hong Kong", "IST": "heure de l’Inde", "EAT": "heure normale d’Afrique de l’Est", "ART": "heure normale d’Argentine"},
+ timezones: map[string]string{"ADT": "heure d’été de l’Atlantique", "OESZ": "heure d’été d’Europe de l’Est", "UYT": "heure normale de l’Uruguay", "MYT": "heure de la Malaisie", "CHAST": "heure normale des îles Chatham", "WIB": "heure de l’Ouest indonésien", "HAT": "heure d’été de Terre-Neuve", "AKST": "heure normale de l’Alaska", "AWDT": "heure d’été de l’Ouest de l’Australie", "COT": "heure normale de Colombie", "PDT": "heure d’été du Pacifique", "WAT": "heure normale d’Afrique de l’Ouest", "BT": "heure du Bhoutan", "AST": "heure normale de l’Atlantique", "ACWST": "heure normale du centre-ouest de l’Australie", "GFT": "heure de la Guyane française", "CLT": "heure normale du Chili", "UYST": "heure d’été de l’Uruguay", "CDT": "heure d’été du Centre", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "MEZ": "heure normale d’Europe centrale", "WEZ": "heure normale d’Europe de l’Ouest", "MDT": "heure d’été des Rocheuses", "∅∅∅": "heure d’été de Brasilia", "HAST": "heure normale d’Hawaii - Aléoutiennes", "ARST": "heure d’été de l’Argentine", "IST": "heure de l’Inde", "LHDT": "heure d’été de Lord Howe", "CST": "heure normale du centre nord-américain", "HKST": "heure d’été de Hong Kong", "BOT": "heure de Bolivie", "SAST": "heure normale d’Afrique méridionale", "WESZ": "heure d’été d’Europe de l’Ouest", "VET": "heure du Venezuela", "JDT": "heure d’été du Japon", "AKDT": "heure d’été de l’Alaska", "NZDT": "heure d’été de la Nouvelle-Zélande", "EDT": "heure d’été de l’Est", "TMT": "heure normale du Turkménistan", "CAT": "heure normale d’Afrique centrale", "ACDT": "heure d’été du centre de l’Australie", "ECT": "heure de l’Équateur", "NZST": "heure normale de la Nouvelle-Zélande", "ACWDT": "heure d’été du centre-ouest de l’Australie", "HNT": "heure normale de Terre-Neuve", "AEDT": "heure d’été de l’Est de l’Australie", "EST": "heure normale de l’Est nord-américain", "MESZ": "heure d’été d’Europe centrale", "SGT": "heure de Singapour", "GMT": "heure moyenne de Greenwich", "GYT": "heure du Guyana", "CLST": "heure d’été du Chili", "WIT": "heure de l’Est indonésien", "SRT": "heure du Suriname", "WITA": "heure du Centre indonésien", "MST": "heure normale des Rocheuses", "WART": "heure normale de l’Ouest argentin", "HKT": "heure normale de Hong Kong", "WARST": "heure d’été de l’Ouest argentin", "JST": "heure normale du Japon", "COST": "heure d’été de Colombie", "ChST": "heure des Chamorro", "LHST": "heure normale de Lord Howe", "ACST": "heure normale du centre de l’Australie", "CHADT": "heure d’été des îles Chatham", "TMST": "heure d’été du Turkménistan", "AEST": "heure normale de l’Est de l’Australie", "AWST": "heure normale de l’Ouest de l’Australie", "ART": "heure normale d’Argentine", "PST": "heure normale du Pacifique nord-américain", "EAT": "heure normale d’Afrique de l’Est", "WAST": "heure d’été d’Afrique de l’Ouest", "OEZ": "heure normale d’Europe de l’Est"},
}
}
diff --git a/fr_PF/fr_PF_test.go b/fr_PF/fr_PF_test.go
new file mode 100644
index 00000000..d6586f3c
--- /dev/null
+++ b/fr_PF/fr_PF_test.go
@@ -0,0 +1,1120 @@
+package fr_PF
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr_PF"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr_PM/fr_PM.go b/fr_PM/fr_PM.go
index 3ece46ed..69369fbc 100644
--- a/fr_PM/fr_PM.go
+++ b/fr_PM/fr_PM.go
@@ -49,7 +49,7 @@ func New() locales.Translator {
locale: "fr_PM",
pluralsCardinal: []locales.PluralRule{2, 6},
pluralsOrdinal: []locales.PluralRule{2, 6},
- pluralsRange: []locales.PluralRule{6, 2},
+ pluralsRange: []locales.PluralRule{2, 6},
decimal: "٫",
group: "٬",
minus: "‏−",
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"∅∅∅": "heure d’été de l’Amazonie", "ACWST": "heure normale du centre-ouest de l’Australie", "ACWDT": "heure d’été du centre-ouest de l’Australie", "VET": "heure du Venezuela", "WARST": "heure d’été de l’Ouest argentin", "WIB": "heure de l’Ouest indonésien", "HAT": "heure d’été de Terre-Neuve", "EAT": "heure normale d’Afrique de l’Est", "SRT": "heure du Suriname", "AKST": "heure normale de l’Alaska", "AWDT": "heure d’été de l’Ouest de l’Australie", "TMT": "heure normale du Turkménistan", "JDT": "heure d’été du Japon", "PDT": "heure d’été du Pacifique", "CST": "heure normale du centre nord-américain", "NZDT": "heure d’été de la Nouvelle-Zélande", "WEZ": "heure normale d’Europe de l’Ouest", "WAST": "heure d’été d’Afrique de l’Ouest", "MST": "heure normale de Macao", "JST": "heure normale du Japon", "AKDT": "heure d’été de l’Alaska", "LHDT": "heure d’été de Lord Howe", "ECT": "heure de l’Équateur", "AST": "heure normale de l’Atlantique", "EDT": "heure d’été de l’Est", "OEZ": "heure normale d’Europe de l’Est", "ART": "heure normale d’Argentine", "ARST": "heure d’été de l’Argentine", "TMST": "heure d’été du Turkménistan", "MESZ": "heure d’été d’Europe centrale", "NZST": "heure normale de la Nouvelle-Zélande", "HNT": "heure normale de Terre-Neuve", "ACST": "heure normale du centre de l’Australie", "MYT": "heure de la Malaisie", "BOT": "heure de Bolivie", "UYST": "heure d’été de l’Uruguay", "AEST": "heure normale de l’Est de l’Australie", "OESZ": "heure d’été d’Europe de l’Est", "GYT": "heure du Guyana", "CLT": "heure normale du Chili", "CLST": "heure d’été du Chili", "CHAST": "heure normale des îles Chatham", "ADT": "heure d’été de l’Atlantique", "AEDT": "heure d’été de l’Est de l’Australie", "GMT": "heure moyenne de Greenwich", "MDT": "heure d’été de Macao", "HAST": "heure normale d’Hawaii - Aléoutiennes", "HKST": "heure d’été de Hong Kong", "GFT": "heure de la Guyane française", "ACDT": "heure d’été du centre de l’Australie", "ChST": "heure des Chamorro", "EST": "heure normale de l’Est nord-américain", "SAST": "heure normale d’Afrique méridionale", "WART": "heure normale de l’Ouest argentin", "LHST": "heure normale de Lord Howe", "CHADT": "heure d’été des îles Chatham", "WIT": "heure de l’Est indonésien", "PST": "heure normale du Pacifique nord-américain", "COST": "heure d’été de Colombie", "WAT": "heure normale d’Afrique de l’Ouest", "HKT": "heure normale de Hong Kong", "IST": "heure de l’Inde", "UYT": "heure normale de l’Uruguay", "WESZ": "heure d’été d’Europe de l’Ouest", "CAT": "heure normale d’Afrique centrale", "COT": "heure normale de Colombie", "BT": "heure du Bhoutan", "WITA": "heure du Centre indonésien", "AWST": "heure normale de l’Ouest de l’Australie", "CDT": "heure d’été du Centre", "MEZ": "heure normale d’Europe centrale", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "SGT": "heure de Singapour"},
+ timezones: map[string]string{"LHDT": "heure d’été de Lord Howe", "MDT": "heure d’été des Rocheuses", "ACST": "heure normale du centre de l’Australie", "ACDT": "heure d’été du centre de l’Australie", "WARST": "heure d’été de l’Ouest argentin", "SRT": "heure du Suriname", "MYT": "heure de la Malaisie", "LHST": "heure normale de Lord Howe", "CAT": "heure normale d’Afrique centrale", "WESZ": "heure d’été d’Europe de l’Ouest", "GFT": "heure de la Guyane française", "NZST": "heure normale de la Nouvelle-Zélande", "BOT": "heure de Bolivie", "EST": "heure normale de l’Est nord-américain", "GMT": "heure moyenne de Greenwich", "UYT": "heure normale de l’Uruguay", "EAT": "heure normale d’Afrique de l’Est", "GYT": "heure du Guyana", "PDT": "heure d’été du Pacifique", "HAT": "heure d’été de Terre-Neuve", "WIB": "heure de l’Ouest indonésien", "AEST": "heure normale de l’Est de l’Australie", "CST": "heure normale du centre nord-américain", "EDT": "heure d’été de l’Est", "AST": "heure normale de l’Atlantique", "MEZ": "heure normale d’Europe centrale", "SAST": "heure normale d’Afrique méridionale", "IST": "heure de l’Inde", "SGT": "heure de Singapour", "TMST": "heure d’été du Turkménistan", "∅∅∅": "heure d’été de Brasilia", "ARST": "heure d’été de l’Argentine", "HNT": "heure normale de Terre-Neuve", "WAT": "heure normale d’Afrique de l’Ouest", "AEDT": "heure d’été de l’Est de l’Australie", "UYST": "heure d’été de l’Uruguay", "NZDT": "heure d’été de la Nouvelle-Zélande", "COT": "heure normale de Colombie", "OESZ": "heure d’été d’Europe de l’Est", "ECT": "heure de l’Équateur", "ART": "heure normale d’Argentine", "AWST": "heure normale de l’Ouest de l’Australie", "BT": "heure du Bhoutan", "HKT": "heure normale de Hong Kong", "HAST": "heure normale d’Hawaii - Aléoutiennes", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "COST": "heure d’été de Colombie", "TMT": "heure normale du Turkménistan", "CLST": "heure d’été du Chili", "CDT": "heure d’été du Centre", "PST": "heure normale du Pacifique nord-américain", "VET": "heure du Venezuela", "JDT": "heure d’été du Japon", "MESZ": "heure d’été d’Europe centrale", "OEZ": "heure normale d’Europe de l’Est", "WIT": "heure de l’Est indonésien", "MST": "heure normale des Rocheuses", "ACWDT": "heure d’été du centre-ouest de l’Australie", "ChST": "heure des Chamorro", "CHAST": "heure normale des îles Chatham", "ADT": "heure d’été de l’Atlantique", "JST": "heure normale du Japon", "ACWST": "heure normale du centre-ouest de l’Australie", "CLT": "heure normale du Chili", "CHADT": "heure d’été des îles Chatham", "WITA": "heure du Centre indonésien", "WAST": "heure d’été d’Afrique de l’Ouest", "AKST": "heure normale de l’Alaska", "AKDT": "heure d’été de l’Alaska", "AWDT": "heure d’été de l’Ouest de l’Australie", "WEZ": "heure normale d’Europe de l’Ouest", "WART": "heure normale de l’Ouest argentin", "HKST": "heure d’été de Hong Kong"},
}
}
diff --git a/fr_PM/fr_PM_test.go b/fr_PM/fr_PM_test.go
new file mode 100644
index 00000000..e648a102
--- /dev/null
+++ b/fr_PM/fr_PM_test.go
@@ -0,0 +1,1120 @@
+package fr_PM
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr_PM"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr_RE/fr_RE.go b/fr_RE/fr_RE.go
index 889440f9..5bf48bdd 100644
--- a/fr_RE/fr_RE.go
+++ b/fr_RE/fr_RE.go
@@ -49,7 +49,7 @@ func New() locales.Translator {
locale: "fr_RE",
pluralsCardinal: []locales.PluralRule{2, 6},
pluralsOrdinal: []locales.PluralRule{2, 6},
- pluralsRange: []locales.PluralRule{6, 2},
+ pluralsRange: []locales.PluralRule{2, 6},
decimal: "٫",
group: "٬",
minus: "‏−",
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"SGT": "heure de Singapour", "AST": "heure normale de l’Atlantique", "GYT": "heure du Guyana", "AKDT": "heure d’été de l’Alaska", "UYST": "heure d’été de l’Uruguay", "CLST": "heure d’été du Chili", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "HAT": "heure d’été de Terre-Neuve", "JST": "heure normale du Japon", "NZST": "heure normale de la Nouvelle-Zélande", "EST": "heure normale de l’Est nord-américain", "SAST": "heure normale d’Afrique méridionale", "OESZ": "heure d’été d’Europe de l’Est", "IST": "heure de l’Inde", "MEZ": "heure normale d’Europe centrale", "MESZ": "heure d’été d’Europe centrale", "WESZ": "heure d’été d’Europe de l’Ouest", "ADT": "heure d’été de l’Atlantique", "WIT": "heure de l’Est indonésien", "WIB": "heure de l’Ouest indonésien", "MDT": "heure d’été de Macao", "NZDT": "heure d’été de la Nouvelle-Zélande", "AEST": "heure normale de l’Est de l’Australie", "CHAST": "heure normale des îles Chatham", "COT": "heure normale de Colombie", "CLT": "heure normale du Chili", "LHST": "heure normale de Lord Howe", "AEDT": "heure d’été de l’Est de l’Australie", "HAST": "heure normale d’Hawaii - Aléoutiennes", "HKST": "heure d’été de Hong Kong", "MYT": "heure de la Malaisie", "AKST": "heure normale de l’Alaska", "CHADT": "heure d’été des îles Chatham", "VET": "heure du Venezuela", "WEZ": "heure normale d’Europe de l’Ouest", "GFT": "heure de la Guyane française", "WITA": "heure du Centre indonésien", "MST": "heure normale de Macao", "ACST": "heure normale du centre de l’Australie", "∅∅∅": "heure d’été de l’Amazonie", "COST": "heure d’été de Colombie", "WAT": "heure normale d’Afrique de l’Ouest", "OEZ": "heure normale d’Europe de l’Est", "ACDT": "heure d’été du centre de l’Australie", "TMT": "heure normale du Turkménistan", "PDT": "heure d’été du Pacifique", "LHDT": "heure d’été de Lord Howe", "AWST": "heure normale de l’Ouest de l’Australie", "GMT": "heure moyenne de Greenwich", "BOT": "heure de Bolivie", "CST": "heure normale du centre nord-américain", "ACWST": "heure normale du centre-ouest de l’Australie", "CAT": "heure normale d’Afrique centrale", "HKT": "heure normale de Hong Kong", "ARST": "heure d’été de l’Argentine", "JDT": "heure d’été du Japon", "UYT": "heure normale de l’Uruguay", "EDT": "heure d’été de l’Est", "BT": "heure du Bhoutan", "WARST": "heure d’été de l’Ouest argentin", "HNT": "heure normale de Terre-Neuve", "ART": "heure normale d’Argentine", "EAT": "heure normale d’Afrique de l’Est", "PST": "heure normale du Pacifique nord-américain", "SRT": "heure du Suriname", "ACWDT": "heure d’été du centre-ouest de l’Australie", "ChST": "heure des Chamorro", "WART": "heure normale de l’Ouest argentin", "TMST": "heure d’été du Turkménistan", "AWDT": "heure d’été de l’Ouest de l’Australie", "CDT": "heure d’été du Centre", "ECT": "heure de l’Équateur", "WAST": "heure d’été d’Afrique de l’Ouest"},
+ timezones: map[string]string{"ChST": "heure des Chamorro", "ADT": "heure d’été de l’Atlantique", "HAST": "heure normale d’Hawaii - Aléoutiennes", "HNT": "heure normale de Terre-Neuve", "COT": "heure normale de Colombie", "LHDT": "heure d’été de Lord Howe", "CST": "heure normale du centre nord-américain", "HKST": "heure d’été de Hong Kong", "IST": "heure de l’Inde", "WIB": "heure de l’Ouest indonésien", "CLT": "heure normale du Chili", "CLST": "heure d’été du Chili", "PST": "heure normale du Pacifique nord-américain", "BOT": "heure de Bolivie", "TMT": "heure normale du Turkménistan", "ART": "heure normale d’Argentine", "JST": "heure normale du Japon", "WEZ": "heure normale d’Europe de l’Ouest", "ACWST": "heure normale du centre-ouest de l’Australie", "MEZ": "heure normale d’Europe centrale", "ACST": "heure normale du centre de l’Australie", "AKST": "heure normale de l’Alaska", "WIT": "heure de l’Est indonésien", "MYT": "heure de la Malaisie", "CDT": "heure d’été du Centre", "∅∅∅": "heure d’été des Açores", "AST": "heure normale de l’Atlantique", "WART": "heure normale de l’Ouest argentin", "ACDT": "heure d’été du centre de l’Australie", "PDT": "heure d’été du Pacifique", "CAT": "heure normale d’Afrique centrale", "WITA": "heure du Centre indonésien", "JDT": "heure d’été du Japon", "SGT": "heure de Singapour", "TMST": "heure d’été du Turkménistan", "OESZ": "heure d’été d’Europe de l’Est", "UYT": "heure normale de l’Uruguay", "GFT": "heure de la Guyane française", "MST": "heure normale de Macao", "WARST": "heure d’été de l’Ouest argentin", "EAT": "heure normale d’Afrique de l’Est", "SRT": "heure du Suriname", "NZST": "heure normale de la Nouvelle-Zélande", "WAST": "heure d’été d’Afrique de l’Ouest", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "WESZ": "heure d’été d’Europe de l’Ouest", "HAT": "heure d’été de Terre-Neuve", "LHST": "heure normale de Lord Howe", "ARST": "heure d’été de l’Argentine", "EST": "heure normale de l’Est nord-américain", "SAST": "heure normale d’Afrique méridionale", "WAT": "heure normale d’Afrique de l’Ouest", "CHADT": "heure d’été des îles Chatham", "AWDT": "heure d’été de l’Ouest de l’Australie", "AWST": "heure normale de l’Ouest de l’Australie", "AEST": "heure normale de l’Est de l’Australie", "ECT": "heure de l’Équateur", "ACWDT": "heure d’été du centre-ouest de l’Australie", "AEDT": "heure d’été de l’Est de l’Australie", "GYT": "heure du Guyana", "BT": "heure du Bhoutan", "MDT": "heure d’été de Macao", "EDT": "heure d’été de l’Est", "COST": "heure d’été de Colombie", "GMT": "heure moyenne de Greenwich", "UYST": "heure d’été de l’Uruguay", "VET": "heure du Venezuela", "MESZ": "heure d’été d’Europe centrale", "AKDT": "heure d’été de l’Alaska", "NZDT": "heure d’été de la Nouvelle-Zélande", "OEZ": "heure normale d’Europe de l’Est", "CHAST": "heure normale des îles Chatham", "HKT": "heure normale de Hong Kong"},
}
}
diff --git a/fr_RE/fr_RE_test.go b/fr_RE/fr_RE_test.go
new file mode 100644
index 00000000..9fdccdca
--- /dev/null
+++ b/fr_RE/fr_RE_test.go
@@ -0,0 +1,1120 @@
+package fr_RE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr_RE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr_RW/fr_RW.go b/fr_RW/fr_RW.go
index 8259a8c5..71b59ddd 100644
--- a/fr_RW/fr_RW.go
+++ b/fr_RW/fr_RW.go
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"CDT": "heure d’été du Centre", "ACWDT": "heure d’été du centre-ouest de l’Australie", "EST": "heure normale de l’Est nord-américain", "COST": "heure d’été de Colombie", "HAST": "heure normale d’Hawaii - Aléoutiennes", "EAT": "heure normale d’Afrique de l’Est", "ACDT": "heure d’été du centre de l’Australie", "LHST": "heure normale de Lord Howe", "SGT": "heure de Singapour", "CLT": "heure normale du Chili", "AEDT": "heure d’été de l’Est de l’Australie", "ARST": "heure d’été de l’Argentine", "AKDT": "heure d’été de l’Alaska", "CST": "heure normale du centre nord-américain", "HNT": "heure normale de Terre-Neuve", "JDT": "heure d’été du Japon", "WART": "heure normale de l’Ouest argentin", "SRT": "heure du Suriname", "CHAST": "heure normale des îles Chatham", "CHADT": "heure d’été des îles Chatham", "OEZ": "heure normale d’Europe de l’Est", "GMT": "heure moyenne de Greenwich", "MST": "heure normale de Macao", "WARST": "heure d’été de l’Ouest argentin", "MDT": "heure d’été de Macao", "AEST": "heure normale de l’Est de l’Australie", "ECT": "heure de l’Équateur", "NZST": "heure normale de la Nouvelle-Zélande", "WAST": "heure d’été d’Afrique de l’Ouest", "IST": "heure de l’Inde", "HAT": "heure d’été de Terre-Neuve", "MEZ": "heure normale d’Europe centrale", "WESZ": "heure d’été d’Europe de l’Ouest", "CAT": "heure normale d’Afrique centrale", "EDT": "heure d’été de l’Est", "GFT": "heure de la Guyane française", "TMT": "heure normale du Turkménistan", "ART": "heure normale d’Argentine", "OESZ": "heure d’été d’Europe de l’Est", "GYT": "heure du Guyana", "COT": "heure normale de Colombie", "PDT": "heure d’été du Pacifique", "NZDT": "heure d’été de la Nouvelle-Zélande", "ACWST": "heure normale du centre-ouest de l’Australie", "ChST": "heure des Chamorro", "AST": "heure normale de l’Atlantique", "SAST": "heure normale d’Afrique méridionale", "ACST": "heure normale du centre de l’Australie", "PST": "heure normale du Pacifique nord-américain", "MESZ": "heure d’été d’Europe centrale", "ADT": "heure d’été de l’Atlantique", "BT": "heure du Bhoutan", "HKT": "heure normale de Hong Kong", "TMST": "heure d’été du Turkménistan", "LHDT": "heure d’été de Lord Howe", "BOT": "heure de Bolivie", "UYST": "heure d’été de l’Uruguay", "HKST": "heure d’été de Hong Kong", "WIB": "heure de l’Ouest indonésien", "MYT": "heure de la Malaisie", "CLST": "heure d’été du Chili", "AKST": "heure normale de l’Alaska", "AWST": "heure normale de l’Ouest de l’Australie", "JST": "heure normale du Japon", "UYT": "heure normale de l’Uruguay", "VET": "heure du Venezuela", "WEZ": "heure normale d’Europe de l’Ouest", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "WITA": "heure du Centre indonésien", "WIT": "heure de l’Est indonésien", "∅∅∅": "heure d’été de l’Amazonie", "WAT": "heure normale d’Afrique de l’Ouest", "AWDT": "heure d’été de l’Ouest de l’Australie"},
+ timezones: map[string]string{"WIT": "heure de l’Est indonésien", "MST": "heure normale des Rocheuses", "MYT": "heure de la Malaisie", "VET": "heure du Venezuela", "AST": "heure normale de l’Atlantique", "TMT": "heure normale du Turkménistan", "CDT": "heure d’été du Centre", "ACDT": "heure d’été du centre de l’Australie", "WARST": "heure d’été de l’Ouest argentin", "GFT": "heure de la Guyane française", "HAT": "heure d’été de Terre-Neuve", "PST": "heure normale du Pacifique nord-américain", "TMST": "heure d’été du Turkménistan", "UYT": "heure normale de l’Uruguay", "BT": "heure du Bhoutan", "CHAST": "heure normale des îles Chatham", "ECT": "heure de l’Équateur", "AWST": "heure normale de l’Ouest de l’Australie", "EDT": "heure d’été de l’Est", "WEZ": "heure normale d’Europe de l’Ouest", "HNT": "heure normale de Terre-Neuve", "OEZ": "heure normale d’Europe de l’Est", "MESZ": "heure d’été d’Europe centrale", "CAT": "heure normale d’Afrique centrale", "COST": "heure d’été de Colombie", "AEST": "heure normale de l’Est de l’Australie", "∅∅∅": "heure d’été de Brasilia", "CHADT": "heure d’été des îles Chatham", "LHST": "heure normale de Lord Howe", "MEZ": "heure normale d’Europe centrale", "WESZ": "heure d’été d’Europe de l’Ouest", "AEDT": "heure d’été de l’Est de l’Australie", "MDT": "heure d’été des Rocheuses", "HKT": "heure normale de Hong Kong", "ChST": "heure des Chamorro", "ADT": "heure d’été de l’Atlantique", "NZST": "heure normale de la Nouvelle-Zélande", "HAST": "heure normale d’Hawaii - Aléoutiennes", "WAT": "heure normale d’Afrique de l’Ouest", "WITA": "heure du Centre indonésien", "BOT": "heure de Bolivie", "CST": "heure normale du centre nord-américain", "JST": "heure normale du Japon", "JDT": "heure d’été du Japon", "AKDT": "heure d’été de l’Alaska", "ACWST": "heure normale du centre-ouest de l’Australie", "AWDT": "heure d’été de l’Ouest de l’Australie", "WIB": "heure de l’Ouest indonésien", "OESZ": "heure d’été d’Europe de l’Est", "ACST": "heure normale du centre de l’Australie", "WART": "heure normale de l’Ouest argentin", "ACWDT": "heure d’été du centre-ouest de l’Australie", "PDT": "heure d’été du Pacifique", "CLST": "heure d’été du Chili", "SGT": "heure de Singapour", "GMT": "heure moyenne de Greenwich", "GYT": "heure du Guyana", "UYST": "heure d’été de l’Uruguay", "EAT": "heure normale d’Afrique de l’Est", "CLT": "heure normale du Chili", "HKST": "heure d’été de Hong Kong", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "WAST": "heure d’été d’Afrique de l’Ouest", "SAST": "heure normale d’Afrique méridionale", "IST": "heure de l’Inde", "EST": "heure normale de l’Est nord-américain", "LHDT": "heure d’été de Lord Howe", "AKST": "heure normale de l’Alaska", "ARST": "heure d’été de l’Argentine", "COT": "heure normale de Colombie", "SRT": "heure du Suriname", "ART": "heure normale d’Argentine", "NZDT": "heure d’été de la Nouvelle-Zélande"},
}
}
diff --git a/fr_RW/fr_RW_test.go b/fr_RW/fr_RW_test.go
new file mode 100644
index 00000000..e50d9f6d
--- /dev/null
+++ b/fr_RW/fr_RW_test.go
@@ -0,0 +1,1120 @@
+package fr_RW
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr_RW"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr_SC/fr_SC.go b/fr_SC/fr_SC.go
index a3861685..e5d3253b 100644
--- a/fr_SC/fr_SC.go
+++ b/fr_SC/fr_SC.go
@@ -49,7 +49,7 @@ func New() locales.Translator {
locale: "fr_SC",
pluralsCardinal: []locales.PluralRule{2, 6},
pluralsOrdinal: []locales.PluralRule{2, 6},
- pluralsRange: []locales.PluralRule{2, 6},
+ pluralsRange: []locales.PluralRule{6, 2},
decimal: "٫",
group: "٬",
minus: "‏−",
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"WARST": "heure d’été de l’Ouest argentin", "LHDT": "heure d’été de Lord Howe", "ACST": "heure normale du centre de l’Australie", "SRT": "heure du Suriname", "AWDT": "heure d’été de l’Ouest de l’Australie", "LHST": "heure normale de Lord Howe", "ACWDT": "heure d’été du centre-ouest de l’Australie", "BT": "heure du Bhoutan", "OESZ": "heure d’été d’Europe de l’Est", "EAT": "heure normale d’Afrique de l’Est", "MST": "heure normale de Macao", "AWST": "heure normale de l’Ouest de l’Australie", "WIT": "heure de l’Est indonésien", "WIB": "heure de l’Ouest indonésien", "IST": "heure de l’Inde", "GFT": "heure de la Guyane française", "JDT": "heure d’été du Japon", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "ACDT": "heure d’été du centre de l’Australie", "MYT": "heure de la Malaisie", "CLT": "heure normale du Chili", "CHAST": "heure normale des îles Chatham", "WITA": "heure du Centre indonésien", "HNT": "heure normale de Terre-Neuve", "PST": "heure normale du Pacifique nord-américain", "NZST": "heure normale de la Nouvelle-Zélande", "BOT": "heure de Bolivie", "SGT": "heure de Singapour", "SAST": "heure normale d’Afrique méridionale", "WAST": "heure d’été d’Afrique de l’Ouest", "HKST": "heure d’été de Hong Kong", "MDT": "heure d’été de Macao", "CAT": "heure normale d’Afrique centrale", "GYT": "heure du Guyana", "VET": "heure du Venezuela", "WESZ": "heure d’été d’Europe de l’Ouest", "HAST": "heure normale d’Hawaii - Aléoutiennes", "JST": "heure normale du Japon", "UYT": "heure normale de l’Uruguay", "AEDT": "heure d’été de l’Est de l’Australie", "ChST": "heure des Chamorro", "CDT": "heure d’été du Centre", "MESZ": "heure d’été d’Europe centrale", "WART": "heure normale de l’Ouest argentin", "OEZ": "heure normale d’Europe de l’Est", "TMT": "heure normale du Turkménistan", "ARST": "heure d’été de l’Argentine", "AKDT": "heure d’été de l’Alaska", "HKT": "heure normale de Hong Kong", "TMST": "heure d’été du Turkménistan", "AKST": "heure normale de l’Alaska", "ACWST": "heure normale du centre-ouest de l’Australie", "ECT": "heure de l’Équateur", "CST": "heure normale du centre nord-américain", "WEZ": "heure normale d’Europe de l’Ouest", "EDT": "heure d’été de l’Est", "COT": "heure normale de Colombie", "GMT": "heure moyenne de Greenwich", "CLST": "heure d’été du Chili", "AEST": "heure normale de l’Est de l’Australie", "ART": "heure normale d’Argentine", "MEZ": "heure normale d’Europe centrale", "NZDT": "heure d’été de la Nouvelle-Zélande", "UYST": "heure d’été de l’Uruguay", "∅∅∅": "heure d’été de Brasilia", "EST": "heure normale de l’Est nord-américain", "COST": "heure d’été de Colombie", "ADT": "heure d’été de l’Atlantique", "PDT": "heure d’été du Pacifique", "AST": "heure normale de l’Atlantique", "WAT": "heure normale d’Afrique de l’Ouest", "HAT": "heure d’été de Terre-Neuve", "CHADT": "heure d’été des îles Chatham"},
+ timezones: map[string]string{"JST": "heure normale du Japon", "NZDT": "heure d’été de la Nouvelle-Zélande", "WIB": "heure de l’Ouest indonésien", "AEDT": "heure d’été de l’Est de l’Australie", "HKT": "heure normale de Hong Kong", "AKDT": "heure d’été de l’Alaska", "AWDT": "heure d’été de l’Ouest de l’Australie", "UYT": "heure normale de l’Uruguay", "LHST": "heure normale de Lord Howe", "CST": "heure normale du centre nord-américain", "WART": "heure normale de l’Ouest argentin", "ART": "heure normale d’Argentine", "AKST": "heure normale de l’Alaska", "MESZ": "heure d’été d’Europe centrale", "COST": "heure d’été de Colombie", "GFT": "heure de la Guyane française", "WITA": "heure du Centre indonésien", "EDT": "heure d’été de l’Est", "OESZ": "heure d’été d’Europe de l’Est", "ACST": "heure normale du centre de l’Australie", "HNT": "heure normale de Terre-Neuve", "GYT": "heure du Guyana", "CDT": "heure d’été du Centre", "CHADT": "heure d’été des îles Chatham", "NZST": "heure normale de la Nouvelle-Zélande", "SAST": "heure normale d’Afrique méridionale", "IST": "heure de l’Inde", "TMT": "heure normale du Turkménistan", "WESZ": "heure d’été d’Europe de l’Ouest", "CLST": "heure d’été du Chili", "MDT": "heure d’été des Rocheuses", "ADT": "heure d’été de l’Atlantique", "HAST": "heure normale d’Hawaii - Aléoutiennes", "WEZ": "heure normale d’Europe de l’Ouest", "ACDT": "heure d’été du centre de l’Australie", "BOT": "heure de Bolivie", "GMT": "heure moyenne de Greenwich", "ACWDT": "heure d’été du centre-ouest de l’Australie", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "EST": "heure normale de l’Est nord-américain", "ChST": "heure des Chamorro", "MST": "heure normale des Rocheuses", "HKST": "heure d’été de Hong Kong", "AST": "heure normale de l’Atlantique", "PDT": "heure d’été du Pacifique", "BT": "heure du Bhoutan", "LHDT": "heure d’été de Lord Howe", "WAT": "heure normale d’Afrique de l’Ouest", "HAT": "heure d’été de Terre-Neuve", "UYST": "heure d’été de l’Uruguay", "COT": "heure normale de Colombie", "CAT": "heure normale d’Afrique centrale", "CLT": "heure normale du Chili", "WIT": "heure de l’Est indonésien", "JDT": "heure d’été du Japon", "ACWST": "heure normale du centre-ouest de l’Australie", "MEZ": "heure normale d’Europe centrale", "∅∅∅": "heure d’été de l’Amazonie", "SGT": "heure de Singapour", "OEZ": "heure normale d’Europe de l’Est", "MYT": "heure de la Malaisie", "VET": "heure du Venezuela", "EAT": "heure normale d’Afrique de l’Est", "CHAST": "heure normale des îles Chatham", "ARST": "heure d’été de l’Argentine", "AWST": "heure normale de l’Ouest de l’Australie", "PST": "heure normale du Pacifique nord-américain", "TMST": "heure d’été du Turkménistan", "ECT": "heure de l’Équateur", "WAST": "heure d’été d’Afrique de l’Ouest", "AEST": "heure normale de l’Est de l’Australie", "WARST": "heure d’été de l’Ouest argentin", "SRT": "heure du Suriname"},
}
}
diff --git a/fr_SC/fr_SC_test.go b/fr_SC/fr_SC_test.go
new file mode 100644
index 00000000..31d9d87c
--- /dev/null
+++ b/fr_SC/fr_SC_test.go
@@ -0,0 +1,1120 @@
+package fr_SC
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr_SC"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr_SN/fr_SN.go b/fr_SN/fr_SN.go
index 3d2e01e4..ef2c3c1e 100644
--- a/fr_SN/fr_SN.go
+++ b/fr_SN/fr_SN.go
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"AEST": "heure normale de l’Est de l’Australie", "HKST": "heure d’été de Hong Kong", "HAT": "heure d’été de Terre-Neuve", "COST": "heure d’été de Colombie", "IST": "heure de l’Inde", "OESZ": "heure d’été d’Europe de l’Est", "SRT": "heure du Suriname", "PST": "heure normale du Pacifique nord-américain", "BOT": "heure de Bolivie", "ECT": "heure de l’Équateur", "ACDT": "heure d’été du centre de l’Australie", "AWDT": "heure d’été de l’Ouest de l’Australie", "ACST": "heure normale du centre de l’Australie", "LHST": "heure normale de Lord Howe", "JDT": "heure d’été du Japon", "CST": "heure normale du centre nord-américain", "NZDT": "heure d’été de la Nouvelle-Zélande", "WEZ": "heure normale d’Europe de l’Ouest", "GMT": "heure moyenne de Greenwich", "ART": "heure normale d’Argentine", "MYT": "heure de la Malaisie", "MESZ": "heure d’été d’Europe centrale", "UYT": "heure normale de l’Uruguay", "VET": "heure du Venezuela", "ChST": "heure des Chamorro", "EAT": "heure normale d’Afrique de l’Est", "TMT": "heure normale du Turkménistan", "JST": "heure normale du Japon", "UYST": "heure d’été de l’Uruguay", "HAST": "heure normale d’Hawaii - Aléoutiennes", "WART": "heure normale de l’Ouest argentin", "ARST": "heure d’été de l’Argentine", "CHAST": "heure normale des îles Chatham", "CLT": "heure normale du Chili", "CLST": "heure d’été du Chili", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "HNT": "heure normale de Terre-Neuve", "MST": "heure normale de Macao", "MDT": "heure d’été de Macao", "LHDT": "heure d’été de Lord Howe", "EST": "heure normale de l’Est nord-américain", "ADT": "heure d’été de l’Atlantique", "SGT": "heure de Singapour", "GFT": "heure de la Guyane française", "WIT": "heure de l’Est indonésien", "CDT": "heure d’été du Centre", "MEZ": "heure normale d’Europe centrale", "WESZ": "heure d’été d’Europe de l’Ouest", "ACWST": "heure normale du centre-ouest de l’Australie", "WAT": "heure normale d’Afrique de l’Ouest", "WIB": "heure de l’Ouest indonésien", "OEZ": "heure normale d’Europe de l’Est", "GYT": "heure du Guyana", "EDT": "heure d’été de l’Est", "COT": "heure normale de Colombie", "AST": "heure normale de l’Atlantique", "BT": "heure du Bhoutan", "WITA": "heure du Centre indonésien", "NZST": "heure normale de la Nouvelle-Zélande", "SAST": "heure normale d’Afrique méridionale", "AKDT": "heure d’été de l’Alaska", "AWST": "heure normale de l’Ouest de l’Australie", "CHADT": "heure d’été des îles Chatham", "CAT": "heure normale d’Afrique centrale", "WARST": "heure d’été de l’Ouest argentin", "TMST": "heure d’été du Turkménistan", "AKST": "heure normale de l’Alaska", "WAST": "heure d’été d’Afrique de l’Ouest", "HKT": "heure normale de Hong Kong", "∅∅∅": "heure d’été de l’Amazonie", "PDT": "heure d’été du Pacifique", "ACWDT": "heure d’été du centre-ouest de l’Australie", "AEDT": "heure d’été de l’Est de l’Australie"},
+ timezones: map[string]string{"AKST": "heure normale de l’Alaska", "AKDT": "heure d’été de l’Alaska", "SGT": "heure de Singapour", "WIB": "heure de l’Ouest indonésien", "CHAST": "heure normale des îles Chatham", "MST": "heure normale de Macao", "EDT": "heure d’été de l’Est", "HAST": "heure normale d’Hawaii - Aléoutiennes", "JDT": "heure d’été du Japon", "ADT": "heure d’été de l’Atlantique", "EST": "heure normale de l’Est nord-américain", "HKT": "heure normale de Hong Kong", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "JST": "heure normale du Japon", "OESZ": "heure d’été d’Europe de l’Est", "LHST": "heure normale de Lord Howe", "WEZ": "heure normale d’Europe de l’Ouest", "MYT": "heure de la Malaisie", "CHADT": "heure d’été des îles Chatham", "ART": "heure normale d’Argentine", "WITA": "heure du Centre indonésien", "NZDT": "heure d’été de la Nouvelle-Zélande", "AEST": "heure normale de l’Est de l’Australie", "GYT": "heure du Guyana", "WAST": "heure d’été d’Afrique de l’Ouest", "CLST": "heure d’été du Chili", "UYT": "heure normale de l’Uruguay", "EAT": "heure normale d’Afrique de l’Est", "ECT": "heure de l’Équateur", "HKST": "heure d’été de Hong Kong", "PDT": "heure d’été du Pacifique", "SAST": "heure normale d’Afrique méridionale", "WARST": "heure d’été de l’Ouest argentin", "AEDT": "heure d’été de l’Est de l’Australie", "OEZ": "heure normale d’Europe de l’Est", "WART": "heure normale de l’Ouest argentin", "AWDT": "heure d’été de l’Ouest de l’Australie", "AST": "heure normale de l’Atlantique", "COT": "heure normale de Colombie", "WAT": "heure normale d’Afrique de l’Ouest", "SRT": "heure du Suriname", "CST": "heure normale du centre nord-américain", "PST": "heure normale du Pacifique nord-américain", "MESZ": "heure d’été d’Europe centrale", "∅∅∅": "heure d’été de l’Acre", "ChST": "heure des Chamorro", "BOT": "heure de Bolivie", "IST": "heure de l’Inde", "TMT": "heure normale du Turkménistan", "LHDT": "heure d’été de Lord Howe", "WIT": "heure de l’Est indonésien", "NZST": "heure normale de la Nouvelle-Zélande", "WESZ": "heure d’été d’Europe de l’Ouest", "HAT": "heure d’été de Terre-Neuve", "CLT": "heure normale du Chili", "ACST": "heure normale du centre de l’Australie", "GFT": "heure de la Guyane française", "AWST": "heure normale de l’Ouest de l’Australie", "ARST": "heure d’été de l’Argentine", "MEZ": "heure normale d’Europe centrale", "CAT": "heure normale d’Afrique centrale", "BT": "heure du Bhoutan", "CDT": "heure d’été du Centre", "VET": "heure du Venezuela", "MDT": "heure d’été de Macao", "HNT": "heure normale de Terre-Neuve", "COST": "heure d’été de Colombie", "ACWST": "heure normale du centre-ouest de l’Australie", "TMST": "heure d’été du Turkménistan", "UYST": "heure d’été de l’Uruguay", "ACDT": "heure d’été du centre de l’Australie", "ACWDT": "heure d’été du centre-ouest de l’Australie", "GMT": "heure moyenne de Greenwich"},
}
}
diff --git a/fr_SN/fr_SN_test.go b/fr_SN/fr_SN_test.go
new file mode 100644
index 00000000..db4ba948
--- /dev/null
+++ b/fr_SN/fr_SN_test.go
@@ -0,0 +1,1120 @@
+package fr_SN
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr_SN"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr_SY/fr_SY.go b/fr_SY/fr_SY.go
index 88818b89..47c64244 100644
--- a/fr_SY/fr_SY.go
+++ b/fr_SY/fr_SY.go
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"WEZ": "heure normale d’Europe de l’Ouest", "CAT": "heure normale d’Afrique centrale", "WAST": "heure d’été d’Afrique de l’Ouest", "EAT": "heure normale d’Afrique de l’Est", "ACDT": "heure d’été du centre de l’Australie", "SRT": "heure du Suriname", "AWDT": "heure d’été de l’Ouest de l’Australie", "MST": "heure normale des Rocheuses", "HAT": "heure d’été de Terre-Neuve", "AKST": "heure normale de l’Alaska", "HAST": "heure normale d’Hawaii - Aléoutiennes", "CDT": "heure d’été du Centre", "BOT": "heure de Bolivie", "UYST": "heure d’été de l’Uruguay", "CLT": "heure normale du Chili", "AEDT": "heure d’été de l’Est de l’Australie", "ECT": "heure de l’Équateur", "WIT": "heure de l’Est indonésien", "OESZ": "heure d’été d’Europe de l’Est", "WITA": "heure du Centre indonésien", "ACST": "heure normale du centre de l’Australie", "CLST": "heure d’été du Chili", "WARST": "heure d’été de l’Ouest argentin", "JST": "heure normale du Japon", "PDT": "heure d’été du Pacifique", "MESZ": "heure d’été d’Europe centrale", "ADT": "heure d’été de l’Atlantique", "ART": "heure normale d’Argentine", "LHST": "heure normale de Lord Howe", "CST": "heure normale du centre nord-américain", "ACWST": "heure normale du centre-ouest de l’Australie", "BT": "heure du Bhoutan", "NZDT": "heure d’été de la Nouvelle-Zélande", "WART": "heure normale de l’Ouest argentin", "ARST": "heure d’été de l’Argentine", "AST": "heure normale de l’Atlantique", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "WAT": "heure normale d’Afrique de l’Ouest", "HKST": "heure d’été de Hong Kong", "WIB": "heure de l’Ouest indonésien", "LHDT": "heure d’été de Lord Howe", "MYT": "heure de la Malaisie", "VET": "heure du Venezuela", "∅∅∅": "heure d’été de Brasilia", "GMT": "heure moyenne de Greenwich", "TMT": "heure normale du Turkménistan", "JDT": "heure d’été du Japon", "AKDT": "heure d’été de l’Alaska", "AWST": "heure normale de l’Ouest de l’Australie", "WESZ": "heure d’été d’Europe de l’Ouest", "OEZ": "heure normale d’Europe de l’Est", "TMST": "heure d’été du Turkménistan", "NZST": "heure normale de la Nouvelle-Zélande", "CHAST": "heure normale des îles Chatham", "EST": "heure normale de l’Est nord-américain", "COT": "heure normale de Colombie", "COST": "heure d’été de Colombie", "GFT": "heure de la Guyane française", "HKT": "heure normale de Hong Kong", "MDT": "heure d’été des Rocheuses", "EDT": "heure d’été de l’Est", "SGT": "heure de Singapour", "MEZ": "heure normale d’Europe centrale", "UYT": "heure normale de l’Uruguay", "ACWDT": "heure d’été du centre-ouest de l’Australie", "ChST": "heure des Chamorro", "CHADT": "heure d’été des îles Chatham", "SAST": "heure normale d’Afrique méridionale", "AEST": "heure normale de l’Est de l’Australie", "IST": "heure de l’Inde", "HNT": "heure normale de Terre-Neuve", "PST": "heure normale du Pacifique nord-américain", "GYT": "heure du Guyana"},
+ timezones: map[string]string{"WAT": "heure normale d’Afrique de l’Ouest", "SGT": "heure de Singapour", "AEST": "heure normale de l’Est de l’Australie", "∅∅∅": "heure d’été des Açores", "HKT": "heure normale de Hong Kong", "CHAST": "heure normale des îles Chatham", "AST": "heure normale de l’Atlantique", "TMST": "heure d’été du Turkménistan", "ACDT": "heure d’été du centre de l’Australie", "SRT": "heure du Suriname", "AKST": "heure normale de l’Alaska", "ADT": "heure d’été de l’Atlantique", "AWDT": "heure d’été de l’Ouest de l’Australie", "BOT": "heure de Bolivie", "WESZ": "heure d’été d’Europe de l’Ouest", "COST": "heure d’été de Colombie", "OESZ": "heure d’été d’Europe de l’Est", "ChST": "heure des Chamorro", "GYT": "heure du Guyana", "ACST": "heure normale du centre de l’Australie", "WART": "heure normale de l’Ouest argentin", "JST": "heure normale du Japon", "GMT": "heure moyenne de Greenwich", "UYT": "heure normale de l’Uruguay", "UYST": "heure d’été de l’Uruguay", "GFT": "heure de la Guyane française", "CHADT": "heure d’été des îles Chatham", "ECT": "heure de l’Équateur", "EDT": "heure d’été de l’Est", "LHST": "heure normale de Lord Howe", "WITA": "heure du Centre indonésien", "NZDT": "heure d’été de la Nouvelle-Zélande", "WIT": "heure de l’Est indonésien", "BT": "heure du Bhoutan", "MDT": "heure d’été de Macao", "MESZ": "heure d’été d’Europe centrale", "WEZ": "heure normale d’Europe de l’Ouest", "COT": "heure normale de Colombie", "MST": "heure normale de Macao", "EST": "heure normale de l’Est nord-américain", "PDT": "heure d’été du Pacifique", "MEZ": "heure normale d’Europe centrale", "OEZ": "heure normale d’Europe de l’Est", "MYT": "heure de la Malaisie", "HKST": "heure d’été de Hong Kong", "VET": "heure du Venezuela", "AKDT": "heure d’été de l’Alaska", "TMT": "heure normale du Turkménistan", "CAT": "heure normale d’Afrique centrale", "WAST": "heure d’été d’Afrique de l’Ouest", "AEDT": "heure d’été de l’Est de l’Australie", "LHDT": "heure d’été de Lord Howe", "CLT": "heure normale du Chili", "CLST": "heure d’été du Chili", "NZST": "heure normale de la Nouvelle-Zélande", "SAST": "heure normale d’Afrique méridionale", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "JDT": "heure d’été du Japon", "ART": "heure normale d’Argentine", "HNT": "heure normale de Terre-Neuve", "HAT": "heure d’été de Terre-Neuve", "ACWDT": "heure d’été du centre-ouest de l’Australie", "AWST": "heure normale de l’Ouest de l’Australie", "HAST": "heure normale d’Hawaii - Aléoutiennes", "EAT": "heure normale d’Afrique de l’Est", "CST": "heure normale du centre nord-américain", "WARST": "heure d’été de l’Ouest argentin", "IST": "heure de l’Inde", "PST": "heure normale du Pacifique nord-américain", "CDT": "heure d’été du Centre", "ACWST": "heure normale du centre-ouest de l’Australie", "ARST": "heure d’été de l’Argentine", "WIB": "heure de l’Ouest indonésien"},
}
}
diff --git a/fr_SY/fr_SY_test.go b/fr_SY/fr_SY_test.go
new file mode 100644
index 00000000..d5bfcd5b
--- /dev/null
+++ b/fr_SY/fr_SY_test.go
@@ -0,0 +1,1120 @@
+package fr_SY
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr_SY"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr_TD/fr_TD.go b/fr_TD/fr_TD.go
index c68bf7f0..84db1743 100644
--- a/fr_TD/fr_TD.go
+++ b/fr_TD/fr_TD.go
@@ -49,7 +49,7 @@ func New() locales.Translator {
locale: "fr_TD",
pluralsCardinal: []locales.PluralRule{2, 6},
pluralsOrdinal: []locales.PluralRule{2, 6},
- pluralsRange: []locales.PluralRule{6, 2},
+ pluralsRange: []locales.PluralRule{2, 6},
decimal: "٫",
group: "٬",
minus: "‏−",
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"HADT": "heure d’été d’Hawaii - Aléoutiennes", "WAST": "heure d’été d’Afrique de l’Ouest", "EAT": "heure normale d’Afrique de l’Est", "JDT": "heure d’été du Japon", "GYT": "heure du Guyana", "MEZ": "heure normale d’Europe centrale", "CHADT": "heure d’été des îles Chatham", "OEZ": "heure normale d’Europe de l’Est", "LHST": "heure normale de Lord Howe", "CLT": "heure normale du Chili", "CLST": "heure d’été du Chili", "GFT": "heure de la Guyane française", "JST": "heure normale du Japon", "AST": "heure normale de l’Atlantique", "ChST": "heure des Chamorro", "EST": "heure normale de l’Est nord-américain", "ACST": "heure normale du centre de l’Australie", "NZST": "heure normale de la Nouvelle-Zélande", "COST": "heure d’été de Colombie", "WIB": "heure de l’Ouest indonésien", "HNT": "heure normale de Terre-Neuve", "MST": "heure normale de Macao", "CDT": "heure d’été du Centre", "MESZ": "heure d’été d’Europe centrale", "AEDT": "heure d’été de l’Est de l’Australie", "SAST": "heure normale d’Afrique méridionale", "IST": "heure de l’Inde", "TMT": "heure normale du Turkménistan", "ART": "heure normale d’Argentine", "AWDT": "heure d’été de l’Ouest de l’Australie", "VET": "heure du Venezuela", "OESZ": "heure d’été d’Europe de l’Est", "PST": "heure normale du Pacifique nord-américain", "LHDT": "heure d’été de Lord Howe", "UYT": "heure normale de l’Uruguay", "CAT": "heure normale d’Afrique centrale", "TMST": "heure d’été du Turkménistan", "WESZ": "heure d’été d’Europe de l’Ouest", "ACWST": "heure normale du centre-ouest de l’Australie", "WAT": "heure normale d’Afrique de l’Ouest", "ACDT": "heure d’été du centre de l’Australie", "MYT": "heure de la Malaisie", "CHAST": "heure normale des îles Chatham", "AKST": "heure normale de l’Alaska", "AKDT": "heure d’été de l’Alaska", "BOT": "heure de Bolivie", "ADT": "heure d’été de l’Atlantique", "HKT": "heure normale de Hong Kong", "SGT": "heure de Singapour", "WIT": "heure de l’Est indonésien", "MDT": "heure d’été de Macao", "ARST": "heure d’été de l’Argentine", "ECT": "heure de l’Équateur", "HAST": "heure normale d’Hawaii - Aléoutiennes", "HAT": "heure d’été de Terre-Neuve", "∅∅∅": "heure d’été de l’Amazonie", "AWST": "heure normale de l’Ouest de l’Australie", "EDT": "heure d’été de l’Est", "PDT": "heure d’été du Pacifique", "HKST": "heure d’été de Hong Kong", "WARST": "heure d’été de l’Ouest argentin", "NZDT": "heure d’été de la Nouvelle-Zélande", "UYST": "heure d’été de l’Uruguay", "ACWDT": "heure d’été du centre-ouest de l’Australie", "COT": "heure normale de Colombie", "AEST": "heure normale de l’Est de l’Australie", "BT": "heure du Bhoutan", "WART": "heure normale de l’Ouest argentin", "WITA": "heure du Centre indonésien", "GMT": "heure moyenne de Greenwich", "SRT": "heure du Suriname", "CST": "heure normale du centre nord-américain", "WEZ": "heure normale d’Europe de l’Ouest"},
+ timezones: map[string]string{"CAT": "heure normale d’Afrique centrale", "GFT": "heure de la Guyane française", "∅∅∅": "heure d’été des Açores", "ECT": "heure de l’Équateur", "NZST": "heure normale de la Nouvelle-Zélande", "BT": "heure du Bhoutan", "ACST": "heure normale du centre de l’Australie", "WAT": "heure normale d’Afrique de l’Ouest", "WAST": "heure d’été d’Afrique de l’Ouest", "CLT": "heure normale du Chili", "UYT": "heure normale de l’Uruguay", "MYT": "heure de la Malaisie", "OESZ": "heure d’été d’Europe de l’Est", "LHST": "heure normale de Lord Howe", "CST": "heure normale du centre nord-américain", "WITA": "heure du Centre indonésien", "ACWST": "heure normale du centre-ouest de l’Australie", "ACWDT": "heure d’été du centre-ouest de l’Australie", "HNT": "heure normale de Terre-Neuve", "UYST": "heure d’été de l’Uruguay", "NZDT": "heure d’été de la Nouvelle-Zélande", "BOT": "heure de Bolivie", "TMT": "heure normale du Turkménistan", "JST": "heure normale du Japon", "AST": "heure normale de l’Atlantique", "AWDT": "heure d’été de l’Ouest de l’Australie", "WIB": "heure de l’Ouest indonésien", "WEZ": "heure normale d’Europe de l’Ouest", "AEDT": "heure d’été de l’Est de l’Australie", "WARST": "heure d’été de l’Ouest argentin", "CHAST": "heure normale des îles Chatham", "ADT": "heure d’été de l’Atlantique", "PST": "heure normale du Pacifique nord-américain", "PDT": "heure d’été du Pacifique", "GYT": "heure du Guyana", "WIT": "heure de l’Est indonésien", "AKST": "heure normale de l’Alaska", "AKDT": "heure d’été de l’Alaska", "HAST": "heure normale d’Hawaii - Aléoutiennes", "MST": "heure normale de Macao", "HKST": "heure d’été de Hong Kong", "CLST": "heure d’été du Chili", "EDT": "heure d’été de l’Est", "HAT": "heure d’été de Terre-Neuve", "SGT": "heure de Singapour", "LHDT": "heure d’été de Lord Howe", "HKT": "heure normale de Hong Kong", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "SAST": "heure normale d’Afrique méridionale", "EAT": "heure normale d’Afrique de l’Est", "CDT": "heure d’été du Centre", "ACDT": "heure d’été du centre de l’Australie", "WART": "heure normale de l’Ouest argentin", "EST": "heure normale de l’Est nord-américain", "MESZ": "heure d’été d’Europe centrale", "AEST": "heure normale de l’Est de l’Australie", "ARST": "heure d’été de l’Argentine", "WESZ": "heure d’été d’Europe de l’Ouest", "OEZ": "heure normale d’Europe de l’Est", "AWST": "heure normale de l’Ouest de l’Australie", "MEZ": "heure normale d’Europe centrale", "SRT": "heure du Suriname", "COT": "heure normale de Colombie", "JDT": "heure d’été du Japon", "ART": "heure normale d’Argentine", "IST": "heure de l’Inde", "COST": "heure d’été de Colombie", "TMST": "heure d’été du Turkménistan", "GMT": "heure moyenne de Greenwich", "ChST": "heure des Chamorro", "MDT": "heure d’été de Macao", "CHADT": "heure d’été des îles Chatham", "VET": "heure du Venezuela"},
}
}
diff --git a/fr_TD/fr_TD_test.go b/fr_TD/fr_TD_test.go
new file mode 100644
index 00000000..b1f06543
--- /dev/null
+++ b/fr_TD/fr_TD_test.go
@@ -0,0 +1,1120 @@
+package fr_TD
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr_TD"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr_TG/fr_TG.go b/fr_TG/fr_TG.go
index bcc27e74..0c74e35a 100644
--- a/fr_TG/fr_TG.go
+++ b/fr_TG/fr_TG.go
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"GYT": "heure du Guyana", "WEZ": "heure normale d’Europe de l’Ouest", "MST": "heure normale des Rocheuses", "MDT": "heure d’été des Rocheuses", "EDT": "heure d’été de l’Est", "HAST": "heure normale d’Hawaii - Aléoutiennes", "SGT": "heure de Singapour", "WART": "heure normale de l’Ouest argentin", "GMT": "heure moyenne de Greenwich", "GFT": "heure de la Guyane française", "ART": "heure normale d’Argentine", "ARST": "heure d’été de l’Argentine", "TMT": "heure normale du Turkménistan", "JDT": "heure d’été du Japon", "EST": "heure normale de l’Est nord-américain", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "LHDT": "heure d’été de Lord Howe", "BOT": "heure de Bolivie", "AEST": "heure normale de l’Est de l’Australie", "SRT": "heure du Suriname", "UYST": "heure d’été de l’Uruguay", "WAST": "heure d’été d’Afrique de l’Ouest", "HAT": "heure d’été de Terre-Neuve", "MYT": "heure de la Malaisie", "∅∅∅": "heure d’été des Açores", "CST": "heure normale du centre nord-américain", "MESZ": "heure d’été d’Europe centrale", "ECT": "heure de l’Équateur", "ACDT": "heure d’été du centre de l’Australie", "PDT": "heure d’été du Pacifique", "LHST": "heure normale de Lord Howe", "NZST": "heure normale de la Nouvelle-Zélande", "NZDT": "heure d’été de la Nouvelle-Zélande", "WESZ": "heure d’été d’Europe de l’Ouest", "COST": "heure d’été de Colombie", "HKST": "heure d’été de Hong Kong", "WITA": "heure du Centre indonésien", "PST": "heure normale du Pacifique nord-américain", "ACWDT": "heure d’été du centre-ouest de l’Australie", "SAST": "heure normale d’Afrique méridionale", "HKT": "heure normale de Hong Kong", "OESZ": "heure d’été d’Europe de l’Est", "AKDT": "heure d’été de l’Alaska", "UYT": "heure normale de l’Uruguay", "ChST": "heure des Chamorro", "CHADT": "heure d’été des îles Chatham", "CAT": "heure normale d’Afrique centrale", "JST": "heure normale du Japon", "AEDT": "heure d’été de l’Est de l’Australie", "CLT": "heure normale du Chili", "WAT": "heure normale d’Afrique de l’Ouest", "HNT": "heure normale de Terre-Neuve", "ACST": "heure normale du centre de l’Australie", "CLST": "heure d’été du Chili", "ADT": "heure d’été de l’Atlantique", "WARST": "heure d’été de l’Ouest argentin", "WIT": "heure de l’Est indonésien", "WIB": "heure de l’Ouest indonésien", "EAT": "heure normale d’Afrique de l’Est", "AST": "heure normale de l’Atlantique", "AKST": "heure normale de l’Alaska", "ACWST": "heure normale du centre-ouest de l’Australie", "VET": "heure du Venezuela", "BT": "heure du Bhoutan", "IST": "heure de l’Inde", "OEZ": "heure normale d’Europe de l’Est", "MEZ": "heure normale d’Europe centrale", "CHAST": "heure normale des îles Chatham", "COT": "heure normale de Colombie", "AWST": "heure normale de l’Ouest de l’Australie", "AWDT": "heure d’été de l’Ouest de l’Australie", "CDT": "heure d’été du Centre", "TMST": "heure d’été du Turkménistan"},
+ timezones: map[string]string{"ADT": "heure d’été de l’Atlantique", "BOT": "heure de Bolivie", "WIB": "heure de l’Ouest indonésien", "UYT": "heure normale de l’Uruguay", "CHAST": "heure normale des îles Chatham", "CHADT": "heure d’été des îles Chatham", "WITA": "heure du Centre indonésien", "AKST": "heure normale de l’Alaska", "CST": "heure normale du centre nord-américain", "ART": "heure normale d’Argentine", "GMT": "heure moyenne de Greenwich", "UYST": "heure d’été de l’Uruguay", "LHST": "heure normale de Lord Howe", "SRT": "heure du Suriname", "JDT": "heure d’été du Japon", "IST": "heure de l’Inde", "SGT": "heure de Singapour", "WEZ": "heure normale d’Europe de l’Ouest", "CLT": "heure normale du Chili", "HAST": "heure normale d’Hawaii - Aléoutiennes", "PDT": "heure d’été du Pacifique", "TMT": "heure normale du Turkménistan", "GYT": "heure du Guyana", "AEST": "heure normale de l’Est de l’Australie", "HKST": "heure d’été de Hong Kong", "ARST": "heure d’été de l’Argentine", "AKDT": "heure d’été de l’Alaska", "WAT": "heure normale d’Afrique de l’Ouest", "AWDT": "heure d’été de l’Ouest de l’Australie", "WESZ": "heure d’été d’Europe de l’Ouest", "CDT": "heure d’été du Centre", "ACST": "heure normale du centre de l’Australie", "VET": "heure du Venezuela", "MDT": "heure d’été de Macao", "EST": "heure normale de l’Est nord-américain", "CAT": "heure normale d’Afrique centrale", "ChST": "heure des Chamorro", "MYT": "heure de la Malaisie", "EAT": "heure normale d’Afrique de l’Est", "MST": "heure normale de Macao", "ECT": "heure de l’Équateur", "COST": "heure d’été de Colombie", "WART": "heure normale de l’Ouest argentin", "NZDT": "heure d’été de la Nouvelle-Zélande", "HNT": "heure normale de Terre-Neuve", "OEZ": "heure normale d’Europe de l’Est", "GFT": "heure de la Guyane française", "AST": "heure normale de l’Atlantique", "AWST": "heure normale de l’Ouest de l’Australie", "TMST": "heure d’été du Turkménistan", "EDT": "heure d’été de l’Est", "WAST": "heure d’été d’Afrique de l’Ouest", "CLST": "heure d’été du Chili", "BT": "heure du Bhoutan", "ACWST": "heure normale du centre-ouest de l’Australie", "ACWDT": "heure d’été du centre-ouest de l’Australie", "MESZ": "heure d’été d’Europe centrale", "NZST": "heure normale de la Nouvelle-Zélande", "LHDT": "heure d’été de Lord Howe", "HKT": "heure normale de Hong Kong", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "SAST": "heure normale d’Afrique méridionale", "ACDT": "heure d’été du centre de l’Australie", "∅∅∅": "heure d’été des Açores", "JST": "heure normale du Japon", "PST": "heure normale du Pacifique nord-américain", "OESZ": "heure d’été d’Europe de l’Est", "AEDT": "heure d’été de l’Est de l’Australie", "WARST": "heure d’été de l’Ouest argentin", "MEZ": "heure normale d’Europe centrale", "COT": "heure normale de Colombie", "HAT": "heure d’été de Terre-Neuve", "WIT": "heure de l’Est indonésien"},
}
}
diff --git a/fr_TG/fr_TG_test.go b/fr_TG/fr_TG_test.go
new file mode 100644
index 00000000..3a4776a5
--- /dev/null
+++ b/fr_TG/fr_TG_test.go
@@ -0,0 +1,1120 @@
+package fr_TG
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr_TG"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr_TN/fr_TN.go b/fr_TN/fr_TN.go
index d1048fdf..fb46d506 100644
--- a/fr_TN/fr_TN.go
+++ b/fr_TN/fr_TN.go
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"AST": "heure normale de l’Atlantique", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "GYT": "heure du Guyana", "CST": "heure normale du centre nord-américain", "AEST": "heure normale de l’Est de l’Australie", "ECT": "heure de l’Équateur", "TMST": "heure d’été du Turkménistan", "AKST": "heure normale de l’Alaska", "ACWST": "heure normale du centre-ouest de l’Australie", "TMT": "heure normale du Turkménistan", "MYT": "heure de la Malaisie", "CHAST": "heure normale des îles Chatham", "CHADT": "heure d’été des îles Chatham", "IST": "heure de l’Inde", "HAT": "heure d’été de Terre-Neuve", "MESZ": "heure d’été d’Europe centrale", "NZST": "heure normale de la Nouvelle-Zélande", "CLST": "heure d’été du Chili", "CAT": "heure normale d’Afrique centrale", "HKST": "heure d’été de Hong Kong", "WIT": "heure de l’Est indonésien", "OESZ": "heure d’été d’Europe de l’Est", "ACST": "heure normale du centre de l’Australie", "ARST": "heure d’été de l’Argentine", "WAST": "heure d’été d’Afrique de l’Ouest", "WARST": "heure d’été de l’Ouest argentin", "PDT": "heure d’été du Pacifique", "WIB": "heure de l’Ouest indonésien", "AWST": "heure normale de l’Ouest de l’Australie", "ACWDT": "heure d’été du centre-ouest de l’Australie", "MDT": "heure d’été de Macao", "PST": "heure normale du Pacifique nord-américain", "WESZ": "heure d’été d’Europe de l’Ouest", "HKT": "heure normale de Hong Kong", "OEZ": "heure normale d’Europe de l’Est", "WITA": "heure du Centre indonésien", "EAT": "heure normale d’Afrique de l’Est", "AKDT": "heure d’été de l’Alaska", "UYT": "heure normale de l’Uruguay", "BT": "heure du Bhoutan", "ACDT": "heure d’été du centre de l’Australie", "JDT": "heure d’été du Japon", "CLT": "heure normale du Chili", "HNT": "heure normale de Terre-Neuve", "JST": "heure normale du Japon", "LHST": "heure normale de Lord Howe", "WAT": "heure normale d’Afrique de l’Ouest", "ChST": "heure des Chamorro", "SAST": "heure normale d’Afrique méridionale", "GFT": "heure de la Guyane française", "AWDT": "heure d’été de l’Ouest de l’Australie", "MEZ": "heure normale d’Europe centrale", "ADT": "heure d’été de l’Atlantique", "HAST": "heure normale d’Hawaii - Aléoutiennes", "SGT": "heure de Singapour", "UYST": "heure d’été de l’Uruguay", "VET": "heure du Venezuela", "WEZ": "heure normale d’Europe de l’Ouest", "AEDT": "heure d’été de l’Est de l’Australie", "EDT": "heure d’été de l’Est", "COT": "heure normale de Colombie", "WART": "heure normale de l’Ouest argentin", "GMT": "heure moyenne de Greenwich", "ART": "heure normale d’Argentine", "EST": "heure normale de l’Est nord-américain", "COST": "heure d’été de Colombie", "∅∅∅": "heure d’été de l’Acre", "MST": "heure normale de Macao", "SRT": "heure du Suriname", "LHDT": "heure d’été de Lord Howe", "CDT": "heure d’été du Centre", "NZDT": "heure d’été de la Nouvelle-Zélande", "BOT": "heure de Bolivie"},
+ timezones: map[string]string{"LHST": "heure normale de Lord Howe", "VET": "heure du Venezuela", "JDT": "heure d’été du Japon", "PDT": "heure d’été du Pacifique", "BOT": "heure de Bolivie", "HAST": "heure normale d’Hawaii - Aléoutiennes", "NZDT": "heure d’été de la Nouvelle-Zélande", "COT": "heure normale de Colombie", "WAST": "heure d’été d’Afrique de l’Ouest", "ACWST": "heure normale du centre-ouest de l’Australie", "WITA": "heure du Centre indonésien", "AKDT": "heure d’été de l’Alaska", "ADT": "heure d’été de l’Atlantique", "MYT": "heure de la Malaisie", "BT": "heure du Bhoutan", "AST": "heure normale de l’Atlantique", "HAT": "heure d’été de Terre-Neuve", "LHDT": "heure d’été de Lord Howe", "CDT": "heure d’été du Centre", "JST": "heure normale du Japon", "OEZ": "heure normale d’Europe de l’Est", "GMT": "heure moyenne de Greenwich", "ACWDT": "heure d’été du centre-ouest de l’Australie", "ART": "heure normale d’Argentine", "MESZ": "heure d’été d’Europe centrale", "WEZ": "heure normale d’Europe de l’Ouest", "WARST": "heure d’été de l’Ouest argentin", "AWST": "heure normale de l’Ouest de l’Australie", "CLST": "heure d’été du Chili", "EAT": "heure normale d’Afrique de l’Est", "MST": "heure normale de Macao", "OESZ": "heure d’été d’Europe de l’Est", "WIT": "heure de l’Est indonésien", "HKT": "heure normale de Hong Kong", "EST": "heure normale de l’Est nord-américain", "COST": "heure d’été de Colombie", "GYT": "heure du Guyana", "UYT": "heure normale de l’Uruguay", "SRT": "heure du Suriname", "CST": "heure normale du centre nord-américain", "∅∅∅": "heure d’été des Açores", "CLT": "heure normale du Chili", "IST": "heure de l’Inde", "CAT": "heure normale d’Afrique centrale", "ChST": "heure des Chamorro", "ECT": "heure de l’Équateur", "TMST": "heure d’été du Turkménistan", "WAT": "heure normale d’Afrique de l’Ouest", "UYST": "heure d’été de l’Uruguay", "SAST": "heure normale d’Afrique méridionale", "HKST": "heure d’été de Hong Kong", "AWDT": "heure d’été de l’Ouest de l’Australie", "AKST": "heure normale de l’Alaska", "PST": "heure normale du Pacifique nord-américain", "SGT": "heure de Singapour", "TMT": "heure normale du Turkménistan", "ACST": "heure normale du centre de l’Australie", "CHAST": "heure normale des îles Chatham", "ARST": "heure d’été de l’Argentine", "NZST": "heure normale de la Nouvelle-Zélande", "WART": "heure normale de l’Ouest argentin", "ACDT": "heure d’été du centre de l’Australie", "CHADT": "heure d’été des îles Chatham", "MEZ": "heure normale d’Europe centrale", "HNT": "heure normale de Terre-Neuve", "AEST": "heure normale de l’Est de l’Australie", "GFT": "heure de la Guyane française", "MDT": "heure d’été de Macao", "EDT": "heure d’été de l’Est", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "WESZ": "heure d’été d’Europe de l’Ouest", "WIB": "heure de l’Ouest indonésien", "AEDT": "heure d’été de l’Est de l’Australie"},
}
}
diff --git a/fr_TN/fr_TN_test.go b/fr_TN/fr_TN_test.go
new file mode 100644
index 00000000..ab21a788
--- /dev/null
+++ b/fr_TN/fr_TN_test.go
@@ -0,0 +1,1120 @@
+package fr_TN
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr_TN"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr_VU/fr_VU.go b/fr_VU/fr_VU.go
index 78a99836..5bae1b4e 100644
--- a/fr_VU/fr_VU.go
+++ b/fr_VU/fr_VU.go
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"ACDT": "heure d’été du centre de l’Australie", "MYT": "heure de la Malaisie", "PST": "heure normale du Pacifique nord-américain", "UYST": "heure d’été de l’Uruguay", "WAST": "heure d’été d’Afrique de l’Ouest", "GFT": "heure de la Guyane française", "AST": "heure normale de l’Atlantique", "SGT": "heure de Singapour", "HNT": "heure normale de Terre-Neuve", "MESZ": "heure d’été d’Europe centrale", "CLST": "heure d’été du Chili", "MST": "heure normale de Macao", "COT": "heure normale de Colombie", "UYT": "heure normale de l’Uruguay", "ART": "heure normale d’Argentine", "TMT": "heure normale du Turkménistan", "LHDT": "heure d’été de Lord Howe", "CLT": "heure normale du Chili", "ECT": "heure de l’Équateur", "OEZ": "heure normale d’Europe de l’Est", "JST": "heure normale du Japon", "AKDT": "heure d’été de l’Alaska", "ACST": "heure normale du centre de l’Australie", "NZDT": "heure d’été de la Nouvelle-Zélande", "ACWST": "heure normale du centre-ouest de l’Australie", "AEDT": "heure d’été de l’Est de l’Australie", "EST": "heure normale de l’Est nord-américain", "HKT": "heure normale de Hong Kong", "WART": "heure normale de l’Ouest argentin", "∅∅∅": "heure d’été de l’Amazonie", "EDT": "heure d’été de l’Est", "COST": "heure d’été de Colombie", "HAST": "heure normale d’Hawaii - Aléoutiennes", "ADT": "heure d’été de l’Atlantique", "BT": "heure du Bhoutan", "AWST": "heure normale de l’Ouest de l’Australie", "ChST": "heure des Chamorro", "GYT": "heure du Guyana", "BOT": "heure de Bolivie", "NZST": "heure normale de la Nouvelle-Zélande", "HKST": "heure d’été de Hong Kong", "HAT": "heure d’été de Terre-Neuve", "IST": "heure de l’Inde", "WARST": "heure d’été de l’Ouest argentin", "OESZ": "heure d’été d’Europe de l’Est", "CAT": "heure normale d’Afrique centrale", "JDT": "heure d’été du Japon", "AKST": "heure normale de l’Alaska", "AWDT": "heure d’été de l’Ouest de l’Australie", "CDT": "heure d’été du Centre", "CHAST": "heure normale des îles Chatham", "SAST": "heure normale d’Afrique méridionale", "WITA": "heure du Centre indonésien", "WIB": "heure de l’Ouest indonésien", "WESZ": "heure d’été d’Europe de l’Ouest", "WEZ": "heure normale d’Europe de l’Ouest", "WIT": "heure de l’Est indonésien", "LHST": "heure normale de Lord Howe", "SRT": "heure du Suriname", "CHADT": "heure d’été des îles Chatham", "ACWDT": "heure d’été du centre-ouest de l’Australie", "GMT": "heure moyenne de Greenwich", "CST": "heure normale du centre nord-américain", "MEZ": "heure normale d’Europe centrale", "TMST": "heure d’été du Turkménistan", "EAT": "heure normale d’Afrique de l’Est", "PDT": "heure d’été du Pacifique", "VET": "heure du Venezuela", "AEST": "heure normale de l’Est de l’Australie", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "WAT": "heure normale d’Afrique de l’Ouest", "ARST": "heure d’été de l’Argentine", "MDT": "heure d’été de Macao"},
+ timezones: map[string]string{"MDT": "heure d’été des Rocheuses", "JST": "heure normale du Japon", "JDT": "heure d’été du Japon", "ACWST": "heure normale du centre-ouest de l’Australie", "∅∅∅": "heure d’été de l’Amazonie", "MYT": "heure de la Malaisie", "WIT": "heure de l’Est indonésien", "CDT": "heure d’été du Centre", "ACST": "heure normale du centre de l’Australie", "ADT": "heure d’été de l’Atlantique", "BOT": "heure de Bolivie", "PDT": "heure d’été du Pacifique", "AEDT": "heure d’été de l’Est de l’Australie", "SRT": "heure du Suriname", "GFT": "heure de la Guyane française", "HKST": "heure d’été de Hong Kong", "HAST": "heure normale d’Hawaii - Aléoutiennes", "EDT": "heure d’été de l’Est", "COST": "heure d’été de Colombie", "WAT": "heure normale d’Afrique de l’Ouest", "AKDT": "heure d’été de l’Alaska", "MEZ": "heure normale d’Europe centrale", "WAST": "heure d’été d’Afrique de l’Ouest", "ChST": "heure des Chamorro", "OESZ": "heure d’été d’Europe de l’Est", "ACDT": "heure d’été du centre de l’Australie", "NZST": "heure normale de la Nouvelle-Zélande", "CAT": "heure normale d’Afrique centrale", "HNT": "heure normale de Terre-Neuve", "GYT": "heure du Guyana", "MESZ": "heure d’été d’Europe centrale", "EST": "heure normale de l’Est nord-américain", "TMST": "heure d’été du Turkménistan", "GMT": "heure moyenne de Greenwich", "AEST": "heure normale de l’Est de l’Australie", "PST": "heure normale du Pacifique nord-américain", "WESZ": "heure d’été d’Europe de l’Ouest", "WEZ": "heure normale d’Europe de l’Ouest", "MST": "heure normale des Rocheuses", "HKT": "heure normale de Hong Kong", "ART": "heure normale d’Argentine", "ACWDT": "heure d’été du centre-ouest de l’Australie", "AWDT": "heure d’été de l’Ouest de l’Australie", "TMT": "heure normale du Turkménistan", "HAT": "heure d’été de Terre-Neuve", "ARST": "heure d’été de l’Argentine", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "NZDT": "heure d’été de la Nouvelle-Zélande", "SAST": "heure normale d’Afrique méridionale", "WART": "heure normale de l’Ouest argentin", "ECT": "heure de l’Équateur", "AKST": "heure normale de l’Alaska", "SGT": "heure de Singapour", "UYT": "heure normale de l’Uruguay", "LHDT": "heure d’été de Lord Howe", "CHADT": "heure d’été des îles Chatham", "AWST": "heure normale de l’Ouest de l’Australie", "IST": "heure de l’Inde", "WARST": "heure d’été de l’Ouest argentin", "CHAST": "heure normale des îles Chatham", "CLST": "heure d’été du Chili", "EAT": "heure normale d’Afrique de l’Est", "LHST": "heure normale de Lord Howe", "WITA": "heure du Centre indonésien", "COT": "heure normale de Colombie", "CST": "heure normale du centre nord-américain", "VET": "heure du Venezuela", "AST": "heure normale de l’Atlantique", "WIB": "heure de l’Ouest indonésien", "OEZ": "heure normale d’Europe de l’Est", "BT": "heure du Bhoutan", "CLT": "heure normale du Chili", "UYST": "heure d’été de l’Uruguay"},
}
}
diff --git a/fr_VU/fr_VU_test.go b/fr_VU/fr_VU_test.go
new file mode 100644
index 00000000..214c5be7
--- /dev/null
+++ b/fr_VU/fr_VU_test.go
@@ -0,0 +1,1120 @@
+package fr_VU
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr_VU"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr_WF/fr_WF.go b/fr_WF/fr_WF.go
index b4967e10..e362a6da 100644
--- a/fr_WF/fr_WF.go
+++ b/fr_WF/fr_WF.go
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"MEZ": "heure normale d’Europe centrale", "WEZ": "heure normale d’Europe de l’Ouest", "MDT": "heure d’été des Rocheuses", "WIT": "heure de l’Est indonésien", "GFT": "heure de la Guyane française", "AWDT": "heure d’été de l’Ouest de l’Australie", "NZDT": "heure d’été de la Nouvelle-Zélande", "CLST": "heure d’été du Chili", "PST": "heure normale du Pacifique nord-américain", "VET": "heure du Venezuela", "CAT": "heure normale d’Afrique centrale", "COST": "heure d’été de Colombie", "TMT": "heure normale du Turkménistan", "AWST": "heure normale de l’Ouest de l’Australie", "NZST": "heure normale de la Nouvelle-Zélande", "BOT": "heure de Bolivie", "EST": "heure normale de l’Est nord-américain", "WAT": "heure normale d’Afrique de l’Ouest", "HKT": "heure normale de Hong Kong", "JDT": "heure d’été du Japon", "MESZ": "heure d’été d’Europe centrale", "HAST": "heure normale d’Hawaii - Aléoutiennes", "UYST": "heure d’été de l’Uruguay", "ACWDT": "heure d’été du centre-ouest de l’Australie", "AEST": "heure normale de l’Est de l’Australie", "MST": "heure normale des Rocheuses", "ART": "heure normale d’Argentine", "AKST": "heure normale de l’Alaska", "LHST": "heure normale de Lord Howe", "WIB": "heure de l’Ouest indonésien", "HAT": "heure d’été de Terre-Neuve", "EAT": "heure normale d’Afrique de l’Est", "GYT": "heure du Guyana", "CLT": "heure normale du Chili", "CHAST": "heure normale des îles Chatham", "CHADT": "heure d’été des îles Chatham", "COT": "heure normale de Colombie", "WAST": "heure d’été d’Afrique de l’Ouest", "HKST": "heure d’été de Hong Kong", "OEZ": "heure normale d’Europe de l’Est", "ACDT": "heure d’été du centre de l’Australie", "ARST": "heure d’été de l’Argentine", "TMST": "heure d’été du Turkménistan", "AST": "heure normale de l’Atlantique", "SGT": "heure de Singapour", "PDT": "heure d’été du Pacifique", "ACWST": "heure normale du centre-ouest de l’Australie", "ChST": "heure des Chamorro", "ECT": "heure de l’Équateur", "BT": "heure du Bhoutan", "CST": "heure normale du centre nord-américain", "WART": "heure normale de l’Ouest argentin", "GMT": "heure moyenne de Greenwich", "JST": "heure normale du Japon", "SRT": "heure du Suriname", "CDT": "heure d’été du Centre", "EDT": "heure d’été de l’Est", "∅∅∅": "heure d’été de Brasilia", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "SAST": "heure normale d’Afrique méridionale", "OESZ": "heure d’été d’Europe de l’Est", "ACST": "heure normale du centre de l’Australie", "UYT": "heure normale de l’Uruguay", "ADT": "heure d’été de l’Atlantique", "IST": "heure de l’Inde", "HNT": "heure normale de Terre-Neuve", "WESZ": "heure d’été d’Europe de l’Ouest", "AEDT": "heure d’été de l’Est de l’Australie", "WARST": "heure d’été de l’Ouest argentin", "WITA": "heure du Centre indonésien", "AKDT": "heure d’été de l’Alaska", "LHDT": "heure d’été de Lord Howe", "MYT": "heure de la Malaisie"},
+ timezones: map[string]string{"WIT": "heure de l’Est indonésien", "ACDT": "heure d’été du centre de l’Australie", "VET": "heure du Venezuela", "AWST": "heure normale de l’Ouest de l’Australie", "HNT": "heure normale de Terre-Neuve", "OESZ": "heure d’été d’Europe de l’Est", "MDT": "heure d’été des Rocheuses", "CLT": "heure normale du Chili", "HKST": "heure d’été de Hong Kong", "ART": "heure normale d’Argentine", "PDT": "heure d’été du Pacifique", "MEZ": "heure normale d’Europe centrale", "OEZ": "heure normale d’Europe de l’Est", "MYT": "heure de la Malaisie", "BT": "heure du Bhoutan", "CLST": "heure d’été du Chili", "CST": "heure normale du centre nord-américain", "SGT": "heure de Singapour", "ECT": "heure de l’Équateur", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "COT": "heure normale de Colombie", "WESZ": "heure d’été d’Europe de l’Ouest", "LHDT": "heure d’été de Lord Howe", "SRT": "heure du Suriname", "ACST": "heure normale du centre de l’Australie", "GMT": "heure moyenne de Greenwich", "HAST": "heure normale d’Hawaii - Aléoutiennes", "SAST": "heure normale d’Afrique méridionale", "AST": "heure normale de l’Atlantique", "ACWST": "heure normale du centre-ouest de l’Australie", "WAT": "heure normale d’Afrique de l’Ouest", "TMT": "heure normale du Turkménistan", "EAT": "heure normale d’Afrique de l’Est", "CDT": "heure d’été du Centre", "ARST": "heure d’été de l’Argentine", "∅∅∅": "heure d’été de Brasilia", "JST": "heure normale du Japon", "MESZ": "heure d’été d’Europe centrale", "AKST": "heure normale de l’Alaska", "PST": "heure normale du Pacifique nord-américain", "TMST": "heure d’été du Turkménistan", "MST": "heure normale des Rocheuses", "UYST": "heure d’été de l’Uruguay", "CHAST": "heure normale des îles Chatham", "GYT": "heure du Guyana", "WARST": "heure d’été de l’Ouest argentin", "ADT": "heure d’été de l’Atlantique", "WITA": "heure du Centre indonésien", "IST": "heure de l’Inde", "WEZ": "heure normale d’Europe de l’Ouest", "ChST": "heure des Chamorro", "BOT": "heure de Bolivie", "CAT": "heure normale d’Afrique centrale", "AEST": "heure normale de l’Est de l’Australie", "WART": "heure normale de l’Ouest argentin", "JDT": "heure d’été du Japon", "NZST": "heure normale de la Nouvelle-Zélande", "NZDT": "heure d’été de la Nouvelle-Zélande", "HAT": "heure d’été de Terre-Neuve", "WIB": "heure de l’Ouest indonésien", "WAST": "heure d’été d’Afrique de l’Ouest", "AEDT": "heure d’été de l’Est de l’Australie", "HKT": "heure normale de Hong Kong", "AKDT": "heure d’été de l’Alaska", "CHADT": "heure d’été des îles Chatham", "ACWDT": "heure d’été du centre-ouest de l’Australie", "EST": "heure normale de l’Est nord-américain", "EDT": "heure d’été de l’Est", "UYT": "heure normale de l’Uruguay", "LHST": "heure normale de Lord Howe", "GFT": "heure de la Guyane française", "AWDT": "heure d’été de l’Ouest de l’Australie", "COST": "heure d’été de Colombie"},
}
}
diff --git a/fr_WF/fr_WF_test.go b/fr_WF/fr_WF_test.go
new file mode 100644
index 00000000..ba6b0c91
--- /dev/null
+++ b/fr_WF/fr_WF_test.go
@@ -0,0 +1,1120 @@
+package fr_WF
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr_WF"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fr_YT/fr_YT.go b/fr_YT/fr_YT.go
index e5ac810c..3d901c87 100644
--- a/fr_YT/fr_YT.go
+++ b/fr_YT/fr_YT.go
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. J.-C.", "ap. J.-C."},
erasNarrow: []string{"av. J.-C.", "ap. J.-C."},
erasWide: []string{"avant Jésus-Christ", "après Jésus-Christ"},
- timezones: map[string]string{"GFT": "heure de la Guyane française", "TMST": "heure d’été du Turkménistan", "AWST": "heure normale de l’Ouest de l’Australie", "WEZ": "heure normale d’Europe de l’Ouest", "CHADT": "heure d’été des îles Chatham", "HAT": "heure d’été de Terre-Neuve", "WAT": "heure normale d’Afrique de l’Ouest", "GMT": "heure moyenne de Greenwich", "CAT": "heure normale d’Afrique centrale", "ADT": "heure d’été de l’Atlantique", "BT": "heure du Bhoutan", "SRT": "heure du Suriname", "AEST": "heure normale de l’Est de l’Australie", "AEDT": "heure d’été de l’Est de l’Australie", "CHAST": "heure normale des îles Chatham", "COT": "heure normale de Colombie", "AKDT": "heure d’été de l’Alaska", "MYT": "heure de la Malaisie", "CDT": "heure d’été du Centre", "VET": "heure du Venezuela", "ACDT": "heure d’été du centre de l’Australie", "CST": "heure normale du centre nord-américain", "BOT": "heure de Bolivie", "ACWDT": "heure d’été du centre-ouest de l’Australie", "OESZ": "heure d’été d’Europe de l’Est", "AST": "heure normale de l’Atlantique", "WITA": "heure du Centre indonésien", "AKST": "heure normale de l’Alaska", "PST": "heure normale du Pacifique nord-américain", "UYST": "heure d’été de l’Uruguay", "EDT": "heure d’été de l’Est", "GYT": "heure du Guyana", "MDT": "heure d’été de Macao", "ART": "heure normale d’Argentine", "ARST": "heure d’été de l’Argentine", "CLT": "heure normale du Chili", "CLST": "heure d’été du Chili", "ECT": "heure de l’Équateur", "WIB": "heure de l’Ouest indonésien", "TMT": "heure normale du Turkménistan", "HKST": "heure d’été de Hong Kong", "IST": "heure de l’Inde", "JST": "heure normale du Japon", "MEZ": "heure normale d’Europe centrale", "ACWST": "heure normale du centre-ouest de l’Australie", "∅∅∅": "heure d’été de Brasilia", "WART": "heure normale de l’Ouest argentin", "LHST": "heure normale de Lord Howe", "NZDT": "heure d’été de la Nouvelle-Zélande", "COST": "heure d’été de Colombie", "HAST": "heure normale d’Hawaii - Aléoutiennes", "WAST": "heure d’été d’Afrique de l’Ouest", "OEZ": "heure normale d’Europe de l’Est", "EAT": "heure normale d’Afrique de l’Est", "EST": "heure normale de l’Est nord-américain", "SAST": "heure normale d’Afrique méridionale", "WIT": "heure de l’Est indonésien", "ACST": "heure normale du centre de l’Australie", "SGT": "heure de Singapour", "HKT": "heure normale de Hong Kong", "HNT": "heure normale de Terre-Neuve", "LHDT": "heure d’été de Lord Howe", "JDT": "heure d’été du Japon", "NZST": "heure normale de la Nouvelle-Zélande", "WESZ": "heure d’été d’Europe de l’Ouest", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "PDT": "heure d’été du Pacifique", "AWDT": "heure d’été de l’Ouest de l’Australie", "UYT": "heure normale de l’Uruguay", "MST": "heure normale de Macao", "MESZ": "heure d’été d’Europe centrale", "ChST": "heure des Chamorro", "WARST": "heure d’été de l’Ouest argentin"},
+ timezones: map[string]string{"SAST": "heure normale d’Afrique méridionale", "MESZ": "heure d’été d’Europe centrale", "BOT": "heure de Bolivie", "COT": "heure normale de Colombie", "AKST": "heure normale de l’Alaska", "ACWST": "heure normale du centre-ouest de l’Australie", "IST": "heure de l’Inde", "AEDT": "heure d’été de l’Est de l’Australie", "CHADT": "heure d’été des îles Chatham", "AST": "heure normale de l’Atlantique", "AWDT": "heure d’été de l’Ouest de l’Australie", "EDT": "heure d’été de l’Est", "COST": "heure d’été de Colombie", "ACST": "heure normale du centre de l’Australie", "GFT": "heure de la Guyane française", "MDT": "heure d’été de Macao", "PST": "heure normale du Pacifique nord-américain", "WESZ": "heure d’été d’Europe de l’Ouest", "HNT": "heure normale de Terre-Neuve", "GMT": "heure moyenne de Greenwich", "JDT": "heure d’été du Japon", "NZST": "heure normale de la Nouvelle-Zélande", "CAT": "heure normale d’Afrique centrale", "WARST": "heure d’été de l’Ouest argentin", "MEZ": "heure normale d’Europe centrale", "WAT": "heure normale d’Afrique de l’Ouest", "WAST": "heure d’été d’Afrique de l’Ouest", "UYT": "heure normale de l’Uruguay", "CDT": "heure d’été du Centre", "HADT": "heure d’été d’Hawaii - Aléoutiennes", "OEZ": "heure normale d’Europe de l’Est", "ADT": "heure d’été de l’Atlantique", "WEZ": "heure normale d’Europe de l’Ouest", "WIB": "heure de l’Ouest indonésien", "OESZ": "heure d’été d’Europe de l’Est", "LHDT": "heure d’été de Lord Howe", "SRT": "heure du Suriname", "WITA": "heure du Centre indonésien", "JST": "heure normale du Japon", "TMST": "heure d’été du Turkménistan", "AEST": "heure normale de l’Est de l’Australie", "BT": "heure du Bhoutan", "WART": "heure normale de l’Ouest argentin", "AKDT": "heure d’été de l’Alaska", "HAST": "heure normale d’Hawaii - Aléoutiennes", "HAT": "heure d’été de Terre-Neuve", "GYT": "heure du Guyana", "CLT": "heure normale du Chili", "MST": "heure normale de Macao", "HKST": "heure d’été de Hong Kong", "AWST": "heure normale de l’Ouest de l’Australie", "EST": "heure normale de l’Est nord-américain", "CST": "heure normale du centre nord-américain", "∅∅∅": "heure d’été des Açores", "ARST": "heure d’été de l’Argentine", "NZDT": "heure d’été de la Nouvelle-Zélande", "EAT": "heure normale d’Afrique de l’Est", "ACDT": "heure d’été du centre de l’Australie", "HKT": "heure normale de Hong Kong", "LHST": "heure normale de Lord Howe", "WIT": "heure de l’Est indonésien", "CHAST": "heure normale des îles Chatham", "VET": "heure du Venezuela", "SGT": "heure de Singapour", "MYT": "heure de la Malaisie", "PDT": "heure d’été du Pacifique", "TMT": "heure normale du Turkménistan", "ChST": "heure des Chamorro", "UYST": "heure d’été de l’Uruguay", "ECT": "heure de l’Équateur", "ACWDT": "heure d’été du centre-ouest de l’Australie", "ART": "heure normale d’Argentine", "CLST": "heure d’été du Chili"},
}
}
diff --git a/fr_YT/fr_YT_test.go b/fr_YT/fr_YT_test.go
new file mode 100644
index 00000000..1a4aeaa1
--- /dev/null
+++ b/fr_YT/fr_YT_test.go
@@ -0,0 +1,1120 @@
+package fr_YT
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fr_YT"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fur/fur.go b/fur/fur.go
index e194c928..f887bea2 100644
--- a/fur/fur.go
+++ b/fur/fur.go
@@ -69,7 +69,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"pdC", "ddC"},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"SGT": "SGT", "JST": "JST", "MESZ": "Ore estive de Europe centrâl", "ACWST": "ACWST", "EST": "EST", "COT": "COT", "UYT": "UYT", "CDT": "CDT", "NZDT": "NZDT", "CHADT": "CHADT", "∅∅∅": "∅∅∅", "WART": "WART", "AEDT": "AEDT", "AST": "AST", "AKDT": "AKDT", "AWST": "AWST", "CLST": "CLST", "HKST": "HKST", "AKST": "AKST", "PDT": "PDT", "ART": "ART", "TMST": "TMST", "SRT": "SRT", "BT": "BT", "WIB": "WIB", "HAST": "HAST", "HKT": "HKT", "LHDT": "LHDT", "MEZ": "Ore standard de Europe centrâl", "VET": "VET", "CAT": "CAT", "ADT": "ADT", "GMT": "GMT", "ACDT": "ACDT", "NZST": "NZST", "ChST": "ChST", "WARST": "WARST", "WITA": "WITA", "COST": "COST", "HADT": "HADT", "HNT": "HNT", "OESZ": "Ore estive de Europe orientâl", "EAT": "EAT", "MDT": "MDT", "CLT": "CLT", "ACWDT": "ACWDT", "JDT": "JDT", "CST": "CST", "AWDT": "AWDT", "WEZ": "Ore standard de Europe ocidentâl", "SAST": "SAST", "ARST": "ARST", "OEZ": "Ore standard de Europe orientâl", "UYST": "UYST", "MST": "MST", "EDT": "EDT", "WAST": "WAST", "CHAST": "CHAST", "ACST": "ACST", "GYT": "GYT", "HAT": "HAT", "GFT": "GFT", "TMT": "TMT", "PST": "PST", "WESZ": "Ore estive de Europe ocidentâl", "ECT": "ECT", "IST": "IST", "MYT": "MYT", "BOT": "BOT", "AEST": "AEST", "WAT": "WAT", "WIT": "WIT", "LHST": "LHST"},
+ timezones: map[string]string{"EST": "EST", "AEDT": "AEDT", "GYT": "GYT", "LHDT": "LHDT", "AWST": "AWST", "WAT": "WAT", "AEST": "AEST", "MYT": "MYT", "WARST": "WARST", "COST": "COST", "MST": "MST", "CST": "CST", "EDT": "EDT", "HAST": "HAST", "OESZ": "Ore estive de Europe orientâl", "LHST": "LHST", "WIT": "WIT", "ADT": "ADT", "JST": "JST", "HAT": "HAT", "ChST": "ChST", "CHAST": "CHAST", "CHADT": "CHADT", "AST": "AST", "ART": "ART", "WESZ": "Ore estive de Europe ocidentâl", "TMST": "TMST", "CAT": "CAT", "BT": "BT", "VET": "VET", "UYT": "UYT", "ACDT": "ACDT", "ARST": "ARST", "JDT": "JDT", "MESZ": "Ore estive de Europe centrâl", "BOT": "BOT", "WAST": "WAST", "WART": "WART", "HKST": "HKST", "NZDT": "NZDT", "GMT": "GMT", "HKT": "HKT", "WITA": "WITA", "AKDT": "AKDT", "GFT": "GFT", "ECT": "ECT", "HNT": "HNT", "COT": "COT", "OEZ": "Ore standard de Europe orientâl", "CDT": "CDT", "AKST": "AKST", "HADT": "HADT", "NZST": "NZST", "∅∅∅": "∅∅∅", "SGT": "SGT", "CLT": "CLT", "EAT": "EAT", "PDT": "PDT", "WEZ": "Ore standard de Europe ocidentâl", "AWDT": "AWDT", "MEZ": "Ore standard de Europe centrâl", "TMT": "TMT", "ACWST": "ACWST", "IST": "IST", "PST": "PST", "SAST": "SAST", "MDT": "MDT", "ACST": "ACST", "ACWDT": "ACWDT", "WIB": "WIB", "CLST": "CLST", "UYST": "UYST", "SRT": "SRT"},
}
}
diff --git a/fur/fur_test.go b/fur/fur_test.go
new file mode 100644
index 00000000..c7f73cad
--- /dev/null
+++ b/fur/fur_test.go
@@ -0,0 +1,1120 @@
+package fur
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fur"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fur_IT/fur_IT.go b/fur_IT/fur_IT.go
index fd7487e9..75772f85 100644
--- a/fur_IT/fur_IT.go
+++ b/fur_IT/fur_IT.go
@@ -69,7 +69,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"pdC", "ddC"},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"WARST": "WARST", "AWST": "AWST", "NZST": "NZST", "UYST": "UYST", "ACWST": "ACWST", "HADT": "HADT", "COT": "COT", "HAT": "HAT", "PST": "PST", "BOT": "BOT", "AEDT": "AEDT", "CLST": "CLST", "EST": "EST", "ACST": "ACST", "EAT": "EAT", "UYT": "UYT", "CDT": "CDT", "ADT": "ADT", "OEZ": "Ore standard de Europe orientâl", "AEST": "AEST", "ChST": "ChST", "ECT": "ECT", "WAST": "WAST", "MST": "MST", "ACWDT": "ACWDT", "HAST": "HAST", "WIT": "WIT", "WESZ": "Ore estive de Europe ocidentâl", "COST": "COST", "MYT": "MYT", "JST": "JST", "LHDT": "LHDT", "GMT": "GMT", "GFT": "GFT", "WIB": "WIB", "MEZ": "Ore standard de Europe centrâl", "MESZ": "Ore estive de Europe centrâl", "SGT": "SGT", "WAT": "WAT", "BT": "BT", "HKST": "HKST", "WART": "WART", "WITA": "WITA", "ACDT": "ACDT", "GYT": "GYT", "∅∅∅": "∅∅∅", "CHAST": "CHAST", "OESZ": "Ore estive de Europe orientâl", "AKDT": "AKDT", "SAST": "SAST", "JDT": "JDT", "CLT": "CLT", "CAT": "CAT", "MDT": "MDT", "ART": "ART", "AWDT": "AWDT", "SRT": "SRT", "EDT": "EDT", "NZDT": "NZDT", "VET": "VET", "PDT": "PDT", "HNT": "HNT", "ARST": "ARST", "TMST": "TMST", "CST": "CST", "CHADT": "CHADT", "HKT": "HKT", "IST": "IST", "TMT": "TMT", "LHST": "LHST", "AKST": "AKST", "WEZ": "Ore standard de Europe ocidentâl", "AST": "AST"},
+ timezones: map[string]string{"AEST": "AEST", "AEDT": "AEDT", "SAST": "SAST", "PDT": "PDT", "HAT": "HAT", "LHDT": "LHDT", "JDT": "JDT", "AWDT": "AWDT", "NZST": "NZST", "NZDT": "NZDT", "WAT": "WAT", "ACDT": "ACDT", "CHAST": "CHAST", "AKDT": "AKDT", "AWST": "AWST", "TMST": "TMST", "HNT": "HNT", "MST": "MST", "COT": "COT", "CDT": "CDT", "WART": "WART", "ACWDT": "ACWDT", "ART": "ART", "EDT": "EDT", "COST": "COST", "OEZ": "Ore standard de Europe orientâl", "BT": "BT", "ACWST": "ACWST", "BOT": "BOT", "PST": "PST", "OESZ": "Ore estive de Europe orientâl", "CLT": "CLT", "CLST": "CLST", "GFT": "GFT", "ECT": "ECT", "ADT": "ADT", "WIT": "WIT", "LHST": "LHST", "HKST": "HKST", "IST": "IST", "ChST": "ChST", "HKT": "HKT", "EST": "EST", "MEZ": "Ore standard de Europe centrâl", "WAST": "WAST", "SGT": "SGT", "GYT": "GYT", "UYT": "UYT", "WARST": "WARST", "MESZ": "Ore estive de Europe centrâl", "MYT": "MYT", "∅∅∅": "∅∅∅", "CHADT": "CHADT", "ARST": "ARST", "WESZ": "Ore estive de Europe ocidentâl", "CST": "CST", "VET": "VET", "AST": "AST", "UYST": "UYST", "SRT": "SRT", "AKST": "AKST", "WITA": "WITA", "CAT": "CAT", "WEZ": "Ore standard de Europe ocidentâl", "ACST": "ACST", "JST": "JST", "HADT": "HADT", "WIB": "WIB", "TMT": "TMT", "GMT": "GMT", "EAT": "EAT", "MDT": "MDT", "HAST": "HAST"},
}
}
diff --git a/fur_IT/fur_IT_test.go b/fur_IT/fur_IT_test.go
new file mode 100644
index 00000000..331976e6
--- /dev/null
+++ b/fur_IT/fur_IT_test.go
@@ -0,0 +1,1120 @@
+package fur_IT
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fur_IT"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fy/fy.go b/fy/fy.go
index 96e0ebaf..4938bcd5 100644
--- a/fy/fy.go
+++ b/fy/fy.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"f.Kr.", "n.Kr."},
erasNarrow: []string{"f.K.", "n.K."},
erasWide: []string{"Foar Kristus", "nei Kristus"},
- timezones: map[string]string{"ARST": "Argentynske simmertiid", "NZDT": "Nij-Seelânske simmertiid", "LHDT": "Lord Howe-eilânske simmertiid", "GYT": "Guyaanske tiid", "AKST": "Alaska-standerttiid", "AST": "Atlantic-standerttiid", "HNT": "Newfoundlânske-standerttiid", "IST": "Yndiaaske tiid", "AWST": "West-Australyske standerttiid", "ADT": "Atlantic-simmertiid", "HAT": "Newfoundlânske-simmertiid", "AEST": "East-Australyske standerttiid", "JDT": "Japanske simmertiid", "PDT": "Pasifik-simmertiid", "COT": "Kolombiaanske standerttiid", "HAST": "Hawaii-Aleoetyske standerttiid", "ACDT": "Midden-Australyske simmertiid", "AWDT": "West-Australyske simmertiid", "WAST": "West-Afrikaanske simmertiid", "NZST": "Nij-Seelânske standerttiid", "CST": "Central-standerttiid", "HADT": "Hawaii-Aleoetyske simmertiid", "OEZ": "East-Europeeske standerttiid", "SRT": "Surinaamske tiid", "CHAST": "Chatham standerttiid", "MYT": "Maleisyske tiid", "BOT": "Boliviaanske tiid", "UYT": "Uruguayaanske standerttiid", "HKT": "Hongkongse standerttiid", "WART": "West-Argentynske standerttiid", "WIT": "East-Yndonezyske tiid", "TMST": "Turkmeense simmertiid", "UYST": "Uruguayaanske simmertiid", "SGT": "Singaporese standerttiid", "TMT": "Turkmeense standerttiid", "WARST": "West-Argentynske simmertiid", "MST": "Macause standerttiid", "MEZ": "Midden-Europeeske standerttiid", "VET": "Fenezolaanske tiid", "EAT": "East-Afrikaanske tiid", "ACWDT": "Midden-Australyske westelijke simmertiid", "CAT": "Sintraal-Afrikaanske tiid", "SAST": "Sûd-Afrikaanske tiid", "GFT": "Frâns-Guyaanske tiid", "ACST": "Midden-Australyske standerttiid", "ChST": "Chamorro-tiid", "CLST": "Sileenske simmertiid", "∅∅∅": "Brazyljaanske simmertiid", "LHST": "Lord Howe-eilânske standerttiid", "CDT": "Central-simmertiid", "AEDT": "East-Australyske simmertiid", "AKDT": "Alaska-simmertiid", "CHADT": "Chatham simmertiid", "EST": "Eastern-standerttiid", "BT": "Bhutaanske tiid", "WAT": "West-Afrikaanske standerttiid", "GMT": "Greenwich Mean Time", "OESZ": "East-Europeeske simmertiid", "MDT": "Macause simmertiid", "WEZ": "West-Europeeske standerttiid", "WITA": "Sintraal-Yndonezyske tiid", "ART": "Argentynske standerttiid", "CLT": "Sileenske standerttiid", "WESZ": "West-Europeeske simmertiid", "COST": "Kolombiaanske simmertiid", "ECT": "Ecuadoraanske tiid", "EDT": "Eastern-simmertiid", "HKST": "Hongkongse simmertiid", "ACWST": "Midden-Australyske westelijke standerttiid", "WIB": "West-Yndonezyske tiid", "JST": "Japanske standerttiid", "PST": "Pasifik-standerttiid", "MESZ": "Midden-Europeeske simmertiid"},
+ timezones: map[string]string{"CDT": "Central-simmertiid", "ART": "Argentynske standerttiid", "COST": "Kolombiaanske simmertiid", "EAT": "East-Afrikaanske tiid", "HADT": "Hawaii-Aleoetyske simmertiid", "CLST": "Sileenske simmertiid", "WIT": "East-Yndonezyske tiid", "MST": "Mountain-standerttiid", "WART": "West-Argentynske standerttiid", "PDT": "Pasifik-simmertiid", "CAT": "Sintraal-Afrikaanske tiid", "BT": "Bhutaanske tiid", "MDT": "Mountain-simmertiid", "ACWDT": "Midden-Australyske westelijke simmertiid", "EST": "Eastern-standerttiid", "OESZ": "East-Europeeske simmertiid", "GFT": "Frâns-Guyaanske tiid", "TMT": "Turkmeense standerttiid", "WEZ": "West-Europeeske standerttiid", "OEZ": "East-Europeeske standerttiid", "CHAST": "Chatham standerttiid", "ECT": "Ecuadoraanske tiid", "MEZ": "Midden-Europeeske standerttiid", "MESZ": "Midden-Europeeske simmertiid", "ADT": "Atlantic-simmertiid", "UYST": "Uruguayaanske simmertiid", "CHADT": "Chatham simmertiid", "WITA": "Sintraal-Yndonezyske tiid", "EDT": "Eastern-simmertiid", "TMST": "Turkmeense simmertiid", "WESZ": "West-Europeeske simmertiid", "AEST": "East-Australyske standerttiid", "GYT": "Guyaanske tiid", "AWDT": "West-Australyske simmertiid", "HAST": "Hawaii-Aleoetyske standerttiid", "HAT": "Newfoundlânske-simmertiid", "NZST": "Nij-Seelânske standerttiid", "∅∅∅": "Amazone-simmertiid", "HNT": "Newfoundlânske-standerttiid", "SGT": "Singaporese standerttiid", "ACWST": "Midden-Australyske westelijke standerttiid", "ARST": "Argentynske simmertiid", "WAT": "West-Afrikaanske standerttiid", "AEDT": "East-Australyske simmertiid", "ChST": "Chamorro-tiid", "MYT": "Maleisyske tiid", "ACDT": "Midden-Australyske simmertiid", "SAST": "Sûd-Afrikaanske tiid", "COT": "Kolombiaanske standerttiid", "WARST": "West-Argentynske simmertiid", "VET": "Fenezolaanske tiid", "AKST": "Alaska-standerttiid", "ACST": "Midden-Australyske standerttiid", "AKDT": "Alaska-simmertiid", "SRT": "Surinaamske tiid", "HKST": "Hongkongse simmertiid", "PST": "Pasifik-standerttiid", "WIB": "West-Yndonezyske tiid", "WAST": "West-Afrikaanske simmertiid", "CLT": "Sileenske standerttiid", "LHDT": "Lord Howe-eilânske simmertiid", "AWST": "West-Australyske standerttiid", "NZDT": "Nij-Seelânske simmertiid", "GMT": "Greenwich Mean Time", "LHST": "Lord Howe-eilânske standerttiid", "CST": "Central-standerttiid", "HKT": "Hongkongse standerttiid", "AST": "Atlantic-standerttiid", "BOT": "Boliviaanske tiid", "IST": "Yndiaaske tiid", "UYT": "Uruguayaanske standerttiid", "JST": "Japanske standerttiid", "JDT": "Japanske simmertiid"},
}
}
diff --git a/fy/fy_test.go b/fy/fy_test.go
new file mode 100644
index 00000000..28192185
--- /dev/null
+++ b/fy/fy_test.go
@@ -0,0 +1,1120 @@
+package fy
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fy"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/fy_NL/fy_NL.go b/fy_NL/fy_NL.go
index ed7e142d..4a42d555 100644
--- a/fy_NL/fy_NL.go
+++ b/fy_NL/fy_NL.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"f.Kr.", "n.Kr."},
erasNarrow: []string{"f.K.", "n.K."},
erasWide: []string{"Foar Kristus", "nei Kristus"},
- timezones: map[string]string{"HKST": "Hongkongse simmertiid", "ARST": "Argentynske simmertiid", "EAT": "East-Afrikaanske tiid", "AKST": "Alaska-standerttiid", "UYST": "Uruguayaanske simmertiid", "ChST": "Chamorro-tiid", "ECT": "Ecuadoraanske tiid", "ADT": "Atlantic-simmertiid", "ACDT": "Midden-Australyske simmertiid", "CHAST": "Chatham standerttiid", "WIT": "East-Yndonezyske tiid", "AWST": "West-Australyske standerttiid", "CLT": "Sileenske standerttiid", "IST": "Yndiaaske tiid", "AEDT": "East-Australyske simmertiid", "MST": "Mountain-standerttiid", "WAST": "West-Afrikaanske simmertiid", "WAT": "West-Afrikaanske standerttiid", "GMT": "Greenwich Mean Time", "WITA": "Sintraal-Yndonezyske tiid", "OESZ": "East-Europeeske simmertiid", "CHADT": "Chatham simmertiid", "ACWST": "Midden-Australyske westelijke standerttiid", "∅∅∅": "Brazyljaanske simmertiid", "WARST": "West-Argentynske simmertiid", "LHDT": "Lord Howe-eilânske simmertiid", "JST": "Japanske standerttiid", "MDT": "Mountain-simmertiid", "ACST": "Midden-Australyske standerttiid", "UYT": "Uruguayaanske standerttiid", "CDT": "Central-simmertiid", "MEZ": "Midden-Europeeske standerttiid", "MESZ": "Midden-Europeeske simmertiid", "NZST": "Nij-Seelânske standerttiid", "ACWDT": "Midden-Australyske westelijke simmertiid", "AST": "Atlantic-standerttiid", "ART": "Argentynske standerttiid", "CLST": "Sileenske simmertiid", "BT": "Bhutaanske tiid", "WART": "West-Argentynske standerttiid", "AKDT": "Alaska-simmertiid", "PDT": "Pasifik-simmertiid", "WEZ": "West-Europeeske standerttiid", "EDT": "Eastern-simmertiid", "HKT": "Hongkongse standerttiid", "WIB": "West-Yndonezyske tiid", "COST": "Kolombiaanske simmertiid", "HNT": "Newfoundlânske-standerttiid", "JDT": "Japanske simmertiid", "SRT": "Surinaamske tiid", "NZDT": "Nij-Seelânske simmertiid", "WESZ": "West-Europeeske simmertiid", "HAT": "Newfoundlânske-simmertiid", "TMST": "Turkmeense simmertiid", "LHST": "Lord Howe-eilânske standerttiid", "CST": "Central-standerttiid", "COT": "Kolombiaanske standerttiid", "SGT": "Singaporese standerttiid", "SAST": "Sûd-Afrikaanske tiid", "HADT": "Hawaii-Aleoetyske simmertiid", "PST": "Pasifik-standerttiid", "AEST": "East-Australyske standerttiid", "VET": "Fenezolaanske tiid", "CAT": "Sintraal-Afrikaanske tiid", "HAST": "Hawaii-Aleoetyske standerttiid", "GYT": "Guyaanske tiid", "BOT": "Boliviaanske tiid", "OEZ": "East-Europeeske standerttiid", "TMT": "Turkmeense standerttiid", "AWDT": "West-Australyske simmertiid", "EST": "Eastern-standerttiid", "GFT": "Frâns-Guyaanske tiid", "MYT": "Maleisyske tiid"},
+ timezones: map[string]string{"MST": "Mountain-standerttiid", "UYT": "Uruguayaanske standerttiid", "ACST": "Midden-Australyske standerttiid", "PST": "Pasifik-standerttiid", "OEZ": "East-Europeeske standerttiid", "AEDT": "East-Australyske simmertiid", "CST": "Central-standerttiid", "HKT": "Hongkongse standerttiid", "VET": "Fenezolaanske tiid", "AKST": "Alaska-standerttiid", "AST": "Atlantic-standerttiid", "ART": "Argentynske standerttiid", "GMT": "Greenwich Mean Time", "SAST": "Sûd-Afrikaanske tiid", "TMST": "Turkmeense simmertiid", "WEZ": "West-Europeeske standerttiid", "HAT": "Newfoundlânske-simmertiid", "WIB": "West-Yndonezyske tiid", "LHST": "Lord Howe-eilânske standerttiid", "CLT": "Sileenske standerttiid", "GFT": "Frâns-Guyaanske tiid", "EDT": "Eastern-simmertiid", "CAT": "Sintraal-Afrikaanske tiid", "BT": "Bhutaanske tiid", "MESZ": "Midden-Europeeske simmertiid", "OESZ": "East-Europeeske simmertiid", "COST": "Kolombiaanske simmertiid", "GYT": "Guyaanske tiid", "CLST": "Sileenske simmertiid", "ACDT": "Midden-Australyske simmertiid", "WITA": "Sintraal-Yndonezyske tiid", "BOT": "Boliviaanske tiid", "HAST": "Hawaii-Aleoetyske standerttiid", "WAT": "West-Afrikaanske standerttiid", "WIT": "East-Yndonezyske tiid", "ADT": "Atlantic-simmertiid", "EST": "Eastern-standerttiid", "PDT": "Pasifik-simmertiid", "NZDT": "Nij-Seelânske simmertiid", "TMT": "Turkmeense standerttiid", "ACWDT": "Midden-Australyske westelijke simmertiid", "ACWST": "Midden-Australyske westelijke standerttiid", "ARST": "Argentynske simmertiid", "NZST": "Nij-Seelânske standerttiid", "HKST": "Hongkongse simmertiid", "COT": "Kolombiaanske standerttiid", "ChST": "Chamorro-tiid", "MDT": "Mountain-simmertiid", "JST": "Japanske standerttiid", "HNT": "Newfoundlânske-standerttiid", "MYT": "Maleisyske tiid", "CHADT": "Chatham simmertiid", "AWST": "West-Australyske standerttiid", "AWDT": "West-Australyske simmertiid", "JDT": "Japanske simmertiid", "MEZ": "Midden-Europeeske standerttiid", "HADT": "Hawaii-Aleoetyske simmertiid", "SGT": "Singaporese standerttiid", "WAST": "West-Afrikaanske simmertiid", "WARST": "West-Argentynske simmertiid", "SRT": "Surinaamske tiid", "CHAST": "Chatham standerttiid", "∅∅∅": "Brazyljaanske simmertiid", "LHDT": "Lord Howe-eilânske simmertiid", "ECT": "Ecuadoraanske tiid", "AKDT": "Alaska-simmertiid", "WESZ": "West-Europeeske simmertiid", "UYST": "Uruguayaanske simmertiid", "CDT": "Central-simmertiid", "WART": "West-Argentynske standerttiid", "EAT": "East-Afrikaanske tiid", "IST": "Yndiaaske tiid", "AEST": "East-Australyske standerttiid"},
}
}
diff --git a/fy_NL/fy_NL_test.go b/fy_NL/fy_NL_test.go
new file mode 100644
index 00000000..82a0c768
--- /dev/null
+++ b/fy_NL/fy_NL_test.go
@@ -0,0 +1,1120 @@
+package fy_NL
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "fy_NL"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ga/ga.go b/ga/ga.go
index c2a73bd3..a0ee8d5a 100644
--- a/ga/ga.go
+++ b/ga/ga.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"RC", "AD"},
erasNarrow: []string{"RC", "AD"},
erasWide: []string{"Roimh Chríost", "Anno Domini"},
- timezones: map[string]string{"EDT": "Am Samhraidh an Oirthir", "WIT": "Am Oirthear na hIndinéise", "TMT": "Am Caighdeánach na Tuircméanastáine", "JST": "Am Caighdeánach na Seapáine", "MESZ": "Am Samhraidh Lár na hEorpa", "MST": "Am Caighdeánach na Sléibhte", "CHAST": "Am Caighdeánach Chatham", "CHADT": "Am Samhraidh Chatham", "PDT": "Am Samhraidh an Aigéin Chiúin", "BOT": "Am na Bolaive", "WAST": "Am Samhraidh Iarthar na hAfraice", "TMST": "Am Samhraidh na Tuircméanastáine", "SRT": "Am Shuranam", "WEZ": "Am Caighdeánach Iarthar na hEorpa", "CAT": "Am Lár na hAfraice", "WART": "Am Caighdeánach Iarthar na hAirgintíne", "JDT": "Am Samhraidh na Seapáine", "MEZ": "Am Caighdeánach Lár na hEorpa", "NZDT": "Am Samhraidh na Nua-Shéalainne", "AST": "Am Caighdeánach an Atlantaigh", "WITA": "Am Lár na hIndinéise", "ACWST": "Am Caighdeánach Mheániarthar na hAstráile", "ChST": "Am Caighdeánach Seamórach", "HNT": "Am Caighdeánach Thalamh an Éisc", "MYT": "Am na Malaeisia", "UYT": "Am Caighdeánach Uragua", "HAST": "Am Caighdeánach Haváí-Ailiúit", "WARST": "Am Samhraidh Iarthar na hAirgintíne", "BT": "Am na Bútáine", "UYST": "Am Samhraidh Uragua", "MDT": "Am Samhraidh na Sléibhte", "HADT": "Am Samhraidh Haváí-Ailiúit", "SGT": "Am Caighdeánach Shingeapór", "WAT": "Am Caighdeánach Iarthar na hAfraice", "COST": "Am Samhraidh na Colóime", "HKT": "Am Caighdeánach Hong Cong", "AKST": "Am Caighdeánach Alasca", "AKDT": "Am Samhraidh Alasca", "COT": "Am Caighdeánach na Colóime", "GFT": "Am Ghuáin na Fraince", "OEZ": "Am Caighdeánach Oirthear na hEorpa", "GYT": "Am na Guáine", "CST": "Am Caighdeánach Lárnach", "CLST": "Am Samhraidh na Sile", "WESZ": "Am Samhraidh Iarthar na hEorpa", "ACWDT": "Am Samhraidh Mheániarthar na hAstráile", "AWST": "Am Caighdeánach Iarthar na hAstráile", "CDT": "Am Samhraidh Lárnach", "WIB": "Am Iarthar na hIndinéise", "OESZ": "Am Samhraidh Oirthear na hEorpa", "ART": "Am Caighdeánach na hAirgintíne", "LHDT": "Am Samhraidh Lord Howe", "AEST": "Am Caighdeánach Oirthear na hAstráile", "ACDT": "Am Samhraidh Lár na hAstráile", "ARST": "Am Samhraidh na hAirgintíne", "LHST": "Am Caighdeánach Lord Howe", "AWDT": "Am Samhraidh Iarthar na hAstráile", "EST": "Am Caighdeánach an Oirthir", "IST": "Am Caighdeánach na hIndia", "GMT": "Meán-Am Greenwich", "PST": "Am Caighdeánach an Aigéin Chiúin", "NZST": "Am Caighdeánach na Nua-Shéalainne", "SAST": "Am Caighdeánach na hAfraice Theas", "EAT": "Am Oirthear na hAfraice", "ACST": "Am Caighdeánach Lár na hAstráile", "CLT": "Am Caighdeánach na Sile", "ADT": "Am Samhraidh an Atlantaigh", "HKST": "Am Samhraidh Hong Cong", "HAT": "Am Samhraidh Thalamh an Éisc", "VET": "Am Veiniséala", "AEDT": "Am Samhraidh Oirthear na hAstráile", "∅∅∅": "Am Samhraidh Bhrasília", "ECT": "Am Eacuadór"},
+ timezones: map[string]string{"CST": "Am Caighdeánach Lárnach", "GFT": "Am Ghuáin na Fraince", "BOT": "Am na Bolaive", "MDT": "Am Samhraidh Mhacao", "AST": "Am Caighdeánach an Atlantaigh", "JDT": "Am Samhraidh na Seapáine", "NZST": "Am Caighdeánach na Nua-Shéalainne", "SGT": "Am Caighdeánach Shingeapór", "OESZ": "Am Samhraidh Oirthear na hEorpa", "ACST": "Am Caighdeánach Lár na hAstráile", "AWST": "Am Caighdeánach Iarthar na hAstráile", "MESZ": "Am Samhraidh Lár na hEorpa", "WIB": "Am Iarthar na hIndinéise", "ChST": "Am Caighdeánach Seamórach", "NZDT": "Am Samhraidh na Nua-Shéalainne", "OEZ": "Am Caighdeánach Oirthear na hEorpa", "UYT": "Am Caighdeánach Uragua", "SRT": "Am Shuranam", "ACWDT": "Am Samhraidh Mheániarthar na hAstráile", "IST": "Am Caighdeánach na hIndia", "TMST": "Am Samhraidh na Tuircméanastáine", "LHDT": "Am Samhraidh Lord Howe", "WARST": "Am Samhraidh Iarthar na hAirgintíne", "CHAST": "Am Caighdeánach Chatham", "ECT": "Am Eacuadór", "AKDT": "Am Samhraidh Alasca", "ARST": "Am Samhraidh na hAirgintíne", "EAT": "Am Oirthear na hAfraice", "HKT": "Am Caighdeánach Hong Cong", "CAT": "Am Lár na hAfraice", "WAT": "Am Caighdeánach Iarthar na hAfraice", "GMT": "Meán-Am Greenwich", "WIT": "Am Oirthear na hIndinéise", "ART": "Am Caighdeánach na hAirgintíne", "JST": "Am Caighdeánach na Seapáine", "HADT": "Am Samhraidh Haváí-Ailiúit", "AEDT": "Am Samhraidh Oirthear na hAstráile", "BT": "Am na Bútáine", "LHST": "Am Caighdeánach Lord Howe", "WEZ": "Am Caighdeánach Iarthar na hEorpa", "HAT": "Am Samhraidh Thalamh an Éisc", "MST": "Am Caighdeánach Mhacao", "VET": "Am Veiniséala", "AKST": "Am Caighdeánach Alasca", "ACWST": "Am Caighdeánach Mheániarthar na hAstráile", "MEZ": "Am Caighdeánach Lár na hEorpa", "HAST": "Am Caighdeánach Haváí-Ailiúit", "CDT": "Am Samhraidh Lárnach", "WART": "Am Caighdeánach Iarthar na hAirgintíne", "HNT": "Am Caighdeánach Thalamh an Éisc", "TMT": "Am Caighdeánach na Tuircméanastáine", "AEST": "Am Caighdeánach Oirthear na hAstráile", "CLT": "Am Caighdeánach na Sile", "CHADT": "Am Samhraidh Chatham", "WITA": "Am Lár na hIndinéise", "EDT": "Am Samhraidh an Oirthir", "PDT": "Am Samhraidh an Aigéin Chiúin", "WESZ": "Am Samhraidh Iarthar na hEorpa", "COT": "Am Caighdeánach na Colóime", "MYT": "Am na Malaeisia", "ACDT": "Am Samhraidh Lár na hAstráile", "EST": "Am Caighdeánach an Oirthir", "CLST": "Am Samhraidh na Sile", "UYST": "Am Samhraidh Uragua", "∅∅∅": "Am Samhraidh na nAsór", "ADT": "Am Samhraidh an Atlantaigh", "AWDT": "Am Samhraidh Iarthar na hAstráile", "SAST": "Am Caighdeánach na hAfraice Theas", "WAST": "Am Samhraidh Iarthar na hAfraice", "GYT": "Am na Guáine", "HKST": "Am Samhraidh Hong Cong", "PST": "Am Caighdeánach an Aigéin Chiúin", "COST": "Am Samhraidh na Colóime"},
}
}
diff --git a/ga/ga_test.go b/ga/ga_test.go
new file mode 100644
index 00000000..dbef8217
--- /dev/null
+++ b/ga/ga_test.go
@@ -0,0 +1,1120 @@
+package ga
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ga"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ga_IE/ga_IE.go b/ga_IE/ga_IE.go
index 075ff0df..42e2732a 100644
--- a/ga_IE/ga_IE.go
+++ b/ga_IE/ga_IE.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"RC", "AD"},
erasNarrow: []string{"RC", "AD"},
erasWide: []string{"Roimh Chríost", "Anno Domini"},
- timezones: map[string]string{"EAT": "Am Oirthear na hAfraice", "AWDT": "Am Samhraidh Iarthar na hAstráile", "UYT": "Am Caighdeánach Uragua", "HKST": "Am Samhraidh Hong Cong", "GMT": "Meán-Am Greenwich", "HAT": "Am Samhraidh Thalamh an Éisc", "SRT": "Am Shuranam", "CAT": "Am Lár na hAfraice", "ADT": "Am Samhraidh an Atlantaigh", "WARST": "Am Samhraidh Iarthar na hAirgintíne", "AWST": "Am Caighdeánach Iarthar na hAstráile", "BOT": "Am na Bolaive", "CLT": "Am Caighdeánach na Sile", "HAST": "Am Caighdeánach Haváí-Ailiúit", "WART": "Am Caighdeánach Iarthar na hAirgintíne", "LHDT": "Am Samhraidh Lord Howe", "MYT": "Am na Malaeisia", "MEZ": "Am Caighdeánach Lár na hEorpa", "MESZ": "Am Samhraidh Lár na hEorpa", "CHADT": "Am Samhraidh Chatham", "OEZ": "Am Caighdeánach Oirthear na hEorpa", "OESZ": "Am Samhraidh Oirthear na hEorpa", "AEST": "Am Caighdeánach Oirthear na hAstráile", "TMT": "Am Caighdeánach na Tuircméanastáine", "AKDT": "Am Samhraidh Alasca", "WIT": "Am Oirthear na hIndinéise", "UYST": "Am Samhraidh Uragua", "AKST": "Am Caighdeánach Alasca", "PST": "Am Caighdeánach an Aigéin Chiúin", "AEDT": "Am Samhraidh Oirthear na hAstráile", "HADT": "Am Samhraidh Haváí-Ailiúit", "HNT": "Am Caighdeánach Thalamh an Éisc", "MST": "Am Caighdeánach Mhacao", "WEZ": "Am Caighdeánach Iarthar na hEorpa", "HKT": "Am Caighdeánach Hong Cong", "ACST": "Am Caighdeánach Lár na hAstráile", "JDT": "Am Samhraidh na Seapáine", "PDT": "Am Samhraidh an Aigéin Chiúin", "CDT": "Am Samhraidh Lárnach", "VET": "Am Veiniséala", "BT": "Am na Bútáine", "ARST": "Am Samhraidh na hAirgintíne", "WITA": "Am Lár na hIndinéise", "CST": "Am Caighdeánach Lárnach", "WAST": "Am Samhraidh Iarthar na hAfraice", "GFT": "Am Ghuáin na Fraince", "NZST": "Am Caighdeánach na Nua-Shéalainne", "COST": "Am Samhraidh na Colóime", "LHST": "Am Caighdeánach Lord Howe", "ChST": "Am Caighdeánach Seamórach", "EDT": "Am Samhraidh an Oirthir", "WAT": "Am Caighdeánach Iarthar na hAfraice", "ART": "Am Caighdeánach na hAirgintíne", "CHAST": "Am Caighdeánach Chatham", "WESZ": "Am Samhraidh Iarthar na hEorpa", "ECT": "Am Eacuadór", "EST": "Am Caighdeánach an Oirthir", "TMST": "Am Samhraidh na Tuircméanastáine", "MDT": "Am Samhraidh Mhacao", "WIB": "Am Iarthar na hIndinéise", "JST": "Am Caighdeánach na Seapáine", "NZDT": "Am Samhraidh na Nua-Shéalainne", "CLST": "Am Samhraidh na Sile", "∅∅∅": "Am Samhraidh Acre", "AST": "Am Caighdeánach an Atlantaigh", "GYT": "Am na Guáine", "SAST": "Am Caighdeánach na hAfraice Theas", "IST": "Am Caighdeánach na hIndia", "ACWST": "Am Caighdeánach Mheániarthar na hAstráile", "ACWDT": "Am Samhraidh Mheániarthar na hAstráile", "COT": "Am Caighdeánach na Colóime", "SGT": "Am Caighdeánach Shingeapór", "ACDT": "Am Samhraidh Lár na hAstráile"},
+ timezones: map[string]string{"SRT": "Am Shuranam", "BOT": "Am na Bolaive", "EDT": "Am Samhraidh an Oirthir", "WIB": "Am Iarthar na hIndinéise", "WART": "Am Caighdeánach Iarthar na hAirgintíne", "AEST": "Am Caighdeánach Oirthear na hAstráile", "LHDT": "Am Samhraidh Lord Howe", "OESZ": "Am Samhraidh Oirthear na hEorpa", "GMT": "Meán-Am Greenwich", "UYST": "Am Samhraidh Uragua", "CHADT": "Am Samhraidh Chatham", "JST": "Am Caighdeánach na Seapáine", "ACWDT": "Am Samhraidh Mheániarthar na hAstráile", "TMT": "Am Caighdeánach na Tuircméanastáine", "HNT": "Am Caighdeánach Thalamh an Éisc", "LHST": "Am Caighdeánach Lord Howe", "HKT": "Am Caighdeánach Hong Cong", "ACWST": "Am Caighdeánach Mheániarthar na hAstráile", "IST": "Am Caighdeánach na hIndia", "COST": "Am Samhraidh na Colóime", "GYT": "Am na Guáine", "MESZ": "Am Samhraidh Lár na hEorpa", "WESZ": "Am Samhraidh Iarthar na hEorpa", "GFT": "Am Ghuáin na Fraince", "ARST": "Am Samhraidh na hAirgintíne", "EST": "Am Caighdeánach an Oirthir", "CST": "Am Caighdeánach Lárnach", "CHAST": "Am Caighdeánach Chatham", "JDT": "Am Samhraidh na Seapáine", "AKST": "Am Caighdeánach Alasca", "UYT": "Am Caighdeánach Uragua", "ECT": "Am Eacuadór", "VET": "Am Veiniséala", "HKST": "Am Samhraidh Hong Cong", "WAT": "Am Caighdeánach Iarthar na hAfraice", "ACST": "Am Caighdeánach Lár na hAstráile", "OEZ": "Am Caighdeánach Oirthear na hEorpa", "SAST": "Am Caighdeánach na hAfraice Theas", "SGT": "Am Caighdeánach Shingeapór", "CAT": "Am Lár na hAfraice", "WIT": "Am Oirthear na hIndinéise", "ADT": "Am Samhraidh an Atlantaigh", "PDT": "Am Samhraidh an Aigéin Chiúin", "WEZ": "Am Caighdeánach Iarthar na hEorpa", "AEDT": "Am Samhraidh Oirthear na hAstráile", "CLST": "Am Samhraidh na Sile", "ART": "Am Caighdeánach na hAirgintíne", "AKDT": "Am Samhraidh Alasca", "AWST": "Am Caighdeánach Iarthar na hAstráile", "COT": "Am Caighdeánach na Colóime", "MYT": "Am na Malaeisia", "PST": "Am Caighdeánach an Aigéin Chiúin", "ACDT": "Am Samhraidh Lár na hAstráile", "WARST": "Am Samhraidh Iarthar na hAirgintíne", "MST": "Am Caighdeánach na Sléibhte", "AST": "Am Caighdeánach an Atlantaigh", "EAT": "Am Oirthear na hAfraice", "BT": "Am na Bútáine", "MDT": "Am Samhraidh na Sléibhte", "CDT": "Am Samhraidh Lárnach", "HADT": "Am Samhraidh Haváí-Ailiúit", "NZST": "Am Caighdeánach na Nua-Shéalainne", "TMST": "Am Samhraidh na Tuircméanastáine", "WAST": "Am Samhraidh Iarthar na hAfraice", "NZDT": "Am Samhraidh na Nua-Shéalainne", "∅∅∅": "Am Samhraidh Bhrasília", "WITA": "Am Lár na hIndinéise", "CLT": "Am Caighdeánach na Sile", "AWDT": "Am Samhraidh Iarthar na hAstráile", "MEZ": "Am Caighdeánach Lár na hEorpa", "HAST": "Am Caighdeánach Haváí-Ailiúit", "HAT": "Am Samhraidh Thalamh an Éisc", "ChST": "Am Caighdeánach Seamórach"},
}
}
diff --git a/ga_IE/ga_IE_test.go b/ga_IE/ga_IE_test.go
new file mode 100644
index 00000000..3d163311
--- /dev/null
+++ b/ga_IE/ga_IE_test.go
@@ -0,0 +1,1120 @@
+package ga_IE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ga_IE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/gd/gd.go b/gd/gd.go
index 70bc9e1c..11d8e35f 100644
--- a/gd/gd.go
+++ b/gd/gd.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"RC", "AD"},
erasNarrow: []string{"R", "A"},
erasWide: []string{"Ro Chrìosta", "An dèidh Chrìosta"},
- timezones: map[string]string{"HKT": "Bun-àm Hong Kong", "HNT": "Bun-àm Talamh an Èisg", "WIB": "Àm nan Innd-Innse an Iar", "MST": "Bun-àm Macàthu", "LHST": "Bun-àm Lord Howe", "JDT": "Tìde samhraidh na Seapaine", "CLST": "Tìde samhraidh na Sile", "WIT": "Àm nan Innd-Innse an Ear", "HAST": "Bun-àm nan Eileanan Hawai’i ’s Aleutach", "WAT": "Bun-àm Afraga an Iar", "WARST": "Tìde samhraidh na h-Argantaine Siaraich", "GYT": "Àm Guidheàna", "AST": "Bun-àm a’ Chuain Siar", "TMST": "Tìde samhraidh Turcmanastàin", "AWST": "Bun-àm Astràilia an Iar", "CHAST": "Bun-àm Chatham", "COST": "Tìde samhraidh Coloimbia", "∅∅∅": "Tìde samhraidh Acre", "WART": "Bun-àm na h-Argantaine Siaraich", "IST": "Àm nan Innseachan", "GMT": "Greenwich Mean Time", "ARST": "Tìde samhraidh na h-Argantaine", "MYT": "Àm Mhalaidhsea", "CDT": "Tìde samhraidh Meadhan Aimeireaga a Tuath", "ACWST": "Bun-àm Meadhan Astràilia an Iar", "ACWDT": "Tìde samhraidh Meadhan Astràilia an Iar", "OESZ": "Tìde samhraidh na Roinn-Eòrpa an Ear", "EAT": "Àm Afraga an Ear", "AKST": "Bun-àm Alaska", "CST": "Bun-àm Meadhan Aimeireaga a Tuath", "HADT": "Tìde Samhraidh nan Eileanan Hawai’i ’s Aleutach", "HAT": "Tìde samhraidh Talamh an Èisg", "MDT": "Tìde samhraidh Macàthu", "PST": "Bun-àm a’ Chuain Sèimh", "MEZ": "Bun-àm Meadhan na Roinn-Eòrpa", "NZST": "Bun-àm Shealainn Nuaidh", "UYT": "Bun-àm Uruguaidh", "AEDT": "Tìde samhraidh Astràilia an Ear", "ART": "Bun-àm na h-Argantaine", "AKDT": "Tìde samhraidh Alaska", "JST": "Bun-àm na Seapaine", "UYST": "Tìde samhraidh Uruguaidh", "ECT": "Àm Eacuadoir", "BT": "Àm Butàin", "MESZ": "Tìde samhraidh Meadhan na Roinn-Eòrpa", "WEZ": "Bun-àm na Roinn-Eòrpa an Iar", "WESZ": "Tìde samhraidh na Roinn-Eòrpa an Iar", "ACST": "Bun-àm Meadhan Astràilia", "PDT": "Tìde samhraidh a’ Chuain Sèimh", "NZDT": "Tìde samhraidh Shealainn Nuaidh", "COT": "Bun-àm Coloimbia", "ADT": "Tìde samhraidh a’ Chuain Siar", "SGT": "Àm Singeapòr", "AWDT": "Tìde samhraidh Astràilia an Iar", "ChST": "Àm Chamorro", "HKST": "Tìde samhraidh Hong Kong", "CHADT": "Tìde samhraidh Chatham", "WAST": "Tìde Samhraidh Afraga an Iar", "GFT": "Àm Guidheàna na Frainge", "WITA": "Àm Meadhan nan Innd-Innse", "SRT": "Àm Suranaim", "BOT": "Àm Boilibhia", "EST": "Bun-àm Aimeireaga a Tuath an Ear", "EDT": "Tìde samhraidh Aimeireaga a Tuath an Ear", "SAST": "Àm Afraga a Deas", "OEZ": "Bun-àm na Roinn-Eòrpa an Ear", "ACDT": "Tìde samhraidh Meadhan Astràilia", "VET": "Àm na Bheiniseala", "TMT": "Bun-àm Turcmanastàin", "LHDT": "Tìde samhraidh Lord Howe", "AEST": "Bun-àm Astràilia an Ear", "CLT": "Bun-àm na Sile", "CAT": "Àm Meadhan Afraga"},
+ timezones: map[string]string{"CLT": "Bun-àm na Sile", "CHADT": "Tìde samhraidh Chatham", "AKST": "Bun-àm Alaska", "ADT": "Tìde samhraidh a’ Chuain Siar", "HAST": "Bun-àm nan Eileanan Hawai’i ’s Aleutach", "∅∅∅": "Tìde samhraidh Amasoin", "TMT": "Bun-àm Turcmanastàin", "CLST": "Tìde samhraidh na Sile", "WARST": "Tìde samhraidh na h-Argantaine Siaraich", "WAT": "Bun-àm Afraga an Iar", "WESZ": "Tìde samhraidh na Roinn-Eòrpa an Iar", "CDT": "Tìde samhraidh Meadhan Aimeireaga a Tuath", "VET": "Àm na Bheiniseala", "AWST": "Bun-àm Astràilia an Iar", "EDT": "Tìde samhraidh Aimeireaga a Tuath an Ear", "COT": "Bun-àm Coloimbia", "CAT": "Àm Meadhan Afraga", "PDT": "Tìde samhraidh a’ Chuain Sèimh", "EAT": "Àm Afraga an Ear", "COST": "Tìde samhraidh Coloimbia", "HNT": "Bun-àm Talamh an Èisg", "MYT": "Àm Mhalaidhsea", "HKT": "Bun-àm Hong Kong", "ART": "Bun-àm na h-Argantaine", "ACWST": "Bun-àm Meadhan Astràilia an Iar", "MEZ": "Bun-àm Meadhan na Roinn-Eòrpa", "MESZ": "Tìde samhraidh Meadhan na Roinn-Eòrpa", "WITA": "Àm Meadhan nan Innd-Innse", "WAST": "Tìde Samhraidh Afraga an Iar", "GMT": "Greenwich Mean Time", "WART": "Bun-àm na h-Argantaine Siaraich", "TMST": "Tìde samhraidh Turcmanastàin", "HAT": "Tìde samhraidh Talamh an Èisg", "ARST": "Tìde samhraidh na h-Argantaine", "SRT": "Àm Suranaim", "HADT": "Tìde Samhraidh nan Eileanan Hawai’i ’s Aleutach", "NZST": "Bun-àm Shealainn Nuaidh", "PST": "Bun-àm a’ Chuain Sèimh", "WIB": "Àm nan Innd-Innse an Iar", "GFT": "Àm Guidheàna na Frainge", "SAST": "Àm Afraga a Deas", "EST": "Bun-àm Aimeireaga a Tuath an Ear", "OEZ": "Bun-àm na Roinn-Eòrpa an Ear", "MST": "Bun-àm Monadh Aimeireaga a Tuath", "OESZ": "Tìde samhraidh na Roinn-Eòrpa an Ear", "LHDT": "Tìde samhraidh Lord Howe", "MDT": "Tìde samhraidh Monadh Aimeireaga a Tuath", "ECT": "Àm Eacuadoir", "JDT": "Tìde samhraidh na Seapaine", "AST": "Bun-àm a’ Chuain Siar", "AWDT": "Tìde samhraidh Astràilia an Iar", "NZDT": "Tìde samhraidh Shealainn Nuaidh", "BT": "Àm Butàin", "LHST": "Bun-àm Lord Howe", "AKDT": "Tìde samhraidh Alaska", "ACWDT": "Tìde samhraidh Meadhan Astràilia an Iar", "WEZ": "Bun-àm na Roinn-Eòrpa an Iar", "UYST": "Tìde samhraidh Uruguaidh", "AEDT": "Tìde samhraidh Astràilia an Ear", "UYT": "Bun-àm Uruguaidh", "WIT": "Àm nan Innd-Innse an Ear", "ACST": "Bun-àm Meadhan Astràilia", "GYT": "Àm Guidheàna", "ChST": "Àm Chamorro", "HKST": "Tìde samhraidh Hong Kong", "CST": "Bun-àm Meadhan Aimeireaga a Tuath", "CHAST": "Bun-àm Chatham", "JST": "Bun-àm na Seapaine", "BOT": "Àm Boilibhia", "SGT": "Àm Singeapòr", "AEST": "Bun-àm Astràilia an Ear", "IST": "Àm nan Innseachan", "ACDT": "Tìde samhraidh Meadhan Astràilia"},
}
}
diff --git a/gd/gd_test.go b/gd/gd_test.go
new file mode 100644
index 00000000..5613fa1f
--- /dev/null
+++ b/gd/gd_test.go
@@ -0,0 +1,1120 @@
+package gd
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "gd"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/gd_GB/gd_GB.go b/gd_GB/gd_GB.go
index de979a3a..7bdcd8cd 100644
--- a/gd_GB/gd_GB.go
+++ b/gd_GB/gd_GB.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"RC", "AD"},
erasNarrow: []string{"R", "A"},
erasWide: []string{"Ro Chrìosta", "An dèidh Chrìosta"},
- timezones: map[string]string{"WAT": "Bun-àm Afraga an Iar", "EAT": "Àm Afraga an Ear", "ACDT": "Tìde samhraidh Meadhan Astràilia", "AWST": "Bun-àm Astràilia an Iar", "NZST": "Bun-àm Shealainn Nuaidh", "WESZ": "Tìde samhraidh na Roinn-Eòrpa an Iar", "ACWST": "Bun-àm Meadhan Astràilia an Iar", "MYT": "Àm Mhalaidhsea", "COST": "Tìde samhraidh Coloimbia", "WIT": "Àm nan Innd-Innse an Ear", "SGT": "Àm Singeapòr", "GMT": "Greenwich Mean Time", "AKST": "Bun-àm Alaska", "PDT": "Tìde samhraidh a’ Chuain Sèimh", "JST": "Bun-àm na Seapaine", "CHADT": "Tìde samhraidh Chatham", "MDT": "Tìde samhraidh Macàthu", "ART": "Bun-àm na h-Argantaine", "AWDT": "Tìde samhraidh Astràilia an Iar", "MEZ": "Bun-àm Meadhan na Roinn-Eòrpa", "NZDT": "Tìde samhraidh Shealainn Nuaidh", "PST": "Bun-àm a’ Chuain Sèimh", "CDT": "Tìde samhraidh Meadhan Aimeireaga a Tuath", "ChST": "Àm Chamorro", "ECT": "Àm Eacuadoir", "WARST": "Tìde samhraidh na h-Argantaine Siaraich", "MESZ": "Tìde samhraidh Meadhan na Roinn-Eòrpa", "OEZ": "Bun-àm na Roinn-Eòrpa an Ear", "HNT": "Bun-àm Talamh an Èisg", "AEST": "Bun-àm Astràilia an Ear", "EDT": "Tìde samhraidh Aimeireaga a Tuath an Ear", "HADT": "Tìde Samhraidh nan Eileanan Hawai’i ’s Aleutach", "COT": "Bun-àm Coloimbia", "ADT": "Tìde samhraidh a’ Chuain Siar", "OESZ": "Tìde samhraidh na Roinn-Eòrpa an Ear", "MST": "Bun-àm Macàthu", "LHST": "Bun-àm Lord Howe", "JDT": "Tìde samhraidh na Seapaine", "SRT": "Àm Suranaim", "CST": "Bun-àm Meadhan Aimeireaga a Tuath", "ACST": "Bun-àm Meadhan Astràilia", "∅∅∅": "Tìde samhraidh Amasoin", "TMT": "Bun-àm Turcmanastàin", "UYST": "Tìde samhraidh Uruguaidh", "HKST": "Tìde samhraidh Hong Kong", "HAT": "Tìde samhraidh Talamh an Èisg", "WAST": "Tìde Samhraidh Afraga an Iar", "LHDT": "Tìde samhraidh Lord Howe", "GYT": "Àm Guidheàna", "CAT": "Àm Meadhan Afraga", "GFT": "Àm Guidheàna na Frainge", "WITA": "Àm Meadhan nan Innd-Innse", "CLT": "Bun-àm na Sile", "HKT": "Bun-àm Hong Kong", "WART": "Bun-àm na h-Argantaine Siaraich", "UYT": "Bun-àm Uruguaidh", "WEZ": "Bun-àm na Roinn-Eòrpa an Iar", "ACWDT": "Tìde samhraidh Meadhan Astràilia an Iar", "CLST": "Tìde samhraidh na Sile", "VET": "Àm na Bheiniseala", "EST": "Bun-àm Aimeireaga a Tuath an Ear", "ARST": "Tìde samhraidh na h-Argantaine", "TMST": "Tìde samhraidh Turcmanastàin", "BOT": "Àm Boilibhia", "CHAST": "Bun-àm Chatham", "HAST": "Bun-àm nan Eileanan Hawai’i ’s Aleutach", "BT": "Àm Butàin", "IST": "Àm nan Innseachan", "WIB": "Àm nan Innd-Innse an Iar", "AKDT": "Tìde samhraidh Alaska", "AEDT": "Tìde samhraidh Astràilia an Ear", "AST": "Bun-àm a’ Chuain Siar", "SAST": "Àm Afraga a Deas"},
+ timezones: map[string]string{"CHAST": "Bun-àm Chatham", "ECT": "Àm Eacuadoir", "WIB": "Àm nan Innd-Innse an Iar", "BT": "Àm Butàin", "EDT": "Tìde samhraidh Aimeireaga a Tuath an Ear", "ACST": "Bun-àm Meadhan Astràilia", "HAT": "Tìde samhraidh Talamh an Èisg", "OEZ": "Bun-àm na Roinn-Eòrpa an Ear", "LHST": "Bun-àm Lord Howe", "VET": "Àm na Bheiniseala", "JDT": "Tìde samhraidh na Seapaine", "EST": "Bun-àm Aimeireaga a Tuath an Ear", "MESZ": "Tìde samhraidh Meadhan na Roinn-Eòrpa", "WIT": "Àm nan Innd-Innse an Ear", "NZST": "Bun-àm Shealainn Nuaidh", "NZDT": "Tìde samhraidh Shealainn Nuaidh", "AEST": "Bun-àm Astràilia an Ear", "CLT": "Bun-àm na Sile", "AWDT": "Tìde samhraidh Astràilia an Iar", "ART": "Bun-àm na h-Argantaine", "ADT": "Tìde samhraidh a’ Chuain Siar", "OESZ": "Tìde samhraidh na Roinn-Eòrpa an Ear", "WITA": "Àm Meadhan nan Innd-Innse", "AKDT": "Tìde samhraidh Alaska", "PDT": "Tìde samhraidh a’ Chuain Sèimh", "ChST": "Àm Chamorro", "AKST": "Bun-àm Alaska", "SGT": "Àm Singeapòr", "MYT": "Àm Mhalaidhsea", "ACDT": "Tìde samhraidh Meadhan Astràilia", "HADT": "Tìde Samhraidh nan Eileanan Hawai’i ’s Aleutach", "WEZ": "Bun-àm na Roinn-Eòrpa an Iar", "AEDT": "Tìde samhraidh Astràilia an Ear", "LHDT": "Tìde samhraidh Lord Howe", "SRT": "Àm Suranaim", "CHADT": "Tìde samhraidh Chatham", "JST": "Bun-àm na Seapaine", "HAST": "Bun-àm nan Eileanan Hawai’i ’s Aleutach", "TMT": "Bun-àm Turcmanastàin", "ACWDT": "Tìde samhraidh Meadhan Astràilia an Iar", "TMST": "Tìde samhraidh Turcmanastàin", "WAST": "Tìde Samhraidh Afraga an Iar", "UYT": "Bun-àm Uruguaidh", "PST": "Bun-àm a’ Chuain Sèimh", "WESZ": "Tìde samhraidh na Roinn-Eòrpa an Iar", "WAT": "Bun-àm Afraga an Iar", "COST": "Tìde samhraidh Coloimbia", "CAT": "Àm Meadhan Afraga", "GMT": "Greenwich Mean Time", "UYST": "Tìde samhraidh Uruguaidh", "MDT": "Tìde samhraidh Macàthu", "HKST": "Tìde samhraidh Hong Kong", "AWST": "Bun-àm Astràilia an Iar", "COT": "Bun-àm Coloimbia", "GFT": "Àm Guidheàna na Frainge", "MST": "Bun-àm Macàthu", "HKT": "Bun-àm Hong Kong", "WART": "Bun-àm na h-Argantaine Siaraich", "ARST": "Tìde samhraidh na h-Argantaine", "GYT": "Àm Guidheàna", "WARST": "Tìde samhraidh na h-Argantaine Siaraich", "HNT": "Bun-àm Talamh an Èisg", "CLST": "Tìde samhraidh na Sile", "CST": "Bun-àm Meadhan Aimeireaga a Tuath", "CDT": "Tìde samhraidh Meadhan Aimeireaga a Tuath", "MEZ": "Bun-àm Meadhan na Roinn-Eòrpa", "BOT": "Àm Boilibhia", "SAST": "Àm Afraga a Deas", "IST": "Àm nan Innseachan", "ACWST": "Bun-àm Meadhan Astràilia an Iar", "AST": "Bun-àm a’ Chuain Siar", "∅∅∅": "Tìde samhraidh Acre", "EAT": "Àm Afraga an Ear"},
}
}
diff --git a/gd_GB/gd_GB_test.go b/gd_GB/gd_GB_test.go
new file mode 100644
index 00000000..aff8a23b
--- /dev/null
+++ b/gd_GB/gd_GB_test.go
@@ -0,0 +1,1120 @@
+package gd_GB
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "gd_GB"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/gl/gl.go b/gl/gl.go
index 0b107c99..a6aeba67 100644
--- a/gl/gl.go
+++ b/gl/gl.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a.C.", "d.C."},
erasNarrow: []string{"", ""},
erasWide: []string{"antes de Cristo", "despois de Cristo"},
- timezones: map[string]string{"BOT": "Horario de Bolivia", "NZDT": "Horario de verán de Nova Celandia", "GFT": "Horario da Güiana Francesa", "TMST": "Horario de verán de Turcomenistán", "LHST": "Horario estándar de Lord Howe", "AKST": "Horario estándar de Alasca", "CAT": "Horario de África Central", "EDT": "Horario de verán de América Oriental", "WAST": "Horario de verán de África Occidental", "IST": "Horario estándar da India", "MDT": "MDT", "MESZ": "Horario de verán de Europa Central", "EST": "Horario estándar América Oriental", "WITA": "Horario de Indonesia Central", "WIB": "Horario de Indonesia Occidental", "CDT": "Horario de verán da zona central", "OEZ": "Horario estándar de Europa Oriental", "MYT": "Horario de Malaisia", "ADT": "Horario de verán do Atlántico", "CST": "Horario estándar central", "WEZ": "Horario estándar de Europa Occidental", "ACWST": "Horario estándar de Australia Occidental Central", "JDT": "Horario de verán de Xapón", "AKDT": "Horario de verán de Alasca", "CLST": "Horario de verán de Chile", "OESZ": "Horario de verán de Europa Oriental", "GYT": "Horario da Güiana", "AWDT": "Horario de verán de Australia Occidental", "NZST": "Horario estándar de Nova Celandia", "SGT": "Horario estándar de Singapur", "HKST": "Horario de verán de Hong Kong", "WIT": "Horario de Indonesia Oriental", "ECT": "Horario de Ecuador", "TMT": "Horario estándar de Turcomenistán", "UYT": "Horario estándar de Uruguai", "UYST": "Horario de verán de Uruguai", "HAST": "Horario estándar de Hawai-Aleutiano", "AST": "Horario estándar do Atlántico", "ACDT": "Horario de verán de Australia Central", "JST": "Horario estándar de Xapón", "ChST": "Horario estándar de Chamorro", "CHADT": "Horario de verán de Chatham", "ACWDT": "Horario de verán de Australia Occidental Central", "COST": "Horario de verán de Colombia", "HADT": "Horario de verán de Hawai-Aleutiano", "ACST": "Horario estándar de Australia Central", "MEZ": "Horario estándar de Europa Central", "ARST": "Horario de verán de Arxentina", "MST": "MST", "SRT": "Horario de Surinam", "VET": "Horario de Venezuela", "SAST": "Horario estándar de Sudáfrica", "BT": "Horario de Bután", "GMT": "Horario do meridiano de Greenwich", "WARST": "Horario de verán de Arxentina Occidental", "COT": "Horario estándar de Colombia", "CLT": "Horario estándar de Chile", "∅∅∅": "∅∅∅", "EAT": "Horario de África Oriental", "PDT": "Horario de verán do Pacífico", "LHDT": "Horario de verán de Lord Howe", "CHAST": "Horario estándar de Chatham", "WESZ": "Horario de verán de Europa Occidental", "HNT": "Horario estándar de Terranova", "HAT": "Horario de verán de Terranova", "ART": "Horario estándar de Arxentina", "PST": "Horario estándar do Pacífico", "AWST": "Horario estándar de Australia Occidental", "AEST": "Horario estándar de Australia Oriental", "AEDT": "Horario de verán de Australia Oriental", "HKT": "Horario estándar de Hong Kong", "WART": "Horario estándar de Arxentina Occidental", "WAT": "Horario estándar de África Occidental"},
+ timezones: map[string]string{"GYT": "Horario da Güiana", "CLT": "Horario estándar de Chile", "UYT": "Horario estándar de Uruguai", "CST": "Horario estándar central", "JST": "Horario estándar de Xapón", "EDT": "Horario de verán de América Oriental", "NZST": "Horario estándar de Nova Celandia", "PDT": "Horario de verán do Pacífico", "HNT": "Horario estándar de Terranova", "WIB": "Horario de Indonesia Occidental", "AEDT": "Horario de verán de Australia Oriental", "BT": "Horario de Bután", "CDT": "Horario de verán da zona central", "ADT": "Horario de verán do Atlántico", "TMT": "Horario estándar de Turcomenistán", "HKT": "Horario estándar de Hong Kong", "CHAST": "Horario estándar de Chatham", "ART": "Horario estándar de Arxentina", "MEZ": "Horario estándar de Europa Central", "WAT": "Horario estándar de África Occidental", "IST": "Horario estándar da India", "HAST": "Horario estándar de Hawai-Aleutiano", "BOT": "Horario de Bolivia", "ChST": "Horario estándar de Chamorro", "MYT": "Horario de Malaisia", "CLST": "Horario de verán de Chile", "ACWDT": "Horario de verán de Australia Occidental Central", "MESZ": "Horario de verán de Europa Central", "HAT": "Horario de verán de Terranova", "UYST": "Horario de verán de Uruguai", "WIT": "Horario de Indonesia Oriental", "AWST": "Horario estándar de Australia Occidental", "WITA": "Horario de Indonesia Central", "JDT": "Horario de verán de Xapón", "OESZ": "Horario de verán de Europa Oriental", "ACDT": "Horario de verán de Australia Central", "GFT": "Horario da Güiana Francesa", "HADT": "Horario de verán de Hawai-Aleutiano", "WAST": "Horario de verán de África Occidental", "COT": "Horario estándar de Colombia", "LHST": "Horario estándar de Lord Howe", "MST": "Horario estándar das montañas americanas", "ACST": "Horario estándar de Australia Central", "VET": "Horario de Venezuela", "AEST": "Horario estándar de Australia Oriental", "EAT": "Horario de África Oriental", "CHADT": "Horario de verán de Chatham", "SAST": "Horario estándar de Sudáfrica", "WEZ": "Horario estándar de Europa Occidental", "WESZ": "Horario de verán de Europa Occidental", "GMT": "Horario do meridiano de Greenwich", "MDT": "Horario de verán das montañas americanas", "HKST": "Horario de verán de Hong Kong", "AKDT": "Horario de verán de Alasca", "AWDT": "Horario de verán de Australia Occidental", "PST": "Horario estándar do Pacífico", "∅∅∅": "Horario de verán de Brasilia", "WART": "Horario estándar de Arxentina Occidental", "WARST": "Horario de verán de Arxentina Occidental", "CAT": "Horario de África Central", "TMST": "Horario de verán de Turcomenistán", "SGT": "Horario estándar de Singapur", "COST": "Horario de verán de Colombia", "OEZ": "Horario estándar de Europa Oriental", "ACWST": "Horario estándar de Australia Occidental Central", "LHDT": "Horario de verán de Lord Howe", "SRT": "Horario de Surinam", "ECT": "Horario de Ecuador", "AKST": "Horario estándar de Alasca", "AST": "Horario estándar do Atlántico", "ARST": "Horario de verán de Arxentina", "EST": "Horario estándar América Oriental", "NZDT": "Horario de verán de Nova Celandia"},
}
}
diff --git a/gl/gl_test.go b/gl/gl_test.go
new file mode 100644
index 00000000..19182850
--- /dev/null
+++ b/gl/gl_test.go
@@ -0,0 +1,1120 @@
+package gl
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "gl"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/gl_ES/gl_ES.go b/gl_ES/gl_ES.go
index af7f4dbf..becd030d 100644
--- a/gl_ES/gl_ES.go
+++ b/gl_ES/gl_ES.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a.C.", "d.C."},
erasNarrow: []string{"", ""},
erasWide: []string{"antes de Cristo", "despois de Cristo"},
- timezones: map[string]string{"PST": "Horario estándar do Pacífico", "AWST": "Horario estándar de Australia Occidental", "MESZ": "Horario de verán de Europa Central", "UYT": "Horario estándar de Uruguai", "AEDT": "Horario de verán de Australia Oriental", "ChST": "Horario estándar de Chamorro", "GFT": "Horario da Güiana Francesa", "ACST": "Horario estándar de Australia Central", "MYT": "Horario de Malaisia", "AKDT": "Horario de verán de Alasca", "MST": "Horario estándar das montañas americanas", "SGT": "Horario estándar de Singapur", "HKST": "Horario de verán de Hong Kong", "WAT": "Horario estándar de África Occidental", "NZDT": "Horario de verán de Nova Celandia", "BOT": "Horario de Bolivia", "CLST": "Horario de verán de Chile", "ACWST": "Horario estándar de Australia Occidental Central", "EST": "Horario estándar América Oriental", "WARST": "Horario de verán de Arxentina Occidental", "IST": "Horario estándar da India", "SRT": "Horario de Surinam", "AWDT": "Horario de verán de Australia Occidental", "EDT": "Horario de verán de América Oriental", "HAST": "Horario estándar de Hawai-Aleutiano", "HKT": "Horario estándar de Hong Kong", "ARST": "Horario de verán de Arxentina", "WESZ": "Horario de verán de Europa Occidental", "AEST": "Horario estándar de Australia Oriental", "BT": "Horario de Bután", "ACDT": "Horario de verán de Australia Central", "PDT": "Horario de verán do Pacífico", "LHST": "Horario estándar de Lord Howe", "LHDT": "Horario de verán de Lord Howe", "CST": "Horario estándar central", "COT": "Horario estándar de Colombia", "COST": "Horario de verán de Colombia", "WITA": "Horario de Indonesia Central", "NZST": "Horario estándar de Nova Celandia", "WEZ": "Horario estándar de Europa Occidental", "ADT": "Horario de verán do Atlántico", "HNT": "Horario estándar de Terranova", "CLT": "Horario estándar de Chile", "ECT": "Horario de Ecuador", "JST": "Horario estándar de Xapón", "TMST": "Horario de verán de Turcomenistán", "JDT": "Horario de verán de Xapón", "AKST": "Horario estándar de Alasca", "WART": "Horario estándar de Arxentina Occidental", "WIB": "Horario de Indonesia Occidental", "GMT": "Horario do meridiano de Greenwich", "GYT": "Horario da Güiana", "AST": "Horario estándar do Atlántico", "SAST": "Horario estándar de Sudáfrica", "EAT": "Horario de África Oriental", "MDT": "Horario de verán das montañas americanas", "WIT": "Horario de Indonesia Oriental", "TMT": "Horario estándar de Turcomenistán", "∅∅∅": "Horario de verán de Brasilia", "HAT": "Horario de verán de Terranova", "ACWDT": "Horario de verán de Australia Occidental Central", "HADT": "Horario de verán de Hawai-Aleutiano", "UYST": "Horario de verán de Uruguai", "ART": "Horario estándar de Arxentina", "VET": "Horario de Venezuela", "OEZ": "Horario estándar de Europa Oriental", "OESZ": "Horario de verán de Europa Oriental", "WAST": "Horario de verán de África Occidental", "CDT": "Horario de verán da zona central", "MEZ": "Horario estándar de Europa Central", "CHAST": "Horario estándar de Chatham", "CHADT": "Horario de verán de Chatham", "CAT": "Horario de África Central"},
+ timezones: map[string]string{"∅∅∅": "Horario de verán das Azores", "MEZ": "Horario estándar de Europa Central", "COT": "Horario estándar de Colombia", "LHST": "Horario estándar de Lord Howe", "CLST": "Horario de verán de Chile", "CST": "Horario estándar central", "ACDT": "Horario de verán de Australia Central", "AKDT": "Horario de verán de Alasca", "IST": "Horario estándar da India", "OEZ": "Horario estándar de Europa Oriental", "AEST": "Horario estándar de Australia Oriental", "ADT": "Horario de verán do Atlántico", "JST": "Horario estándar de Xapón", "TMT": "Horario estándar de Turcomenistán", "TMST": "Horario de verán de Turcomenistán", "OESZ": "Horario de verán de Europa Oriental", "AEDT": "Horario de verán de Australia Oriental", "HKT": "Horario estándar de Hong Kong", "AWDT": "Horario de verán de Australia Occidental", "COST": "Horario de verán de Colombia", "CHADT": "Horario de verán de Chatham", "AWST": "Horario estándar de Australia Occidental", "SAST": "Horario estándar de Sudáfrica", "WESZ": "Horario de verán de Europa Occidental", "ACWST": "Horario estándar de Australia Occidental Central", "PST": "Horario estándar do Pacífico", "PDT": "Horario de verán do Pacífico", "UYST": "Horario de verán de Uruguai", "HKST": "Horario de verán de Hong Kong", "ACWDT": "Horario de verán de Australia Occidental Central", "ART": "Horario estándar de Arxentina", "HAT": "Horario de verán de Terranova", "ChST": "Horario estándar de Chamorro", "MYT": "Horario de Malaisia", "SRT": "Horario de Surinam", "HADT": "Horario de verán de Hawai-Aleutiano", "EAT": "Horario de África Oriental", "CAT": "Horario de África Central", "WAT": "Horario estándar de África Occidental", "WARST": "Horario de verán de Arxentina Occidental", "GFT": "Horario da Güiana Francesa", "AST": "Horario estándar do Atlántico", "EST": "Horario estándar América Oriental", "EDT": "Horario de verán de América Oriental", "NZDT": "Horario de verán de Nova Celandia", "LHDT": "Horario de verán de Lord Howe", "UYT": "Horario estándar de Uruguai", "MDT": "MDT", "JDT": "Horario de verán de Xapón", "CLT": "Horario estándar de Chile", "BOT": "Horario de Bolivia", "ACST": "Horario estándar de Australia Central", "WART": "Horario estándar de Arxentina Occidental", "MST": "MST", "AKST": "Horario estándar de Alasca", "WITA": "Horario de Indonesia Central", "MESZ": "Horario de verán de Europa Central", "ECT": "Horario de Ecuador", "HAST": "Horario estándar de Hawai-Aleutiano", "SGT": "Horario estándar de Singapur", "BT": "Horario de Bután", "GMT": "Horario do meridiano de Greenwich", "GYT": "Horario da Güiana", "CDT": "Horario de verán da zona central", "ARST": "Horario de verán de Arxentina", "NZST": "Horario estándar de Nova Celandia", "WAST": "Horario de verán de África Occidental", "WEZ": "Horario estándar de Europa Occidental", "WIB": "Horario de Indonesia Occidental", "WIT": "Horario de Indonesia Oriental", "CHAST": "Horario estándar de Chatham", "VET": "Horario de Venezuela", "HNT": "Horario estándar de Terranova"},
}
}
diff --git a/gl_ES/gl_ES_test.go b/gl_ES/gl_ES_test.go
new file mode 100644
index 00000000..1c9b772b
--- /dev/null
+++ b/gl_ES/gl_ES_test.go
@@ -0,0 +1,1120 @@
+package gl_ES
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "gl_ES"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/gsw/gsw.go b/gsw/gsw.go
index 6e74aa89..22192cd4 100644
--- a/gsw/gsw.go
+++ b/gsw/gsw.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"v. Chr.", "n. Chr."},
erasNarrow: []string{"v. Chr.", "n. Chr."},
erasWide: []string{"v. Chr.", "n. Chr."},
- timezones: map[string]string{"LHST": "LHST", "CDT": "Amerika-Zentraal Summerziit", "WART": "WART", "ARST": "ARST", "GYT": "GYT", "UYT": "UYT", "HADT": "HADT", "BT": "BT", "WIT": "WIT", "ACDT": "ACDT", "UYST": "UYST", "BOT": "BOT", "WESZ": "Weschteuropäischi Summerziit", "ACWST": "ACWST", "COT": "COT", "IST": "IST", "HNT": "HNT", "SRT": "SRT", "AWST": "AWST", "CLST": "CLST", "ADT": "ADT", "HKST": "HKST", "ACWDT": "ACWDT", "EDT": "EDT", "ECT": "ECT", "OEZ": "Oschteuropäischi Schtandardziit", "PDT": "PDT", "CST": "Amerika-Zentraal Schtandardziit", "ChST": "ChST", "WIB": "WIB", "MESZ": "Mitteleuropäischi Summerziit", "MDT": "MDT", "AST": "AST", "HKT": "HKT", "OESZ": "Oschteuropäischi Summerziit", "TMT": "TMT", "TMST": "TMST", "JST": "JST", "LHDT": "LHDT", "CHADT": "CHADT", "GMT": "GMT", "AKDT": "Alaska-Summerziit", "CHAST": "CHAST", "WAT": "Weschtafrikanischi Schtandardziit", "WARST": "WARST", "CAT": "Zentralafrikanischi Ziit", "COST": "COST", "SAST": "Süüdafrikanischi ziit", "ART": "ART", "JDT": "JDT", "AKST": "Alaska-Schtandardziit", "AWDT": "AWDT", "NZST": "NZST", "CLT": "CLT", "AEDT": "AEDT", "SGT": "SGT", "WITA": "WITA", "ACST": "ACST", "PST": "PST", "∅∅∅": "∅∅∅", "MEZ": "Mitteleuropäischi Schtandardziit", "VET": "VET", "WEZ": "Weschteuropäischi Schtandardziit", "HAST": "HAST", "GFT": "GFT", "NZDT": "NZDT", "MST": "MST", "EST": "EST", "HAT": "HAT", "MYT": "MYT", "AEST": "AEST", "WAST": "Weschtafrikanischi Summerziit", "EAT": "Oschtafrikanischi Ziit"},
+ timezones: map[string]string{"OEZ": "Oschteuropäischi Schtandardziit", "CDT": "Amerika-Zentraal Summerziit", "VET": "VET", "PDT": "PDT", "BOT": "BOT", "HNT": "HNT", "EDT": "EDT", "CST": "Amerika-Zentraal Schtandardziit", "ECT": "ECT", "JDT": "JDT", "PST": "PST", "EAT": "Oschtafrikanischi Ziit", "CHADT": "CHADT", "WAT": "Weschtafrikanischi Schtandardziit", "MYT": "MYT", "WARST": "WARST", "MEZ": "Mitteleuropäischi Schtandardziit", "WIB": "WIB", "WAST": "Weschtafrikanischi Summerziit", "ACST": "ACST", "CHAST": "CHAST", "AEST": "AEST", "WIT": "WIT", "ACWST": "ACWST", "NZST": "NZST", "SGT": "SGT", "COST": "COST", "JST": "JST", "MDT": "MDT", "UYT": "UYT", "ACDT": "ACDT", "GFT": "GFT", "HKST": "HKST", "HADT": "HADT", "CLT": "CLT", "BT": "BT", "SRT": "SRT", "AWDT": "AWDT", "MESZ": "Mitteleuropäischi Summerziit", "GYT": "GYT", "AEDT": "AEDT", "CLST": "CLST", "UYST": "UYST", "LHST": "LHST", "TMT": "TMT", "TMST": "TMST", "MST": "MST", "IST": "IST", "WART": "WART", "AWST": "AWST", "AST": "AST", "ACWDT": "ACWDT", "HAST": "HAST", "NZDT": "NZDT", "LHDT": "LHDT", "HKT": "HKT", "WITA": "WITA", "AKST": "Alaska-Schtandardziit", "AKDT": "Alaska-Summerziit", "SAST": "Süüdafrikanischi ziit", "COT": "COT", "CAT": "Zentralafrikanischi Ziit", "GMT": "GMT", "ARST": "ARST", "EST": "EST", "WESZ": "Weschteuropäischi Summerziit", "ChST": "ChST", "OESZ": "Oschteuropäischi Summerziit", "∅∅∅": "∅∅∅", "ART": "ART", "ADT": "ADT", "HAT": "HAT", "WEZ": "Weschteuropäischi Schtandardziit"},
}
}
diff --git a/gsw/gsw_test.go b/gsw/gsw_test.go
new file mode 100644
index 00000000..c67f827d
--- /dev/null
+++ b/gsw/gsw_test.go
@@ -0,0 +1,1120 @@
+package gsw
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "gsw"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/gsw_CH/gsw_CH.go b/gsw_CH/gsw_CH.go
index 4d8f215c..a92d2bb7 100644
--- a/gsw_CH/gsw_CH.go
+++ b/gsw_CH/gsw_CH.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"v. Chr.", "n. Chr."},
erasNarrow: []string{"v. Chr.", "n. Chr."},
erasWide: []string{"v. Chr.", "n. Chr."},
- timezones: map[string]string{"WIT": "WIT", "GMT": "GMT", "ACST": "ACST", "AWDT": "AWDT", "LHDT": "LHDT", "MESZ": "Mitteleuropäischi Summerziit", "ACWST": "ACWST", "AST": "AST", "ART": "ART", "MST": "MST", "COT": "COT", "BT": "BT", "CAT": "Zentralafrikanischi Ziit", "OESZ": "Oschteuropäischi Summerziit", "OEZ": "Oschteuropäischi Schtandardziit", "HNT": "HNT", "HAT": "HAT", "SRT": "SRT", "CLT": "CLT", "CLST": "CLST", "VET": "VET", "AEDT": "AEDT", "AWST": "AWST", "HAST": "HAST", "HADT": "HADT", "ACDT": "ACDT", "CDT": "Amerika-Zentraal Summerziit", "IST": "IST", "GFT": "GFT", "TMT": "TMT", "UYT": "UYT", "WESZ": "Weschteuropäischi Summerziit", "WART": "WART", "PST": "PST", "CST": "Amerika-Zentraal Schtandardziit", "MEZ": "Mitteleuropäischi Schtandardziit", "NZST": "NZST", "BOT": "BOT", "SGT": "SGT", "TMST": "TMST", "JST": "JST", "GYT": "GYT", "CHAST": "CHAST", "EST": "EST", "ECT": "ECT", "EDT": "EDT", "ADT": "ADT", "HKT": "HKT", "WIB": "WIB", "WAT": "Weschtafrikanischi Schtandardziit", "EAT": "Oschtafrikanischi Ziit", "MYT": "MYT", "LHST": "LHST", "UYST": "UYST", "ACWDT": "ACWDT", "ChST": "ChST", "JDT": "JDT", "AEST": "AEST", "COST": "COST", "MDT": "MDT", "SAST": "Süüdafrikanischi ziit", "ARST": "ARST", "AKDT": "Alaska-Summerziit", "NZDT": "NZDT", "WARST": "WARST", "WITA": "WITA", "PDT": "PDT", "∅∅∅": "∅∅∅", "HKST": "HKST", "AKST": "Alaska-Schtandardziit", "CHADT": "CHADT", "WEZ": "Weschteuropäischi Schtandardziit", "WAST": "Weschtafrikanischi Summerziit"},
+ timezones: map[string]string{"CST": "Amerika-Zentraal Schtandardziit", "HKT": "HKT", "SGT": "SGT", "BT": "BT", "ACST": "ACST", "∅∅∅": "∅∅∅", "HKST": "HKST", "AWST": "AWST", "MESZ": "Mitteleuropäischi Summerziit", "WAT": "Weschtafrikanischi Schtandardziit", "ARST": "ARST", "WITA": "WITA", "PDT": "PDT", "HAST": "HAST", "UYST": "UYST", "WART": "WART", "ACWDT": "ACWDT", "WIT": "WIT", "CHADT": "CHADT", "AST": "AST", "WEZ": "Weschteuropäischi Schtandardziit", "WESZ": "Weschteuropäischi Summerziit", "COT": "COT", "COST": "COST", "AEDT": "AEDT", "LHDT": "LHDT", "EST": "EST", "OEZ": "Oschteuropäischi Schtandardziit", "JST": "JST", "CAT": "Zentralafrikanischi Ziit", "HAT": "HAT", "WIB": "WIB", "ACDT": "ACDT", "CHAST": "CHAST", "TMST": "TMST", "CLST": "CLST", "ACWST": "ACWST", "NZST": "NZST", "GMT": "GMT", "WARST": "WARST", "SRT": "SRT", "ART": "ART", "SAST": "Süüdafrikanischi ziit", "GYT": "GYT", "MDT": "MDT", "AKDT": "Alaska-Summerziit", "IST": "IST", "EDT": "EDT", "PST": "PST", "CDT": "Amerika-Zentraal Summerziit", "JDT": "JDT", "HNT": "HNT", "UYT": "UYT", "VET": "VET", "NZDT": "NZDT", "BOT": "BOT", "TMT": "TMT", "OESZ": "Oschteuropäischi Summerziit", "GFT": "GFT", "ADT": "ADT", "MEZ": "Mitteleuropäischi Schtandardziit", "AEST": "AEST", "EAT": "Oschtafrikanischi Ziit", "ECT": "ECT", "AKST": "Alaska-Schtandardziit", "AWDT": "AWDT", "WAST": "Weschtafrikanischi Summerziit", "ChST": "ChST", "CLT": "CLT", "MST": "MST", "HADT": "HADT", "LHST": "LHST", "MYT": "MYT"},
}
}
diff --git a/gsw_CH/gsw_CH_test.go b/gsw_CH/gsw_CH_test.go
new file mode 100644
index 00000000..98632cdb
--- /dev/null
+++ b/gsw_CH/gsw_CH_test.go
@@ -0,0 +1,1120 @@
+package gsw_CH
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "gsw_CH"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/gsw_FR/gsw_FR.go b/gsw_FR/gsw_FR.go
index 9e6ef0a8..fdf499d2 100644
--- a/gsw_FR/gsw_FR.go
+++ b/gsw_FR/gsw_FR.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"v. Chr.", "n. Chr."},
erasNarrow: []string{"v. Chr.", "n. Chr."},
erasWide: []string{"v. Chr.", "n. Chr."},
- timezones: map[string]string{"LHDT": "LHDT", "CDT": "Amerika-Zentraal Summerziit", "WARST": "WARST", "WIB": "WIB", "ARST": "ARST", "GYT": "GYT", "JDT": "JDT", "WEZ": "Weschteuropäischi Schtandardziit", "COST": "COST", "HAST": "HAST", "∅∅∅": "Amazonas-Summerziit", "MESZ": "Mitteleuropäischi Summerziit", "ECT": "ECT", "BT": "BT", "OEZ": "Oschteuropäischi Schtandardziit", "ACST": "ACST", "AKST": "Alaska-Schtandardziit", "WAT": "Weschtafrikanischi Schtandardziit", "HADT": "HADT", "SGT": "SGT", "WAST": "Weschtafrikanischi Summerziit", "GMT": "GMT", "MYT": "MYT", "ChST": "ChST", "CAT": "Zentralafrikanischi Ziit", "CHADT": "CHADT", "HKT": "HKT", "HKST": "HKST", "HNT": "HNT", "EAT": "Oschtafrikanischi Ziit", "MST": "MST", "CST": "Amerika-Zentraal Schtandardziit", "NZDT": "NZDT", "WESZ": "Weschteuropäischi Summerziit", "AST": "AST", "TMST": "TMST", "JST": "JST", "SRT": "SRT", "PDT": "PDT", "MDT": "MDT", "ACWDT": "ACWDT", "SAST": "Süüdafrikanischi ziit", "GFT": "GFT", "UYST": "UYST", "CLT": "CLT", "COT": "COT", "ACDT": "ACDT", "AEST": "AEST", "EDT": "EDT", "ADT": "ADT", "AKDT": "Alaska-Summerziit", "AWST": "AWST", "MEZ": "Mitteleuropäischi Schtandardziit", "CLST": "CLST", "TMT": "TMT", "ART": "ART", "NZST": "NZST", "ACWST": "ACWST", "AEDT": "AEDT", "WIT": "WIT", "IST": "IST", "LHST": "LHST", "UYT": "UYT", "HAT": "HAT", "BOT": "BOT", "CHAST": "CHAST", "VET": "VET", "EST": "EST", "WART": "WART", "WITA": "WITA", "OESZ": "Oschteuropäischi Summerziit", "PST": "PST", "AWDT": "AWDT"},
+ timezones: map[string]string{"MST": "MST", "WITA": "WITA", "PDT": "PDT", "CLST": "CLST", "BT": "BT", "ART": "ART", "CAT": "Zentralafrikanischi Ziit", "GFT": "GFT", "CHADT": "CHADT", "ECT": "ECT", "VET": "VET", "ACWST": "ACWST", "CDT": "Amerika-Zentraal Summerziit", "TMT": "TMT", "ACDT": "ACDT", "NZDT": "NZDT", "WAST": "Weschtafrikanischi Summerziit", "WEZ": "Weschteuropäischi Schtandardziit", "MYT": "MYT", "JST": "JST", "AKDT": "Alaska-Summerziit", "ACST": "ACST", "HKT": "HKT", "ARST": "ARST", "MEZ": "Mitteleuropäischi Schtandardziit", "WESZ": "Weschteuropäischi Summerziit", "WART": "WART", "AKST": "Alaska-Schtandardziit", "EDT": "EDT", "COST": "COST", "HNT": "HNT", "CST": "Amerika-Zentraal Schtandardziit", "SRT": "SRT", "AWDT": "AWDT", "SAST": "Süüdafrikanischi ziit", "GMT": "GMT", "ADT": "ADT", "NZST": "NZST", "PST": "PST", "WIB": "WIB", "LHDT": "LHDT", "WARST": "WARST", "JDT": "JDT", "COT": "COT", "TMST": "TMST", "AEST": "AEST", "MDT": "MDT", "WAT": "Weschtafrikanischi Schtandardziit", "SGT": "SGT", "ChST": "ChST", "UYT": "UYT", "HKST": "HKST", "AST": "AST", "ACWDT": "ACWDT", "AWST": "AWST", "HAT": "HAT", "EAT": "Oschtafrikanischi Ziit", "LHST": "LHST", "∅∅∅": "∅∅∅", "EST": "EST", "OEZ": "Oschteuropäischi Schtandardziit", "GYT": "GYT", "CLT": "CLT", "BOT": "BOT", "IST": "IST", "AEDT": "AEDT", "HADT": "HADT", "OESZ": "Oschteuropäischi Summerziit", "UYST": "UYST", "CHAST": "CHAST", "HAST": "HAST", "MESZ": "Mitteleuropäischi Summerziit", "WIT": "WIT"},
}
}
diff --git a/gsw_FR/gsw_FR_test.go b/gsw_FR/gsw_FR_test.go
new file mode 100644
index 00000000..77a4bcd0
--- /dev/null
+++ b/gsw_FR/gsw_FR_test.go
@@ -0,0 +1,1120 @@
+package gsw_FR
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "gsw_FR"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/gsw_LI/gsw_LI.go b/gsw_LI/gsw_LI.go
index 77c7e94b..87ab43bf 100644
--- a/gsw_LI/gsw_LI.go
+++ b/gsw_LI/gsw_LI.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"v. Chr.", "n. Chr."},
erasNarrow: []string{"v. Chr.", "n. Chr."},
erasWide: []string{"v. Chr.", "n. Chr."},
- timezones: map[string]string{"SGT": "SGT", "AST": "AST", "HAT": "HAT", "AWST": "AWST", "NZST": "NZST", "ChST": "ChST", "HADT": "HADT", "WAT": "Weschtafrikanischi Schtandardziit", "BT": "BT", "TMST": "TMST", "EAT": "Oschtafrikanischi Ziit", "CDT": "Amerika-Zentraal Summerziit", "ECT": "ECT", "PST": "PST", "WART": "WART", "OEZ": "Oschteuropäischi Schtandardziit", "AWDT": "AWDT", "VET": "VET", "OESZ": "Oschteuropäischi Summerziit", "GFT": "GFT", "WIT": "WIT", "ART": "ART", "LHDT": "LHDT", "MEZ": "Mitteleuropäischi Schtandardziit", "AEDT": "AEDT", "HAST": "HAST", "PDT": "PDT", "JDT": "JDT", "AKDT": "Alaska-Summerziit", "UYT": "UYT", "CHAST": "CHAST", "COST": "COST", "WITA": "WITA", "ARST": "ARST", "∅∅∅": "∅∅∅", "HKT": "HKT", "WARST": "WARST", "GMT": "GMT", "WIB": "WIB", "IST": "IST", "WEZ": "Weschteuropäischi Schtandardziit", "MESZ": "Mitteleuropäischi Summerziit", "EST": "EST", "COT": "COT", "ADT": "ADT", "MDT": "MDT", "ACDT": "ACDT", "GYT": "GYT", "MYT": "MYT", "UYST": "UYST", "HNT": "HNT", "AEST": "AEST", "CHADT": "CHADT", "EDT": "EDT", "ACST": "ACST", "NZDT": "NZDT", "CST": "Amerika-Zentraal Schtandardziit", "MST": "MST", "TMT": "TMT", "LHST": "LHST", "AKST": "Alaska-Schtandardziit", "BOT": "BOT", "CAT": "Zentralafrikanischi Ziit", "WAST": "Weschtafrikanischi Summerziit", "CLST": "CLST", "WESZ": "Weschteuropäischi Summerziit", "SAST": "Süüdafrikanischi ziit", "JST": "JST", "ACWDT": "ACWDT", "CLT": "CLT", "HKST": "HKST", "SRT": "SRT", "ACWST": "ACWST"},
+ timezones: map[string]string{"MST": "MST", "CHADT": "CHADT", "AST": "AST", "PST": "PST", "OEZ": "Oschteuropäischi Schtandardziit", "SRT": "SRT", "ARST": "ARST", "EST": "EST", "PDT": "PDT", "HNT": "HNT", "WIB": "WIB", "HKT": "HKT", "HKST": "HKST", "ADT": "ADT", "ACWST": "ACWST", "EDT": "EDT", "WIT": "WIT", "CST": "Amerika-Zentraal Schtandardziit", "CDT": "Amerika-Zentraal Summerziit", "JST": "JST", "LHDT": "LHDT", "ECT": "ECT", "ART": "ART", "TMST": "TMST", "AEST": "AEST", "CHAST": "CHAST", "AWST": "AWST", "MEZ": "Mitteleuropäischi Schtandardziit", "HADT": "HADT", "NZDT": "NZDT", "BOT": "BOT", "LHST": "LHST", "MYT": "MYT", "ACDT": "ACDT", "WESZ": "Weschteuropäischi Summerziit", "ChST": "ChST", "EAT": "Oschtafrikanischi Ziit", "CLST": "CLST", "NZST": "NZST", "HAT": "HAT", "COST": "COST", "BT": "BT", "IST": "IST", "MESZ": "Mitteleuropäischi Summerziit", "SGT": "SGT", "WAT": "Weschtafrikanischi Schtandardziit", "COT": "COT", "OESZ": "Oschteuropäischi Summerziit", "GYT": "GYT", "UYT": "UYT", "GMT": "GMT", "WARST": "WARST", "SAST": "Süüdafrikanischi ziit", "CAT": "Zentralafrikanischi Ziit", "MDT": "MDT", "AKDT": "Alaska-Summerziit", "WITA": "WITA", "∅∅∅": "Amazonas-Summerziit", "TMT": "TMT", "WART": "WART", "VET": "VET", "JDT": "JDT", "WAST": "Weschtafrikanischi Summerziit", "AEDT": "AEDT", "AWDT": "AWDT", "HAST": "HAST", "WEZ": "Weschteuropäischi Schtandardziit", "CLT": "CLT", "GFT": "GFT", "AKST": "Alaska-Schtandardziit", "ACWDT": "ACWDT", "UYST": "UYST", "ACST": "ACST"},
}
}
diff --git a/gsw_LI/gsw_LI_test.go b/gsw_LI/gsw_LI_test.go
new file mode 100644
index 00000000..13dd3528
--- /dev/null
+++ b/gsw_LI/gsw_LI_test.go
@@ -0,0 +1,1120 @@
+package gsw_LI
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "gsw_LI"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/gu/gu.go b/gu/gu.go
index ea47189f..d35ac90c 100644
--- a/gu/gu.go
+++ b/gu/gu.go
@@ -66,7 +66,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ઈ.સ.પૂર્વે", "ઈ.સ."},
erasNarrow: []string{"ઇ સ પુ", "ઇસ"},
erasWide: []string{"ઈસવીસન પૂર્વે", "ઇસવીસન"},
- timezones: map[string]string{"ACDT": "ઓસ્ટ્રેલિયન મધ્ય દિવસ સમય", "CST": "ઉત્તર અમેરિકન કેન્દ્રિય પ્રમાણભૂત સમય", "WAT": "પશ્ચિમ આફ્રિકા માનક સમય", "IST": "ભારતીય માનક સમય", "MST": "મકાઉ પ્રમાણભૂત સમય", "HAST": "હવાઇ-એલ્યુશિઅન માનક સમય", "TMST": "તુર્કમેનિસ્તાન ગ્રીષ્મ સમય", "ACWST": "ઓસ્ટ્રેલિયન મધ્ય પશ્ચિમી પ્રમાણભૂત સમય", "AEDT": "ઓસ્ટ્રેલિયન પૂર્વીય દિવસ સમય", "CLT": "ચિલી માનક સમય", "CAT": "મધ્ય આફ્રિકા સમય", "AST": "અટલાન્ટિક પ્રમાણભૂત સમય", "HKST": "હોંગ કોંગ ગ્રીષ્મ સમય", "BOT": "બોલિવિયા સમય", "SRT": "સૂરીનામ સમય", "NZST": "ન્યુઝીલેન્ડ માનક સમય", "UYT": "ઉરૂગ્વે માનક સમય", "WEZ": "પશ્ચિમી યુરોપિયન માનક સમય", "ACWDT": "ઓસ્ટ્રેલિયન મધ્ય પશ્ચિમી દિવસ સમય", "WAST": "પશ્ચિમ આફ્રિકા ગ્રીષ્મ સમય", "TMT": "તુર્કમેનિસ્તાન માનક સમય", "ART": "અર્જેન્ટીના માનક સમય", "AKDT": "અલાસ્કા દિવસ સમય", "UYST": "ઉરૂગ્વે ગ્રીષ્મ સમય", "AEST": "ઓસ્ટ્રેલિયન પૂર્વીય પ્રમાણભૂત સમય", "EDT": "ઉત્તર અમેરિકન પૂર્વી દિવસ સમય", "EAT": "પૂર્વ આફ્રિકા સમય", "CHADT": "ચેતહામ દિવસ સમય", "EST": "ઉત્તર અમેરિકન પૂર્વી પ્રમાણભૂત સમય", "HAT": "ન્યૂફાઉન્ડલેન્ડ દિવસ સમય", "PDT": "ઉત્તર અમેરિકન પેસિફિક દિવસ સમય", "AKST": "અલાસ્કા પ્રમાણભૂત સમય", "JDT": "જાપાન દિવસ સમય", "MEZ": "મધ્ય યુરોપિયન માનક સમય", "MESZ": "મધ્ય યુરોપિયન ગ્રીષ્મ સમય", "VET": "વેનેઝુએલા સમય", "MDT": "મકાઉ ગ્રીષ્મ સમય", "COT": "કોલંબિયા માનક સમય", "CHAST": "ચેતહામ માનક સમય", "MYT": "મલેશિયા સમય", "CLST": "ચિલી ગ્રીષ્મ સમય", "WITA": "મધ્ય ઇન્ડોનેશિયા સમય", "AWDT": "ઓસ્ટ્રેલિયન પશ્ચિમી દિવસ સમય", "PST": "ઉત્તર અમેરિકન પેસિફિક પ્રમાણભૂત સમય", "GYT": "ગયાના સમય", "COST": "કોલંબિયા ગ્રીષ્મ સમય", "BT": "ભૂટાન સમય", "WIT": "પૂર્વીય ઇન્ડોનેશિયા સમય", "ARST": "આર્જેન્ટીના ગ્રીષ્મ સમય", "ChST": "કેમોરો માનક સમય", "HADT": "હવાઇ-એલ્યુશિઅન દિવસ સમય", "SGT": "સિંગાપુર માનક સમય", "WART": "પશ્ચિમી અર્જેન્ટીના માનક સમય", "WARST": "પશ્ચિમી અર્જેન્ટીના ગ્રીષ્મ સમય", "OESZ": "પૂર્વી યુરોપીયન ગ્રીષ્મ સમય", "HNT": "ન્યૂફાઉન્ડલેન્ડ પ્રમાણભૂત સમય", "AWST": "ઓસ્ટ્રેલિયન પશ્ચિમી પ્રમાણભૂત સમય", "NZDT": "ન્યુઝીલેન્ડ દિવસ સમય", "WESZ": "પશ્ચિમી યુરોપિયન ગ્રીષ્મ સમય", "ECT": "એક્વાડોર સમય", "ADT": "અટલાન્ટિક દિવસ સમય", "LHDT": "લોર્ડ હોવ દિવસ સમય", "JST": "જાપાન માનક સમય", "LHST": "લોર્ડ હોવ પ્રમાણભૂત સમય", "SAST": "દક્ષિણ આફ્રિકા માનક સમય", "WIB": "પશ્ચિમી ઇન્ડોનેશિયા સમય", "GMT": "ગ્રીનવિચ મધ્યમ સમય", "∅∅∅": "એમેઝોન ગ્રીષ્મ સમય", "HKT": "હોંગ કોંગ માનક સમય", "CDT": "ઉત્તર અમેરિકન મધ્ય દિવસ સમય", "OEZ": "પૂર્વી યુરોપિયન માનક સમય", "GFT": "ફ્રેન્ચ ગયાના સમય", "ACST": "ઓસ્ટ્રેલિયન મધ્ય પ્રમાણભૂત સમય"},
+ timezones: map[string]string{"MST": "ઉત્તર અમેરિકન માઉન્ટન પ્રમાણભૂત સમય", "WIT": "પૂર્વીય ઇન્ડોનેશિયા સમય", "AST": "અટલાન્ટિક પ્રમાણભૂત સમય", "ART": "અર્જેન્ટીના માનક સમય", "IST": "ભારતીય માનક સમય", "HAST": "હવાઇ-એલ્યુશિઅન માનક સમય", "LHDT": "લોર્ડ હોવ દિવસ સમય", "CLT": "ચિલી માનક સમય", "WARST": "પશ્ચિમી અર્જેન્ટીના ગ્રીષ્મ સમય", "BOT": "બોલિવિયા સમય", "WESZ": "પશ્ચિમી યુરોપિયન ગ્રીષ્મ સમય", "UYST": "ઉરૂગ્વે ગ્રીષ્મ સમય", "HKT": "હોંગ કોંગ માનક સમય", "WITA": "મધ્ય ઇન્ડોનેશિયા સમય", "PST": "ઉત્તર અમેરિકન પેસિફિક પ્રમાણભૂત સમય", "GMT": "ગ્રીનવિચ મધ્યમ સમય", "ACWDT": "ઓસ્ટ્રેલિયન મધ્ય પશ્ચિમી દિવસ સમય", "AEDT": "ઓસ્ટ્રેલિયન પૂર્વીય દિવસ સમય", "ChST": "કેમોરો માનક સમય", "CST": "ઉત્તર અમેરિકન કેન્દ્રિય પ્રમાણભૂત સમય", "JDT": "જાપાન દિવસ સમય", "PDT": "ઉત્તર અમેરિકન પેસિફિક દિવસ સમય", "CAT": "મધ્ય આફ્રિકા સમય", "COST": "કોલંબિયા ગ્રીષ્મ સમય", "AEST": "ઓસ્ટ્રેલિયન પૂર્વીય પ્રમાણભૂત સમય", "ACDT": "ઓસ્ટ્રેલિયન મધ્ય દિવસ સમય", "CHADT": "ચેતહામ દિવસ સમય", "ADT": "અટલાન્ટિક દિવસ સમય", "HAT": "ન્યૂફાઉન્ડલેન્ડ દિવસ સમય", "SGT": "સિંગાપુર માનક સમય", "COT": "કોલંબિયા માનક સમય", "EDT": "ઉત્તર અમેરિકન પૂર્વી દિવસ સમય", "NZDT": "ન્યુઝીલેન્ડ દિવસ સમય", "LHST": "લોર્ડ હોવ પ્રમાણભૂત સમય", "CLST": "ચિલી ગ્રીષ્મ સમય", "WART": "પશ્ચિમી અર્જેન્ટીના માનક સમય", "SRT": "સૂરીનામ સમય", "JST": "જાપાન માનક સમય", "EST": "ઉત્તર અમેરિકન પૂર્વી પ્રમાણભૂત સમય", "TMT": "તુર્કમેનિસ્તાન માનક સમય", "UYT": "ઉરૂગ્વે માનક સમય", "GFT": "ફ્રેન્ચ ગયાના સમય", "VET": "વેનેઝુએલા સમય", "AKST": "અલાસ્કા પ્રમાણભૂત સમય", "WIB": "પશ્ચિમી ઇન્ડોનેશિયા સમય", "∅∅∅": "બ્રાઝિલિયા ગ્રીષ્મ સમય", "AKDT": "અલાસ્કા દિવસ સમય", "MYT": "મલેશિયા સમય", "CHAST": "ચેતહામ માનક સમય", "AWDT": "ઓસ્ટ્રેલિયન પશ્ચિમી દિવસ સમય", "MEZ": "મધ્ય યુરોપિયન માનક સમય", "BT": "ભૂટાન સમય", "ECT": "એક્વાડોર સમય", "HADT": "હવાઇ-એલ્યુશિઅન દિવસ સમય", "HNT": "ન્યૂફાઉન્ડલેન્ડ પ્રમાણભૂત સમય", "WAST": "પશ્ચિમ આફ્રિકા ગ્રીષ્મ સમય", "OESZ": "પૂર્વી યુરોપીયન ગ્રીષ્મ સમય", "CDT": "ઉત્તર અમેરિકન મધ્ય દિવસ સમય", "GYT": "ગયાના સમય", "EAT": "પૂર્વ આફ્રિકા સમય", "ACST": "ઓસ્ટ્રેલિયન મધ્ય પ્રમાણભૂત સમય", "SAST": "દક્ષિણ આફ્રિકા માનક સમય", "MESZ": "મધ્ય યુરોપિયન ગ્રીષ્મ સમય", "OEZ": "પૂર્વી યુરોપિયન માનક સમય", "ACWST": "ઓસ્ટ્રેલિયન મધ્ય પશ્ચિમી પ્રમાણભૂત સમય", "AWST": "ઓસ્ટ્રેલિયન પશ્ચિમી પ્રમાણભૂત સમય", "WAT": "પશ્ચિમ આફ્રિકા માનક સમય", "TMST": "તુર્કમેનિસ્તાન ગ્રીષ્મ સમય", "MDT": "ઉત્તર અમેરિકન માઉન્ટન દિવસ સમય", "HKST": "હોંગ કોંગ ગ્રીષ્મ સમય", "ARST": "આર્જેન્ટીના ગ્રીષ્મ સમય", "NZST": "ન્યુઝીલેન્ડ માનક સમય", "WEZ": "પશ્ચિમી યુરોપિયન માનક સમય"},
}
}
diff --git a/gu/gu_test.go b/gu/gu_test.go
new file mode 100644
index 00000000..ecb09ebb
--- /dev/null
+++ b/gu/gu_test.go
@@ -0,0 +1,1120 @@
+package gu
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "gu"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/gu_IN/gu_IN.go b/gu_IN/gu_IN.go
index 2311e55e..0bb2da61 100644
--- a/gu_IN/gu_IN.go
+++ b/gu_IN/gu_IN.go
@@ -66,7 +66,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ઈ.સ.પૂર્વે", "ઈ.સ."},
erasNarrow: []string{"ઇ સ પુ", "ઇસ"},
erasWide: []string{"ઈસવીસન પૂર્વે", "ઇસવીસન"},
- timezones: map[string]string{"ECT": "એક્વાડોર સમય", "AWST": "ઓસ્ટ્રેલિયન પશ્ચિમી પ્રમાણભૂત સમય", "JDT": "જાપાન દિવસ સમય", "EST": "ઉત્તર અમેરિકન પૂર્વી પ્રમાણભૂત સમય", "SAST": "દક્ષિણ આફ્રિકા માનક સમય", "WAST": "પશ્ચિમ આફ્રિકા ગ્રીષ્મ સમય", "PST": "ઉત્તર અમેરિકન પેસિફિક પ્રમાણભૂત સમય", "∅∅∅": "બ્રાઝિલિયા ગ્રીષ્મ સમય", "IST": "ભારતીય માનક સમય", "CST": "ઉત્તર અમેરિકન કેન્દ્રિય પ્રમાણભૂત સમય", "MDT": "ઉત્તર અમેરિકન માઉન્ટન દિવસ સમય", "WESZ": "પશ્ચિમી યુરોપિયન ગ્રીષ્મ સમય", "LHDT": "લોર્ડ હોવ દિવસ સમય", "UYT": "ઉરૂગ્વે માનક સમય", "NZST": "ન્યુઝીલેન્ડ માનક સમય", "NZDT": "ન્યુઝીલેન્ડ દિવસ સમય", "VET": "વેનેઝુએલા સમય", "EDT": "ઉત્તર અમેરિકન પૂર્વી દિવસ સમય", "HADT": "હવાઇ-એલ્યુશિઅન દિવસ સમય", "AKST": "અલાસ્કા પ્રમાણભૂત સમય", "JST": "જાપાન માનક સમય", "SRT": "સૂરીનામ સમય", "ACWDT": "ઓસ્ટ્રેલિયન મધ્ય પશ્ચિમી દિવસ સમય", "ACST": "ઓસ્ટ્રેલિયન મધ્ય પ્રમાણભૂત સમય", "GYT": "ગયાના સમય", "CDT": "ઉત્તર અમેરિકન મધ્ય દિવસ સમય", "BT": "ભૂટાન સમય", "HAT": "ન્યૂફાઉન્ડલેન્ડ દિવસ સમય", "WIB": "પશ્ચિમી ઇન્ડોનેશિયા સમય", "ART": "અર્જેન્ટીના માનક સમય", "PDT": "ઉત્તર અમેરિકન પેસિફિક દિવસ સમય", "MYT": "મલેશિયા સમય", "MEZ": "મધ્ય યુરોપિયન માનક સમય", "ChST": "કેમોરો માનક સમય", "ADT": "અટલાન્ટિક દિવસ સમય", "WAT": "પશ્ચિમ આફ્રિકા માનક સમય", "HKT": "હોંગ કોંગ માનક સમય", "HNT": "ન્યૂફાઉન્ડલેન્ડ પ્રમાણભૂત સમય", "AWDT": "ઓસ્ટ્રેલિયન પશ્ચિમી દિવસ સમય", "OESZ": "પૂર્વી યુરોપીયન ગ્રીષ્મ સમય", "GMT": "ગ્રીનવિચ મધ્યમ સમય", "LHST": "લોર્ડ હોવ પ્રમાણભૂત સમય", "MESZ": "મધ્ય યુરોપિયન ગ્રીષ્મ સમય", "AEST": "ઓસ્ટ્રેલિયન પૂર્વીય પ્રમાણભૂત સમય", "CHADT": "ચેતહામ દિવસ સમય", "CLST": "ચિલી ગ્રીષ્મ સમય", "GFT": "ફ્રેન્ચ ગયાના સમય", "CHAST": "ચેતહામ માનક સમય", "COT": "કોલંબિયા માનક સમય", "HAST": "હવાઇ-એલ્યુશિઅન માનક સમય", "OEZ": "પૂર્વી યુરોપિયન માનક સમય", "ACDT": "ઓસ્ટ્રેલિયન મધ્ય દિવસ સમય", "WIT": "પૂર્વીય ઇન્ડોનેશિયા સમય", "UYST": "ઉરૂગ્વે ગ્રીષ્મ સમય", "WEZ": "પશ્ચિમી યુરોપિયન માનક સમય", "COST": "કોલંબિયા ગ્રીષ્મ સમય", "AST": "અટલાન્ટિક પ્રમાણભૂત સમય", "WARST": "પશ્ચિમી અર્જેન્ટીના ગ્રીષ્મ સમય", "EAT": "પૂર્વ આફ્રિકા સમય", "TMST": "તુર્કમેનિસ્તાન ગ્રીષ્મ સમય", "AKDT": "અલાસ્કા દિવસ સમય", "MST": "ઉત્તર અમેરિકન માઉન્ટન પ્રમાણભૂત સમય", "CLT": "ચિલી માનક સમય", "HKST": "હોંગ કોંગ ગ્રીષ્મ સમય", "WART": "પશ્ચિમી અર્જેન્ટીના માનક સમય", "WITA": "મધ્ય ઇન્ડોનેશિયા સમય", "TMT": "તુર્કમેનિસ્તાન માનક સમય", "ACWST": "ઓસ્ટ્રેલિયન મધ્ય પશ્ચિમી પ્રમાણભૂત સમય", "AEDT": "ઓસ્ટ્રેલિયન પૂર્વીય દિવસ સમય", "CAT": "મધ્ય આફ્રિકા સમય", "SGT": "સિંગાપુર માનક સમય", "ARST": "આર્જેન્ટીના ગ્રીષ્મ સમય", "BOT": "બોલિવિયા સમય"},
+ timezones: map[string]string{"PDT": "ઉત્તર અમેરિકન પેસિફિક દિવસ સમય", "MESZ": "મધ્ય યુરોપિયન ગ્રીષ્મ સમય", "WAST": "પશ્ચિમ આફ્રિકા ગ્રીષ્મ સમય", "ACWST": "ઓસ્ટ્રેલિયન મધ્ય પશ્ચિમી પ્રમાણભૂત સમય", "IST": "ભારતીય માનક સમય", "WEZ": "પશ્ચિમી યુરોપિયન માનક સમય", "WIB": "પશ્ચિમી ઇન્ડોનેશિયા સમય", "GYT": "ગયાના સમય", "MDT": "મકાઉ ગ્રીષ્મ સમય", "COST": "કોલંબિયા ગ્રીષ્મ સમય", "AEST": "ઓસ્ટ્રેલિયન પૂર્વીય પ્રમાણભૂત સમય", "UYT": "ઉરૂગ્વે માનક સમય", "EAT": "પૂર્વ આફ્રિકા સમય", "VET": "વેનેઝુએલા સમય", "AKDT": "અલાસ્કા દિવસ સમય", "AWST": "ઓસ્ટ્રેલિયન પશ્ચિમી પ્રમાણભૂત સમય", "ARST": "આર્જેન્ટીના ગ્રીષ્મ સમય", "COT": "કોલંબિયા માનક સમય", "TMT": "તુર્કમેનિસ્તાન માનક સમય", "GMT": "ગ્રીનવિચ મધ્યમ સમય", "OESZ": "પૂર્વી યુરોપીયન ગ્રીષ્મ સમય", "CLT": "ચિલી માનક સમય", "HKST": "હોંગ કોંગ ગ્રીષ્મ સમય", "BOT": "બોલિવિયા સમય", "CDT": "ઉત્તર અમેરિકન મધ્ય દિવસ સમય", "NZST": "ન્યુઝીલેન્ડ માનક સમય", "HADT": "હવાઇ-એલ્યુશિઅન દિવસ સમય", "SAST": "દક્ષિણ આફ્રિકા માનક સમય", "WAT": "પશ્ચિમ આફ્રિકા માનક સમય", "LHDT": "લોર્ડ હોવ દિવસ સમય", "ACST": "ઓસ્ટ્રેલિયન મધ્ય પ્રમાણભૂત સમય", "MST": "મકાઉ પ્રમાણભૂત સમય", "EST": "ઉત્તર અમેરિકન પૂર્વી પ્રમાણભૂત સમય", "HAT": "ન્યૂફાઉન્ડલેન્ડ દિવસ સમય", "CAT": "મધ્ય આફ્રિકા સમય", "OEZ": "પૂર્વી યુરોપિયન માનક સમય", "MYT": "મલેશિયા સમય", "CLST": "ચિલી ગ્રીષ્મ સમય", "SRT": "સૂરીનામ સમય", "CHADT": "ચેતહામ દિવસ સમય", "ART": "અર્જેન્ટીના માનક સમય", "TMST": "તુર્કમેનિસ્તાન ગ્રીષ્મ સમય", "ChST": "કેમોરો માનક સમય", "WIT": "પૂર્વીય ઇન્ડોનેશિયા સમય", "ADT": "અટલાન્ટિક દિવસ સમય", "AST": "અટલાન્ટિક પ્રમાણભૂત સમય", "WITA": "મધ્ય ઇન્ડોનેશિયા સમય", "MEZ": "મધ્ય યુરોપિયન માનક સમય", "HNT": "ન્યૂફાઉન્ડલેન્ડ પ્રમાણભૂત સમય", "ACDT": "ઓસ્ટ્રેલિયન મધ્ય દિવસ સમય", "GFT": "ફ્રેન્ચ ગયાના સમય", "AKST": "અલાસ્કા પ્રમાણભૂત સમય", "EDT": "ઉત્તર અમેરિકન પૂર્વી દિવસ સમય", "HAST": "હવાઇ-એલ્યુશિઅન માનક સમય", "LHST": "લોર્ડ હોવ પ્રમાણભૂત સમય", "UYST": "ઉરૂગ્વે ગ્રીષ્મ સમય", "AWDT": "ઓસ્ટ્રેલિયન પશ્ચિમી દિવસ સમય", "JDT": "જાપાન દિવસ સમય", "PST": "ઉત્તર અમેરિકન પેસિફિક પ્રમાણભૂત સમય", "WESZ": "પશ્ચિમી યુરોપિયન ગ્રીષ્મ સમય", "CHAST": "ચેતહામ માનક સમય", "HKT": "હોંગ કોંગ માનક સમય", "JST": "જાપાન માનક સમય", "SGT": "સિંગાપુર માનક સમય", "BT": "ભૂટાન સમય", "∅∅∅": "એઝોર્સ ગ્રીષ્મ સમય", "NZDT": "ન્યુઝીલેન્ડ દિવસ સમય", "AEDT": "ઓસ્ટ્રેલિયન પૂર્વીય દિવસ સમય", "WARST": "પશ્ચિમી અર્જેન્ટીના ગ્રીષ્મ સમય", "ACWDT": "ઓસ્ટ્રેલિયન મધ્ય પશ્ચિમી દિવસ સમય", "WART": "પશ્ચિમી અર્જેન્ટીના માનક સમય", "CST": "ઉત્તર અમેરિકન કેન્દ્રિય પ્રમાણભૂત સમય", "ECT": "એક્વાડોર સમય"},
}
}
diff --git a/gu_IN/gu_IN_test.go b/gu_IN/gu_IN_test.go
new file mode 100644
index 00000000..7d2fdcba
--- /dev/null
+++ b/gu_IN/gu_IN_test.go
@@ -0,0 +1,1120 @@
+package gu_IN
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "gu_IN"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/guz/guz.go b/guz/guz.go
index 835dddf9..9f780c3f 100644
--- a/guz/guz.go
+++ b/guz/guz.go
@@ -63,7 +63,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"YA", "YK"},
erasNarrow: []string{"", ""},
erasWide: []string{"Yeso ataiborwa", "Yeso kaiboirwe"},
- timezones: map[string]string{"AWDT": "AWDT", "NZDT": "NZDT", "WESZ": "WESZ", "CLST": "CLST", "ADT": "ADT", "IST": "IST", "GYT": "GYT", "SRT": "SRT", "CAT": "CAT", "GFT": "GFT", "MST": "MST", "ARST": "ARST", "PST": "PST", "NZST": "NZST", "ACWST": "ACWST", "OESZ": "OESZ", "TMST": "TMST", "AKST": "AKST", "COST": "COST", "HAT": "HAT", "ACST": "ACST", "JDT": "JDT", "MEZ": "MEZ", "UYST": "UYST", "WAT": "WAT", "WART": "WART", "∅∅∅": "∅∅∅", "LHDT": "LHDT", "JST": "JST", "CST": "CST", "AEST": "AEST", "EST": "EST", "AST": "AST", "LHST": "LHST", "ACWDT": "ACWDT", "VET": "VET", "COT": "COT", "SAST": "SAST", "HKT": "HKT", "WARST": "WARST", "PDT": "PDT", "ART": "ART", "AKDT": "AKDT", "SGT": "SGT", "GMT": "GMT", "HNT": "HNT", "WIB": "WIB", "TMT": "TMT", "CHADT": "CHADT", "EDT": "EDT", "HADT": "HADT", "BT": "BT", "OEZ": "OEZ", "MDT": "MDT", "AWST": "AWST", "WEZ": "WEZ", "CLT": "CLT", "MESZ": "MESZ", "ECT": "ECT", "WITA": "WITA", "CDT": "CDT", "BOT": "BOT", "UYT": "UYT", "ChST": "ChST", "CHAST": "CHAST", "HAST": "HAST", "EAT": "EAT", "ACDT": "ACDT", "MYT": "MYT", "AEDT": "AEDT", "WAST": "WAST", "HKST": "HKST", "WIT": "WIT"},
+ timezones: map[string]string{"SRT": "SRT", "MEZ": "MEZ", "HAST": "HAST", "HADT": "HADT", "GYT": "GYT", "HKST": "HKST", "CHAST": "CHAST", "JST": "JST", "ChST": "ChST", "MST": "MST", "WAST": "WAST", "WEZ": "WEZ", "HAT": "HAT", "COT": "COT", "WARST": "WARST", "ADT": "ADT", "CAT": "CAT", "CLST": "CLST", "CST": "CST", "NZST": "NZST", "IST": "IST", "EDT": "EDT", "AKDT": "AKDT", "BOT": "BOT", "PST": "PST", "SGT": "SGT", "AEST": "AEST", "MYT": "MYT", "ACWST": "ACWST", "ART": "ART", "BT": "BT", "ECT": "ECT", "WESZ": "WESZ", "ACST": "ACST", "AKST": "AKST", "AWST": "AWST", "ACDT": "ACDT", "MDT": "MDT", "VET": "VET", "WITA": "WITA", "TMT": "TMT", "EAT": "EAT", "CLT": "CLT", "OEZ": "OEZ", "WIT": "WIT", "AWDT": "AWDT", "EST": "EST", "MESZ": "MESZ", "COST": "COST", "∅∅∅": "∅∅∅", "ACWDT": "ACWDT", "GMT": "GMT", "GFT": "GFT", "CHADT": "CHADT", "JDT": "JDT", "AST": "AST", "ARST": "ARST", "WIB": "WIB", "TMST": "TMST", "OESZ": "OESZ", "CDT": "CDT", "HKT": "HKT", "NZDT": "NZDT", "PDT": "PDT", "UYT": "UYT", "LHDT": "LHDT", "WART": "WART", "SAST": "SAST", "WAT": "WAT", "HNT": "HNT", "AEDT": "AEDT", "UYST": "UYST", "LHST": "LHST"},
}
}
diff --git a/guz/guz_test.go b/guz/guz_test.go
new file mode 100644
index 00000000..186751ef
--- /dev/null
+++ b/guz/guz_test.go
@@ -0,0 +1,1120 @@
+package guz
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "guz"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/guz_KE/guz_KE.go b/guz_KE/guz_KE.go
index 58f31377..23720c40 100644
--- a/guz_KE/guz_KE.go
+++ b/guz_KE/guz_KE.go
@@ -63,7 +63,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"YA", "YK"},
erasNarrow: []string{"", ""},
erasWide: []string{"Yeso ataiborwa", "Yeso kaiboirwe"},
- timezones: map[string]string{"PDT": "PDT", "UYT": "UYT", "COT": "COT", "ECT": "ECT", "WARST": "WARST", "HAT": "HAT", "EAT": "EAT", "ACST": "ACST", "ACDT": "ACDT", "AKDT": "AKDT", "VET": "VET", "GFT": "GFT", "OEZ": "OEZ", "HAST": "HAST", "LHDT": "LHDT", "BOT": "BOT", "CDT": "CDT", "MESZ": "MESZ", "EST": "EST", "WART": "WART", "TMT": "TMT", "MDT": "MDT", "SAST": "SAST", "WITA": "WITA", "CLST": "CLST", "HKST": "HKST", "IST": "IST", "AEST": "AEST", "GYT": "GYT", "PST": "PST", "ACWDT": "ACWDT", "COST": "COST", "BT": "BT", "CLT": "CLT", "WEZ": "WEZ", "WAST": "WAST", "JST": "JST", "CHAST": "CHAST", "LHST": "LHST", "CAT": "CAT", "CST": "CST", "WESZ": "WESZ", "AST": "AST", "HKT": "HKT", "ARST": "ARST", "AWDT": "AWDT", "∅∅∅": "∅∅∅", "AWST": "AWST", "SRT": "SRT", "NZDT": "NZDT", "ACWST": "ACWST", "WAT": "WAT", "OESZ": "OESZ", "ART": "ART", "CHADT": "CHADT", "MST": "MST", "AKST": "AKST", "MYT": "MYT", "NZST": "NZST", "AEDT": "AEDT", "HADT": "HADT", "GMT": "GMT", "WIB": "WIB", "EDT": "EDT", "SGT": "SGT", "TMST": "TMST", "UYST": "UYST", "JDT": "JDT", "MEZ": "MEZ", "ChST": "ChST", "ADT": "ADT", "HNT": "HNT", "WIT": "WIT"},
+ timezones: map[string]string{"HNT": "HNT", "BT": "BT", "CDT": "CDT", "ACST": "ACST", "NZDT": "NZDT", "WARST": "WARST", "CHADT": "CHADT", "PDT": "PDT", "HKST": "HKST", "ACWST": "ACWST", "OESZ": "OESZ", "ART": "ART", "JST": "JST", "HADT": "HADT", "TMT": "TMT", "UYT": "UYT", "SRT": "SRT", "CST": "CST", "ACDT": "ACDT", "CAT": "CAT", "AWDT": "AWDT", "MDT": "MDT", "WART": "WART", "CHAST": "CHAST", "AWST": "AWST", "UYST": "UYST", "JDT": "JDT", "MEZ": "MEZ", "COST": "COST", "LHST": "LHST", "WIT": "WIT", "GFT": "GFT", "IST": "IST", "TMST": "TMST", "LHDT": "LHDT", "AKDT": "AKDT", "EDT": "EDT", "MESZ": "MESZ", "HAST": "HAST", "AEST": "AEST", "CLST": "CLST", "HKT": "HKT", "AKST": "AKST", "AST": "AST", "GYT": "GYT", "CLT": "CLT", "WEZ": "WEZ", "COT": "COT", "AEDT": "AEDT", "OEZ": "OEZ", "ECT": "ECT", "VET": "VET", "HAT": "HAT", "ChST": "ChST", "SAST": "SAST", "MYT": "MYT", "EAT": "EAT", "WITA": "WITA", "PST": "PST", "WIB": "WIB", "WAT": "WAT", "∅∅∅": "∅∅∅", "ACWDT": "ACWDT", "ARST": "ARST", "NZST": "NZST", "ADT": "ADT", "EST": "EST", "WAST": "WAST", "GMT": "GMT", "MST": "MST", "BOT": "BOT", "WESZ": "WESZ", "SGT": "SGT"},
}
}
diff --git a/guz_KE/guz_KE_test.go b/guz_KE/guz_KE_test.go
new file mode 100644
index 00000000..d9c78aec
--- /dev/null
+++ b/guz_KE/guz_KE_test.go
@@ -0,0 +1,1120 @@
+package guz_KE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "guz_KE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/gv/gv.go b/gv/gv.go
index d834198d..a6d0d10a 100644
--- a/gv/gv.go
+++ b/gv/gv.go
@@ -57,7 +57,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"RC", "AD"},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"CLST": "CLST", "AST": "AST", "WAT": "WAT", "GFT": "GFT", "AKDT": "AKDT", "WITA": "WITA", "SRT": "SRT", "CLT": "CLT", "HADT": "HADT", "HKST": "HKST", "ACST": "ACST", "AWDT": "AWDT", "GYT": "GYT", "NZST": "NZST", "UYST": "UYST", "ECT": "ECT", "PST": "PST", "BOT": "BOT", "MDT": "MDT", "WARST": "WARST", "ACDT": "ACDT", "TMT": "TMT", "MESZ": "MESZ", "WEZ": "WEZ", "WESZ": "WESZ", "WIT": "WIT", "LHDT": "LHDT", "SGT": "SGT", "MYT": "MYT", "NZDT": "NZDT", "AEST": "AEST", "COT": "COT", "∅∅∅": "∅∅∅", "ADT": "ADT", "CST": "CST", "HKT": "HKT", "EAT": "EAT", "ART": "ART", "EST": "EST", "IST": "IST", "ARST": "ARST", "EDT": "EDT", "OESZ": "OESZ", "TMST": "TMST", "UYT": "UYT", "CHADT": "CHADT", "HAST": "HAST", "SAST": "SAST", "WAST": "WAST", "WIB": "WIB", "CDT": "CDT", "ChST": "ChST", "MST": "MST", "CHAST": "CHAST", "JDT": "JDT", "PDT": "PDT", "AWST": "AWST", "ACWDT": "ACWDT", "BT": "BT", "OEZ": "OEZ", "GMT": "GMT", "HNT": "HNT", "HAT": "HAT", "MEZ": "MEZ", "AEDT": "AEDT", "CAT": "CAT", "WART": "WART", "LHST": "LHST", "JST": "JST", "ACWST": "ACWST", "VET": "VET", "COST": "COST", "AKST": "AKST"},
+ timezones: map[string]string{"HADT": "HADT", "CLST": "CLST", "WIT": "WIT", "PST": "PST", "HAST": "HAST", "EDT": "EDT", "PDT": "PDT", "TMT": "TMT", "HKT": "HKT", "ACWST": "ACWST", "ADT": "ADT", "MESZ": "MESZ", "GFT": "GFT", "VET": "VET", "MDT": "MDT", "OEZ": "OEZ", "BT": "BT", "ACWDT": "ACWDT", "AST": "AST", "GMT": "GMT", "WESZ": "WESZ", "OESZ": "OESZ", "AEST": "AEST", "WART": "WART", "HKST": "HKST", "WAST": "WAST", "UYST": "UYST", "MEZ": "MEZ", "MYT": "MYT", "LHST": "LHST", "CLT": "CLT", "EAT": "EAT", "AWST": "AWST", "∅∅∅": "∅∅∅", "EST": "EST", "NZDT": "NZDT", "SGT": "SGT", "TMST": "TMST", "CAT": "CAT", "ACDT": "ACDT", "CHADT": "CHADT", "AKST": "AKST", "COT": "COT", "ECT": "ECT", "ART": "ART", "WAT": "WAT", "WARST": "WARST", "SAST": "SAST", "HNT": "HNT", "AWDT": "AWDT", "ARST": "ARST", "NZST": "NZST", "BOT": "BOT", "IST": "IST", "GYT": "GYT", "CHAST": "CHAST", "MST": "MST", "LHDT": "LHDT", "AEDT": "AEDT", "ChST": "ChST", "WITA": "WITA", "HAT": "HAT", "COST": "COST", "SRT": "SRT", "JDT": "JDT", "WEZ": "WEZ", "CST": "CST", "ACST": "ACST", "AKDT": "AKDT", "UYT": "UYT", "CDT": "CDT", "JST": "JST", "WIB": "WIB"},
}
}
@@ -129,7 +129,7 @@ func (gv *gv) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (gv *gv) MonthsNarrow() []string {
- return gv.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/gv/gv_test.go b/gv/gv_test.go
new file mode 100644
index 00000000..02f110bd
--- /dev/null
+++ b/gv/gv_test.go
@@ -0,0 +1,1120 @@
+package gv
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "gv"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/gv_IM/gv_IM.go b/gv_IM/gv_IM.go
index c5692d15..46ddf845 100644
--- a/gv_IM/gv_IM.go
+++ b/gv_IM/gv_IM.go
@@ -57,7 +57,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"RC", "AD"},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"OESZ": "OESZ", "CST": "CST", "CAT": "CAT", "HKT": "HKT", "ACDT": "ACDT", "TMST": "TMST", "PDT": "PDT", "BOT": "BOT", "AEDT": "AEDT", "WEZ": "WEZ", "∅∅∅": "∅∅∅", "WARST": "WARST", "WITA": "WITA", "MESZ": "MESZ", "UYT": "UYT", "ACWST": "ACWST", "SAST": "SAST", "GMT": "GMT", "LHDT": "LHDT", "GYT": "GYT", "SRT": "SRT", "LHST": "LHST", "JST": "JST", "CDT": "CDT", "ACWDT": "ACWDT", "EST": "EST", "JDT": "JDT", "CLT": "CLT", "COT": "COT", "TMT": "TMT", "AWST": "AWST", "AWDT": "AWDT", "NZDT": "NZDT", "AEST": "AEST", "HNT": "HNT", "AKDT": "AKDT", "HKST": "HKST", "WART": "WART", "ART": "ART", "CHADT": "CHADT", "HADT": "HADT", "MDT": "MDT", "CLST": "CLST", "AST": "AST", "IST": "IST", "EAT": "EAT", "AKST": "AKST", "NZST": "NZST", "VET": "VET", "WESZ": "WESZ", "SGT": "SGT", "ADT": "ADT", "OEZ": "OEZ", "HAT": "HAT", "GFT": "GFT", "MYT": "MYT", "ChST": "ChST", "EDT": "EDT", "COST": "COST", "ECT": "ECT", "HAST": "HAST", "WAT": "WAT", "WIT": "WIT", "ACST": "ACST", "MEZ": "MEZ", "UYST": "UYST", "MST": "MST", "CHAST": "CHAST", "WAST": "WAST", "BT": "BT", "WIB": "WIB", "ARST": "ARST", "PST": "PST"},
+ timezones: map[string]string{"HADT": "HADT", "EST": "EST", "∅∅∅": "∅∅∅", "VET": "VET", "HAST": "HAST", "BT": "BT", "ACDT": "ACDT", "AKDT": "AKDT", "NZST": "NZST", "SAST": "SAST", "ChST": "ChST", "GMT": "GMT", "MST": "MST", "ACWST": "ACWST", "PST": "PST", "MEZ": "MEZ", "BOT": "BOT", "AEST": "AEST", "LHST": "LHST", "CDT": "CDT", "ARST": "ARST", "HAT": "HAT", "CAT": "CAT", "WIT": "WIT", "ACST": "ACST", "HKT": "HKT", "MYT": "MYT", "UYST": "UYST", "ECT": "ECT", "SGT": "SGT", "WARST": "WARST", "WITA": "WITA", "JDT": "JDT", "AEDT": "AEDT", "MDT": "MDT", "SRT": "SRT", "HKST": "HKST", "WAST": "WAST", "AWDT": "AWDT", "EDT": "EDT", "TMST": "TMST", "LHDT": "LHDT", "ACWDT": "ACWDT", "WESZ": "WESZ", "AKST": "AKST", "IST": "IST", "OEZ": "OEZ", "CHADT": "CHADT", "JST": "JST", "UYT": "UYT", "EAT": "EAT", "WART": "WART", "GFT": "GFT", "AST": "AST", "GYT": "GYT", "OESZ": "OESZ", "CLST": "CLST", "COT": "COT", "COST": "COST", "WAT": "WAT", "CST": "CST", "ART": "ART", "NZDT": "NZDT", "ADT": "ADT", "WEZ": "WEZ", "WIB": "WIB", "TMT": "TMT", "CHAST": "CHAST", "AWST": "AWST", "MESZ": "MESZ", "CLT": "CLT", "PDT": "PDT", "HNT": "HNT"},
}
}
@@ -129,7 +129,7 @@ func (gv *gv_IM) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (gv *gv_IM) MonthsNarrow() []string {
- return gv.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/gv_IM/gv_IM_test.go b/gv_IM/gv_IM_test.go
new file mode 100644
index 00000000..6653d6b3
--- /dev/null
+++ b/gv_IM/gv_IM_test.go
@@ -0,0 +1,1120 @@
+package gv_IM
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "gv_IM"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ha/ha.go b/ha/ha.go
index 4894e433..a1b57f07 100644
--- a/ha/ha.go
+++ b/ha/ha.go
@@ -63,7 +63,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"KHAI", "BHAI"},
erasNarrow: []string{"", ""},
erasWide: []string{"Kafin haihuwar annab", "Bayan haihuwar annab"},
- timezones: map[string]string{"LHST": "LHST", "AEST": "AEST", "ChST": "ChST", "WESZ": "WESZ", "ACWST": "ACWST", "WARST": "WARST", "AWDT": "AWDT", "WIB": "WIB", "ACST": "ACST", "MYT": "MYT", "UYT": "UYT", "CDT": "CDT", "CHADT": "CHADT", "HADT": "HADT", "HKT": "HKT", "WEZ": "WEZ", "AKDT": "AKDT", "CLST": "CLST", "CAT": "CAT", "TMT": "TMT", "AWST": "AWST", "ACDT": "ACDT", "TMST": "TMST", "NZST": "NZST", "SGT": "SGT", "WIT": "WIT", "WITA": "WITA", "VET": "VET", "SAST": "SAST", "GMT": "GMT", "MESZ": "MESZ", "CHAST": "CHAST", "ACWDT": "ACWDT", "EDT": "EDT", "SRT": "SRT", "UYST": "UYST", "MEZ": "MEZ", "COT": "COT", "ART": "ART", "BOT": "BOT", "HAT": "HAT", "OESZ": "OESZ", "WAT": "WAT", "WAST": "WAST", "GYT": "GYT", "JST": "JST", "HAST": "HAST", "BT": "BT", "WART": "WART", "JDT": "JDT", "AEDT": "AEDT", "COST": "COST", "IST": "IST", "PST": "PST", "OEZ": "OEZ", "NZDT": "NZDT", "HNT": "HNT", "EAT": "EAT", "ADT": "ADT", "HKST": "HKST", "EST": "EST", "AKST": "AKST", "CLT": "CLT", "MDT": "MDT", "LHDT": "LHDT", "GFT": "GFT", "ARST": "ARST", "MST": "MST", "PDT": "PDT", "CST": "CST", "ECT": "ECT", "∅∅∅": "∅∅∅", "AST": "AST"},
+ timezones: map[string]string{"CLT": "CLT", "BOT": "BOT", "WEZ": "WEZ", "GMT": "GMT", "HKT": "HKT", "MEZ": "MEZ", "SRT": "SRT", "GFT": "GFT", "AWDT": "AWDT", "IST": "IST", "VET": "VET", "HADT": "HADT", "∅∅∅": "∅∅∅", "WAT": "WAT", "MYT": "MYT", "CHADT": "CHADT", "EDT": "EDT", "NZDT": "NZDT", "COT": "COT", "AEDT": "AEDT", "ACDT": "ACDT", "HNT": "HNT", "EAT": "EAT", "CDT": "CDT", "WITA": "WITA", "JDT": "JDT", "WESZ": "WESZ", "TMT": "TMT", "MDT": "MDT", "CST": "CST", "HKST": "HKST", "ARST": "ARST", "AKST": "AKST", "GYT": "GYT", "OEZ": "OEZ", "AEST": "AEST", "UYT": "UYT", "ACWST": "ACWST", "EST": "EST", "COST": "COST", "CAT": "CAT", "WARST": "WARST", "CHAST": "CHAST", "ACWDT": "ACWDT", "AST": "AST", "PDT": "PDT", "HAT": "HAT", "MST": "MST", "WIT": "WIT", "AWST": "AWST", "ART": "ART", "MESZ": "MESZ", "SGT": "SGT", "LHST": "LHST", "WART": "WART", "ECT": "ECT", "TMST": "TMST", "BT": "BT", "NZST": "NZST", "WAST": "WAST", "JST": "JST", "OESZ": "OESZ", "CLST": "CLST", "AKDT": "AKDT", "ADT": "ADT", "HAST": "HAST", "SAST": "SAST", "WIB": "WIB", "ChST": "ChST", "ACST": "ACST", "PST": "PST", "LHDT": "LHDT", "UYST": "UYST"},
}
}
diff --git a/ha/ha_test.go b/ha/ha_test.go
new file mode 100644
index 00000000..0e956a9c
--- /dev/null
+++ b/ha/ha_test.go
@@ -0,0 +1,1120 @@
+package ha
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ha"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ha_GH/ha_GH.go b/ha_GH/ha_GH.go
index f9d0eef1..ec2144c1 100644
--- a/ha_GH/ha_GH.go
+++ b/ha_GH/ha_GH.go
@@ -63,7 +63,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"KHAI", "BHAI"},
erasNarrow: []string{"", ""},
erasWide: []string{"Kafin haihuwar annab", "Bayan haihuwar annab"},
- timezones: map[string]string{"EST": "EST", "ADT": "ADT", "WARST": "WARST", "WITA": "WITA", "ART": "ART", "AWST": "AWST", "ChST": "ChST", "SGT": "SGT", "IST": "IST", "ACST": "ACST", "SAST": "SAST", "UYST": "UYST", "AKDT": "AKDT", "VET": "VET", "MDT": "MDT", "WAST": "WAST", "ARST": "ARST", "∅∅∅": "∅∅∅", "MESZ": "MESZ", "CHAST": "CHAST", "ACWDT": "ACWDT", "AEST": "AEST", "AWDT": "AWDT", "NZDT": "NZDT", "WIT": "WIT", "TMT": "TMT", "BOT": "BOT", "CLST": "CLST", "HKST": "HKST", "PST": "PST", "LHST": "LHST", "GYT": "GYT", "WESZ": "WESZ", "LHDT": "LHDT", "WEZ": "WEZ", "MST": "MST", "EDT": "EDT", "HNT": "HNT", "CST": "CST", "HAST": "HAST", "WART": "WART", "WIB": "WIB", "OEZ": "OEZ", "CLT": "CLT", "AEDT": "AEDT", "OESZ": "OESZ", "HAT": "HAT", "GFT": "GFT", "TMST": "TMST", "EAT": "EAT", "JST": "JST", "SRT": "SRT", "AKST": "AKST", "UYT": "UYT", "GMT": "GMT", "MYT": "MYT", "COST": "COST", "ECT": "ECT", "HKT": "HKT", "MEZ": "MEZ", "CHADT": "CHADT", "ACDT": "ACDT", "CAT": "CAT", "COT": "COT", "AST": "AST", "JDT": "JDT", "PDT": "PDT", "CDT": "CDT", "NZST": "NZST", "ACWST": "ACWST", "HADT": "HADT", "WAT": "WAT", "BT": "BT"},
+ timezones: map[string]string{"AKDT": "AKDT", "GYT": "GYT", "CLT": "CLT", "CST": "CST", "WART": "WART", "AKST": "AKST", "HKST": "HKST", "ACWST": "ACWST", "AWDT": "AWDT", "WAST": "WAST", "EDT": "EDT", "LHDT": "LHDT", "JST": "JST", "ARST": "ARST", "IST": "IST", "WESZ": "WESZ", "CLST": "CLST", "AEDT": "AEDT", "LHST": "LHST", "ACST": "ACST", "ECT": "ECT", "HAST": "HAST", "NZDT": "NZDT", "WIB": "WIB", "TMT": "TMT", "GFT": "GFT", "HKT": "HKT", "VET": "VET", "AST": "AST", "SGT": "SGT", "BOT": "BOT", "PDT": "PDT", "COT": "COT", "SRT": "SRT", "WAT": "WAT", "HNT": "HNT", "ACDT": "ACDT", "∅∅∅": "∅∅∅", "ADT": "ADT", "NZST": "NZST", "AEST": "AEST", "CDT": "CDT", "ART": "ART", "TMST": "TMST", "CAT": "CAT", "WEZ": "WEZ", "OEZ": "OEZ", "AWST": "AWST", "MESZ": "MESZ", "HAT": "HAT", "GMT": "GMT", "ACWDT": "ACWDT", "EST": "EST", "MEZ": "MEZ", "COST": "COST", "BT": "BT", "WARST": "WARST", "MST": "MST", "JDT": "JDT", "PST": "PST", "OESZ": "OESZ", "UYT": "UYT", "CHAST": "CHAST", "CHADT": "CHADT", "HADT": "HADT", "MYT": "MYT", "WIT": "WIT", "EAT": "EAT", "MDT": "MDT", "WITA": "WITA", "SAST": "SAST", "ChST": "ChST", "UYST": "UYST"},
}
}
diff --git a/ha_GH/ha_GH_test.go b/ha_GH/ha_GH_test.go
new file mode 100644
index 00000000..8b02c4df
--- /dev/null
+++ b/ha_GH/ha_GH_test.go
@@ -0,0 +1,1120 @@
+package ha_GH
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ha_GH"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ha_NE/ha_NE.go b/ha_NE/ha_NE.go
index 9f32cb6e..4e7820d3 100644
--- a/ha_NE/ha_NE.go
+++ b/ha_NE/ha_NE.go
@@ -63,7 +63,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"KHAI", "BHAI"},
erasNarrow: []string{"", ""},
erasWide: []string{"Kafin haihuwar annab", "Bayan haihuwar annab"},
- timezones: map[string]string{"WAT": "WAT", "ACDT": "ACDT", "AWDT": "AWDT", "SRT": "SRT", "UYST": "UYST", "AEDT": "AEDT", "MDT": "MDT", "GYT": "GYT", "AKDT": "AKDT", "CST": "CST", "CHAST": "CHAST", "EST": "EST", "OEZ": "OEZ", "HAT": "HAT", "TMT": "TMT", "HADT": "HADT", "HKST": "HKST", "JDT": "JDT", "ACWST": "ACWST", "ACWDT": "ACWDT", "SAST": "SAST", "OESZ": "OESZ", "ART": "ART", "COST": "COST", "MST": "MST", "ACST": "ACST", "LHDT": "LHDT", "VET": "VET", "ADT": "ADT", "WIT": "WIT", "ChST": "ChST", "WEZ": "WEZ", "HAST": "HAST", "WARST": "WARST", "TMST": "TMST", "MEZ": "MEZ", "BOT": "BOT", "UYT": "UYT", "CDT": "CDT", "EDT": "EDT", "GMT": "GMT", "ARST": "ARST", "MYT": "MYT", "JST": "JST", "NZDT": "NZDT", "CLT": "CLT", "∅∅∅": "∅∅∅", "AWST": "AWST", "AKST": "AKST", "AEST": "AEST", "ECT": "ECT", "AST": "AST", "WAST": "WAST", "HKT": "HKT", "HNT": "HNT", "NZST": "NZST", "CLST": "CLST", "BT": "BT", "WART": "WART", "PST": "PST", "CHADT": "CHADT", "SGT": "SGT", "WIB": "WIB", "IST": "IST", "MESZ": "MESZ", "WESZ": "WESZ", "GFT": "GFT", "PDT": "PDT", "COT": "COT", "CAT": "CAT", "WITA": "WITA", "EAT": "EAT", "LHST": "LHST"},
+ timezones: map[string]string{"ADT": "ADT", "AWDT": "AWDT", "NZST": "NZST", "OEZ": "OEZ", "CLT": "CLT", "ECT": "ECT", "HAT": "HAT", "GMT": "GMT", "EAT": "EAT", "HKT": "HKT", "GYT": "GYT", "WIT": "WIT", "WARST": "WARST", "ACWDT": "ACWDT", "UYST": "UYST", "BT": "BT", "ACDT": "ACDT", "CHAST": "CHAST", "HAST": "HAST", "PST": "PST", "TMT": "TMT", "CLST": "CLST", "AWST": "AWST", "ACWST": "ACWST", "TMST": "TMST", "JST": "JST", "AKDT": "AKDT", "AST": "AST", "SRT": "SRT", "SGT": "SGT", "HNT": "HNT", "OESZ": "OESZ", "MYT": "MYT", "VET": "VET", "AKST": "AKST", "MESZ": "MESZ", "HADT": "HADT", "AEDT": "AEDT", "CST": "CST", "LHDT": "LHDT", "WART": "WART", "ART": "ART", "MEZ": "MEZ", "PDT": "PDT", "COT": "COT", "WAST": "WAST", "BOT": "BOT", "ChST": "ChST", "WITA": "WITA", "JDT": "JDT", "CAT": "CAT", "WESZ": "WESZ", "AEST": "AEST", "UYT": "UYT", "EDT": "EDT", "HKST": "HKST", "ARST": "ARST", "SAST": "SAST", "∅∅∅": "∅∅∅", "WIB": "WIB", "MST": "MST", "ACST": "ACST", "IST": "IST", "COST": "COST", "LHST": "LHST", "CDT": "CDT", "NZDT": "NZDT", "EST": "EST", "GFT": "GFT", "WEZ": "WEZ", "WAT": "WAT", "MDT": "MDT", "CHADT": "CHADT"},
}
}
diff --git a/ha_NE/ha_NE_test.go b/ha_NE/ha_NE_test.go
new file mode 100644
index 00000000..c7d01a9b
--- /dev/null
+++ b/ha_NE/ha_NE_test.go
@@ -0,0 +1,1120 @@
+package ha_NE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ha_NE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ha_NG/ha_NG.go b/ha_NG/ha_NG.go
index c1fba39f..09e7995a 100644
--- a/ha_NG/ha_NG.go
+++ b/ha_NG/ha_NG.go
@@ -63,7 +63,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"KHAI", "BHAI"},
erasNarrow: []string{"", ""},
erasWide: []string{"Kafin haihuwar annab", "Bayan haihuwar annab"},
- timezones: map[string]string{"ADT": "ADT", "HKT": "HKT", "AWST": "AWST", "ChST": "ChST", "HADT": "HADT", "BT": "BT", "TMT": "TMT", "TMST": "TMST", "AWDT": "AWDT", "CHAST": "CHAST", "COT": "COT", "IST": "IST", "GMT": "GMT", "MYT": "MYT", "UYT": "UYT", "JDT": "JDT", "NZST": "NZST", "ACWST": "ACWST", "HAST": "HAST", "WITA": "WITA", "ART": "ART", "AST": "AST", "SGT": "SGT", "WARST": "WARST", "OESZ": "OESZ", "MST": "MST", "LHDT": "LHDT", "AEDT": "AEDT", "WIT": "WIT", "MDT": "MDT", "SRT": "SRT", "NZDT": "NZDT", "EDT": "EDT", "ECT": "ECT", "HAT": "HAT", "EAT": "EAT", "CDT": "CDT", "EST": "EST", "SAST": "SAST", "WAST": "WAST", "AKDT": "AKDT", "GYT": "GYT", "CST": "CST", "HKST": "HKST", "OEZ": "OEZ", "JST": "JST", "MEZ": "MEZ", "BOT": "BOT", "CLST": "CLST", "VET": "VET", "ARST": "ARST", "LHST": "LHST", "CLT": "CLT", "AEST": "AEST", "HNT": "HNT", "ACDT": "ACDT", "WEZ": "WEZ", "ACWDT": "ACWDT", "∅∅∅": "∅∅∅", "WIB": "WIB", "PST": "PST", "UYST": "UYST", "CHADT": "CHADT", "CAT": "CAT", "COST": "COST", "WAT": "WAT", "WART": "WART", "GFT": "GFT", "ACST": "ACST", "MESZ": "MESZ", "AKST": "AKST", "PDT": "PDT", "WESZ": "WESZ"},
+ timezones: map[string]string{"HKT": "HKT", "WITA": "WITA", "NZST": "NZST", "COST": "COST", "ACDT": "ACDT", "SRT": "SRT", "GFT": "GFT", "PST": "PST", "PDT": "PDT", "HAST": "HAST", "WIB": "WIB", "OESZ": "OESZ", "SAST": "SAST", "TMT": "TMT", "HNT": "HNT", "SGT": "SGT", "ACST": "ACST", "ARST": "ARST", "BOT": "BOT", "HADT": "HADT", "COT": "COT", "UYST": "UYST", "EAT": "EAT", "JST": "JST", "AST": "AST", "AWDT": "AWDT", "OEZ": "OEZ", "GMT": "GMT", "AEST": "AEST", "LHST": "LHST", "ACWST": "ACWST", "ART": "ART", "EDT": "EDT", "MEZ": "MEZ", "GYT": "GYT", "ECT": "ECT", "MYT": "MYT", "CLST": "CLST", "CST": "CST", "JDT": "JDT", "AKDT": "AKDT", "∅∅∅": "∅∅∅", "WART": "WART", "EST": "EST", "TMST": "TMST", "WAST": "WAST", "WESZ": "WESZ", "AKST": "AKST", "CAT": "CAT", "LHDT": "LHDT", "HKST": "HKST", "CHADT": "CHADT", "AWST": "AWST", "WEZ": "WEZ", "UYT": "UYT", "BT": "BT", "CHAST": "CHAST", "WARST": "WARST", "NZDT": "NZDT", "IST": "IST", "AEDT": "AEDT", "ChST": "ChST", "MST": "MST", "CDT": "CDT", "ADT": "ADT", "HAT": "HAT", "MDT": "MDT", "ACWDT": "ACWDT", "MESZ": "MESZ", "WAT": "WAT", "WIT": "WIT", "CLT": "CLT", "VET": "VET"},
}
}
diff --git a/ha_NG/ha_NG_test.go b/ha_NG/ha_NG_test.go
new file mode 100644
index 00000000..bbed7794
--- /dev/null
+++ b/ha_NG/ha_NG_test.go
@@ -0,0 +1,1120 @@
+package ha_NG
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ha_NG"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/haw/haw.go b/haw/haw.go
index e7623288..2848b2ad 100644
--- a/haw/haw.go
+++ b/haw/haw.go
@@ -56,7 +56,7 @@ func New() locales.Translator {
monthsWide: []string{"", "Ianuali", "Pepeluali", "Malaki", "ʻApelila", "Mei", "Iune", "Iulai", "ʻAukake", "Kepakemapa", "ʻOkakopa", "Nowemapa", "Kekemapa"},
daysAbbreviated: []string{"LP", "P1", "P2", "P3", "P4", "P5", "P6"},
daysWide: []string{"Lāpule", "Poʻakahi", "Poʻalua", "Poʻakolu", "Poʻahā", "Poʻalima", "Poʻaono"},
- timezones: map[string]string{"SRT": "SRT", "UYT": "UYT", "COT": "COT", "HADT": "HADT", "PDT": "PDT", "ARST": "ARST", "AWDT": "AWDT", "JDT": "JDT", "ACWDT": "ACWDT", "HAST": "HAST", "HAT": "HAT", "ART": "ART", "ACWST": "ACWST", "HKT": "HKT", "GFT": "GFT", "WIT": "WIT", "WIB": "WIB", "LHDT": "LHDT", "WAST": "WAST", "WITA": "WITA", "AWST": "AWST", "HKST": "HKST", "MEZ": "MEZ", "AKDT": "AKDT", "NZST": "NZST", "VET": "VET", "HNT": "HNT", "AKST": "AKST", "WART": "WART", "ADT": "ADT", "TMT": "TMT", "BOT": "BOT", "CHADT": "CHADT", "MST": "MST", "TMST": "TMST", "WESZ": "WESZ", "COST": "COST", "AST": "AST", "BT": "BT", "OESZ": "OESZ", "IST": "IST", "∅∅∅": "∅∅∅", "LHST": "LHST", "MESZ": "MESZ", "CDT": "CDT", "ChST": "ChST", "WEZ": "WEZ", "WARST": "WARST", "MDT": "MDT", "JST": "JST", "CST": "CST", "AEST": "AEST", "CLST": "CLST", "GMT": "GMT", "PST": "PST", "ECT": "ECT", "EAT": "EAT", "EDT": "EDT", "SGT": "SGT", "OEZ": "OEZ", "ACDT": "ACDT", "MYT": "MYT", "UYST": "UYST", "AEDT": "AEDT", "GYT": "GYT", "CHAST": "CHAST", "CLT": "CLT", "EST": "EST", "CAT": "CAT", "WAT": "WAT", "ACST": "ACST", "SAST": "SAST", "NZDT": "NZDT"},
+ timezones: map[string]string{"BT": "BT", "LHDT": "LHDT", "CDT": "CDT", "ADT": "ADT", "MEZ": "MEZ", "WAT": "WAT", "LHST": "LHST", "WART": "WART", "GFT": "GFT", "WITA": "WITA", "HADT": "HADT", "IST": "IST", "EDT": "EDT", "TMT": "TMT", "ACST": "ACST", "WARST": "WARST", "VET": "VET", "MST": "MST", "WESZ": "WESZ", "SGT": "SGT", "EST": "EST", "COT": "COT", "COST": "COST", "MYT": "MYT", "ACDT": "ACDT", "HAST": "HAST", "GYT": "GYT", "∅∅∅": "∅∅∅", "CST": "CST", "AKDT": "AKDT", "GMT": "GMT", "CLST": "CLST", "AST": "AST", "TMST": "TMST", "AKST": "AKST", "ACWST": "ACWST", "AWST": "AWST", "ARST": "ARST", "BOT": "BOT", "UYT": "UYT", "SRT": "SRT", "HKT": "HKT", "AEST": "AEST", "ChST": "ChST", "WEZ": "WEZ", "OESZ": "OESZ", "WIB": "WIB", "CHAST": "CHAST", "JDT": "JDT", "AWDT": "AWDT", "ACWDT": "ACWDT", "NZST": "NZST", "CAT": "CAT", "MESZ": "MESZ", "HAT": "HAT", "CLT": "CLT", "ECT": "ECT", "PST": "PST", "OEZ": "OEZ", "EAT": "EAT", "MDT": "MDT", "PDT": "PDT", "CHADT": "CHADT", "WAST": "WAST", "AEDT": "AEDT", "SAST": "SAST", "UYST": "UYST", "HKST": "HKST", "NZDT": "NZDT", "HNT": "HNT", "WIT": "WIT", "JST": "JST", "ART": "ART"},
}
}
@@ -119,7 +119,7 @@ func (haw *haw) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (haw *haw) MonthsNarrow() []string {
- return haw.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/haw/haw_test.go b/haw/haw_test.go
new file mode 100644
index 00000000..61048ac5
--- /dev/null
+++ b/haw/haw_test.go
@@ -0,0 +1,1120 @@
+package haw
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "haw"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/haw_US/haw_US.go b/haw_US/haw_US.go
index c1f20833..66612126 100644
--- a/haw_US/haw_US.go
+++ b/haw_US/haw_US.go
@@ -56,7 +56,7 @@ func New() locales.Translator {
monthsWide: []string{"", "Ianuali", "Pepeluali", "Malaki", "ʻApelila", "Mei", "Iune", "Iulai", "ʻAukake", "Kepakemapa", "ʻOkakopa", "Nowemapa", "Kekemapa"},
daysAbbreviated: []string{"LP", "P1", "P2", "P3", "P4", "P5", "P6"},
daysWide: []string{"Lāpule", "Poʻakahi", "Poʻalua", "Poʻakolu", "Poʻahā", "Poʻalima", "Poʻaono"},
- timezones: map[string]string{"BOT": "BOT", "NZDT": "NZDT", "HKT": "HKT", "EAT": "EAT", "MST": "MST", "EDT": "EDT", "HKST": "HKST", "GFT": "GFT", "AEST": "AEST", "ACDT": "ACDT", "WEZ": "WEZ", "ACWST": "ACWST", "OEZ": "OEZ", "AEDT": "AEDT", "UYST": "UYST", "CLST": "CLST", "HAST": "HAST", "HADT": "HADT", "TMT": "TMT", "TMST": "TMST", "PST": "PST", "AWDT": "AWDT", "CHADT": "CHADT", "VET": "VET", "WESZ": "WESZ", "GMT": "GMT", "MDT": "MDT", "SRT": "SRT", "CDT": "CDT", "COST": "COST", "AST": "AST", "ADT": "ADT", "IST": "IST", "PDT": "PDT", "AWST": "AWST", "ARST": "ARST", "GYT": "GYT", "AKST": "AKST", "ACST": "ACST", "ChST": "ChST", "WARST": "WARST", "WAT": "WAT", "ART": "ART", "CAT": "CAT", "EST": "EST", "BT": "BT", "MYT": "MYT", "ACWDT": "ACWDT", "UYT": "UYT", "COT": "COT", "WIB": "WIB", "∅∅∅": "∅∅∅", "LHST": "LHST", "CHAST": "CHAST", "WAST": "WAST", "AKDT": "AKDT", "MEZ": "MEZ", "CLT": "CLT", "SAST": "SAST", "OESZ": "OESZ", "JDT": "JDT", "WIT": "WIT", "SGT": "SGT", "JST": "JST", "MESZ": "MESZ", "NZST": "NZST", "WART": "WART", "HNT": "HNT", "HAT": "HAT", "ECT": "ECT", "WITA": "WITA", "LHDT": "LHDT", "CST": "CST"},
+ timezones: map[string]string{"∅∅∅": "∅∅∅", "CHADT": "CHADT", "ACWST": "ACWST", "WITA": "WITA", "MST": "MST", "MDT": "MDT", "ADT": "ADT", "AWDT": "AWDT", "SAST": "SAST", "ARST": "ARST", "JST": "JST", "PST": "PST", "HADT": "HADT", "CLT": "CLT", "VET": "VET", "AWST": "AWST", "IST": "IST", "ECT": "ECT", "EDT": "EDT", "TMST": "TMST", "AEDT": "AEDT", "ACDT": "ACDT", "BOT": "BOT", "WESZ": "WESZ", "LHDT": "LHDT", "WEZ": "WEZ", "OEZ": "OEZ", "EAT": "EAT", "CST": "CST", "EST": "EST", "HAST": "HAST", "TMT": "TMT", "GMT": "GMT", "CHAST": "CHAST", "PDT": "PDT", "ChST": "ChST", "LHST": "LHST", "GFT": "GFT", "HKT": "HKT", "NZDT": "NZDT", "HAT": "HAT", "COT": "COT", "GYT": "GYT", "MYT": "MYT", "CLST": "CLST", "CDT": "CDT", "ACWDT": "ACWDT", "MEZ": "MEZ", "WAT": "WAT", "SGT": "SGT", "AEST": "AEST", "UYST": "UYST", "HKST": "HKST", "AKDT": "AKDT", "CAT": "CAT", "WAST": "WAST", "COST": "COST", "OESZ": "OESZ", "UYT": "UYT", "WART": "WART", "WARST": "WARST", "AKST": "AKST", "ART": "ART", "MESZ": "MESZ", "HNT": "HNT", "WIT": "WIT", "ACST": "ACST", "SRT": "SRT", "AST": "AST", "WIB": "WIB", "BT": "BT", "JDT": "JDT", "NZST": "NZST"},
}
}
@@ -119,7 +119,7 @@ func (haw *haw_US) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (haw *haw_US) MonthsNarrow() []string {
- return haw.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/haw_US/haw_US_test.go b/haw_US/haw_US_test.go
new file mode 100644
index 00000000..e6c5f2a8
--- /dev/null
+++ b/haw_US/haw_US_test.go
@@ -0,0 +1,1120 @@
+package haw_US
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "haw_US"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/he/he.go b/he/he.go
index 7088341d..33c063ae 100644
--- a/he/he.go
+++ b/he/he.go
@@ -70,7 +70,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"לפנה״ס", "לספירה"},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"COT": "שעון קולומביה (חורף)", "COST": "שעון קולומביה (קיץ)", "WARST": "שעון מערב ארגנטינה (קיץ)", "GYT": "שעון גויאנה", "UYST": "שעון אורוגוואי (קיץ)", "AEDT": "שעון מזרח אוסטרליה (קיץ)", "∅∅∅": "שעון ברזיליה (קיץ)", "EST": "שעון החוף המזרחי (חורף)", "ADT": "שעון האוקיינוס האטלנטי (קיץ)", "WITA": "שעון מרכז אינדונזיה", "NZST": "שעון ניו זילנד (חורף)", "NZDT": "שעון ניו זילנד (קיץ)", "AKST": "שעון אלסקה (חורף)", "ChST": "שעון צ׳אמורו", "CLT": "שעון צ׳ילה (חורף)", "WAT": "שעון מערב אפריקה (חורף)", "WAST": "שעון מערב אפריקה (קיץ)", "TMT": "שעון טורקמניסטן (חורף)", "SRT": "שעון סורינאם", "WESZ": "שעון מערב אירופה (קיץ)", "CAT": "שעון מרכז אפריקה", "LHDT": "שעון אי הלורד האו (קיץ)", "EDT": "שעון החוף המזרחי (קיץ)", "IST": "שעון הודו", "HKT": "שעון הונג קונג (חורף)", "OEZ": "שעון מזרח אירופה (חורף)", "PST": "שעון רגיל האוקיינוס השקט", "MESZ": "שעון מרכז אירופה (קיץ)", "SGT": "שעון סינגפור", "EAT": "שעון מזרח אפריקה", "JDT": "שעון יפן (קיץ)", "WEZ": "שעון מערב אירופה (חורף)", "HKST": "שעון הונג קונג (קיץ)", "CLST": "שעון צ׳ילה (קיץ)", "AST": "שעון האוקיינוס האטלנטי (חורף)", "HAST": "שעון רגיל האיים האלאוטיים הוואי", "ARST": "שעון ארגנטינה (קיץ)", "UYT": "שעון אורוגוואי (חורף)", "CHAST": "שעון צ׳טהאם (חורף)", "ACST": "שעון מרכז אוסטרליה (חורף)", "JST": "שעון יפן (חורף)", "ACWST": "שעון מרכז-מערב אוסטרליה (חורף)", "LHST": "שעון אי הלורד האו (חורף)", "HAT": "שעון ניופאונדלנד (קיץ)", "TMST": "שעון טורקמניסטן (קיץ)", "MYT": "שעון מלזיה", "MEZ": "שעון מרכז אירופה (חורף)", "CHADT": "שעון צ׳טהאם (קיץ)", "ART": "שעון ארגנטינה (חורף)", "VET": "שעון ונצואלה", "BT": "שעון בהוטן", "WART": "שעון מערב ארגנטינה (חורף)", "SAST": "שעון דרום אפריקה", "GMT": "שעון גריניץ׳\u200f", "WIB": "שעון מערב אינדונזיה", "CDT": "שעון מרכז ארה״ב (קיץ)", "AEST": "שעון מזרח אוסטרליה (חורף)", "WIT": "שעון מזרח אינדונזיה", "AWDT": "שעון מערב אוסטרליה (קיץ)", "AKDT": "שעון אלסקה (קיץ)", "ECT": "שעון אקוודור", "GFT": "שעון גיאנה הצרפתית", "MST": "שעון אזור ההרים בארה״ב (חורף)", "MDT": "שעון אזור ההרים בארה״ב (קיץ)", "HNT": "שעון ניופאונדלנד (חורף)", "OESZ": "שעון מזרח אירופה (קיץ)", "AWST": "שעון מערב אוסטרליה (חורף)", "PDT": "שעון קיץ, מערב ארה״ב (לוס אנג׳לס)", "BOT": "שעון בוליביה", "CST": "שעון מרכז ארה״ב (חורף)", "ACDT": "שעון מרכז אוסטרליה (קיץ)", "ACWDT": "שעון מרכז-מערב אוסטרליה (קיץ)", "HADT": "שעון קיץ האיים האלאוטיים הוואי"},
+ timezones: map[string]string{"WART": "שעון מערב ארגנטינה (חורף)", "SRT": "שעון סורינאם", "ACST": "שעון מרכז אוסטרליה (חורף)", "HKST": "שעון הונג קונג (קיץ)", "JDT": "שעון יפן (קיץ)", "EST": "שעון החוף המזרחי (חורף)", "MEZ": "שעון מרכז אירופה (חורף)", "WEZ": "שעון מערב אירופה (חורף)", "HAT": "שעון ניופאונדלנד (קיץ)", "LHST": "שעון אי הלורד האו (חורף)", "CHAST": "שעון צ׳טהאם (חורף)", "WITA": "שעון מרכז אינדונזיה", "COST": "שעון קולומביה (קיץ)", "TMST": "שעון טורקמניסטן (קיץ)", "AEDT": "שעון מזרח אוסטרליה (קיץ)", "ACDT": "שעון מרכז אוסטרליה (קיץ)", "ECT": "שעון אקוודור", "AWDT": "שעון מערב אוסטרליה (קיץ)", "CLT": "שעון צ׳ילה (חורף)", "IST": "שעון הודו", "GYT": "שעון גויאנה", "ChST": "שעון צ׳אמורו", "GMT": "שעון גריניץ׳\u200f", "MYT": "שעון מלזיה", "BT": "שעון בהוטן", "JST": "שעון יפן (חורף)", "NZST": "שעון ניו זילנד (חורף)", "WAST": "שעון מערב אפריקה (קיץ)", "WIT": "שעון מזרח אינדונזיה", "GFT": "שעון גיאנה הצרפתית", "EDT": "שעון החוף המזרחי (קיץ)", "∅∅∅": "∅∅∅", "AEST": "שעון מזרח אוסטרליה (חורף)", "AWST": "שעון מערב אוסטרליה (חורף)", "ART": "שעון ארגנטינה (חורף)", "TMT": "שעון טורקמניסטן (חורף)", "WARST": "שעון מערב ארגנטינה (קיץ)", "AKDT": "שעון אלסקה (קיץ)", "HNT": "שעון ניופאונדלנד (חורף)", "HADT": "שעון קיץ האיים האלאוטיים הוואי", "WESZ": "שעון מערב אירופה (קיץ)", "EAT": "שעון מזרח אפריקה", "VET": "שעון ונצואלה", "PDT": "שעון קיץ, מערב ארה״ב (לוס אנג׳לס)", "ACWST": "שעון מרכז-מערב אוסטרליה (חורף)", "HAST": "שעון רגיל האיים האלאוטיים הוואי", "NZDT": "שעון ניו זילנד (קיץ)", "OEZ": "שעון מזרח אירופה (חורף)", "CLST": "שעון צ׳ילה (קיץ)", "CHADT": "שעון צ׳טהאם (קיץ)", "HKT": "שעון הונג קונג (חורף)", "SGT": "שעון סינגפור", "UYST": "שעון אורוגוואי (קיץ)", "CST": "שעון מרכז ארה״ב (חורף)", "MST": "שעון חורף מקאו", "PST": "שעון רגיל האוקיינוס השקט", "CDT": "שעון מרכז ארה״ב (קיץ)", "OESZ": "שעון מזרח אירופה (קיץ)", "UYT": "שעון אורוגוואי (חורף)", "COT": "שעון קולומביה (חורף)", "AKST": "שעון אלסקה (חורף)", "MESZ": "שעון מרכז אירופה (קיץ)", "SAST": "שעון דרום אפריקה", "WAT": "שעון מערב אפריקה (חורף)", "ACWDT": "שעון מרכז-מערב אוסטרליה (קיץ)", "ARST": "שעון ארגנטינה (קיץ)", "WIB": "שעון מערב אינדונזיה", "CAT": "שעון מרכז אפריקה", "LHDT": "שעון אי הלורד האו (קיץ)", "AST": "שעון האוקיינוס האטלנטי (חורף)", "BOT": "שעון בוליביה", "MDT": "שעון קיץ מקאו", "ADT": "שעון האוקיינוס האטלנטי (קיץ)"},
}
}
diff --git a/he/he_test.go b/he/he_test.go
new file mode 100644
index 00000000..2aaf8284
--- /dev/null
+++ b/he/he_test.go
@@ -0,0 +1,1120 @@
+package he
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "he"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/he_IL/he_IL.go b/he_IL/he_IL.go
index 6402c6a7..40adb379 100644
--- a/he_IL/he_IL.go
+++ b/he_IL/he_IL.go
@@ -70,7 +70,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"לפנה״ס", "לספירה"},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"BT": "שעון בהוטן", "AKST": "שעון אלסקה (חורף)", "EST": "שעון החוף המזרחי (חורף)", "PDT": "שעון קיץ, מערב ארה״ב (לוס אנג׳לס)", "AWDT": "שעון מערב אוסטרליה (קיץ)", "CHAST": "שעון צ׳טהאם (חורף)", "ACWST": "שעון מרכז-מערב אוסטרליה (חורף)", "ACWDT": "שעון מרכז-מערב אוסטרליה (קיץ)", "ECT": "שעון אקוודור", "MST": "שעון חורף מקאו", "GYT": "שעון גויאנה", "OESZ": "שעון מזרח אירופה (קיץ)", "HADT": "שעון קיץ האיים האלאוטיים הוואי", "WARST": "שעון מערב ארגנטינה (קיץ)", "SRT": "שעון סורינאם", "HNT": "שעון ניופאונדלנד (חורף)", "HKT": "שעון הונג קונג (חורף)", "CST": "שעון מרכז ארה״ב (חורף)", "CAT": "שעון מרכז אפריקה", "EDT": "שעון החוף המזרחי (קיץ)", "ADT": "שעון האוקיינוס האטלנטי (קיץ)", "WAST": "שעון מערב אפריקה (קיץ)", "WITA": "שעון מרכז אינדונזיה", "UYST": "שעון אורוגוואי (קיץ)", "BOT": "שעון בוליביה", "CDT": "שעון מרכז ארה״ב (קיץ)", "NZST": "שעון ניו זילנד (חורף)", "IST": "שעון הודו", "OEZ": "שעון מזרח אירופה (חורף)", "TMT": "שעון טורקמניסטן (חורף)", "ARST": "שעון ארגנטינה (קיץ)", "COT": "שעון קולומביה (חורף)", "WART": "שעון מערב ארגנטינה (חורף)", "NZDT": "שעון ניו זילנד (קיץ)", "AEST": "שעון מזרח אוסטרליה (חורף)", "JDT": "שעון יפן (קיץ)", "UYT": "שעון אורוגוואי (חורף)", "MEZ": "שעון מרכז אירופה (חורף)", "WESZ": "שעון מערב אירופה (קיץ)", "GMT": "שעון גריניץ׳\u200f", "∅∅∅": "שעון אמזונס (קיץ)", "MYT": "שעון מלזיה", "LHDT": "שעון אי הלורד האו (קיץ)", "HAT": "שעון ניופאונדלנד (קיץ)", "WIB": "שעון מערב אינדונזיה", "EAT": "שעון מזרח אפריקה", "ChST": "שעון צ׳אמורו", "AWST": "שעון מערב אוסטרליה (חורף)", "CHADT": "שעון צ׳טהאם (קיץ)", "AST": "שעון האוקיינוס האטלנטי (חורף)", "SGT": "שעון סינגפור", "SAST": "שעון דרום אפריקה", "TMST": "שעון טורקמניסטן (קיץ)", "ACDT": "שעון מרכז אוסטרליה (קיץ)", "CLT": "שעון צ׳ילה (חורף)", "AKDT": "שעון אלסקה (קיץ)", "MESZ": "שעון מרכז אירופה (קיץ)", "AEDT": "שעון מזרח אוסטרליה (קיץ)", "HAST": "שעון רגיל האיים האלאוטיים הוואי", "WIT": "שעון מזרח אינדונזיה", "MDT": "שעון קיץ מקאו", "ACST": "שעון מרכז אוסטרליה (חורף)", "WAT": "שעון מערב אפריקה (חורף)", "JST": "שעון יפן (חורף)", "LHST": "שעון אי הלורד האו (חורף)", "CLST": "שעון צ׳ילה (קיץ)", "VET": "שעון ונצואלה", "WEZ": "שעון מערב אירופה (חורף)", "COST": "שעון קולומביה (קיץ)", "HKST": "שעון הונג קונג (קיץ)", "GFT": "שעון גיאנה הצרפתית", "ART": "שעון ארגנטינה (חורף)", "PST": "שעון רגיל האוקיינוס השקט"},
+ timezones: map[string]string{"AKST": "שעון אלסקה (חורף)", "AWDT": "שעון מערב אוסטרליה (קיץ)", "OESZ": "שעון מזרח אירופה (קיץ)", "LHDT": "שעון אי הלורד האו (קיץ)", "WARST": "שעון מערב ארגנטינה (קיץ)", "CHADT": "שעון צ׳טהאם (קיץ)", "ACWST": "שעון מרכז-מערב אוסטרליה (חורף)", "∅∅∅": "שעון אמזונס (קיץ)", "UYST": "שעון אורוגוואי (קיץ)", "IST": "שעון הודו", "WAST": "שעון מערב אפריקה (קיץ)", "OEZ": "שעון מזרח אירופה (חורף)", "MYT": "שעון מלזיה", "BOT": "שעון בוליביה", "WESZ": "שעון מערב אירופה (קיץ)", "SGT": "שעון סינגפור", "EST": "שעון החוף המזרחי (חורף)", "CLT": "שעון צ׳ילה (חורף)", "MST": "שעון אזור ההרים בארה״ב (חורף)", "GMT": "שעון גריניץ׳\u200f", "AEDT": "שעון מזרח אוסטרליה (קיץ)", "ChST": "שעון צ׳אמורו", "HKT": "שעון הונג קונג (חורף)", "HADT": "שעון קיץ האיים האלאוטיים הוואי", "COT": "שעון קולומביה (חורף)", "COST": "שעון קולומביה (קיץ)", "LHST": "שעון אי הלורד האו (חורף)", "ACST": "שעון מרכז אוסטרליה (חורף)", "MESZ": "שעון מרכז אירופה (קיץ)", "WEZ": "שעון מערב אירופה (חורף)", "UYT": "שעון אורוגוואי (חורף)", "ECT": "שעון אקוודור", "AST": "שעון האוקיינוס האטלנטי (חורף)", "ARST": "שעון ארגנטינה (קיץ)", "NZDT": "שעון ניו זילנד (קיץ)", "CLST": "שעון צ׳ילה (קיץ)", "BT": "שעון בהוטן", "ACDT": "שעון מרכז אוסטרליה (קיץ)", "CHAST": "שעון צ׳טהאם (חורף)", "WITA": "שעון מרכז אינדונזיה", "JST": "שעון יפן (חורף)", "MEZ": "שעון מרכז אירופה (חורף)", "GYT": "שעון גויאנה", "WIT": "שעון מזרח אינדונזיה", "EAT": "שעון מזרח אפריקה", "MDT": "שעון אזור ההרים בארה״ב (קיץ)", "ACWDT": "שעון מרכז-מערב אוסטרליה (קיץ)", "EDT": "שעון החוף המזרחי (קיץ)", "HAT": "שעון ניופאונדלנד (קיץ)", "GFT": "שעון גיאנה הצרפתית", "HKST": "שעון הונג קונג (קיץ)", "ADT": "שעון האוקיינוס האטלנטי (קיץ)", "SAST": "שעון דרום אפריקה", "HNT": "שעון ניופאונדלנד (חורף)", "TMT": "שעון טורקמניסטן (חורף)", "AEST": "שעון מזרח אוסטרליה (חורף)", "CDT": "שעון מרכז ארה״ב (קיץ)", "WART": "שעון מערב ארגנטינה (חורף)", "JDT": "שעון יפן (קיץ)", "PST": "שעון רגיל האוקיינוס השקט", "PDT": "שעון קיץ, מערב ארה״ב (לוס אנג׳לס)", "WIB": "שעון מערב אינדונזיה", "VET": "שעון ונצואלה", "AKDT": "שעון אלסקה (קיץ)", "ART": "שעון ארגנטינה (חורף)", "HAST": "שעון רגיל האיים האלאוטיים הוואי", "CST": "שעון מרכז ארה״ב (חורף)", "SRT": "שעון סורינאם", "AWST": "שעון מערב אוסטרליה (חורף)", "TMST": "שעון טורקמניסטן (קיץ)", "CAT": "שעון מרכז אפריקה", "NZST": "שעון ניו זילנד (חורף)", "WAT": "שעון מערב אפריקה (חורף)"},
}
}
diff --git a/he_IL/he_IL_test.go b/he_IL/he_IL_test.go
new file mode 100644
index 00000000..3c21e607
--- /dev/null
+++ b/he_IL/he_IL_test.go
@@ -0,0 +1,1120 @@
+package he_IL
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "he_IL"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/hi/hi.go b/hi/hi.go
index 26e3c1c3..030a9bd6 100644
--- a/hi/hi.go
+++ b/hi/hi.go
@@ -67,7 +67,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ईसा-पूर्व", "ईस्वी"},
erasNarrow: []string{"", ""},
erasWide: []string{"ईसा-पूर्व", "ईसवी सन"},
- timezones: map[string]string{"CHADT": "चैथम डेलाइट समय", "ACWST": "ऑस्\u200dट्रेलियाई केंद्रीय पश्चिमी मानक समय", "ECT": "इक्वाडोर समय", "HKST": "हाँग काँग ग्रीष्मकालीन समय", "TMT": "तुर्कमेनिस्तान मानक समय", "AKST": "अलास्\u200dका मानक समय", "CDT": "उत्तरी अमेरिकी केंद्रीय डेलाइट समय", "UYT": "उरुग्वे मानक समय", "JDT": "जापान डेलाइट समय", "WAST": "पश्चिम अफ़्रीका ग्रीष्मकालीन समय", "GMT": "ग्रीनविच मीन टाइम", "PDT": "उत्तरी अमेरिकी प्रशांत डेलाइट समय", "BOT": "बोलीविया समय", "MST": "उत्तरी अमेरिकी माउंटेन मानक समय", "HKT": "हाँग काँग मानक समय", "WIT": "पूर्वी इंडोनेशिया समय", "SRT": "सूरीनाम समय", "AEDT": "ऑस्\u200dट्रेलियाई पूर्वी डेलाइट समय", "WAT": "पश्चिम अफ़्रीका मानक समय", "MDT": "उत्तरी अमेरिकी माउंटेन डेलाइट समय", "GFT": "फ़्रेंच गुयाना समय", "EAT": "पूर्वी अफ़्रीका समय", "ARST": "अर्जेंटीना ग्रीष्मकालीन समय", "MYT": "मलेशिया समय", "CST": "उत्तरी अमेरिकी केंद्रीय मानक समय", "COT": "कोलंबिया मानक समय", "WESZ": "पश्चिमी यूरोपीय ग्रीष्\u200dमकालीन समय", "COST": "कोलंबिया ग्रीष्मकालीन समय", "HNT": "न्यूफ़ाउंडलैंड मानक समय", "HAT": "न्यूफ़ाउंडलैंड डेलाइट समय", "ACST": "ऑस्\u200dट्रेलियाई केंद्रीय मानक समय", "AKDT": "अलास्\u200dका डेलाइट समय", "MEZ": "मध्य यूरोपीय मानक समय", "CLT": "चिली मानक समय", "SAST": "दक्षिण अफ़्रीका समय", "TMST": "तुर्कमेनिस्तान ग्रीष्मकालीन समय", "ACDT": "ऑस्\u200dट्रेलियाई केंद्रीय डेलाइट समय", "ART": "अर्जेंटीना मानक समय", "ACWDT": "ऑस्\u200dट्रेलियाई केंद्रीय पश्चिमी डेलाइट समय", "ChST": "चामोरो मानक समय", "SGT": "सिंगापुर समय", "CHAST": "चैथम मानक समय", "WIB": "पश्चिमी इंडोनेशिया समय", "OESZ": "पूर्वी यूरोपीय ग्रीष्मकालीन समय", "LHST": "लॉर्ड होवे मानक समय", "WARST": "पश्चिमी अर्जेंटीना ग्रीष्मकालीन समय", "GYT": "गुयाना समय", "CAT": "मध्य अफ़्रीका समय", "OEZ": "पूर्वी यूरोपीय मानक समय", "AWDT": "ऑस्ट्रेलियाई पश्चिमी डेलाइट समय", "AST": "अटलांटिक मानक समय", "WART": "पश्चिमी अर्जेंटीना मानक समय", "WITA": "मध्य इंडोनेशिया समय", "IST": "भारतीय मानक समय", "MESZ": "मध्\u200dय यूरोपीय ग्रीष्\u200dमकालीन समय", "UYST": "उरुग्वे ग्रीष्मकालीन समय", "HADT": "हवाई–आल्यूशन डेलाइट समय", "NZDT": "न्यूज़ीलैंड डेलाइट समय", "CLST": "चिली ग्रीष्मकालीन समय", "VET": "वेनेज़ुएला समय", "∅∅∅": "अज़ोरेस ग्रीष्मकालीन समय", "NZST": "न्यूज़ीलैंड मानक समय", "WEZ": "पश्चिमी यूरोपीय मानक समय", "EST": "उत्तरी अमेरिकी पूर्वी मानक समय", "EDT": "उत्तरी अमेरिकी पूर्वी डेलाइट समय", "JST": "जापान मानक समय", "AWST": "ऑस्ट्रेलियाई पश्चिमी मानक समय", "LHDT": "लॉर्ड होवे डेलाइट समय", "HAST": "हवाई–आल्यूशन मानक समय", "BT": "भूटान समय", "PST": "उत्तरी अमेरिकी प्रशांत मानक समय", "AEST": "ऑस्\u200dट्रेलियाई पूर्वी मानक समय", "ADT": "अटलांटिक डेलाइट समय"},
+ timezones: map[string]string{"CLT": "चिली मानक समय", "LHST": "लॉर्ड होवे मानक समय", "WART": "पश्चिमी अर्जेंटीना मानक समय", "AST": "अटलांटिक मानक समय", "ART": "अर्जेंटीना मानक समय", "SAST": "दक्षिण अफ़्रीका समय", "COT": "कोलंबिया मानक समय", "HADT": "हवाई–आल्यूशन डेलाइट समय", "BOT": "बोलीविया समय", "EDT": "उत्तरी अमेरिकी पूर्वी डेलाइट समय", "HAT": "न्यूफ़ाउंडलैंड डेलाइट समय", "MST": "MST", "HKT": "हाँग काँग मानक समय", "HKST": "हाँग काँग ग्रीष्मकालीन समय", "AKST": "अलास्\u200dका मानक समय", "ACWDT": "ऑस्\u200dट्रेलियाई केंद्रीय पश्चिमी डेलाइट समय", "MEZ": "मध्य यूरोपीय मानक समय", "WESZ": "पश्चिमी यूरोपीय ग्रीष्\u200dमकालीन समय", "ChST": "चामोरो मानक समय", "CDT": "उत्तरी अमेरिकी केंद्रीय डेलाइट समय", "ACDT": "ऑस्\u200dट्रेलियाई केंद्रीय डेलाइट समय", "CHAST": "चैथम मानक समय", "CHADT": "चैथम डेलाइट समय", "AWDT": "ऑस्ट्रेलियाई पश्चिमी डेलाइट समय", "LHDT": "लॉर्ड होवे डेलाइट समय", "ACWST": "ऑस्\u200dट्रेलियाई केंद्रीय पश्चिमी मानक समय", "SGT": "सिंगापुर समय", "UYT": "उरुग्वे मानक समय", "WARST": "पश्चिमी अर्जेंटीना ग्रीष्मकालीन समय", "WITA": "मध्य इंडोनेशिया समय", "HAST": "हवाई–आल्यूशन मानक समय", "CLST": "चिली ग्रीष्मकालीन समय", "EAT": "पूर्वी अफ़्रीका समय", "CST": "उत्तरी अमेरिकी केंद्रीय मानक समय", "MDT": "MDT", "EST": "उत्तरी अमेरिकी पूर्वी मानक समय", "WIB": "पश्चिमी इंडोनेशिया समय", "UYST": "उरुग्वे ग्रीष्मकालीन समय", "ACST": "ऑस्\u200dट्रेलियाई केंद्रीय मानक समय", "ADT": "अटलांटिक डेलाइट समय", "TMST": "तुर्कमेनिस्तान ग्रीष्मकालीन समय", "WEZ": "पश्चिमी यूरोपीय मानक समय", "AEDT": "ऑस्\u200dट्रेलियाई पूर्वी डेलाइट समय", "ARST": "अर्जेंटीना ग्रीष्मकालीन समय", "GYT": "गुयाना समय", "ECT": "इक्वाडोर समय", "WAST": "पश्चिम अफ़्रीका ग्रीष्मकालीन समय", "BT": "भूटान समय", "JST": "जापान मानक समय", "IST": "भारतीय मानक समय", "MESZ": "मध्\u200dय यूरोपीय ग्रीष्\u200dमकालीन समय", "HNT": "न्यूफ़ाउंडलैंड मानक समय", "OESZ": "पूर्वी यूरोपीय ग्रीष्मकालीन समय", "SRT": "सूरीनाम समय", "AKDT": "अलास्\u200dका डेलाइट समय", "NZDT": "न्यूज़ीलैंड डेलाइट समय", "GMT": "ग्रीनविच मीन टाइम", "WIT": "पूर्वी इंडोनेशिया समय", "PST": "उत्तरी अमेरिकी प्रशांत मानक समय", "TMT": "तुर्कमेनिस्तान मानक समय", "AEST": "ऑस्\u200dट्रेलियाई पूर्वी मानक समय", "MYT": "मलेशिया समय", "GFT": "फ़्रेंच गुयाना समय", "VET": "वेनेज़ुएला समय", "JDT": "जापान डेलाइट समय", "AWST": "ऑस्ट्रेलियाई पश्चिमी मानक समय", "NZST": "न्यूज़ीलैंड मानक समय", "∅∅∅": "अज़ोरेस ग्रीष्मकालीन समय", "PDT": "उत्तरी अमेरिकी प्रशांत डेलाइट समय", "CAT": "मध्य अफ़्रीका समय", "OEZ": "पूर्वी यूरोपीय मानक समय", "COST": "कोलंबिया ग्रीष्मकालीन समय", "WAT": "पश्चिम अफ़्रीका मानक समय"},
}
}
diff --git a/hi/hi_test.go b/hi/hi_test.go
new file mode 100644
index 00000000..ad02c2df
--- /dev/null
+++ b/hi/hi_test.go
@@ -0,0 +1,1120 @@
+package hi
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "hi"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/hi_IN/hi_IN.go b/hi_IN/hi_IN.go
index 2f860a96..d6d673db 100644
--- a/hi_IN/hi_IN.go
+++ b/hi_IN/hi_IN.go
@@ -45,7 +45,7 @@ func New() locales.Translator {
locale: "hi_IN",
pluralsCardinal: []locales.PluralRule{2, 6},
pluralsOrdinal: []locales.PluralRule{2, 3, 4, 5, 6},
- pluralsRange: []locales.PluralRule{2, 6},
+ pluralsRange: []locales.PluralRule{6, 2},
decimal: ".",
group: ",",
minus: "-",
@@ -67,7 +67,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ईसा-पूर्व", "ईस्वी"},
erasNarrow: []string{"", ""},
erasWide: []string{"ईसा-पूर्व", "ईसवी सन"},
- timezones: map[string]string{"COST": "कोलंबिया ग्रीष्मकालीन समय", "GMT": "ग्रीनविच मीन टाइम", "HAT": "न्यूफ़ाउंडलैंड डेलाइट समय", "AEST": "ऑस्\u200dट्रेलियाई पूर्वी मानक समय", "CLST": "चिली ग्रीष्मकालीन समय", "CDT": "उत्तरी अमेरिकी केंद्रीय डेलाइट समय", "WITA": "मध्य इंडोनेशिया समय", "TMT": "तुर्कमेनिस्तान मानक समय", "LHDT": "लॉर्ड होवे डेलाइट समय", "JST": "जापान मानक समय", "AKST": "अलास्\u200dका मानक समय", "AKDT": "अलास्\u200dका डेलाइट समय", "VET": "वेनेज़ुएला समय", "ACWST": "ऑस्\u200dट्रेलियाई केंद्रीय पश्चिमी मानक समय", "CST": "उत्तरी अमेरिकी केंद्रीय मानक समय", "COT": "कोलंबिया मानक समय", "WART": "पश्चिमी अर्जेंटीना मानक समय", "MEZ": "मध्य यूरोपीय मानक समय", "TMST": "तुर्कमेनिस्तान ग्रीष्मकालीन समय", "LHST": "लॉर्ड होवे मानक समय", "SRT": "सूरीनाम समय", "∅∅∅": "∅∅∅", "ADT": "अटलांटिक डेलाइट समय", "WAT": "पश्चिम अफ़्रीका मानक समय", "GFT": "फ़्रेंच गुयाना समय", "UYST": "उरुग्वे ग्रीष्मकालीन समय", "HAST": "हवाई–आल्यूशन मानक समय", "OEZ": "पूर्वी यूरोपीय मानक समय", "NZDT": "न्यूज़ीलैंड डेलाइट समय", "BOT": "बोलीविया समय", "EST": "उत्तरी अमेरिकी पूर्वी मानक समय", "EDT": "उत्तरी अमेरिकी पूर्वी डेलाइट समय", "SGT": "सिंगापुर समय", "IST": "भारतीय मानक समय", "OESZ": "पूर्वी यूरोपीय ग्रीष्मकालीन समय", "MESZ": "मध्\u200dय यूरोपीय ग्रीष्\u200dमकालीन समय", "PST": "उत्तरी अमेरिकी प्रशांत मानक समय", "WEZ": "पश्चिमी यूरोपीय मानक समय", "CAT": "मध्य अफ़्रीका समय", "HADT": "हवाई–आल्यूशन डेलाइट समय", "HKST": "हाँग काँग ग्रीष्मकालीन समय", "HNT": "न्यूफ़ाउंडलैंड मानक समय", "ACST": "ऑस्\u200dट्रेलियाई केंद्रीय मानक समय", "WAST": "पश्चिम अफ़्रीका ग्रीष्मकालीन समय", "MST": "MST", "JDT": "जापान डेलाइट समय", "UYT": "उरुग्वे मानक समय", "ChST": "चामोरो मानक समय", "WARST": "पश्चिमी अर्जेंटीना ग्रीष्मकालीन समय", "WIT": "पूर्वी इंडोनेशिया समय", "MYT": "मलेशिया समय", "PDT": "उत्तरी अमेरिकी प्रशांत डेलाइट समय", "NZST": "न्यूज़ीलैंड मानक समय", "CHAST": "चैथम मानक समय", "CHADT": "चैथम डेलाइट समय", "HKT": "हाँग काँग मानक समय", "SAST": "दक्षिण अफ़्रीका समय", "ART": "अर्जेंटीना मानक समय", "AWST": "ऑस्ट्रेलियाई पश्चिमी मानक समय", "BT": "भूटान समय", "AEDT": "ऑस्\u200dट्रेलियाई पूर्वी डेलाइट समय", "ACWDT": "ऑस्\u200dट्रेलियाई केंद्रीय पश्चिमी डेलाइट समय", "ECT": "इक्वाडोर समय", "AWDT": "ऑस्ट्रेलियाई पश्चिमी डेलाइट समय", "AST": "अटलांटिक मानक समय", "WIB": "पश्चिमी इंडोनेशिया समय", "ARST": "अर्जेंटीना ग्रीष्मकालीन समय", "EAT": "पूर्वी अफ़्रीका समय", "WESZ": "पश्चिमी यूरोपीय ग्रीष्\u200dमकालीन समय", "ACDT": "ऑस्\u200dट्रेलियाई केंद्रीय डेलाइट समय", "MDT": "MDT", "GYT": "गुयाना समय", "CLT": "चिली मानक समय"},
+ timezones: map[string]string{"ACST": "ऑस्\u200dट्रेलियाई केंद्रीय मानक समय", "ARST": "अर्जेंटीना ग्रीष्मकालीन समय", "MEZ": "मध्य यूरोपीय मानक समय", "WIB": "पश्चिमी इंडोनेशिया समय", "CLT": "चिली मानक समय", "LHDT": "लॉर्ड होवे डेलाइट समय", "GYT": "गुयाना समय", "HKST": "हाँग काँग ग्रीष्मकालीन समय", "AKDT": "अलास्\u200dका डेलाइट समय", "HADT": "हवाई–आल्यूशन डेलाइट समय", "NZDT": "न्यूज़ीलैंड डेलाइट समय", "ChST": "चामोरो मानक समय", "JST": "जापान मानक समय", "MESZ": "मध्\u200dय यूरोपीय ग्रीष्\u200dमकालीन समय", "WEZ": "पश्चिमी यूरोपीय मानक समय", "AEST": "ऑस्\u200dट्रेलियाई पूर्वी मानक समय", "ADT": "अटलांटिक डेलाइट समय", "WART": "पश्चिमी अर्जेंटीना मानक समय", "WARST": "पश्चिमी अर्जेंटीना ग्रीष्मकालीन समय", "WITA": "मध्य इंडोनेशिया समय", "EST": "उत्तरी अमेरिकी पूर्वी मानक समय", "OEZ": "पूर्वी यूरोपीय मानक समय", "GMT": "ग्रीनविच मीन टाइम", "CST": "उत्तरी अमेरिकी केंद्रीय मानक समय", "MDT": "MDT", "HAST": "हवाई–आल्यूशन मानक समय", "HNT": "न्यूफ़ाउंडलैंड मानक समय", "CAT": "मध्य अफ़्रीका समय", "IST": "भारतीय मानक समय", "ACDT": "ऑस्\u200dट्रेलियाई केंद्रीय डेलाइट समय", "CDT": "उत्तरी अमेरिकी केंद्रीय डेलाइट समय", "ACWDT": "ऑस्\u200dट्रेलियाई केंद्रीय पश्चिमी डेलाइट समय", "SAST": "दक्षिण अफ़्रीका समय", "COT": "कोलंबिया मानक समय", "TMT": "तुर्कमेनिस्तान मानक समय", "CLST": "चिली ग्रीष्मकालीन समय", "ECT": "इक्वाडोर समय", "WAT": "पश्चिम अफ़्रीका मानक समय", "WESZ": "पश्चिमी यूरोपीय ग्रीष्\u200dमकालीन समय", "BT": "भूटान समय", "SRT": "सूरीनाम समय", "CHAST": "चैथम मानक समय", "AWST": "ऑस्ट्रेलियाई पश्चिमी मानक समय", "WAST": "पश्चिम अफ़्रीका ग्रीष्मकालीन समय", "AEDT": "ऑस्\u200dट्रेलियाई पूर्वी डेलाइट समय", "GFT": "फ़्रेंच गुयाना समय", "MST": "MST", "CHADT": "चैथम डेलाइट समय", "AWDT": "ऑस्ट्रेलियाई पश्चिमी डेलाइट समय", "PST": "उत्तरी अमेरिकी प्रशांत मानक समय", "HAT": "न्यूफ़ाउंडलैंड डेलाइट समय", "ACWST": "ऑस्\u200dट्रेलियाई केंद्रीय पश्चिमी मानक समय", "OESZ": "पूर्वी यूरोपीय ग्रीष्मकालीन समय", "WIT": "पूर्वी इंडोनेशिया समय", "HKT": "हाँग काँग मानक समय", "AKST": "अलास्\u200dका मानक समय", "EDT": "उत्तरी अमेरिकी पूर्वी डेलाइट समय", "COST": "कोलंबिया ग्रीष्मकालीन समय", "TMST": "तुर्कमेनिस्तान ग्रीष्मकालीन समय", "VET": "वेनेज़ुएला समय", "JDT": "जापान डेलाइट समय", "AST": "अटलांटिक मानक समय", "NZST": "न्यूज़ीलैंड मानक समय", "UYT": "उरुग्वे मानक समय", "ART": "अर्जेंटीना मानक समय", "PDT": "उत्तरी अमेरिकी प्रशांत डेलाइट समय", "SGT": "सिंगापुर समय", "MYT": "मलेशिया समय", "EAT": "पूर्वी अफ़्रीका समय", "BOT": "बोलीविया समय", "∅∅∅": "अमेज़न ग्रीष्मकालीन समय", "UYST": "उरुग्वे ग्रीष्मकालीन समय", "LHST": "लॉर्ड होवे मानक समय"},
}
}
diff --git a/hi_IN/hi_IN_test.go b/hi_IN/hi_IN_test.go
new file mode 100644
index 00000000..3c87f192
--- /dev/null
+++ b/hi_IN/hi_IN_test.go
@@ -0,0 +1,1120 @@
+package hi_IN
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "hi_IN"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/hr/hr.go b/hr/hr.go
index 8e902ecc..48d9298d 100644
--- a/hr/hr.go
+++ b/hr/hr.go
@@ -47,7 +47,7 @@ func New() locales.Translator {
locale: "hr",
pluralsCardinal: []locales.PluralRule{2, 4, 6},
pluralsOrdinal: []locales.PluralRule{6},
- pluralsRange: []locales.PluralRule{2, 4, 6},
+ pluralsRange: []locales.PluralRule{4, 6, 2},
decimal: ",",
group: ".",
minus: "-",
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"pr. Kr.", "p. Kr."},
erasNarrow: []string{"pr.n.e.", "AD"},
erasWide: []string{"prije Krista", "poslije Krista"},
- timezones: map[string]string{"MESZ": "srednjoeuropsko ljetno vrijeme", "BT": "butansko vrijeme", "WESZ": "zapadnoeuropsko ljetno vrijeme", "HAT": "newfoundlandsko ljetno vrijeme", "BOT": "bolivijsko vrijeme", "ADT": "atlantsko ljetno vrijeme", "GYT": "gvajansko vrijeme", "JDT": "japansko ljetno vrijeme", "SRT": "surinamsko vrijeme", "TMST": "turkmenistansko ljetno vrijeme", "TMT": "turkmenistansko standardno vrijeme", "AKST": "aljaško standardno vrijeme", "NZST": "novozelandsko standardno vrijeme", "CDT": "središnje ljetno vrijeme", "CLST": "čileansko ljetno vrijeme", "EST": "istočno standardno vrijeme", "EDT": "istočno ljetno vrijeme", "GMT": "univerzalno vrijeme", "PDT": "pacifičko ljetno vrijeme", "LHST": "standardno vrijeme otoka Lord Howe", "ACWST": "australsko središnje zapadno standardno vrijeme", "AEDT": "istočnoaustralsko ljetno vrijeme", "ChST": "standardno vrijeme Chamorra", "HKT": "hongkonško standardno vrijeme", "SAST": "južnoafričko vrijeme", "PST": "pacifičko standardno vrijeme", "MST": "planinsko standardno vrijeme", "MDT": "planinsko ljetno vrijeme", "VET": "venezuelsko vrijeme", "SGT": "singapursko vrijeme", "AST": "atlantsko standardno vrijeme", "WART": "zapadno-argentinsko standardno vrijeme", "OESZ": "istočnoeuropsko ljetno vrijeme", "IST": "indijsko vrijeme", "ACDT": "srednjoaustralsko ljetno vrijeme", "ARST": "argentinsko ljetno vrijeme", "NZDT": "novozelandsko ljetno vrijeme", "ACST": "srednjoaustralsko standardno vrijeme", "EAT": "istočnoafričko vrijeme", "∅∅∅": "azorsko ljetno vrijeme", "CHAST": "standardno vrijeme Chathama", "COT": "kolumbijsko standardno vrijeme", "ART": "argentinsko standardno vrijeme", "WAST": "zapadnoafričko ljetno vrijeme", "AWST": "zapadnoaustralsko standardno vrijeme", "AWDT": "zapadnoaustralsko ljetno vrijeme", "UYT": "urugvajsko standardno vrijeme", "UYST": "urugvajsko ljetno vrijeme", "CLT": "čileansko standardno vrijeme", "WEZ": "zapadnoeuropsko standardno vrijeme", "CAT": "srednjoafričko vrijeme", "HKST": "hongkonško ljetno vrijeme", "WIB": "zapadnoindonezijsko vrijeme", "LHDT": "ljetno vrijeme otoka Lord Howe", "AEST": "istočnoaustralsko standardno vrijeme", "ECT": "ekvadorsko vrijeme", "HADT": "havajsko-aleutsko ljetno vrijeme", "HNT": "newfoundlandsko standardno vrijeme", "CST": "središnje standardno vrijeme", "ACWDT": "australsko središnje zapadno ljetno vrijeme", "GFT": "vrijeme Francuske Gvajane", "JST": "japansko standardno vrijeme", "COST": "kolumbijsko ljetno vrijeme", "WITA": "srednjoindonezijsko vrijeme", "MEZ": "srednjoeuropsko standardno vrijeme", "OEZ": "istočnoeuropsko standardno vrijeme", "CHADT": "ljetno vrijeme Chathama", "HAST": "havajsko-aleutsko standardno vrijeme", "MYT": "malezijsko vrijeme", "AKDT": "aljaško ljetno vrijeme", "WAT": "zapadnoafričko standardno vrijeme", "WARST": "zapadno-argentinsko ljetno vrijeme", "WIT": "istočnoindonezijsko vrijeme"},
+ timezones: map[string]string{"AEST": "istočnoaustralsko standardno vrijeme", "UYT": "urugvajsko standardno vrijeme", "EST": "istočno standardno vrijeme", "NZST": "novozelandsko standardno vrijeme", "CAT": "srednjoafričko vrijeme", "WAT": "zapadnoafričko standardno vrijeme", "SGT": "singapursko vrijeme", "OEZ": "istočnoeuropsko standardno vrijeme", "WART": "zapadno-argentinsko standardno vrijeme", "VET": "venezuelsko vrijeme", "EDT": "istočno ljetno vrijeme", "WAST": "zapadnoafričko ljetno vrijeme", "MYT": "malezijsko vrijeme", "HKT": "hongkonško standardno vrijeme", "AST": "atlantsko standardno vrijeme", "PST": "pacifičko standardno vrijeme", "WEZ": "zapadnoeuropsko standardno vrijeme", "ChST": "standardno vrijeme Chamorra", "WIT": "istočnoindonezijsko vrijeme", "HADT": "havajsko-aleutsko ljetno vrijeme", "∅∅∅": "amazonsko ljetno vrijeme", "CLT": "čileansko standardno vrijeme", "ACWDT": "australsko središnje zapadno ljetno vrijeme", "WESZ": "zapadnoeuropsko ljetno vrijeme", "OESZ": "istočnoeuropsko ljetno vrijeme", "MST": "planinsko standardno vrijeme", "PDT": "pacifičko ljetno vrijeme", "TMT": "turkmenistansko standardno vrijeme", "AKST": "aljaško standardno vrijeme", "JST": "japansko standardno vrijeme", "GYT": "gvajansko vrijeme", "MDT": "planinsko ljetno vrijeme", "WARST": "zapadno-argentinsko ljetno vrijeme", "HKST": "hongkonško ljetno vrijeme", "HAT": "newfoundlandsko ljetno vrijeme", "COT": "kolumbijsko standardno vrijeme", "TMST": "turkmenistansko ljetno vrijeme", "AEDT": "istočnoaustralsko ljetno vrijeme", "UYST": "urugvajsko ljetno vrijeme", "GFT": "vrijeme Francuske Gvajane", "ADT": "atlantsko ljetno vrijeme", "SAST": "južnoafričko vrijeme", "NZDT": "novozelandsko ljetno vrijeme", "EAT": "istočnoafričko vrijeme", "CHAST": "standardno vrijeme Chathama", "SRT": "surinamsko vrijeme", "ART": "argentinsko standardno vrijeme", "BOT": "bolivijsko vrijeme", "HNT": "newfoundlandsko standardno vrijeme", "COST": "kolumbijsko ljetno vrijeme", "WIB": "zapadnoindonezijsko vrijeme", "GMT": "univerzalno vrijeme", "JDT": "japansko ljetno vrijeme", "CLST": "čileansko ljetno vrijeme", "IST": "indijsko vrijeme", "MEZ": "srednjoeuropsko standardno vrijeme", "LHST": "standardno vrijeme otoka Lord Howe", "LHDT": "ljetno vrijeme otoka Lord Howe", "ECT": "ekvadorsko vrijeme", "AWST": "zapadnoaustralsko standardno vrijeme", "ARST": "argentinsko ljetno vrijeme", "WITA": "srednjoindonezijsko vrijeme", "CST": "središnje standardno vrijeme", "ACDT": "srednjoaustralsko ljetno vrijeme", "CHADT": "ljetno vrijeme Chathama", "AKDT": "aljaško ljetno vrijeme", "ACWST": "australsko središnje zapadno standardno vrijeme", "BT": "butansko vrijeme", "CDT": "središnje ljetno vrijeme", "AWDT": "zapadnoaustralsko ljetno vrijeme", "MESZ": "srednjoeuropsko ljetno vrijeme", "HAST": "havajsko-aleutsko standardno vrijeme", "ACST": "srednjoaustralsko standardno vrijeme"},
}
}
diff --git a/hr/hr_test.go b/hr/hr_test.go
new file mode 100644
index 00000000..e0cd295b
--- /dev/null
+++ b/hr/hr_test.go
@@ -0,0 +1,1120 @@
+package hr
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "hr"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/hr_BA/hr_BA.go b/hr_BA/hr_BA.go
index 3394adea..863353f0 100644
--- a/hr_BA/hr_BA.go
+++ b/hr_BA/hr_BA.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"pr. Kr.", "p. Kr."},
erasNarrow: []string{"pr.n.e.", "AD"},
erasWide: []string{"prije Krista", "poslije Krista"},
- timezones: map[string]string{"IST": "indijsko vrijeme", "NZDT": "novozelandsko ljetno vrijeme", "BOT": "bolivijsko vrijeme", "CST": "središnje standardno vrijeme", "AEDT": "istočnoaustralsko ljetno vrijeme", "SGT": "singapursko vrijeme", "LHST": "standardno vrijeme otoka Lord Howe", "PST": "pacifičko standardno vrijeme", "MEZ": "srednjoeuropsko standardno vrijeme", "MST": "planinsko standardno vrijeme", "WARST": "zapadno-argentinsko ljetno vrijeme", "WIB": "zapadnoindonezijsko vrijeme", "OEZ": "istočnoeuropsko standardno vrijeme", "AWST": "zapadnoaustralsko standardno vrijeme", "AKST": "aljaško standardno vrijeme", "WEZ": "zapadnoeuropsko standardno vrijeme", "WITA": "srednjoindonezijsko vrijeme", "WESZ": "zapadnoeuropsko ljetno vrijeme", "ACWST": "australsko središnje zapadno standardno vrijeme", "ACDT": "srednjoaustralsko ljetno vrijeme", "CAT": "srednjoafričko vrijeme", "GFT": "vrijeme Francuske Gvajane", "ADT": "atlantsko ljetno vrijeme", "HAT": "newfoundlandsko ljetno vrijeme", "COST": "kolumbijsko ljetno vrijeme", "∅∅∅": "brazilijsko ljetno vrijeme", "CHAST": "standardno vrijeme Chathama", "HKT": "hongkonško standardno vrijeme", "TMST": "turkmenistansko ljetno vrijeme", "AEST": "istočnoaustralsko standardno vrijeme", "ACWDT": "australsko središnje zapadno ljetno vrijeme", "HKST": "hongkonško ljetno vrijeme", "WAST": "zapadnoafričko ljetno vrijeme", "EAT": "istočnoafričko vrijeme", "PDT": "pacifičko ljetno vrijeme", "MESZ": "srednjoeuropsko ljetno vrijeme", "CLT": "čileansko standardno vrijeme", "BT": "butansko vrijeme", "SAST": "južnoafričko vrijeme", "ARST": "argentinsko ljetno vrijeme", "NZST": "novozelandsko standardno vrijeme", "UYT": "urugvajsko standardno vrijeme", "UYST": "urugvajsko ljetno vrijeme", "ChST": "standardno vrijeme Chamorra", "COT": "kolumbijsko standardno vrijeme", "WAT": "zapadnoafričko standardno vrijeme", "LHDT": "ljetno vrijeme otoka Lord Howe", "MYT": "malezijsko vrijeme", "JST": "japansko standardno vrijeme", "JDT": "japansko ljetno vrijeme", "CDT": "središnje ljetno vrijeme", "CHADT": "ljetno vrijeme Chathama", "VET": "venezuelsko vrijeme", "OESZ": "istočnoeuropsko ljetno vrijeme", "ART": "argentinsko standardno vrijeme", "TMT": "turkmenistansko standardno vrijeme", "GYT": "gvajansko vrijeme", "HNT": "newfoundlandsko standardno vrijeme", "WIT": "istočnoindonezijsko vrijeme", "MDT": "planinsko ljetno vrijeme", "HADT": "havajsko-aleutsko ljetno vrijeme", "EST": "istočno standardno vrijeme", "HAST": "havajsko-aleutsko standardno vrijeme", "WART": "zapadno-argentinsko standardno vrijeme", "ACST": "srednjoaustralsko standardno vrijeme", "AWDT": "zapadnoaustralsko ljetno vrijeme", "SRT": "surinamsko vrijeme", "CLST": "čileansko ljetno vrijeme", "ECT": "ekvadorsko vrijeme", "AKDT": "aljaško ljetno vrijeme", "GMT": "univerzalno vrijeme", "EDT": "istočno ljetno vrijeme", "AST": "atlantsko standardno vrijeme"},
+ timezones: map[string]string{"ACST": "srednjoaustralsko standardno vrijeme", "ACDT": "srednjoaustralsko ljetno vrijeme", "CHAST": "standardno vrijeme Chathama", "CHADT": "ljetno vrijeme Chathama", "ACWST": "australsko središnje zapadno standardno vrijeme", "OESZ": "istočnoeuropsko ljetno vrijeme", "MYT": "malezijsko vrijeme", "AEDT": "istočnoaustralsko ljetno vrijeme", "WIT": "istočnoindonezijsko vrijeme", "MDT": "ljetno makaosko vrijeme", "SGT": "singapursko vrijeme", "CDT": "središnje ljetno vrijeme", "HKST": "hongkonško ljetno vrijeme", "AST": "atlantsko standardno vrijeme", "WAT": "zapadnoafričko standardno vrijeme", "UYT": "urugvajsko standardno vrijeme", "MST": "standardno makaosko vrijeme", "JST": "japansko standardno vrijeme", "EDT": "istočno ljetno vrijeme", "NZST": "novozelandsko standardno vrijeme", "GYT": "gvajansko vrijeme", "EAT": "istočnoafričko vrijeme", "CLT": "čileansko standardno vrijeme", "AKST": "aljaško standardno vrijeme", "HAST": "havajsko-aleutsko standardno vrijeme", "HADT": "havajsko-aleutsko ljetno vrijeme", "WESZ": "zapadnoeuropsko ljetno vrijeme", "LHST": "standardno vrijeme otoka Lord Howe", "AKDT": "aljaško ljetno vrijeme", "ACWDT": "australsko središnje zapadno ljetno vrijeme", "ART": "argentinsko standardno vrijeme", "CLST": "čileansko ljetno vrijeme", "COST": "kolumbijsko ljetno vrijeme", "CST": "središnje standardno vrijeme", "∅∅∅": "azorsko ljetno vrijeme", "ADT": "atlantsko ljetno vrijeme", "AWST": "zapadnoaustralsko standardno vrijeme", "BOT": "bolivijsko vrijeme", "EST": "istočno standardno vrijeme", "PDT": "pacifičko ljetno vrijeme", "AWDT": "zapadnoaustralsko ljetno vrijeme", "NZDT": "novozelandsko ljetno vrijeme", "WEZ": "zapadnoeuropsko standardno vrijeme", "WART": "zapadno-argentinsko standardno vrijeme", "IST": "indijsko vrijeme", "MEZ": "srednjoeuropsko standardno vrijeme", "TMST": "turkmenistansko ljetno vrijeme", "WIB": "zapadnoindonezijsko vrijeme", "LHDT": "ljetno vrijeme otoka Lord Howe", "SAST": "južnoafričko vrijeme", "HAT": "newfoundlandsko ljetno vrijeme", "COT": "kolumbijsko standardno vrijeme", "WARST": "zapadno-argentinsko ljetno vrijeme", "HKT": "hongkonško standardno vrijeme", "VET": "venezuelsko vrijeme", "JDT": "japansko ljetno vrijeme", "WAST": "zapadnoafričko ljetno vrijeme", "OEZ": "istočnoeuropsko standardno vrijeme", "ECT": "ekvadorsko vrijeme", "ARST": "argentinsko ljetno vrijeme", "MESZ": "srednjoeuropsko ljetno vrijeme", "BT": "butansko vrijeme", "SRT": "surinamsko vrijeme", "PST": "pacifičko standardno vrijeme", "CAT": "srednjoafričko vrijeme", "HNT": "newfoundlandsko standardno vrijeme", "GFT": "vrijeme Francuske Gvajane", "WITA": "srednjoindonezijsko vrijeme", "TMT": "turkmenistansko standardno vrijeme", "GMT": "univerzalno vrijeme", "AEST": "istočnoaustralsko standardno vrijeme", "ChST": "standardno vrijeme Chamorra", "UYST": "urugvajsko ljetno vrijeme"},
}
}
diff --git a/hr_BA/hr_BA_test.go b/hr_BA/hr_BA_test.go
new file mode 100644
index 00000000..7f81c6d4
--- /dev/null
+++ b/hr_BA/hr_BA_test.go
@@ -0,0 +1,1120 @@
+package hr_BA
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "hr_BA"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/hr_HR/hr_HR.go b/hr_HR/hr_HR.go
index 50c261f0..cda56407 100644
--- a/hr_HR/hr_HR.go
+++ b/hr_HR/hr_HR.go
@@ -47,7 +47,7 @@ func New() locales.Translator {
locale: "hr_HR",
pluralsCardinal: []locales.PluralRule{2, 4, 6},
pluralsOrdinal: []locales.PluralRule{6},
- pluralsRange: []locales.PluralRule{6, 2, 4},
+ pluralsRange: []locales.PluralRule{4, 6, 2},
decimal: ",",
group: ".",
minus: "-",
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"pr. Kr.", "p. Kr."},
erasNarrow: []string{"pr.n.e.", "AD"},
erasWide: []string{"prije Krista", "poslije Krista"},
- timezones: map[string]string{"ACWST": "australsko središnje zapadno standardno vrijeme", "AEST": "istočnoaustralsko standardno vrijeme", "TMT": "turkmenistansko standardno vrijeme", "AKST": "aljaško standardno vrijeme", "LHST": "standardno vrijeme otoka Lord Howe", "MST": "planinsko standardno vrijeme", "COT": "kolumbijsko standardno vrijeme", "SGT": "singapursko vrijeme", "WARST": "zapadno-argentinsko ljetno vrijeme", "WIT": "istočnoindonezijsko vrijeme", "ACDT": "srednjoaustralsko ljetno vrijeme", "ART": "argentinsko standardno vrijeme", "AWDT": "zapadnoaustralsko ljetno vrijeme", "LHDT": "ljetno vrijeme otoka Lord Howe", "GYT": "gvajansko vrijeme", "CDT": "središnje ljetno vrijeme", "UYST": "urugvajsko ljetno vrijeme", "HADT": "havajsko-aleutsko ljetno vrijeme", "SAST": "južnoafričko vrijeme", "GFT": "vrijeme Francuske Gvajane", "EAT": "istočnoafričko vrijeme", "AWST": "zapadnoaustralsko standardno vrijeme", "BOT": "bolivijsko vrijeme", "MEZ": "srednjoeuropsko standardno vrijeme", "ChST": "standardno vrijeme Chamorra", "ADT": "atlantsko ljetno vrijeme", "HAT": "newfoundlandsko ljetno vrijeme", "MESZ": "srednjoeuropsko ljetno vrijeme", "MDT": "planinsko ljetno vrijeme", "CHAST": "standardno vrijeme Chathama", "CHADT": "ljetno vrijeme Chathama", "CLT": "čileansko standardno vrijeme", "ACST": "srednjoaustralsko standardno vrijeme", "AKDT": "aljaško ljetno vrijeme", "CST": "središnje standardno vrijeme", "WEZ": "zapadnoeuropsko standardno vrijeme", "∅∅∅": "brazilijsko ljetno vrijeme", "AST": "atlantsko standardno vrijeme", "HAST": "havajsko-aleutsko standardno vrijeme", "GMT": "univerzalno vrijeme", "PDT": "pacifičko ljetno vrijeme", "HKT": "hongkonško standardno vrijeme", "JST": "japansko standardno vrijeme", "WESZ": "zapadnoeuropsko ljetno vrijeme", "VET": "venezuelsko vrijeme", "EST": "istočno standardno vrijeme", "COST": "kolumbijsko ljetno vrijeme", "WART": "zapadno-argentinsko standardno vrijeme", "EDT": "istočno ljetno vrijeme", "HKST": "hongkonško ljetno vrijeme", "OESZ": "istočnoeuropsko ljetno vrijeme", "HNT": "newfoundlandsko standardno vrijeme", "ARST": "argentinsko ljetno vrijeme", "TMST": "turkmenistansko ljetno vrijeme", "WAT": "zapadnoafričko standardno vrijeme", "WAST": "zapadnoafričko ljetno vrijeme", "IST": "indijsko vrijeme", "PST": "pacifičko standardno vrijeme", "MYT": "malezijsko vrijeme", "JDT": "japansko ljetno vrijeme", "ACWDT": "australsko središnje zapadno ljetno vrijeme", "AEDT": "istočnoaustralsko ljetno vrijeme", "CLST": "čileansko ljetno vrijeme", "ECT": "ekvadorsko vrijeme", "OEZ": "istočnoeuropsko standardno vrijeme", "WIB": "zapadnoindonezijsko vrijeme", "SRT": "surinamsko vrijeme", "UYT": "urugvajsko standardno vrijeme", "CAT": "srednjoafričko vrijeme", "BT": "butansko vrijeme", "WITA": "srednjoindonezijsko vrijeme", "NZST": "novozelandsko standardno vrijeme", "NZDT": "novozelandsko ljetno vrijeme"},
+ timezones: map[string]string{"MDT": "planinsko ljetno vrijeme", "HAT": "newfoundlandsko ljetno vrijeme", "WIB": "zapadnoindonezijsko vrijeme", "WAST": "zapadnoafričko ljetno vrijeme", "AEST": "istočnoaustralsko standardno vrijeme", "JDT": "japansko ljetno vrijeme", "EDT": "istočno ljetno vrijeme", "MESZ": "srednjoeuropsko ljetno vrijeme", "WART": "zapadno-argentinsko standardno vrijeme", "SRT": "surinamsko vrijeme", "HAST": "havajsko-aleutsko standardno vrijeme", "WEZ": "zapadnoeuropsko standardno vrijeme", "CDT": "središnje ljetno vrijeme", "ART": "argentinsko standardno vrijeme", "GMT": "univerzalno vrijeme", "MYT": "malezijsko vrijeme", "AST": "atlantsko standardno vrijeme", "MST": "planinsko standardno vrijeme", "CLST": "čileansko ljetno vrijeme", "WIT": "istočnoindonezijsko vrijeme", "ACWDT": "australsko središnje zapadno ljetno vrijeme", "UYT": "urugvajsko standardno vrijeme", "BT": "butansko vrijeme", "ECT": "ekvadorsko vrijeme", "EST": "istočno standardno vrijeme", "PDT": "pacifičko ljetno vrijeme", "HADT": "havajsko-aleutsko ljetno vrijeme", "HNT": "newfoundlandsko standardno vrijeme", "ACDT": "srednjoaustralsko ljetno vrijeme", "WITA": "srednjoindonezijsko vrijeme", "AKDT": "aljaško ljetno vrijeme", "∅∅∅": "Acre ljetno vrijeme", "TMT": "turkmenistansko standardno vrijeme", "OEZ": "istočnoeuropsko standardno vrijeme", "CST": "središnje standardno vrijeme", "CAT": "srednjoafričko vrijeme", "AEDT": "istočnoaustralsko ljetno vrijeme", "LHST": "standardno vrijeme otoka Lord Howe", "CHAST": "standardno vrijeme Chathama", "AWST": "zapadnoaustralsko standardno vrijeme", "SAST": "južnoafričko vrijeme", "COST": "kolumbijsko ljetno vrijeme", "TMST": "turkmenistansko ljetno vrijeme", "VET": "venezuelsko vrijeme", "ACWST": "australsko središnje zapadno standardno vrijeme", "NZST": "novozelandsko standardno vrijeme", "WESZ": "zapadnoeuropsko ljetno vrijeme", "COT": "kolumbijsko standardno vrijeme", "ChST": "standardno vrijeme Chamorra", "MEZ": "srednjoeuropsko standardno vrijeme", "LHDT": "ljetno vrijeme otoka Lord Howe", "AKST": "aljaško standardno vrijeme", "OESZ": "istočnoeuropsko ljetno vrijeme", "EAT": "istočnoafričko vrijeme", "ACST": "srednjoaustralsko standardno vrijeme", "ARST": "argentinsko ljetno vrijeme", "PST": "pacifičko standardno vrijeme", "IST": "indijsko vrijeme", "SGT": "singapursko vrijeme", "WAT": "zapadnoafričko standardno vrijeme", "CLT": "čileansko standardno vrijeme", "CHADT": "ljetno vrijeme Chathama", "BOT": "bolivijsko vrijeme", "UYST": "urugvajsko ljetno vrijeme", "WARST": "zapadno-argentinsko ljetno vrijeme", "ADT": "atlantsko ljetno vrijeme", "HKST": "hongkonško ljetno vrijeme", "AWDT": "zapadnoaustralsko ljetno vrijeme", "JST": "japansko standardno vrijeme", "NZDT": "novozelandsko ljetno vrijeme", "GYT": "gvajansko vrijeme", "GFT": "vrijeme Francuske Gvajane", "HKT": "hongkonško standardno vrijeme"},
}
}
@@ -103,8 +103,8 @@ func (hr *hr_HR) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
f := locales.F(n, v)
iMod10 := i % 10
iMod100 := i % 100
- fMod100 := f % 100
fMod10 := f % 10
+ fMod100 := f % 100
if (v == 0 && iMod10 == 1 && iMod100 != 11) || (fMod10 == 1 && fMod100 != 11) {
return locales.PluralRuleOne
diff --git a/hr_HR/hr_HR_test.go b/hr_HR/hr_HR_test.go
new file mode 100644
index 00000000..343214e4
--- /dev/null
+++ b/hr_HR/hr_HR_test.go
@@ -0,0 +1,1120 @@
+package hr_HR
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "hr_HR"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/hsb/hsb.go b/hsb/hsb.go
index 7460aec0..f82f88dd 100644
--- a/hsb/hsb.go
+++ b/hsb/hsb.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"př.Chr.n.", "po Chr.n."},
erasNarrow: []string{"", ""},
erasWide: []string{"před Chrystowym narodźenjom", "po Chrystowym narodźenju"},
- timezones: map[string]string{"ACWST": "srjedźozapadny awstralski standardny čas", "HAST": "hawaiisko-aleutski standardny čas", "WITA": "srjedźoindoneski čas", "∅∅∅": "Amaconaski lětni čas", "AKST": "alaskaski standardny čas", "CLT": "chilski standardny čas", "NZST": "nowoseelandski standardny čas", "WESZ": "zapadoeuropski lětni čas", "SGT": "Singapurski čas", "HNT": "nowofundlandski standardny čas", "GFT": "francoskoguyanski čas", "ART": "argentinski standardny čas", "MYT": "malajziski čas", "OEZ": "wuchodoeuropski standardny čas", "MESZ": "srjedźoeuropski lětni čas", "PST": "sewjeroameriski pacifiski standardny čas", "AST": "atlantiski standardny čas", "ACST": "srjedźoawstralski standardny čas", "LHST": "standardny čas kupy Lord-Howe", "JDT": "japanski lětni čas", "SRT": "surinamski čas", "OESZ": "wuchodoeuropski lětni čas", "PDT": "sewjeroameriski pacifiski lětni čas", "ECT": "ekwadorski čas", "SAST": "južnoafriski čas", "WART": "zapadoargentinski standardny čas", "WARST": "zapadoargentinski lětni čas", "WIB": "zapadoindoneski čas", "GYT": "guyanski čas", "VET": "venezuelski čas", "BT": "bhutanski čas", "TMT": "turkmenski standardny čas", "ADT": "atlantiski lětni čas", "AKDT": "alaskaski lětni čas", "CDT": "sewjeroameriski centralny lětni čas", "AEST": "wuchodoawstralski standardny čas", "HKST": "Hongkongski lětni čas", "GMT": "Greenwichski čas", "HAT": "nowofundlandski lětni čas", "EAT": "wuchodoafriski čas", "AWDT": "zapadoawstralski lětni čas", "MST": "MST", "COST": "kolumbiski lětni čas", "HADT": "hawaiisko-aleutski lětni čas", "AEDT": "wuchodoawstralski lětni čas", "CAT": "centralnoafriski čas", "IST": "indiski čas", "AWST": "zapadoawstralski standardny čas", "LHDT": "lětni čas kupy Lord-Howe", "MEZ": "srjedźoeuropski standardny čas", "UYT": "uruguayski standardny čas", "UYST": "uruguayski lětni čas", "CHAST": "chathamski standardny čas", "WIT": "wuchodoindoneski", "ACDT": "srjedźoawstralski lětni čas", "MDT": "MDT", "JST": "japanski standardny čas", "ARST": "argentinski lětni čas", "WEZ": "zapadoeuropski standardny čas", "NZDT": "nowoseelandski lětni čas", "ChST": "chamorroski čas", "COT": "kolumbiski standardny čas", "WAST": "zapadoafriski lětni čas", "BOT": "boliwiski čas", "CLST": "chilski lětni čas", "EDT": "sewjeroameriski wuchodny lětni čas", "WAT": "zapadoafriski standardny čas", "CST": "sewjeroameriski centralny standardny čas", "CHADT": "chathamski lětni čas", "TMST": "turkmenski lětni čas", "ACWDT": "sjedźozapadny awstralski lětni čas", "EST": "sewjeroameriski wuchodny standardny čas", "HKT": "Hongkongski standardny čas"},
+ timezones: map[string]string{"HKST": "Hongkongski lětni čas", "WESZ": "zapadoeuropski lětni čas", "COST": "kolumbiski lětni čas", "OESZ": "wuchodoeuropski lětni čas", "MDT": "MDT", "GMT": "Greenwichski čas", "AST": "atlantiski standardny čas", "NZST": "nowoseelandski standardny čas", "WARST": "zapadoargentinski lětni čas", "VET": "venezuelski čas", "ART": "argentinski standardny čas", "ARST": "argentinski lětni čas", "COT": "kolumbiski standardny čas", "GYT": "guyanski čas", "LHST": "standardny čas kupy Lord-Howe", "LHDT": "lětni čas kupy Lord-Howe", "CHADT": "chathamski lětni čas", "ADT": "atlantiski lětni čas", "OEZ": "wuchodoeuropski standardny čas", "CST": "sewjeroameriski centralny standardny čas", "GFT": "francoskoguyanski čas", "TMT": "turkmenski standardny čas", "UYST": "uruguayski lětni čas", "ACDT": "srjedźoawstralski lětni čas", "∅∅∅": "acorski lětni čas", "ECT": "ekwadorski čas", "AWDT": "zapadoawstralski lětni čas", "SAST": "južnoafriski čas", "HADT": "hawaiisko-aleutski lětni čas", "WEZ": "zapadoeuropski standardny čas", "AWST": "zapadoawstralski standardny čas", "WAT": "zapadoafriski standardny čas", "AEST": "wuchodoawstralski standardny čas", "CLT": "chilski standardny čas", "WART": "zapadoargentinski standardny čas", "NZDT": "nowoseelandski lětni čas", "HNT": "nowofundlandski standardny čas", "BT": "bhutanski čas", "CLST": "chilski lětni čas", "HKT": "Hongkongski standardny čas", "ACWST": "srjedźozapadny awstralski standardny čas", "IST": "indiski čas", "WAST": "zapadoafriski lětni čas", "MYT": "malajziski čas", "SRT": "surinamski čas", "AKST": "alaskaski standardny čas", "WITA": "srjedźoindoneski čas", "BOT": "boliwiski čas", "PDT": "sewjeroameriski pacifiski lětni čas", "MESZ": "srjedźoeuropski lětni čas", "HAT": "nowofundlandski lětni čas", "TMST": "turkmenski lětni čas", "CHAST": "chathamski standardny čas", "JST": "japanski standardny čas", "AKDT": "alaskaski lětni čas", "ACWDT": "sjedźozapadny awstralski lětni čas", "PST": "sewjeroameriski pacifiski standardny čas", "MEZ": "srjedźoeuropski standardny čas", "ACST": "srjedźoawstralski standardny čas", "JDT": "japanski lětni čas", "EST": "sewjeroameriski wuchodny standardny čas", "EDT": "sewjeroameriski wuchodny lětni čas", "WIB": "zapadoindoneski čas", "AEDT": "wuchodoawstralski lětni čas", "WIT": "wuchodoindoneski", "MST": "MST", "CAT": "centralnoafriski čas", "SGT": "Singapurski čas", "UYT": "uruguayski standardny čas", "CDT": "sewjeroameriski centralny lětni čas", "HAST": "hawaiisko-aleutski standardny čas", "ChST": "chamorroski čas", "EAT": "wuchodoafriski čas"},
}
}
diff --git a/hsb/hsb_test.go b/hsb/hsb_test.go
new file mode 100644
index 00000000..b9502a02
--- /dev/null
+++ b/hsb/hsb_test.go
@@ -0,0 +1,1120 @@
+package hsb
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "hsb"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/hsb_DE/hsb_DE.go b/hsb_DE/hsb_DE.go
index 5c19449b..effe15f5 100644
--- a/hsb_DE/hsb_DE.go
+++ b/hsb_DE/hsb_DE.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"př.Chr.n.", "po Chr.n."},
erasNarrow: []string{"", ""},
erasWide: []string{"před Chrystowym narodźenjom", "po Chrystowym narodźenju"},
- timezones: map[string]string{"ChST": "chamorroski čas", "ART": "argentinski standardny čas", "LHDT": "lětni čas kupy Lord-Howe", "GYT": "guyanski čas", "AEST": "wuchodoawstralski standardny čas", "WART": "zapadoargentinski standardny čas", "MST": "MST", "UYST": "uruguayski lětni čas", "HAST": "hawaiisko-aleutski standardny čas", "GFT": "francoskoguyanski čas", "∅∅∅": "Amaconaski lětni čas", "AKST": "alaskaski standardny čas", "HADT": "hawaiisko-aleutski lětni čas", "SAST": "južnoafriski čas", "CHAST": "chathamski standardny čas", "EST": "sewjeroameriski wuchodny standardny čas", "MYT": "malajziski čas", "ACWDT": "sjedźozapadny awstralski lětni čas", "CLST": "chilski lětni čas", "WAST": "zapadoafriski lětni čas", "IST": "indiski čas", "UYT": "uruguayski standardny čas", "SRT": "surinamski čas", "AKDT": "alaskaski lětni čas", "CDT": "sewjeroameriski centralny lětni čas", "MESZ": "srjedźoeuropski lětni čas", "ACWST": "srjedźozapadny awstralski standardny čas", "WITA": "srjedźoindoneski čas", "TMST": "turkmenski lětni čas", "JDT": "japanski lětni čas", "COST": "kolumbiski lětni čas", "CAT": "centralnoafriski čas", "TMT": "turkmenski standardny čas", "BOT": "boliwiski čas", "CLT": "chilski standardny čas", "PST": "sewjeroameriski pacifiski standardny čas", "WESZ": "zapadoeuropski lětni čas", "AEDT": "wuchodoawstralski lětni čas", "WIT": "wuchodoindoneski", "OEZ": "wuchodoeuropski standardny čas", "ACST": "srjedźoawstralski standardny čas", "ADT": "atlantiski lětni čas", "WIB": "zapadoindoneski čas", "OESZ": "wuchodoeuropski lětni čas", "LHST": "standardny čas kupy Lord-Howe", "GMT": "Greenwichski čas", "NZDT": "nowoseelandski lětni čas", "VET": "venezuelski čas", "EDT": "sewjeroameriski wuchodny lětni čas", "COT": "kolumbiski standardny čas", "ECT": "ekwadorski čas", "HAT": "nowofundlandski lětni čas", "CST": "sewjeroameriski centralny standardny čas", "NZST": "nowoseelandski standardny čas", "ACDT": "srjedźoawstralski lětni čas", "PDT": "sewjeroameriski pacifiski lětni čas", "AWST": "zapadoawstralski standardny čas", "SGT": "Singapurski čas", "WAT": "zapadoafriski standardny čas", "HKT": "Hongkongski standardny čas", "WARST": "zapadoargentinski lětni čas", "AWDT": "zapadoawstralski lětni čas", "MEZ": "srjedźoeuropski standardny čas", "CHADT": "chathamski lětni čas", "AST": "atlantiski standardny čas", "HNT": "nowofundlandski standardny čas", "EAT": "wuchodoafriski čas", "ARST": "argentinski lětni čas", "JST": "japanski standardny čas", "WEZ": "zapadoeuropski standardny čas", "BT": "bhutanski čas", "HKST": "Hongkongski lětni čas", "MDT": "MDT"},
+ timezones: map[string]string{"MYT": "malajziski čas", "CHADT": "chathamski lětni čas", "BOT": "boliwiski čas", "WESZ": "zapadoeuropski lětni čas", "WAT": "zapadoafriski standardny čas", "COT": "kolumbiski standardny čas", "AEDT": "wuchodoawstralski lětni čas", "GYT": "guyanski čas", "MST": "sewjeroameriski hórski standardny čas", "AKDT": "alaskaski lětni čas", "ARST": "argentinski lětni čas", "JDT": "japanski lětni čas", "OESZ": "wuchodoeuropski lětni čas", "MDT": "sewjeroameriski hórski lětni čas", "CLST": "chilski lětni čas", "CST": "sewjeroameriski centralny standardny čas", "WART": "zapadoargentinski standardny čas", "EAT": "wuchodoafriski čas", "CHAST": "chathamski standardny čas", "ECT": "ekwadorski čas", "HNT": "nowofundlandski standardny čas", "COST": "kolumbiski lětni čas", "GMT": "Greenwichski čas", "LHDT": "lětni čas kupy Lord-Howe", "UYT": "uruguayski standardny čas", "SAST": "južnoafriski čas", "NZDT": "nowoseelandski lětni čas", "TMST": "turkmenski lětni čas", "WAST": "zapadoafriski lětni čas", "OEZ": "wuchodoeuropski standardny čas", "ChST": "chamorroski čas", "WARST": "zapadoargentinski lětni čas", "ADT": "atlantiski lětni čas", "MEZ": "srjedźoeuropski standardny čas", "NZST": "nowoseelandski standardny čas", "HAT": "nowofundlandski lětni čas", "BT": "bhutanski čas", "WIT": "wuchodoindoneski", "HKT": "Hongkongski standardny čas", "AST": "atlantiski standardny čas", "AWST": "zapadoawstralski standardny čas", "ART": "argentinski standardny čas", "ACWDT": "sjedźozapadny awstralski lětni čas", "JST": "japanski standardny čas", "CDT": "sewjeroameriski centralny lětni čas", "IST": "indiski čas", "PST": "sewjeroameriski pacifiski standardny čas", "MESZ": "srjedźoeuropski lětni čas", "HAST": "hawaiisko-aleutski standardny čas", "TMT": "turkmenski standardny čas", "UYST": "uruguayski lětni čas", "SRT": "surinamski čas", "EDT": "sewjeroameriski wuchodny lětni čas", "ACST": "srjedźoawstralski standardny čas", "GFT": "francoskoguyanski čas", "VET": "venezuelski čas", "AWDT": "zapadoawstralski lětni čas", "HADT": "hawaiisko-aleutski lětni čas", "CAT": "centralnoafriski čas", "LHST": "standardny čas kupy Lord-Howe", "AKST": "alaskaski standardny čas", "ACWST": "srjedźozapadny awstralski standardny čas", "WEZ": "zapadoeuropski standardny čas", "WIB": "zapadoindoneski čas", "AEST": "wuchodoawstralski standardny čas", "ACDT": "srjedźoawstralski lětni čas", "WITA": "srjedźoindoneski čas", "PDT": "sewjeroameriski pacifiski lětni čas", "HKST": "Hongkongski lětni čas", "EST": "sewjeroameriski wuchodny standardny čas", "SGT": "Singapurski čas", "CLT": "chilski standardny čas", "∅∅∅": "Brasiliski lětni čas"},
}
}
diff --git a/hsb_DE/hsb_DE_test.go b/hsb_DE/hsb_DE_test.go
new file mode 100644
index 00000000..3c92f276
--- /dev/null
+++ b/hsb_DE/hsb_DE_test.go
@@ -0,0 +1,1120 @@
+package hsb_DE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "hsb_DE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/hu/hu.go b/hu/hu.go
index 150531a5..4447d781 100644
--- a/hu/hu.go
+++ b/hu/hu.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"i. e.", "i. sz."},
erasNarrow: []string{"ie.", "isz."},
erasWide: []string{"időszámításunk előtt", "időszámításunk szerint"},
- timezones: map[string]string{"WITA": "közép-indonéziai idő", "∅∅∅": "amazóniai nyári idő", "GYT": "guyanai téli idő", "TMT": "türkmenisztáni téli idő", "WESZ": "nyugat-európai nyári idő", "COST": "kolumbiai nyári idő", "SAST": "dél-afrikai téli idő", "ChST": "chamorrói téli idő", "OESZ": "kelet-európai nyári idő", "MYT": "malajziai idő", "AKST": "alaszkai zónaidő", "BOT": "bolíviai téli idő", "ART": "argentínai téli idő", "NZDT": "új-zélandi nyári idő", "CLST": "chilei nyári idő", "HKST": "hongkongi nyári idő", "CAT": "közép-afrikai téli idő", "HADT": "hawaii-aleuti nyári idő", "WAT": "nyugat-afrikai téli idő", "ACST": "közép-ausztráliai téli idő", "MST": "Macaui zónaidő", "AWDT": "nyugat-ausztráliai nyári idő", "AEST": "kelet-ausztráliai téli idő", "OEZ": "kelet-európai téli idő", "JST": "japán téli idő", "ACWST": "közép-nyugat-ausztráliai téli idő", "CLT": "chilei téli idő", "WEZ": "nyugat-európai téli idő", "LHDT": "Lord Howe-szigeti nyári idő", "JDT": "japán nyári idő", "PST": "csendes-óceáni zónaidő", "UYST": "uruguayi nyári idő", "ACDT": "közép-ausztráliai nyári idő", "CHADT": "chathami nyári idő", "EAT": "kelet-afrikai téli idő", "MDT": "Macaui nyári idő", "SGT": "szingapúri téli idő", "HAST": "hawaii-aleuti téli idő", "HKT": "hongkongi téli idő", "GMT": "greenwichi középidő, téli idő", "LHST": "Lord Howe-szigeti téli idő", "EST": "keleti államokbeli zónaidő", "BT": "butáni idő", "UYT": "uruguayi téli idő", "CDT": "középső államokbeli nyári idő", "EDT": "keleti államokbeli nyári idő", "WAST": "nyugat-afrikai nyári idő", "PDT": "csendes-óceáni nyári idő", "VET": "venezuelai idő", "AST": "atlanti-óceáni zónaidő", "WARST": "nyugat-argentínai nyári idő", "HAT": "új-fundlandi nyári idő", "WIT": "kelet-indonéziai idő", "MESZ": "közép-európai nyári idő", "WART": "nyugat-argentínai téli idő", "ARST": "Argentínai nyári idő", "TMST": "türkmenisztáni nyári idő", "COT": "kolumbiai téli idő", "ADT": "atlanti-óceáni nyári idő", "AEDT": "kelet-ausztráliai nyári idő", "ACWDT": "közép-nyugat-ausztráliai nyári idő", "ECT": "ecuadori téli idő", "HNT": "új-fundlandi zónaidő", "GFT": "francia-guianai idő", "AWST": "nyugat-ausztráliai téli idő", "NZST": "új-zélandi téli idő", "CST": "középső államokbeli zónaidő", "MEZ": "közép-európai téli idő", "CHAST": "chathami téli idő", "WIB": "nyugat-indonéziai téli idő", "IST": "indiai téli idő", "SRT": "szurinámi idő", "AKDT": "alaszkai nyári idő"},
+ timezones: map[string]string{"CST": "középső államokbeli zónaidő", "ECT": "ecuadori téli idő", "HADT": "hawaii-aleuti nyári idő", "OEZ": "kelet-európai téli idő", "ACDT": "közép-ausztráliai nyári idő", "BOT": "bolíviai téli idő", "COT": "kolumbiai téli idő", "HNT": "új-fundlandi zónaidő", "WIB": "nyugat-indonéziai téli idő", "EAT": "kelet-afrikai téli idő", "SRT": "szurinámi idő", "UYT": "uruguayi téli idő", "∅∅∅": "azori nyári idő", "CHADT": "chathami nyári idő", "AWST": "nyugat-ausztráliai téli idő", "MESZ": "közép-európai nyári idő", "ACST": "közép-ausztráliai téli idő", "WITA": "közép-indonéziai idő", "HAST": "hawaii-aleuti téli idő", "PDT": "csendes-óceáni nyári idő", "JDT": "japán nyári idő", "AEDT": "kelet-ausztráliai nyári idő", "MST": "Macaui zónaidő", "IST": "indiai téli idő", "GYT": "guyanai téli idő", "UYST": "uruguayi nyári idő", "MDT": "Macaui nyári idő", "TMST": "türkmenisztáni nyári idő", "HAT": "új-fundlandi nyári idő", "WAT": "nyugat-afrikai téli idő", "WESZ": "nyugat-európai nyári idő", "OESZ": "kelet-európai nyári idő", "ChST": "chamorrói téli idő", "CLST": "chilei nyári idő", "JST": "japán téli idő", "AWDT": "nyugat-ausztráliai nyári idő", "COST": "kolumbiai nyári idő", "WIT": "kelet-indonéziai idő", "MYT": "malajziai idő", "WARST": "nyugat-argentínai nyári idő", "LHDT": "Lord Howe-szigeti nyári idő", "ARST": "Argentínai nyári idő", "SAST": "dél-afrikai téli idő", "CLT": "chilei téli idő", "ART": "argentínai téli idő", "CDT": "középső államokbeli nyári idő", "ACWST": "közép-nyugat-ausztráliai téli idő", "SGT": "szingapúri téli idő", "AEST": "kelet-ausztráliai téli idő", "HKT": "hongkongi téli idő", "HKST": "hongkongi nyári idő", "AKST": "alaszkai zónaidő", "GMT": "greenwichi középidő, téli idő", "WEZ": "nyugat-európai téli idő", "LHST": "Lord Howe-szigeti téli idő", "WART": "nyugat-argentínai téli idő", "CHAST": "chathami téli idő", "ACWDT": "közép-nyugat-ausztráliai nyári idő", "EDT": "keleti államokbeli nyári idő", "EST": "keleti államokbeli zónaidő", "PST": "csendes-óceáni zónaidő", "MEZ": "közép-európai téli idő", "CAT": "közép-afrikai téli idő", "GFT": "francia-guianai idő", "AST": "atlanti-óceáni zónaidő", "ADT": "atlanti-óceáni nyári idő", "NZDT": "új-zélandi nyári idő", "TMT": "türkmenisztáni téli idő", "WAST": "nyugat-afrikai nyári idő", "BT": "butáni idő", "VET": "venezuelai idő", "AKDT": "alaszkai nyári idő", "NZST": "új-zélandi téli idő"},
}
}
diff --git a/hu/hu_test.go b/hu/hu_test.go
new file mode 100644
index 00000000..74090674
--- /dev/null
+++ b/hu/hu_test.go
@@ -0,0 +1,1120 @@
+package hu
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "hu"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/hu_HU/hu_HU.go b/hu_HU/hu_HU.go
index f81ba010..28bfe504 100644
--- a/hu_HU/hu_HU.go
+++ b/hu_HU/hu_HU.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"i. e.", "i. sz."},
erasNarrow: []string{"ie.", "isz."},
erasWide: []string{"időszámításunk előtt", "időszámításunk szerint"},
- timezones: map[string]string{"OEZ": "kelet-európai téli idő", "GFT": "francia-guianai idő", "MST": "Macaui zónaidő", "SRT": "szurinámi idő", "PST": "csendes-óceáni zónaidő", "LHST": "Lord Howe-szigeti téli idő", "MEZ": "közép-európai téli idő", "WEZ": "nyugat-európai téli idő", "COT": "kolumbiai téli idő", "ARST": "Argentínai nyári idő", "EAT": "kelet-afrikai téli idő", "AWST": "nyugat-ausztráliai téli idő", "AEDT": "kelet-ausztráliai nyári idő", "WARST": "nyugat-argentínai nyári idő", "WITA": "közép-indonéziai idő", "ART": "argentínai téli idő", "CLT": "chilei téli idő", "CHAST": "chathami téli idő", "EDT": "keleti államokbeli nyári idő", "WAT": "nyugat-afrikai téli idő", "IST": "indiai téli idő", "AKDT": "alaszkai nyári idő", "HKST": "hongkongi nyári idő", "WIT": "kelet-indonéziai idő", "AWDT": "nyugat-ausztráliai nyári idő", "UYST": "uruguayi nyári idő", "NZST": "új-zélandi téli idő", "UYT": "uruguayi téli idő", "WESZ": "nyugat-európai nyári idő", "BT": "butáni idő", "WIB": "nyugat-indonéziai téli idő", "GMT": "greenwichi középidő, téli idő", "PDT": "csendes-óceáni nyári idő", "ACWST": "közép-nyugat-ausztráliai téli idő", "ChST": "chamorrói téli idő", "TMST": "türkmenisztáni nyári idő", "NZDT": "új-zélandi nyári idő", "ACST": "közép-ausztráliai téli idő", "AKST": "alaszkai zónaidő", "HAST": "hawaii-aleuti téli idő", "HAT": "új-fundlandi nyári idő", "TMT": "türkmenisztáni téli idő", "CHADT": "chathami nyári idő", "COST": "kolumbiai nyári idő", "ADT": "atlanti-óceáni nyári idő", "WART": "nyugat-argentínai téli idő", "JST": "japán téli idő", "JDT": "japán nyári idő", "CLST": "chilei nyári idő", "ECT": "ecuadori téli idő", "HADT": "hawaii-aleuti nyári idő", "ACDT": "közép-ausztráliai nyári idő", "MYT": "malajziai idő", "MESZ": "közép-európai nyári idő", "CAT": "közép-afrikai téli idő", "SGT": "szingapúri téli idő", "WAST": "nyugat-afrikai nyári idő", "HNT": "új-fundlandi zónaidő", "CDT": "középső államokbeli nyári idő", "VET": "venezuelai idő", "ACWDT": "közép-nyugat-ausztráliai nyári idő", "AEST": "kelet-ausztráliai téli idő", "HKT": "hongkongi téli idő", "OESZ": "kelet-európai nyári idő", "MDT": "Macaui nyári idő", "LHDT": "Lord Howe-szigeti nyári idő", "GYT": "guyanai téli idő", "CST": "középső államokbeli zónaidő", "BOT": "bolíviai téli idő", "EST": "keleti államokbeli zónaidő", "AST": "atlanti-óceáni zónaidő", "∅∅∅": "amazóniai nyári idő", "SAST": "dél-afrikai téli idő"},
+ timezones: map[string]string{"AKST": "alaszkai zónaidő", "MESZ": "közép-európai nyári idő", "BT": "butáni idő", "IST": "indiai téli idő", "TMT": "türkmenisztáni téli idő", "WAT": "nyugat-afrikai téli idő", "SRT": "szurinámi idő", "AWDT": "nyugat-ausztráliai nyári idő", "AEST": "kelet-ausztráliai téli idő", "MDT": "hegyvidéki nyári idő", "CDT": "középső államokbeli nyári idő", "ACST": "közép-ausztráliai téli idő", "HKT": "hongkongi téli idő", "VET": "venezuelai idő", "PST": "csendes-óceáni zónaidő", "WESZ": "nyugat-európai nyári idő", "OEZ": "kelet-európai téli idő", "WARST": "nyugat-argentínai nyári idő", "ARST": "Argentínai nyári idő", "MEZ": "közép-európai téli idő", "HADT": "hawaii-aleuti nyári idő", "WAST": "nyugat-afrikai nyári idő", "UYT": "uruguayi téli idő", "CHAST": "chathami téli idő", "ADT": "atlanti-óceáni nyári idő", "∅∅∅": "amazóniai nyári idő", "LHST": "Lord Howe-szigeti téli idő", "MYT": "malajziai idő", "CST": "középső államokbeli zónaidő", "AKDT": "alaszkai nyári idő", "AWST": "nyugat-ausztráliai téli idő", "HAST": "hawaii-aleuti téli idő", "ACDT": "közép-ausztráliai nyári idő", "LHDT": "Lord Howe-szigeti nyári idő", "GFT": "francia-guianai idő", "JST": "japán téli idő", "BOT": "bolíviai téli idő", "NZST": "új-zélandi téli idő", "NZDT": "új-zélandi nyári idő", "SGT": "szingapúri téli idő", "COT": "kolumbiai téli idő", "WIB": "nyugat-indonéziai téli idő", "AST": "atlanti-óceáni zónaidő", "ACWST": "közép-nyugat-ausztráliai téli idő", "ACWDT": "közép-nyugat-ausztráliai nyári idő", "JDT": "japán nyári idő", "SAST": "dél-afrikai téli idő", "TMST": "türkmenisztáni nyári idő", "ChST": "chamorrói téli idő", "CHADT": "chathami nyári idő", "ART": "argentínai téli idő", "EST": "keleti államokbeli zónaidő", "EDT": "keleti államokbeli nyári idő", "CAT": "közép-afrikai téli idő", "HAT": "új-fundlandi nyári idő", "EAT": "kelet-afrikai téli idő", "HKST": "hongkongi nyári idő", "GMT": "greenwichi középidő, téli idő", "GYT": "guyanai téli idő", "CLST": "chilei nyári idő", "WITA": "közép-indonéziai idő", "CLT": "chilei téli idő", "ECT": "ecuadori téli idő", "OESZ": "kelet-európai nyári idő", "AEDT": "kelet-ausztráliai nyári idő", "MST": "hegyvidéki zónaidő", "UYST": "uruguayi nyári idő", "PDT": "csendes-óceáni nyári idő", "WEZ": "nyugat-európai téli idő", "HNT": "új-fundlandi zónaidő", "COST": "kolumbiai nyári idő", "WIT": "kelet-indonéziai idő", "WART": "nyugat-argentínai téli idő"},
}
}
diff --git a/hu_HU/hu_HU_test.go b/hu_HU/hu_HU_test.go
new file mode 100644
index 00000000..c05d3724
--- /dev/null
+++ b/hu_HU/hu_HU_test.go
@@ -0,0 +1,1120 @@
+package hu_HU
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "hu_HU"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/hy/hy.go b/hy/hy.go
index 8488f4fd..0a74d92e 100644
--- a/hy/hy.go
+++ b/hy/hy.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"", ""},
erasNarrow: []string{"", ""},
erasWide: []string{"մ.թ.ա.", "մ.թ."},
- timezones: map[string]string{"BT": "Բութանի ժամանակ", "IST": "Հնդկաստանի ստանդարտ ժամանակ", "MDT": "MDT", "SAST": "Հարավաֆրիկյան ժամանակ", "ARST": "Արգենտինայի ամառային ժամանակ", "WEZ": "Արևմտյան Եվրոպայի ստանդարտ ժամանակ", "WAST": "Արևմտաաֆրիկյան ամառային ժամանակ", "JDT": "Ճապոնիայի ամառային ժամանակ", "SGT": "Սինգապուրի ժամանակ", "HKST": "Հոնկոնգի ամառային ժամանակ", "WAT": "Արևմտաաֆրիկյան ստանդարտ ժամանակ", "GYT": "Գայանայի ժամանակ", "CDT": "Կենտրոնական Ամերիկայի ամառային ժամանակ", "WIB": "Արևմտյան Ինդոնեզիայի ժամանակ", "AWST": "Արևմտաավստրալիական ստանդարտ ժամանակ", "CST": "Կենտրոնական Ամերիկայի ստանդարտ ժամանակ", "AKST": "Ալյասկայի ստանդարտ ժամանակ", "AEDT": "Արևելաավստրալիական ամառային ժամանակ", "CHAST": "Չաթեմ կղզու ստանդարտ ժամանակ", "HAST": "Հավայան-ալեուտյան ստանդարտ ժամանակ", "ACST": "Կենտրոնաավստրալիական ստանդարտ ժամանակ", "MST": "MST", "LHST": "Լորդ Հաուի ստանդարտ ժամանակ", "JST": "Ճապոնիայի ստանդարտ ժամանակ", "HKT": "Հոնկոնգի ստանդարտ ժամանակ", "GMT": "Գրինվիչի ժամանակ", "HAT": "Նյուֆաունդլենդի ամառային ժամանակ", "ADT": "Ատլանտյան ամառային ժամանակ", "CAT": "Կենտրոնաաֆրիկյան ժամանակ", "AST": "Ատլանտյան ստանդարտ ժամանակ", "OEZ": "Արևելյան Եվրոպայի ստանդարտ ժամանակ", "MYT": "Մալայզիայի ժամանակ", "PST": "Խաղաղօվկիանոսային ստանդարտ ժամանակ (Հյուսիսային Ամերիկա)", "PDT": "Խաղաղօվկիանոսային ամառային ժամանակ (Հյուսիսային Ամերիկա)", "SRT": "Սուրինամի ժամանակ", "BOT": "Բոլիվիայի ժամանակ", "ChST": "Չամորոյի ժամանակ", "ACWDT": "Կենտրոնաավստրալիական արևմտյան ամառային ժամանակ", "ACWST": "Կենտրոնաավստրալիական արևմտյան ստանդարտ ժամանակ", "HNT": "Նյուֆաունդլենդի ստանդարտ ժամանակ", "ART": "Արգենտինայի ստնադարտ ժամանակ", "MESZ": "Կենտրոնական Եվրոպայի ամառային ժամանակ", "CLT": "Չիլիի ստանդարտ ժամանակ", "COT": "Կոլումբիայի ստանդարտ ժամանակ", "GFT": "Ֆրանսիական Գվիանայի ժամանակ", "∅∅∅": "Ամազոնյան ամառային ժամանակ", "CHADT": "Չաթեմ կղզու ամառային ժամանակ", "WESZ": "Արևմտյան Եվրոպայի ամառային ժամանակ", "EAT": "Արևելաաֆրիկյան ժամանակ", "EST": "Արևելյան Ամերիկայի ստանդարտ ժամանակ", "EDT": "Արևելյան Ամերիկայի ամառային ժամանակ", "AEST": "Արևելաավստրալիական ստանդարտ ժամանակ", "CLST": "Չիլիի ամառային ժամանակ", "WARST": "Արևմտյան Արգենտինայի ամառային ժամանակ", "OESZ": "Արևելյան Եվրոպայի ամառային ժամանակ", "ACDT": "Կենտրոնաավստրալիական ամառային ժամանակ", "TMT": "Թուրքմենստանի ստանդարտ ժամանակ", "ECT": "Էկվադորի ժամանակ", "HADT": "Հավայան-ալեուտյան ամառային ժամանակ", "WITA": "Կենտրոնական Ինդոնեզիայի ժամանակ", "LHDT": "Լորդ Հաուի ամառային ժամանակ", "UYT": "Ուրուգվայի ստանդարտ ժամանակ", "MEZ": "Կենտրոնական Եվրոպայի ստանդարտ ժամանակ", "UYST": "Ուրուգվայի ամառային ժամանակ", "VET": "Վենեսուելայի ժամանակ", "WART": "Արևմտյան Արգենտինայի ստնադարտ ժամանակ", "WIT": "Արևելյան Ինդոնեզիայի ժամանակ", "AWDT": "Արևմտաավստրալիական ամառային ժամանակ", "AKDT": "Ալյասկայի ամառային ժամանակ", "TMST": "Թուրքմենստանի ամառային ժամանակ", "NZST": "Նոր Զելանդիայի ստանդարտ ժամանակ", "NZDT": "Նոր Զելանդիայի ամառային ժամանակ", "COST": "Կոլումբիայի ամառային ժամանակ"},
+ timezones: map[string]string{"TMST": "Թուրքմենստանի ամառային ժամանակ", "CLT": "Չիլիի ստանդարտ ժամանակ", "ECT": "Էկվադորի ժամանակ", "WITA": "Կենտրոնական Ինդոնեզիայի ժամանակ", "COT": "Կոլումբիայի ստանդարտ ժամանակ", "EAT": "Արևելաաֆրիկյան ժամանակ", "SGT": "Սինգապուրի ժամանակ", "WIB": "Արևմտյան Ինդոնեզիայի ժամանակ", "OEZ": "Արևելյան Եվրոպայի ստանդարտ ժամանակ", "GMT": "Գրինվիչի ժամանակ", "LHST": "Լորդ Հաուի ստանդարտ ժամանակ", "LHDT": "Լորդ Հաուի ամառային ժամանակ", "CST": "Կենտրոնական Ամերիկայի ստանդարտ ժամանակ", "WART": "Արևմտյան Արգենտինայի ստնադարտ ժամանակ", "PDT": "Խաղաղօվկիանոսային ամառային ժամանակ (Հյուսիսային Ամերիկա)", "CAT": "Կենտրոնաաֆրիկյան ժամանակ", "GFT": "Ֆրանսիական Գվիանայի ժամանակ", "ChST": "Չամորոյի ժամանակ", "UYST": "Ուրուգվայի ամառային ժամանակ", "NZST": "Նոր Զելանդիայի ստանդարտ ժամանակ", "WESZ": "Արևմտյան Եվրոպայի ամառային ժամանակ", "HAT": "Նյուֆաունդլենդի ամառային ժամանակ", "AEST": "Արևելաավստրալիական ստանդարտ ժամանակ", "SRT": "Սուրինամի ժամանակ", "ART": "Արգենտինայի ստնադարտ ժամանակ", "ARST": "Արգենտինայի ամառային ժամանակ", "EDT": "Արևելյան Ամերիկայի ամառային ժամանակ", "MST": "Լեռնային ստանդարտ ժամանակ (Հյուսիսային Ամերիկա)", "ACDT": "Կենտրոնաավստրալիական ամառային ժամանակ", "CDT": "Կենտրոնական Ամերիկայի ամառային ժամանակ", "ACST": "Կենտրոնաավստրալիական ստանդարտ ժամանակ", "AWST": "Արևմտաավստրալիական ստանդարտ ժամանակ", "EST": "Արևելյան Ամերիկայի ստանդարտ ժամանակ", "∅∅∅": "Ամազոնյան ամառային ժամանակ", "COST": "Կոլումբիայի ամառային ժամանակ", "WAT": "Արևմտաաֆրիկյան ստանդարտ ժամանակ", "WEZ": "Արևմտյան Եվրոպայի ստանդարտ ժամանակ", "AKDT": "Ալյասկայի ամառային ժամանակ", "ACWDT": "Կենտրոնաավստրալիական արևմտյան ամառային ժամանակ", "WIT": "Արևելյան Ինդոնեզիայի ժամանակ", "BOT": "Բոլիվիայի ժամանակ", "AEDT": "Արևելաավստրալիական ամառային ժամանակ", "HAST": "Հավայան-ալեուտյան ստանդարտ ժամանակ", "HADT": "Հավայան-ալեուտյան ամառային ժամանակ", "HKT": "Հոնկոնգի ստանդարտ ժամանակ", "PST": "Խաղաղօվկիանոսային ստանդարտ ժամանակ (Հյուսիսային Ամերիկա)", "HNT": "Նյուֆաունդլենդի ստանդարտ ժամանակ", "WAST": "Արևմտաաֆրիկյան ամառային ժամանակ", "MYT": "Մալայզիայի ժամանակ", "MDT": "Լեռնային ամառային ժամանակ (Հյուսիսային Ամերիկա)", "MEZ": "Կենտրոնական Եվրոպայի ստանդարտ ժամանակ", "SAST": "Հարավաֆրիկյան ժամանակ", "AKST": "Ալյասկայի ստանդարտ ժամանակ", "MESZ": "Կենտրոնական Եվրոպայի ամառային ժամանակ", "UYT": "Ուրուգվայի ստանդարտ ժամանակ", "BT": "Բութանի ժամանակ", "JST": "Ճապոնիայի ստանդարտ ժամանակ", "JDT": "Ճապոնիայի ամառային ժամանակ", "IST": "Հնդկաստանի ստանդարտ ժամանակ", "HKST": "Հոնկոնգի ամառային ժամանակ", "CHAST": "Չաթեմ կղզու ստանդարտ ժամանակ", "AST": "Ատլանտյան ստանդարտ ժամանակ", "AWDT": "Արևմտաավստրալիական ամառային ժամանակ", "CLST": "Չիլիի ամառային ժամանակ", "GYT": "Գայանայի ժամանակ", "WARST": "Արևմտյան Արգենտինայի ամառային ժամանակ", "VET": "Վենեսուելայի ժամանակ", "CHADT": "Չաթեմ կղզու ամառային ժամանակ", "ADT": "Ատլանտյան ամառային ժամանակ", "TMT": "Թուրքմենստանի ստանդարտ ժամանակ", "OESZ": "Արևելյան Եվրոպայի ամառային ժամանակ", "ACWST": "Կենտրոնաավստրալիական արևմտյան ստանդարտ ժամանակ", "NZDT": "Նոր Զելանդիայի ամառային ժամանակ"},
}
}
diff --git a/hy/hy_test.go b/hy/hy_test.go
new file mode 100644
index 00000000..9ffe5b85
--- /dev/null
+++ b/hy/hy_test.go
@@ -0,0 +1,1120 @@
+package hy
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "hy"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/hy_AM/hy_AM.go b/hy_AM/hy_AM.go
index f37324d3..fa30c140 100644
--- a/hy_AM/hy_AM.go
+++ b/hy_AM/hy_AM.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"", ""},
erasNarrow: []string{"", ""},
erasWide: []string{"մ.թ.ա.", "մ.թ."},
- timezones: map[string]string{"LHST": "Լորդ Հաուի ստանդարտ ժամանակ", "MESZ": "Կենտրոնական Եվրոպայի ամառային ժամանակ", "UYST": "Ուրուգվայի ամառային ժամանակ", "HADT": "Հավայան-ալեուտյան ամառային ժամանակ", "WAST": "Արևմտաաֆրիկյան ամառային ժամանակ", "OESZ": "Արևելյան Եվրոպայի ամառային ժամանակ", "HAST": "Հավայան-ալեուտյան ստանդարտ ժամանակ", "TMT": "Թուրքմենստանի ստանդարտ ժամանակ", "COST": "Կոլումբիայի ամառային ժամանակ", "JST": "Ճապոնիայի ստանդարտ ժամանակ", "NZST": "Նոր Զելանդիայի ստանդարտ ժամանակ", "NZDT": "Նոր Զելանդիայի ամառային ժամանակ", "WESZ": "Արևմտյան Եվրոպայի ամառային ժամանակ", "EDT": "Արևելյան Ամերիկայի ամառային ժամանակ", "SGT": "Սինգապուրի ժամանակ", "AKDT": "Ալյասկայի ամառային ժամանակ", "LHDT": "Լորդ Հաուի ամառային ժամանակ", "GYT": "Գայանայի ժամանակ", "AEST": "Արևելաավստրալիական ստանդարտ ժամանակ", "GMT": "Գրինվիչի ժամանակ", "ACDT": "Կենտրոնաավստրալիական ամառային ժամանակ", "∅∅∅": "Ազորյան կղզիների ամառային ժամանակ", "CHAST": "Չաթեմ կղզու ստանդարտ ժամանակ", "WIT": "Արևելյան Ինդոնեզիայի ժամանակ", "TMST": "Թուրքմենստանի ամառային ժամանակ", "AWDT": "Արևմտաավստրալիական ամառային ժամանակ", "ACWST": "Կենտրոնաավստրալիական արևմտյան ստանդարտ ժամանակ", "CHADT": "Չաթեմ կղզու ամառային ժամանակ", "SAST": "Հարավաֆրիկյան ժամանակ", "WARST": "Արևմտյան Արգենտինայի ամառային ժամանակ", "ART": "Արգենտինայի ստնադարտ ժամանակ", "MYT": "Մալայզիայի ժամանակ", "WAT": "Արևմտաաֆրիկյան ստանդարտ ժամանակ", "JDT": "Ճապոնիայի ամառային ժամանակ", "AWST": "Արևմտաավստրալիական ստանդարտ ժամանակ", "VET": "Վենեսուելայի ժամանակ", "EST": "Արևելյան Ամերիկայի ստանդարտ ժամանակ", "BT": "Բութանի ժամանակ", "EAT": "Արևելաաֆրիկյան ժամանակ", "MST": "Լեռնային ստանդարտ ժամանակ (Հյուսիսային Ամերիկա)", "COT": "Կոլումբիայի ստանդարտ ժամանակ", "CST": "Կենտրոնական Ամերիկայի ստանդարտ ժամանակ", "AEDT": "Արևելաավստրալիական ամառային ժամանակ", "WIB": "Արևմտյան Ինդոնեզիայի ժամանակ", "HNT": "Նյուֆաունդլենդի ստանդարտ ժամանակ", "CDT": "Կենտրոնական Ամերիկայի ամառային ժամանակ", "CLST": "Չիլիի ամառային ժամանակ", "ACWDT": "Կենտրոնաավստրալիական արևմտյան ամառային ժամանակ", "CAT": "Կենտրոնաաֆրիկյան ժամանակ", "WART": "Արևմտյան Արգենտինայի ստնադարտ ժամանակ", "ARST": "Արգենտինայի ամառային ժամանակ", "IST": "Հնդկաստանի ստանդարտ ժամանակ", "ACST": "Կենտրոնաավստրալիական ստանդարտ ժամանակ", "SRT": "Սուրինամի ժամանակ", "AKST": "Ալյասկայի ստանդարտ ժամանակ", "PST": "Խաղաղօվկիանոսային ստանդարտ ժամանակ (Հյուսիսային Ամերիկա)", "BOT": "Բոլիվիայի ժամանակ", "WEZ": "Արևմտյան Եվրոպայի ստանդարտ ժամանակ", "HKST": "Հոնկոնգի ամառային ժամանակ", "PDT": "Խաղաղօվկիանոսային ամառային ժամանակ (Հյուսիսային Ամերիկա)", "CLT": "Չիլիի ստանդարտ ժամանակ", "WITA": "Կենտրոնական Ինդոնեզիայի ժամանակ", "MEZ": "Կենտրոնական Եվրոպայի ստանդարտ ժամանակ", "ChST": "Չամորոյի ժամանակ", "MDT": "Լեռնային ամառային ժամանակ (Հյուսիսային Ամերիկա)", "AST": "Ատլանտյան ստանդարտ ժամանակ", "HKT": "Հոնկոնգի ստանդարտ ժամանակ", "UYT": "Ուրուգվայի ստանդարտ ժամանակ", "ECT": "Էկվադորի ժամանակ", "ADT": "Ատլանտյան ամառային ժամանակ", "OEZ": "Արևելյան Եվրոպայի ստանդարտ ժամանակ", "HAT": "Նյուֆաունդլենդի ամառային ժամանակ", "GFT": "Ֆրանսիական Գվիանայի ժամանակ"},
+ timezones: map[string]string{"COST": "Կոլումբիայի ամառային ժամանակ", "ChST": "Չամորոյի ժամանակ", "LHDT": "Լորդ Հաուի ամառային ժամանակ", "CDT": "Կենտրոնական Ամերիկայի ամառային ժամանակ", "CHADT": "Չաթեմ կղզու ամառային ժամանակ", "HADT": "Հավայան-ալեուտյան ամառային ժամանակ", "NZDT": "Նոր Զելանդիայի ամառային ժամանակ", "OEZ": "Արևելյան Եվրոպայի ստանդարտ ժամանակ", "WART": "Արևմտյան Արգենտինայի ստնադարտ ժամանակ", "GFT": "Ֆրանսիական Գվիանայի ժամանակ", "CHAST": "Չաթեմ կղզու ստանդարտ ժամանակ", "AWDT": "Արևմտաավստրալիական ամառային ժամանակ", "LHST": "Լորդ Հաուի ստանդարտ ժամանակ", "UYST": "Ուրուգվայի ամառային ժամանակ", "AWST": "Արևմտաավստրալիական ստանդարտ ժամանակ", "HAT": "Նյուֆաունդլենդի ամառային ժամանակ", "UYT": "Ուրուգվայի ստանդարտ ժամանակ", "WITA": "Կենտրոնական Ինդոնեզիայի ժամանակ", "WIT": "Արևելյան Ինդոնեզիայի ժամանակ", "EAT": "Արևելաաֆրիկյան ժամանակ", "MST": "Լեռնային ստանդարտ ժամանակ (Հյուսիսային Ամերիկա)", "VET": "Վենեսուելայի ժամանակ", "AEDT": "Արևելաավստրալիական ամառային ժամանակ", "BT": "Բութանի ժամանակ", "MDT": "Լեռնային ամառային ժամանակ (Հյուսիսային Ամերիկա)", "CLT": "Չիլիի ստանդարտ ժամանակ", "WARST": "Արևմտյան Արգենտինայի ամառային ժամանակ", "COT": "Կոլումբիայի ստանդարտ ժամանակ", "WESZ": "Արևմտյան Եվրոպայի ամառային ժամանակ", "SAST": "Հարավաֆրիկյան ժամանակ", "ARST": "Արգենտինայի ամառային ժամանակ", "WEZ": "Արևմտյան Եվրոպայի ստանդարտ ժամանակ", "SRT": "Սուրինամի ժամանակ", "HKST": "Հոնկոնգի ամառային ժամանակ", "ART": "Արգենտինայի ստնադարտ ժամանակ", "IST": "Հնդկաստանի ստանդարտ ժամանակ", "WIB": "Արևմտյան Ինդոնեզիայի ժամանակ", "CLST": "Չիլիի ամառային ժամանակ", "ACDT": "Կենտրոնաավստրալիական ամառային ժամանակ", "ECT": "Էկվադորի ժամանակ", "JDT": "Ճապոնիայի ամառային ժամանակ", "PDT": "Խաղաղօվկիանոսային ամառային ժամանակ (Հյուսիսային Ամերիկա)", "HAST": "Հավայան-ալեուտյան ստանդարտ ժամանակ", "CAT": "Կենտրոնաաֆրիկյան ժամանակ", "GMT": "Գրինվիչի ժամանակ", "PST": "Խաղաղօվկիանոսային ստանդարտ ժամանակ (Հյուսիսային Ամերիկա)", "MESZ": "Կենտրոնական Եվրոպայի ամառային ժամանակ", "TMT": "Թուրքմենստանի ստանդարտ ժամանակ", "WAT": "Արևմտաաֆրիկյան ստանդարտ ժամանակ", "WAST": "Արևմտաաֆրիկյան ամառային ժամանակ", "HNT": "Նյուֆաունդլենդի ստանդարտ ժամանակ", "OESZ": "Արևելյան Եվրոպայի ամառային ժամանակ", "EDT": "Արևելյան Ամերիկայի ամառային ժամանակ", "JST": "Ճապոնիայի ստանդարտ ժամանակ", "AEST": "Արևելաավստրալիական ստանդարտ ժամանակ", "GYT": "Գայանայի ժամանակ", "CST": "Կենտրոնական Ամերիկայի ստանդարտ ժամանակ", "ACST": "Կենտրոնաավստրալիական ստանդարտ ժամանակ", "ACWDT": "Կենտրոնաավստրալիական արևմտյան ամառային ժամանակ", "EST": "Արևելյան Ամերիկայի ստանդարտ ժամանակ", "MEZ": "Կենտրոնական Եվրոպայի ստանդարտ ժամանակ", "MYT": "Մալայզիայի ժամանակ", "HKT": "Հոնկոնգի ստանդարտ ժամանակ", "AST": "Ատլանտյան ստանդարտ ժամանակ", "ADT": "Ատլանտյան ամառային ժամանակ", "SGT": "Սինգապուրի ժամանակ", "∅∅∅": "Ամազոնյան ամառային ժամանակ", "AKDT": "Ալյասկայի ամառային ժամանակ", "ACWST": "Կենտրոնաավստրալիական արևմտյան ստանդարտ ժամանակ", "BOT": "Բոլիվիայի ժամանակ", "NZST": "Նոր Զելանդիայի ստանդարտ ժամանակ", "TMST": "Թուրքմենստանի ամառային ժամանակ", "AKST": "Ալյասկայի ստանդարտ ժամանակ"},
}
}
diff --git a/hy_AM/hy_AM_test.go b/hy_AM/hy_AM_test.go
new file mode 100644
index 00000000..1ac24361
--- /dev/null
+++ b/hy_AM/hy_AM_test.go
@@ -0,0 +1,1120 @@
+package hy_AM
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "hy_AM"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/id/id.go b/id/id.go
index 0e799e0a..2f86dcfd 100644
--- a/id/id.go
+++ b/id/id.go
@@ -67,7 +67,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"SM", "M"},
erasNarrow: []string{"SM", "M"},
erasWide: []string{"Sebelum Masehi", "M"},
- timezones: map[string]string{"ACWST": "Waktu Standar Barat Tengah Australia", "HKT": "Waktu Standar Hong Kong", "HNT": "Waktu Standar Newfoundland", "PST": "Waktu Standar Pasifik", "CHAST": "Waktu Standar Chatham", "WAT": "Waktu Standar Afrika Barat", "AKST": "Waktu Standar Alaska", "AKDT": "Waktu Musim Panas Alaska", "CHADT": "Waktu Musim Panas Chatham", "COT": "Waktu Standar Kolombia", "∅∅∅": "Waktu Musim Panas Acre", "WIB": "Waktu Indonesia Barat", "TMST": "Waktu Musim Panas Turkmenistan", "JST": "Waktu Standar Jepang", "SRT": "Waktu Suriname", "ACWDT": "Waktu Musim Panas Barat Tengah Australia", "GYT": "Waktu Guyana", "NZDT": "Waktu Musim Panas Selandia Baru", "OEZ": "Waktu Standar Eropa Timur", "ACST": "Waktu Standar Tengah Australia", "TMT": "Waktu Standar Turkmenistan", "EAT": "Waktu Afrika Timur", "HKST": "Waktu Musim Panas Hong Kong", "AEST": "Waktu Standar Timur Australia", "WESZ": "Waktu Musim Panas Eropa Barat", "JDT": "Waktu Musim Panas Jepang", "UYST": "Waktu Musim Panas Uruguay", "CLT": "Waktu Standar Cile", "BT": "Waktu Bhutan", "WART": "Waktu Standar Argentina Bagian Barat", "ART": "Waktu Standar Argentina", "MYT": "Waktu Malaysia", "HADT": "Waktu Musim Panas Hawaii-Aleutian", "GFT": "Waktu Guyana Prancis", "ChST": "Waktu Chamorro", "AWDT": "Waktu Musim Panas Barat Australia", "CST": "Waktu Standar Tengah", "CLST": "Waktu Musim Panas Cile", "CAT": "Waktu Afrika Tengah", "AWST": "Waktu Standar Barat Australia", "CDT": "Waktu Musim Panas Tengah", "AEDT": "Waktu Musim Panas Timur Australia", "SGT": "Waktu Standar Singapura", "WARST": "Waktu Musim Panas Argentina Bagian Barat", "SAST": "Waktu Standar Afrika Selatan", "WITA": "Waktu Indonesia Tengah", "EDT": "Waktu Musim Panas Timur", "MESZ": "Waktu Musim Panas Eropa Tengah", "EST": "Waktu Standar Timur", "WAST": "Waktu Musim Panas Afrika Barat", "IST": "Waktu India", "OESZ": "Waktu Musim Panas Eropa Timur", "BOT": "Waktu Bolivia", "HAT": "Waktu Musim Panas Newfoundland", "NZST": "Waktu Standar Selandia Baru", "MEZ": "Waktu Standar Eropa Tengah", "WEZ": "Waktu Standar Eropa Barat", "VET": "Waktu Venezuela", "ECT": "Waktu Ekuador", "AST": "Waktu Standar Atlantik", "ARST": "Waktu Musim Panas Argentina", "MDT": "Waktu Musim Panas Makau", "PDT": "Waktu Musim Panas Pasifik", "COST": "Waktu Musim Panas Kolombia", "ACDT": "Waktu Musim Panas Tengah Australia", "MST": "Waktu Standar Makau", "LHDT": "Waktu Musim Panas Lord Howe", "UYT": "Waktu Standar Uruguay", "LHST": "Waktu Standar Lord Howe", "ADT": "Waktu Musim Panas Atlantik", "HAST": "Waktu Standar Hawaii-Aleutian", "GMT": "Waktu Rata-rata Greenwich", "WIT": "Waktu Indonesia Timur"},
+ timezones: map[string]string{"WARST": "Waktu Musim Panas Argentina Bagian Barat", "MDT": "Waktu Musim Panas Makau", "HKST": "Waktu Musim Panas Hong Kong", "PST": "Waktu Standar Pasifik", "HAST": "Waktu Standar Hawaii-Aleutian", "HADT": "Waktu Musim Panas Hawaii-Aleutian", "HAT": "Waktu Musim Panas Newfoundland", "AEDT": "Waktu Musim Panas Timur Australia", "CLST": "Waktu Musim Panas Cile", "ECT": "Waktu Ekuador", "JDT": "Waktu Musim Panas Jepang", "AST": "Waktu Standar Atlantik", "CST": "Waktu Standar Tengah", "UYT": "Waktu Standar Uruguay", "WIT": "Waktu Indonesia Timur", "MYT": "Waktu Malaysia", "OEZ": "Waktu Standar Eropa Timur", "AEST": "Waktu Standar Timur Australia", "WART": "Waktu Standar Argentina Bagian Barat", "ART": "Waktu Standar Argentina", "EDT": "Waktu Musim Panas Timur", "COST": "Waktu Musim Panas Kolombia", "CAT": "Waktu Afrika Tengah", "HNT": "Waktu Standar Newfoundland", "EAT": "Waktu Afrika Timur", "LHDT": "Waktu Musim Panas Lord Howe", "HKT": "Waktu Standar Hong Kong", "AWDT": "Waktu Musim Panas Barat Australia", "TMST": "Waktu Musim Panas Turkmenistan", "SGT": "Waktu Standar Singapura", "CDT": "Waktu Musim Panas Tengah", "CHADT": "Waktu Musim Panas Chatham", "MEZ": "Waktu Standar Eropa Tengah", "UYST": "Waktu Musim Panas Uruguay", "WAT": "Waktu Standar Afrika Barat", "ACWST": "Waktu Standar Barat Tengah Australia", "AWST": "Waktu Standar Barat Australia", "MESZ": "Waktu Musim Panas Eropa Tengah", "WITA": "Waktu Indonesia Tengah", "ChST": "Waktu Chamorro", "SRT": "Waktu Suriname", "GFT": "Waktu Guyana Prancis", "ACWDT": "Waktu Musim Panas Barat Tengah Australia", "COT": "Waktu Standar Kolombia", "GYT": "Waktu Guyana", "AKDT": "Waktu Musim Panas Alaska", "BOT": "Waktu Bolivia", "WEZ": "Waktu Standar Eropa Barat", "WIB": "Waktu Indonesia Barat", "WAST": "Waktu Musim Panas Afrika Barat", "AKST": "Waktu Standar Alaska", "NZST": "Waktu Standar Selandia Baru", "∅∅∅": "Waktu Musim Panas Amazon", "BT": "Waktu Bhutan", "CLT": "Waktu Standar Cile", "JST": "Waktu Standar Jepang", "TMT": "Waktu Standar Turkmenistan", "WESZ": "Waktu Musim Panas Eropa Barat", "ACST": "Waktu Standar Tengah Australia", "CHAST": "Waktu Standar Chatham", "NZDT": "Waktu Musim Panas Selandia Baru", "PDT": "Waktu Musim Panas Pasifik", "EST": "Waktu Standar Timur", "OESZ": "Waktu Musim Panas Eropa Timur", "GMT": "Waktu Rata-rata Greenwich", "ADT": "Waktu Musim Panas Atlantik", "ARST": "Waktu Musim Panas Argentina", "SAST": "Waktu Standar Afrika Selatan", "LHST": "Waktu Standar Lord Howe", "ACDT": "Waktu Musim Panas Tengah Australia", "MST": "Waktu Standar Makau", "VET": "Waktu Venezuela", "IST": "Waktu India"},
}
}
diff --git a/id/id_test.go b/id/id_test.go
new file mode 100644
index 00000000..97c4e4a4
--- /dev/null
+++ b/id/id_test.go
@@ -0,0 +1,1120 @@
+package id
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "id"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/id_ID/id_ID.go b/id_ID/id_ID.go
index 803417c6..5d163ccf 100644
--- a/id_ID/id_ID.go
+++ b/id_ID/id_ID.go
@@ -67,7 +67,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"SM", "M"},
erasNarrow: []string{"SM", "M"},
erasWide: []string{"Sebelum Masehi", "M"},
- timezones: map[string]string{"AWDT": "Waktu Musim Panas Barat Australia", "BOT": "Waktu Bolivia", "AEST": "Waktu Standar Timur Australia", "GYT": "Waktu Guyana", "MEZ": "Waktu Standar Eropa Tengah", "EDT": "Waktu Musim Panas Timur", "ECT": "Waktu Ekuador", "EST": "Waktu Standar Timur", "BT": "Waktu Bhutan", "WIB": "Waktu Indonesia Barat", "PDT": "Waktu Musim Panas Pasifik", "UYT": "Waktu Standar Uruguay", "CLST": "Waktu Musim Panas Cile", "ACWST": "Waktu Standar Barat Tengah Australia", "WAT": "Waktu Standar Afrika Barat", "MESZ": "Waktu Musim Panas Eropa Tengah", "ACWDT": "Waktu Musim Panas Barat Tengah Australia", "AST": "Waktu Standar Atlantik", "IST": "Waktu India", "WITA": "Waktu Indonesia Tengah", "LHDT": "Waktu Musim Panas Lord Howe", "NZST": "Waktu Standar Selandia Baru", "MDT": "Waktu Musim Panas Makau", "JDT": "Waktu Musim Panas Jepang", "AKST": "Waktu Standar Alaska", "AKDT": "Waktu Musim Panas Alaska", "AWST": "Waktu Standar Barat Australia", "LHST": "Waktu Standar Lord Howe", "NZDT": "Waktu Musim Panas Selandia Baru", "VET": "Waktu Venezuela", "ChST": "Waktu Chamorro", "COT": "Waktu Standar Kolombia", "SGT": "Waktu Standar Singapura", "GFT": "Waktu Guyana Prancis", "WESZ": "Waktu Musim Panas Eropa Barat", "WIT": "Waktu Indonesia Timur", "OEZ": "Waktu Standar Eropa Timur", "HNT": "Waktu Standar Newfoundland", "EAT": "Waktu Afrika Timur", "ACST": "Waktu Standar Tengah Australia", "ACDT": "Waktu Musim Panas Tengah Australia", "CHAST": "Waktu Standar Chatham", "CAT": "Waktu Afrika Tengah", "OESZ": "Waktu Musim Panas Eropa Timur", "WARST": "Waktu Musim Panas Argentina Bagian Barat", "∅∅∅": "Waktu Musim Panas Amazon", "PST": "Waktu Standar Pasifik", "UYST": "Waktu Musim Panas Uruguay", "AEDT": "Waktu Musim Panas Timur Australia", "HKT": "Waktu Standar Hong Kong", "HKST": "Waktu Musim Panas Hong Kong", "ART": "Waktu Standar Argentina", "ARST": "Waktu Musim Panas Argentina", "HADT": "Waktu Musim Panas Hawaii-Aleutian", "TMST": "Waktu Musim Panas Turkmenistan", "COST": "Waktu Musim Panas Kolombia", "HAT": "Waktu Musim Panas Newfoundland", "MST": "Waktu Standar Makau", "CST": "Waktu Standar Tengah", "ADT": "Waktu Musim Panas Atlantik", "HAST": "Waktu Standar Hawaii-Aleutian", "GMT": "Waktu Rata-rata Greenwich", "WART": "Waktu Standar Argentina Bagian Barat", "JST": "Waktu Standar Jepang", "SRT": "Waktu Suriname", "CDT": "Waktu Musim Panas Tengah", "CLT": "Waktu Standar Cile", "SAST": "Waktu Standar Afrika Selatan", "WAST": "Waktu Musim Panas Afrika Barat", "MYT": "Waktu Malaysia", "TMT": "Waktu Standar Turkmenistan", "WEZ": "Waktu Standar Eropa Barat", "CHADT": "Waktu Musim Panas Chatham"},
+ timezones: map[string]string{"CHAST": "Waktu Standar Chatham", "GYT": "Waktu Guyana", "MDT": "Waktu Musim Panas Makau", "ADT": "Waktu Musim Panas Atlantik", "AWDT": "Waktu Musim Panas Barat Australia", "WITA": "Waktu Indonesia Tengah", "EST": "Waktu Standar Timur", "WESZ": "Waktu Musim Panas Eropa Barat", "WIB": "Waktu Indonesia Barat", "WIT": "Waktu Indonesia Timur", "CLST": "Waktu Musim Panas Cile", "ACST": "Waktu Standar Tengah Australia", "ACDT": "Waktu Musim Panas Tengah Australia", "VET": "Waktu Venezuela", "IST": "Waktu India", "HAST": "Waktu Standar Hawaii-Aleutian", "HADT": "Waktu Musim Panas Hawaii-Aleutian", "AWST": "Waktu Standar Barat Australia", "MEZ": "Waktu Standar Eropa Tengah", "CAT": "Waktu Afrika Tengah", "CLT": "Waktu Standar Cile", "WART": "Waktu Standar Argentina Bagian Barat", "AKST": "Waktu Standar Alaska", "WAT": "Waktu Standar Afrika Barat", "COST": "Waktu Musim Panas Kolombia", "EAT": "Waktu Afrika Timur", "∅∅∅": "Waktu Musim Panas Azores", "GMT": "Waktu Rata-rata Greenwich", "BT": "Waktu Bhutan", "UYST": "Waktu Musim Panas Uruguay", "JDT": "Waktu Musim Panas Jepang", "EDT": "Waktu Musim Panas Timur", "LHST": "Waktu Standar Lord Howe", "ACWST": "Waktu Standar Barat Tengah Australia", "JST": "Waktu Standar Jepang", "AEST": "Waktu Standar Timur Australia", "SRT": "Waktu Suriname", "CHADT": "Waktu Musim Panas Chatham", "ARST": "Waktu Musim Panas Argentina", "SAST": "Waktu Standar Afrika Selatan", "HAT": "Waktu Musim Panas Newfoundland", "CDT": "Waktu Musim Panas Tengah", "AKDT": "Waktu Musim Panas Alaska", "WEZ": "Waktu Standar Eropa Barat", "AEDT": "Waktu Musim Panas Timur Australia", "LHDT": "Waktu Musim Panas Lord Howe", "AST": "Waktu Standar Atlantik", "ACWDT": "Waktu Musim Panas Barat Tengah Australia", "OEZ": "Waktu Standar Eropa Timur", "GFT": "Waktu Guyana Prancis", "ECT": "Waktu Ekuador", "MESZ": "Waktu Musim Panas Eropa Tengah", "NZDT": "Waktu Musim Panas Selandia Baru", "TMT": "Waktu Standar Turkmenistan", "MYT": "Waktu Malaysia", "HKT": "Waktu Standar Hong Kong", "HNT": "Waktu Standar Newfoundland", "UYT": "Waktu Standar Uruguay", "WARST": "Waktu Musim Panas Argentina Bagian Barat", "ART": "Waktu Standar Argentina", "BOT": "Waktu Bolivia", "PST": "Waktu Standar Pasifik", "TMST": "Waktu Musim Panas Turkmenistan", "WAST": "Waktu Musim Panas Afrika Barat", "COT": "Waktu Standar Kolombia", "OESZ": "Waktu Musim Panas Eropa Timur", "MST": "Waktu Standar Makau", "HKST": "Waktu Musim Panas Hong Kong", "PDT": "Waktu Musim Panas Pasifik", "NZST": "Waktu Standar Selandia Baru", "SGT": "Waktu Standar Singapura", "ChST": "Waktu Chamorro", "CST": "Waktu Standar Tengah"},
}
}
diff --git a/id_ID/id_ID_test.go b/id_ID/id_ID_test.go
new file mode 100644
index 00000000..0d3380fc
--- /dev/null
+++ b/id_ID/id_ID_test.go
@@ -0,0 +1,1120 @@
+package id_ID
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "id_ID"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ig/ig.go b/ig/ig.go
index de5cc6a5..21e69dde 100644
--- a/ig/ig.go
+++ b/ig/ig.go
@@ -61,7 +61,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"T.K.", "A.K."},
erasNarrow: []string{"", ""},
erasWide: []string{"Tupu Kristi", "Afọ Kristi"},
- timezones: map[string]string{"CDT": "CDT", "WESZ": "WESZ", "CHADT": "CHADT", "PDT": "PDT", "CLT": "CLT", "CHAST": "CHAST", "COT": "COT", "HKT": "HKT", "IST": "IST", "∅∅∅": "∅∅∅", "SRT": "SRT", "AWDT": "AWDT", "HAST": "HAST", "HADT": "HADT", "WAST": "WAST", "WIT": "WIT", "EST": "EST", "ECT": "ECT", "WIB": "WIB", "MST": "MST", "MESZ": "MESZ", "SGT": "SGT", "HKST": "HKST", "GMT": "GMT", "LHST": "LHST", "GYT": "GYT", "AEST": "AEST", "ChST": "ChST", "WARST": "WARST", "OESZ": "OESZ", "WITA": "WITA", "TMT": "TMT", "AKDT": "AKDT", "WEZ": "WEZ", "SAST": "SAST", "BT": "BT", "HAT": "HAT", "ADT": "ADT", "WAT": "WAT", "OEZ": "OEZ", "EAT": "EAT", "TMST": "TMST", "CAT": "CAT", "WART": "WART", "ARST": "ARST", "CST": "CST", "MDT": "MDT", "EDT": "EDT", "ACST": "ACST", "JDT": "JDT", "AWST": "AWST", "AST": "AST", "GFT": "GFT", "ACDT": "ACDT", "ART": "ART", "NZDT": "NZDT", "CLST": "CLST", "AEDT": "AEDT", "PST": "PST", "MYT": "MYT", "NZST": "NZST", "BOT": "BOT", "VET": "VET", "HNT": "HNT", "JST": "JST", "AKST": "AKST", "LHDT": "LHDT", "MEZ": "MEZ", "UYT": "UYT", "UYST": "UYST", "ACWST": "ACWST", "ACWDT": "ACWDT", "COST": "COST"},
+ timezones: map[string]string{"WIB": "WIB", "TMST": "TMST", "CAT": "CAT", "EAT": "EAT", "CST": "CST", "∅∅∅": "∅∅∅", "AST": "AST", "HAST": "HAST", "AWDT": "AWDT", "ART": "ART", "EDT": "EDT", "PDT": "PDT", "UYST": "UYST", "HKT": "HKT", "ACWST": "ACWST", "AWST": "AWST", "SRT": "SRT", "CLT": "CLT", "ACDT": "ACDT", "LHDT": "LHDT", "SAST": "SAST", "COST": "COST", "GYT": "GYT", "WESZ": "WESZ", "SGT": "SGT", "CDT": "CDT", "CHADT": "CHADT", "PST": "PST", "WAST": "WAST", "EST": "EST", "HAT": "HAT", "CLST": "CLST", "WART": "WART", "WARST": "WARST", "ARST": "ARST", "NZST": "NZST", "BOT": "BOT", "AEST": "AEST", "BT": "BT", "ECT": "ECT", "VET": "VET", "TMT": "TMT", "ADT": "ADT", "GMT": "GMT", "AEDT": "AEDT", "WIT": "WIT", "HNT": "HNT", "LHST": "LHST", "ACWDT": "ACWDT", "IST": "IST", "WEZ": "WEZ", "NZDT": "NZDT", "MESZ": "MESZ", "OEZ": "OEZ", "OESZ": "OESZ", "MYT": "MYT", "GFT": "GFT", "MST": "MST", "AKDT": "AKDT", "MDT": "MDT", "JDT": "JDT", "AKST": "AKST", "COT": "COT", "ChST": "ChST", "HKST": "HKST", "JST": "JST", "MEZ": "MEZ", "UYT": "UYT", "CHAST": "CHAST", "HADT": "HADT", "ACST": "ACST", "WITA": "WITA", "WAT": "WAT"},
}
}
@@ -117,7 +117,7 @@ func (ig *ig) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (ig *ig) MonthsNarrow() []string {
- return ig.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/ig/ig_test.go b/ig/ig_test.go
new file mode 100644
index 00000000..03c0d2ff
--- /dev/null
+++ b/ig/ig_test.go
@@ -0,0 +1,1120 @@
+package ig
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ig"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ig_NG/ig_NG.go b/ig_NG/ig_NG.go
index 89809519..c09f6b44 100644
--- a/ig_NG/ig_NG.go
+++ b/ig_NG/ig_NG.go
@@ -61,7 +61,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"T.K.", "A.K."},
erasNarrow: []string{"", ""},
erasWide: []string{"Tupu Kristi", "Afọ Kristi"},
- timezones: map[string]string{"NZST": "NZST", "ACWDT": "ACWDT", "EST": "EST", "ACDT": "ACDT", "PST": "PST", "MESZ": "MESZ", "LHST": "LHST", "ECT": "ECT", "HAT": "HAT", "WIT": "WIT", "MYT": "MYT", "UYST": "UYST", "CDT": "CDT", "VET": "VET", "WESZ": "WESZ", "WITA": "WITA", "IST": "IST", "TMST": "TMST", "SGT": "SGT", "GFT": "GFT", "GMT": "GMT", "ChST": "ChST", "AEST": "AEST", "BT": "BT", "WIB": "WIB", "UYT": "UYT", "WEZ": "WEZ", "COST": "COST", "HADT": "HADT", "SAST": "SAST", "MST": "MST", "AWST": "AWST", "CAT": "CAT", "HKT": "HKT", "WAT": "WAT", "CLST": "CLST", "EAT": "EAT", "MEZ": "MEZ", "WAST": "WAST", "HNT": "HNT", "OEZ": "OEZ", "JST": "JST", "CHAST": "CHAST", "WART": "WART", "OESZ": "OESZ", "ACST": "ACST", "EDT": "EDT", "HAST": "HAST", "WARST": "WARST", "MDT": "MDT", "CLT": "CLT", "NZDT": "NZDT", "AWDT": "AWDT", "ART": "ART", "AKDT": "AKDT", "PDT": "PDT", "SRT": "SRT", "CST": "CST", "HKST": "HKST", "TMT": "TMT", "JDT": "JDT", "ADT": "ADT", "∅∅∅": "∅∅∅", "BOT": "BOT", "ACWST": "ACWST", "AKST": "AKST", "CHADT": "CHADT", "AEDT": "AEDT", "COT": "COT", "AST": "AST", "ARST": "ARST", "LHDT": "LHDT", "GYT": "GYT"},
+ timezones: map[string]string{"WITA": "WITA", "NZDT": "NZDT", "COT": "COT", "UYT": "UYT", "EAT": "EAT", "AWST": "AWST", "SAST": "SAST", "∅∅∅": "∅∅∅", "WEZ": "WEZ", "CLT": "CLT", "ACST": "ACST", "CST": "CST", "HKST": "HKST", "WARST": "WARST", "ADT": "ADT", "HADT": "HADT", "AEDT": "AEDT", "OESZ": "OESZ", "JDT": "JDT", "JST": "JST", "BOT": "BOT", "LHST": "LHST", "MST": "MST", "PST": "PST", "MYT": "MYT", "SRT": "SRT", "CDT": "CDT", "VET": "VET", "ACWST": "ACWST", "COST": "COST", "GMT": "GMT", "AEST": "AEST", "CHADT": "CHADT", "MEZ": "MEZ", "NZST": "NZST", "SGT": "SGT", "ChST": "ChST", "WIT": "WIT", "AST": "AST", "WAST": "WAST", "TMT": "TMT", "WAT": "WAT", "HNT": "HNT", "ARST": "ARST", "AWDT": "AWDT", "WESZ": "WESZ", "WIB": "WIB", "OEZ": "OEZ", "BT": "BT", "CLST": "CLST", "ECT": "ECT", "ART": "ART", "ACDT": "ACDT", "GFT": "GFT", "CHAST": "CHAST", "ACWDT": "ACWDT", "AKDT": "AKDT", "EST": "EST", "HAT": "HAT", "TMST": "TMST", "CAT": "CAT", "WART": "WART", "MDT": "MDT", "AKST": "AKST", "IST": "IST", "LHDT": "LHDT", "HKT": "HKT", "UYST": "UYST", "GYT": "GYT", "PDT": "PDT", "MESZ": "MESZ", "HAST": "HAST", "EDT": "EDT"},
}
}
@@ -117,7 +117,7 @@ func (ig *ig_NG) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (ig *ig_NG) MonthsNarrow() []string {
- return ig.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/ig_NG/ig_NG_test.go b/ig_NG/ig_NG_test.go
new file mode 100644
index 00000000..d7d76af8
--- /dev/null
+++ b/ig_NG/ig_NG_test.go
@@ -0,0 +1,1120 @@
+package ig_NG
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ig_NG"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ii/ii.go b/ii/ii.go
index 6d8b2f68..77bb2a96 100644
--- a/ii/ii.go
+++ b/ii/ii.go
@@ -68,7 +68,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ꃅꋊꂿ", "ꃅꋊꊂ"},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"ART": "ART", "WEZ": "WEZ", "ACWDT": "ACWDT", "ChST": "ChST", "HKST": "HKST", "WIB": "WIB", "GFT": "GFT", "MESZ": "MESZ", "AEDT": "AEDT", "SGT": "SGT", "TMT": "TMT", "AWDT": "AWDT", "VET": "VET", "HNT": "HNT", "MEZ": "MEZ", "LHST": "LHST", "CHAST": "CHAST", "IST": "IST", "EAT": "EAT", "MDT": "MDT", "EDT": "EDT", "GMT": "GMT", "AEST": "AEST", "CAT": "CAT", "WIT": "WIT", "LHDT": "LHDT", "CLST": "CLST", "NZST": "NZST", "HKT": "HKT", "WITA": "WITA", "∅∅∅": "∅∅∅", "CDT": "CDT", "AKDT": "AKDT", "NZDT": "NZDT", "EST": "EST", "MYT": "MYT", "JST": "JST", "SRT": "SRT", "BOT": "BOT", "TMST": "TMST", "AKST": "AKST", "AWST": "AWST", "ADT": "ADT", "BT": "BT", "ACDT": "ACDT", "ARST": "ARST", "ECT": "ECT", "COT": "COT", "SAST": "SAST", "WAST": "WAST", "CHADT": "CHADT", "CLT": "CLT", "WAT": "WAT", "ACST": "ACST", "JDT": "JDT", "WESZ": "WESZ", "WART": "WART", "OEZ": "OEZ", "OESZ": "OESZ", "HAT": "HAT", "AST": "AST", "PDT": "PDT", "CST": "CST", "UYST": "UYST", "UYT": "UYT", "ACWST": "ACWST", "COST": "COST", "HAST": "HAST", "HADT": "HADT", "MST": "MST", "PST": "PST", "GYT": "GYT", "WARST": "WARST"},
+ timezones: map[string]string{"AKST": "AKST", "IST": "IST", "BOT": "BOT", "SGT": "SGT", "COT": "COT", "ChST": "ChST", "WAT": "WAT", "EAT": "EAT", "GFT": "GFT", "ECT": "ECT", "ADT": "ADT", "ACWST": "ACWST", "ACST": "ACST", "ARST": "ARST", "WITA": "WITA", "MESZ": "MESZ", "WEZ": "WEZ", "CAT": "CAT", "OESZ": "OESZ", "WIT": "WIT", "WARST": "WARST", "JDT": "JDT", "PST": "PST", "PDT": "PDT", "SAST": "SAST", "GYT": "GYT", "HKST": "HKST", "AKDT": "AKDT", "HADT": "HADT", "WIB": "WIB", "GMT": "GMT", "NZST": "NZST", "LHDT": "LHDT", "CLST": "CLST", "WART": "WART", "CST": "CST", "LHST": "LHST", "UYST": "UYST", "HAT": "HAT", "TMT": "TMT", "SRT": "SRT", "CHADT": "CHADT", "AWDT": "AWDT", "JST": "JST", "HAST": "HAST", "AEST": "AEST", "AST": "AST", "ART": "ART", "EST": "EST", "OEZ": "OEZ", "∅∅∅": "∅∅∅", "AWST": "AWST", "TMST": "TMST", "MST": "MST", "UYT": "UYT", "CDT": "CDT", "CHAST": "CHAST", "AEDT": "AEDT", "BT": "BT", "MDT": "MDT", "EDT": "EDT", "MEZ": "MEZ", "VET": "VET", "ACWDT": "ACWDT", "WAST": "WAST", "HNT": "HNT", "MYT": "MYT", "CLT": "CLT", "ACDT": "ACDT", "HKT": "HKT", "NZDT": "NZDT", "WESZ": "WESZ", "COST": "COST"},
}
}
@@ -124,7 +124,7 @@ func (ii *ii) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (ii *ii) MonthsNarrow() []string {
- return ii.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/ii/ii_test.go b/ii/ii_test.go
new file mode 100644
index 00000000..28dac3ea
--- /dev/null
+++ b/ii/ii_test.go
@@ -0,0 +1,1120 @@
+package ii
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ii"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ii_CN/ii_CN.go b/ii_CN/ii_CN.go
index 91f77c36..8ad7e6d5 100644
--- a/ii_CN/ii_CN.go
+++ b/ii_CN/ii_CN.go
@@ -68,7 +68,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ꃅꋊꂿ", "ꃅꋊꊂ"},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"ARST": "ARST", "∅∅∅": "∅∅∅", "AWDT": "AWDT", "NZDT": "NZDT", "ChST": "ChST", "HKT": "HKT", "HAT": "HAT", "HNT": "HNT", "EAT": "EAT", "TMT": "TMT", "PDT": "PDT", "MESZ": "MESZ", "WESZ": "WESZ", "ACWDT": "ACWDT", "EST": "EST", "WEZ": "WEZ", "CHAST": "CHAST", "OESZ": "OESZ", "WITA": "WITA", "MDT": "MDT", "CDT": "CDT", "ADT": "ADT", "SRT": "SRT", "AEST": "AEST", "CHADT": "CHADT", "CLST": "CLST", "WAST": "WAST", "HAST": "HAST", "ACST": "ACST", "TMST": "TMST", "PST": "PST", "AWST": "AWST", "CST": "CST", "COST": "COST", "ECT": "ECT", "WAT": "WAT", "AKDT": "AKDT", "ACWST": "ACWST", "BT": "BT", "AEDT": "AEDT", "HADT": "HADT", "WIT": "WIT", "ART": "ART", "UYT": "UYT", "VET": "VET", "JST": "JST", "IST": "IST", "OEZ": "OEZ", "GMT": "GMT", "NZST": "NZST", "BOT": "BOT", "UYST": "UYST", "COT": "COT", "AST": "AST", "SAST": "SAST", "HKST": "HKST", "MST": "MST", "MYT": "MYT", "CAT": "CAT", "SGT": "SGT", "LHDT": "LHDT", "GYT": "GYT", "WART": "WART", "ACDT": "ACDT", "AKST": "AKST", "LHST": "LHST", "JDT": "JDT", "MEZ": "MEZ", "EDT": "EDT", "GFT": "GFT", "CLT": "CLT", "WARST": "WARST", "WIB": "WIB"},
+ timezones: map[string]string{"COT": "COT", "GMT": "GMT", "AEST": "AEST", "CHAST": "CHAST", "NZDT": "NZDT", "ECT": "ECT", "WAT": "WAT", "HAT": "HAT", "GYT": "GYT", "MYT": "MYT", "CST": "CST", "ACST": "ACST", "CAT": "CAT", "SGT": "SGT", "MST": "MST", "HAST": "HAST", "AKST": "AKST", "AKDT": "AKDT", "AWST": "AWST", "SAST": "SAST", "EAT": "EAT", "UYT": "UYT", "PDT": "PDT", "ARST": "ARST", "TMT": "TMT", "BT": "BT", "UYST": "UYST", "∅∅∅": "∅∅∅", "HKT": "HKT", "ART": "ART", "WAST": "WAST", "OEZ": "OEZ", "AST": "AST", "WITA": "WITA", "OESZ": "OESZ", "SRT": "SRT", "GFT": "GFT", "CHADT": "CHADT", "BOT": "BOT", "LHST": "LHST", "MDT": "MDT", "HKST": "HKST", "ADT": "ADT", "ACWST": "ACWST", "AWDT": "AWDT", "CLT": "CLT", "WARST": "WARST", "ACWDT": "ACWDT", "EDT": "EDT", "MEZ": "MEZ", "WEZ": "WEZ", "HNT": "HNT", "ChST": "ChST", "LHDT": "LHDT", "CDT": "CDT", "IST": "IST", "COST": "COST", "WIB": "WIB", "AEDT": "AEDT", "JST": "JST", "MESZ": "MESZ", "NZST": "NZST", "WIT": "WIT", "WART": "WART", "VET": "VET", "HADT": "HADT", "WESZ": "WESZ", "TMST": "TMST", "CLST": "CLST", "PST": "PST", "ACDT": "ACDT", "JDT": "JDT", "EST": "EST"},
}
}
@@ -124,7 +124,7 @@ func (ii *ii_CN) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (ii *ii_CN) MonthsNarrow() []string {
- return ii.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/ii_CN/ii_CN_test.go b/ii_CN/ii_CN_test.go
new file mode 100644
index 00000000..5abe8bf5
--- /dev/null
+++ b/ii_CN/ii_CN_test.go
@@ -0,0 +1,1120 @@
+package ii_CN
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ii_CN"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/is/is.go b/is/is.go
index 2d8abd81..960b905d 100644
--- a/is/is.go
+++ b/is/is.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"f.Kr.", "e.Kr."},
erasNarrow: []string{"f.k.", "e.k."},
erasWide: []string{"fyrir Krist", "eftir Krist"},
- timezones: map[string]string{"EDT": "Sumartími í austurhluta Bandaríkjanna og Kanada", "WIT": "Austur-Indónesíutími", "PST": "Staðaltími á Kyrrahafssvæðinu", "AWDT": "Sumartími í Vestur-Ástralíu", "NZST": "Staðaltími á Nýja-Sjálandi", "COST": "Sumartími í Kólumbíu", "IST": "Indlandstími", "OEZ": "Staðaltími í Austur-Evrópu", "HNT": "Staðaltími á Nýfundnalandi", "TMST": "Sumartími í Túrkmenistan", "UYT": "Staðaltími í Úrúgvæ", "ChST": "Chamorro-staðaltími", "TMT": "Staðaltími í Túrkmenistan", "AKST": "Staðaltími í Alaska", "LHDT": "Sumartími á Lord Howe-eyju", "CLST": "Sumartími í Síle", "AST": "Staðaltími á Atlantshafssvæðinu", "HKST": "Sumartími í Hong Kong", "MYT": "Malasíutími", "CDT": "Sumartími í miðhluta Bandaríkjanna og Kanada", "ADT": "Sumartími á Atlantshafssvæðinu", "MST": "MST", "MESZ": "Sumartími í Mið-Evrópu", "CHADT": "Sumartími í Chatham", "∅∅∅": "Sumartími í Brasilíu", "JDT": "Sumartími í Japan", "CST": "Staðaltími í miðhluta Bandaríkjanna og Kanada", "ACWDT": "Sumartími í miðvesturhluta Ástralíu", "CLT": "Staðaltími í Síle", "HAST": "Staðaltími á Havaí og Aleúta", "JST": "Staðaltími í Japan", "UYST": "Sumartími í Úrúgvæ", "AEST": "Staðaltími í Austur-Ástralíu", "EST": "Staðaltími í austurhluta Bandaríkjanna og Kanada", "HADT": "Sumartími á Havaí og Aleúta", "SAST": "Suður-Afríkutími", "BT": "Bútantími", "HAT": "Sumartími á Nýfundnalandi", "WITA": "Mið-Indónesíutími", "BOT": "Bólivíutími", "CAT": "Mið-Afríkutími", "GMT": "Greenwich-staðaltími", "GFT": "Tími í Frönsku Gvæjana", "MEZ": "Staðaltími í Mið-Evrópu", "EAT": "Austur-Afríkutími", "ACST": "Staðaltími í Mið-Ástralíu", "NZDT": "Sumartími á Nýja-Sjálandi", "WESZ": "Sumartími í Vestur-Evrópu", "CHAST": "Staðaltími í Chatham", "WAT": "Staðaltími í Vestur-Afríku", "HKT": "Staðaltími í Hong Kong", "ART": "Staðaltími í Argentínu", "PDT": "Sumartími á Kyrrahafssvæðinu", "COT": "Staðaltími í Kólumbíu", "ECT": "Ekvadortími", "WART": "Staðaltími í Vestur-Argentínu", "ACWST": "Staðaltími í miðvesturhluta Ástralíu", "AEDT": "Sumartími í Austur-Ástralíu", "OESZ": "Sumartími í Austur-Evrópu", "ARST": "Sumartími í Argentínu", "AKDT": "Sumartími í Alaska", "SRT": "Súrinamtími", "WEZ": "Staðaltími í Vestur-Evrópu", "SGT": "Singapúrtími", "AWST": "Staðaltími í Vestur-Ástralíu", "WIB": "Vestur-Indónesíutími", "MDT": "MDT", "ACDT": "Sumartími í Mið-Ástralíu", "VET": "Venesúelatími", "WAST": "Sumartími í Vestur-Afríku", "WARST": "Sumartími í Vestur-Argentínu", "LHST": "Staðaltími á Lord Howe-eyju", "GYT": "Gvæjanatími"},
+ timezones: map[string]string{"WITA": "Mið-Indónesíutími", "JST": "Staðaltími í Japan", "AKST": "Staðaltími í Alaska", "SAST": "Suður-Afríkutími", "TMST": "Sumartími í Túrkmenistan", "WAST": "Sumartími í Vestur-Afríku", "BT": "Bútantími", "ADT": "Sumartími á Atlantshafssvæðinu", "CAT": "Mið-Afríkutími", "SRT": "Súrinamtími", "WARST": "Sumartími í Vestur-Argentínu", "JDT": "Sumartími í Japan", "PDT": "Sumartími á Kyrrahafssvæðinu", "TMT": "Staðaltími í Túrkmenistan", "GYT": "Gvæjanatími", "CLT": "Staðaltími í Síle", "COST": "Sumartími í Kólumbíu", "CLST": "Sumartími í Síle", "WIT": "Austur-Indónesíutími", "ART": "Staðaltími í Argentínu", "MEZ": "Staðaltími í Mið-Evrópu", "MESZ": "Sumartími í Mið-Evrópu", "BOT": "Bólivíutími", "IST": "Indlandstími", "ACWDT": "Sumartími í miðvesturhluta Ástralíu", "HAST": "Staðaltími á Havaí og Aleúta", "∅∅∅": "Sumartími á Amasónsvæðinu", "GMT": "Greenwich-staðaltími", "ECT": "Ekvadortími", "HKST": "Sumartími í Hong Kong", "CST": "Staðaltími í miðhluta Bandaríkjanna og Kanada", "VET": "Venesúelatími", "AST": "Staðaltími á Atlantshafssvæðinu", "HADT": "Sumartími á Havaí og Aleúta", "CDT": "Sumartími í miðhluta Bandaríkjanna og Kanada", "CHAST": "Staðaltími í Chatham", "WIB": "Vestur-Indónesíutími", "UYST": "Sumartími í Úrúgvæ", "LHDT": "Sumartími á Lord Howe-eyju", "WART": "Staðaltími í Vestur-Argentínu", "MST": "MST", "ARST": "Sumartími í Argentínu", "HAT": "Sumartími á Nýfundnalandi", "WESZ": "Sumartími í Vestur-Evrópu", "AEDT": "Sumartími í Austur-Ástralíu", "SGT": "Singapúrtími", "WAT": "Staðaltími í Vestur-Afríku", "AEST": "Staðaltími í Austur-Ástralíu", "HKT": "Staðaltími í Hong Kong", "CHADT": "Sumartími í Chatham", "AWDT": "Sumartími í Vestur-Ástralíu", "NZDT": "Sumartími á Nýja-Sjálandi", "EST": "Staðaltími í austurhluta Bandaríkjanna og Kanada", "EAT": "Austur-Afríkutími", "ACST": "Staðaltími í Mið-Ástralíu", "AKDT": "Sumartími í Alaska", "ACWST": "Staðaltími í miðvesturhluta Ástralíu", "EDT": "Sumartími í austurhluta Bandaríkjanna og Kanada", "ACDT": "Sumartími í Mið-Ástralíu", "GFT": "Tími í Frönsku Gvæjana", "AWST": "Staðaltími í Vestur-Ástralíu", "PST": "Staðaltími á Kyrrahafssvæðinu", "HNT": "Staðaltími á Nýfundnalandi", "WEZ": "Staðaltími í Vestur-Evrópu", "OEZ": "Staðaltími í Austur-Evrópu", "OESZ": "Sumartími í Austur-Evrópu", "MYT": "Malasíutími", "COT": "Staðaltími í Kólumbíu", "ChST": "Chamorro-staðaltími", "LHST": "Staðaltími á Lord Howe-eyju", "MDT": "MDT", "NZST": "Staðaltími á Nýja-Sjálandi", "UYT": "Staðaltími í Úrúgvæ"},
}
}
diff --git a/is/is_test.go b/is/is_test.go
new file mode 100644
index 00000000..048b27e2
--- /dev/null
+++ b/is/is_test.go
@@ -0,0 +1,1120 @@
+package is
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "is"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/is_IS/is_IS.go b/is_IS/is_IS.go
index f2c370bb..f8a1f4c3 100644
--- a/is_IS/is_IS.go
+++ b/is_IS/is_IS.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"f.Kr.", "e.Kr."},
erasNarrow: []string{"f.k.", "e.k."},
erasWide: []string{"fyrir Krist", "eftir Krist"},
- timezones: map[string]string{"TMT": "Staðaltími í Túrkmenistan", "NZST": "Staðaltími á Nýja-Sjálandi", "ACWST": "Staðaltími í miðvesturhluta Ástralíu", "CLT": "Staðaltími í Síle", "ACST": "Staðaltími í Mið-Ástralíu", "∅∅∅": "Sumartími á Amasónsvæðinu", "AWDT": "Sumartími í Vestur-Ástralíu", "GYT": "Gvæjanatími", "JDT": "Sumartími í Japan", "UYST": "Sumartími í Úrúgvæ", "MYT": "Malasíutími", "CHAST": "Staðaltími í Chatham", "ACWDT": "Sumartími í miðvesturhluta Ástralíu", "WAT": "Staðaltími í Vestur-Afríku", "BT": "Bútantími", "GMT": "Greenwich-staðaltími", "HAT": "Sumartími á Nýfundnalandi", "EAT": "Austur-Afríkutími", "WESZ": "Sumartími í Vestur-Evrópu", "PST": "Staðaltími á Kyrrahafssvæðinu", "WEZ": "Staðaltími í Vestur-Evrópu", "HKST": "Sumartími í Hong Kong", "WART": "Staðaltími í Vestur-Argentínu", "IST": "Indlandstími", "MST": "MST", "ARST": "Sumartími í Argentínu", "COST": "Sumartími í Kólumbíu", "MDT": "MDT", "AEST": "Staðaltími í Austur-Ástralíu", "ECT": "Ekvadortími", "HADT": "Sumartími á Havaí og Aleúta", "WITA": "Mið-Indónesíutími", "WIB": "Vestur-Indónesíutími", "TMST": "Sumartími í Túrkmenistan", "LHDT": "Sumartími á Lord Howe-eyju", "CAT": "Mið-Afríkutími", "HKT": "Staðaltími í Hong Kong", "PDT": "Sumartími á Kyrrahafssvæðinu", "NZDT": "Sumartími á Nýja-Sjálandi", "AEDT": "Sumartími í Austur-Ástralíu", "SAST": "Suður-Afríkutími", "WARST": "Sumartími í Vestur-Argentínu", "MEZ": "Staðaltími í Mið-Evrópu", "BOT": "Bólivíutími", "ADT": "Sumartími á Atlantshafssvæðinu", "ACDT": "Sumartími í Mið-Ástralíu", "AWST": "Staðaltími í Vestur-Ástralíu", "JST": "Staðaltími í Japan", "CDT": "Sumartími í miðhluta Bandaríkjanna og Kanada", "CLST": "Sumartími í Síle", "COT": "Staðaltími í Kólumbíu", "AKST": "Staðaltími í Alaska", "LHST": "Staðaltími á Lord Howe-eyju", "CST": "Staðaltími í miðhluta Bandaríkjanna og Kanada", "EST": "Staðaltími í austurhluta Bandaríkjanna og Kanada", "SGT": "Singapúrtími", "WAST": "Sumartími í Vestur-Afríku", "OESZ": "Sumartími í Austur-Evrópu", "ART": "Staðaltími í Argentínu", "AKDT": "Sumartími í Alaska", "GFT": "Tími í Frönsku Gvæjana", "SRT": "Súrinamtími", "ChST": "Chamorro-staðaltími", "AST": "Staðaltími á Atlantshafssvæðinu", "HAST": "Staðaltími á Havaí og Aleúta", "VET": "Venesúelatími", "EDT": "Sumartími í austurhluta Bandaríkjanna og Kanada", "OEZ": "Staðaltími í Austur-Evrópu", "HNT": "Staðaltími á Nýfundnalandi", "WIT": "Austur-Indónesíutími", "MESZ": "Sumartími í Mið-Evrópu", "UYT": "Staðaltími í Úrúgvæ", "CHADT": "Sumartími í Chatham"},
+ timezones: map[string]string{"MDT": "MDT", "TMST": "Sumartími í Túrkmenistan", "HNT": "Staðaltími á Nýfundnalandi", "UYT": "Staðaltími í Úrúgvæ", "MST": "MST", "AST": "Staðaltími á Atlantshafssvæðinu", "PST": "Staðaltími á Kyrrahafssvæðinu", "BOT": "Bólivíutími", "WARST": "Sumartími í Vestur-Argentínu", "AWST": "Staðaltími í Vestur-Ástralíu", "ChST": "Chamorro-staðaltími", "CHADT": "Sumartími í Chatham", "ECT": "Ekvadortími", "HKST": "Sumartími í Hong Kong", "ARST": "Sumartími í Argentínu", "WITA": "Mið-Indónesíutími", "AKST": "Staðaltími í Alaska", "OEZ": "Staðaltími í Austur-Evrópu", "SGT": "Singapúrtími", "COST": "Sumartími í Kólumbíu", "WART": "Staðaltími í Vestur-Argentínu", "GFT": "Tími í Frönsku Gvæjana", "ACWST": "Staðaltími í miðvesturhluta Ástralíu", "HAT": "Sumartími á Nýfundnalandi", "COT": "Staðaltími í Kólumbíu", "WIB": "Vestur-Indónesíutími", "OESZ": "Sumartími í Austur-Evrópu", "∅∅∅": "Sumartími á Asóreyjum", "VET": "Venesúelatími", "HKT": "Staðaltími í Hong Kong", "SAST": "Suður-Afríkutími", "WAT": "Staðaltími í Vestur-Afríku", "CLT": "Staðaltími í Síle", "SRT": "Súrinamtími", "JST": "Staðaltími í Japan", "NZDT": "Sumartími á Nýja-Sjálandi", "IST": "Indlandstími", "PDT": "Sumartími á Kyrrahafssvæðinu", "WESZ": "Sumartími í Vestur-Evrópu", "ACDT": "Sumartími í Mið-Ástralíu", "ACWDT": "Sumartími í miðvesturhluta Ástralíu", "ART": "Staðaltími í Argentínu", "EST": "Staðaltími í austurhluta Bandaríkjanna og Kanada", "CHAST": "Staðaltími í Chatham", "HADT": "Sumartími á Havaí og Aleúta", "CLST": "Sumartími í Síle", "UYST": "Sumartími í Úrúgvæ", "LHST": "Staðaltími á Lord Howe-eyju", "ADT": "Sumartími á Atlantshafssvæðinu", "MEZ": "Staðaltími í Mið-Evrópu", "MESZ": "Sumartími í Mið-Evrópu", "WAST": "Sumartími í Vestur-Afríku", "AEST": "Staðaltími í Austur-Ástralíu", "GMT": "Greenwich-staðaltími", "MYT": "Malasíutími", "EDT": "Sumartími í austurhluta Bandaríkjanna og Kanada", "GYT": "Gvæjanatími", "WIT": "Austur-Indónesíutími", "EAT": "Austur-Afríkutími", "CST": "Staðaltími í miðhluta Bandaríkjanna og Kanada", "CDT": "Sumartími í miðhluta Bandaríkjanna og Kanada", "JDT": "Sumartími í Japan", "AKDT": "Sumartími í Alaska", "HAST": "Staðaltími á Havaí og Aleúta", "WEZ": "Staðaltími í Vestur-Evrópu", "AEDT": "Sumartími í Austur-Ástralíu", "CAT": "Mið-Afríkutími", "LHDT": "Sumartími á Lord Howe-eyju", "BT": "Bútantími", "ACST": "Staðaltími í Mið-Ástralíu", "AWDT": "Sumartími í Vestur-Ástralíu", "NZST": "Staðaltími á Nýja-Sjálandi", "TMT": "Staðaltími í Túrkmenistan"},
}
}
diff --git a/is_IS/is_IS_test.go b/is_IS/is_IS_test.go
new file mode 100644
index 00000000..31ab0c27
--- /dev/null
+++ b/is_IS/is_IS_test.go
@@ -0,0 +1,1120 @@
+package is_IS
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "is_IS"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/it/it.go b/it/it.go
index 07c86074..a9cbb221 100644
--- a/it/it.go
+++ b/it/it.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a.C.", "d.C."},
erasNarrow: []string{"aC", "dC"},
erasWide: []string{"a.C.", "d.C."},
- timezones: map[string]string{"HAT": "Ora legale di Terranova", "JDT": "Ora legale del Giappone", "SGT": "Ora Singapore", "WIT": "Ora dell’Indonesia orientale", "OESZ": "Ora legale dell’Europa orientale", "HNT": "Ora standard di Terranova", "ChST": "Ora Chamorro", "NZST": "Ora standard della Nuova Zelanda", "EST": "Ora standard orientale USA", "ECT": "Ora dell’Ecuador", "WESZ": "Ora legale dell’Europa occidentale", "ACWDT": "Ora legale dell’Australia centroccidentale", "PDT": "Ora legale del Pacifico USA", "AWDT": "Ora legale dell’Australia occidentale", "MEZ": "Ora standard dell’Europa centrale", "CHAST": "Ora standard delle Chatham", "SAST": "Ora dell’Africa meridionale", "CST": "Ora standard centrale USA", "BOT": "Ora della Bolivia", "AEST": "Ora standard dell’Australia orientale", "AST": "Ora standard dell’Atlantico", "HADT": "Ora legale delle Isole Hawaii-Aleutine", "TMST": "Ora legale del Turkmenistan", "ARST": "Ora legale dell’Argentina", "AKST": "Ora standard dell’Alaska", "VET": "Ora del Venezuela", "AKDT": "Ora legale dell’Alaska", "UYST": "Ora legale dell’Uruguay", "CLT": "Ora standard del Cile", "EDT": "Ora legale orientale USA", "BT": "Ora del Bhutan", "HKT": "Ora standard di Hong Kong", "GFT": "Ora della Guiana francese", "MST": "MST", "MESZ": "Ora legale dell’Europa centrale", "CAT": "Ora dell’Africa centrale", "COT": "Ora standard della Colombia", "HKST": "Ora legale di Hong Kong", "EAT": "Ora dell’Africa orientale", "MYT": "Ora della Malesia", "JST": "Ora standard del Giappone", "ACST": "Ora standard dell’Australia centrale", "UYT": "Ora standard dell’Uruguay", "CLST": "Ora legale del Cile", "ADT": "Ora legale dell’Atlantico", "WAST": "Ora legale dell’Africa occidentale", "IST": "Ora standard dell’India", "GMT": "Ora del meridiano di Greenwich", "MDT": "MDT", "WEZ": "Ora standard dell’Europa occidentale", "COST": "Ora legale della Colombia", "AEDT": "Ora legale dell’Australia orientale", "WARST": "Ora legale dell’Argentina occidentale", "WAT": "Ora standard dell’Africa occidentale", "TMT": "Ora standard del Turkmenistan", "ACWST": "Ora standard dell’Australia centroccidentale", "WIB": "Ora dell’Indonesia occidentale", "PST": "Ora standard del Pacifico USA", "CHADT": "Ora legale delle Chatham", "WART": "Ora standard dell’Argentina occidentale", "ART": "Ora standard dell’Argentina", "SRT": "Ora del Suriname", "LHST": "Ora standard di Lord Howe", "AWST": "Ora standard dell’Australia occidentale", "LHDT": "Ora legale di Lord Howe", "CDT": "Ora legale centrale USA", "NZDT": "Ora legale della Nuova Zelanda", "WITA": "Ora dell’Indonesia centrale", "OEZ": "Ora standard dell’Europa orientale", "ACDT": "Ora legale dell’Australia centrale", "GYT": "Ora della Guyana", "HAST": "Ora standard delle Isole Hawaii-Aleutine", "∅∅∅": "Ora legale dell’Amazzonia"},
+ timezones: map[string]string{"EAT": "Ora dell’Africa orientale", "LHST": "Ora standard di Lord Howe", "CHADT": "Ora legale delle Chatham", "AWDT": "Ora legale dell’Australia occidentale", "ARST": "Ora legale dell’Argentina", "NZST": "Ora standard della Nuova Zelanda", "COT": "Ora standard della Colombia", "AEDT": "Ora legale dell’Australia orientale", "MYT": "Ora della Malesia", "ART": "Ora standard dell’Argentina", "EST": "Ora standard orientale USA", "WAT": "Ora standard dell’Africa occidentale", "SGT": "Ora Singapore", "EDT": "Ora legale orientale USA", "CDT": "Ora legale centrale USA", "HADT": "Ora legale delle Isole Hawaii-Aleutine", "GFT": "Ora della Guiana francese", "HKT": "Ora standard di Hong Kong", "AKST": "Ora standard dell’Alaska", "ACWST": "Ora standard dell’Australia centroccidentale", "GYT": "Ora della Guyana", "CHAST": "Ora standard delle Chatham", "NZDT": "Ora legale della Nuova Zelanda", "COST": "Ora legale della Colombia", "WEZ": "Ora standard dell’Europa occidentale", "UYST": "Ora legale dell’Uruguay", "WARST": "Ora legale dell’Argentina occidentale", "ECT": "Ora dell’Ecuador", "ADT": "Ora legale dell’Atlantico", "IST": "Ora standard dell’India", "PDT": "Ora legale del Pacifico USA", "CLT": "Ora standard del Cile", "OEZ": "Ora standard dell’Europa orientale", "PST": "Ora standard del Pacifico USA", "CAT": "Ora dell’Africa centrale", "WESZ": "Ora legale dell’Europa occidentale", "ChST": "Ora Chamorro", "AKDT": "Ora legale dell’Alaska", "AST": "Ora standard dell’Atlantico", "MEZ": "Ora standard dell’Europa centrale", "MESZ": "Ora legale dell’Europa centrale", "TMST": "Ora legale del Turkmenistan", "ACDT": "Ora legale dell’Australia centrale", "GMT": "Ora del meridiano di Greenwich", "WIT": "Ora dell’Indonesia orientale", "MDT": "Ora legale Montagne Rocciose USA", "AWST": "Ora standard dell’Australia occidentale", "∅∅∅": "Ora legale dell’Amazzonia", "HNT": "Ora standard di Terranova", "CST": "Ora standard centrale USA", "AEST": "Ora standard dell’Australia orientale", "BT": "Ora del Bhutan", "WITA": "Ora dell’Indonesia centrale", "ACWDT": "Ora legale dell’Australia centroccidentale", "WIB": "Ora dell’Indonesia occidentale", "TMT": "Ora standard del Turkmenistan", "OESZ": "Ora legale dell’Europa orientale", "VET": "Ora del Venezuela", "CLST": "Ora legale del Cile", "LHDT": "Ora legale di Lord Howe", "WART": "Ora standard dell’Argentina occidentale", "MST": "Ora standard Montagne Rocciose USA", "ACST": "Ora standard dell’Australia centrale", "HKST": "Ora legale di Hong Kong", "JST": "Ora standard del Giappone", "BOT": "Ora della Bolivia", "SAST": "Ora dell’Africa meridionale", "WAST": "Ora legale dell’Africa occidentale", "HAT": "Ora legale di Terranova", "JDT": "Ora legale del Giappone", "HAST": "Ora standard delle Isole Hawaii-Aleutine", "UYT": "Ora standard dell’Uruguay", "SRT": "Ora del Suriname"},
}
}
diff --git a/it/it_test.go b/it/it_test.go
new file mode 100644
index 00000000..daefa9aa
--- /dev/null
+++ b/it/it_test.go
@@ -0,0 +1,1120 @@
+package it
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "it"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/it_CH/it_CH.go b/it_CH/it_CH.go
index c5606e9f..654a483a 100644
--- a/it_CH/it_CH.go
+++ b/it_CH/it_CH.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a.C.", "d.C."},
erasNarrow: []string{"aC", "dC"},
erasWide: []string{"a.C.", "d.C."},
- timezones: map[string]string{"MESZ": "Ora legale dell’Europa centrale", "UYST": "Ora legale dell’Uruguay", "WESZ": "Ora legale dell’Europa occidentale", "OESZ": "Ora legale dell’Europa orientale", "AKDT": "Ora legale dell’Alaska", "CDT": "Ora legale centrale USA", "HKST": "Ora legale di Hong Kong", "LHDT": "Ora legale di Lord Howe", "CHAST": "Ora standard delle Chatham", "SGT": "Ora Singapore", "IST": "Ora standard dell’India", "MEZ": "Ora standard dell’Europa centrale", "ACWST": "Ora standard dell’Australia centroccidentale", "HAST": "Ora standard delle Isole Hawaii-Aleutine", "WAT": "Ora standard dell’Africa occidentale", "SAST": "Ora dell’Africa meridionale", "ARST": "Ora legale dell’Argentina", "JST": "Ora standard del Giappone", "CHADT": "Ora legale delle Chatham", "ACDT": "Ora legale dell’Australia centrale", "PST": "Ora standard del Pacifico USA", "UYT": "Ora standard dell’Uruguay", "ACWDT": "Ora legale dell’Australia centroccidentale", "SRT": "Ora del Suriname", "JDT": "Ora legale del Giappone", "WEZ": "Ora standard dell’Europa occidentale", "COST": "Ora legale della Colombia", "BT": "Ora del Bhutan", "WARST": "Ora legale dell’Argentina occidentale", "MYT": "Ora della Malesia", "MST": "Ora standard Montagne Rocciose USA", "COT": "Ora standard della Colombia", "ChST": "Ora Chamorro", "∅∅∅": "Ora legale delle Azzorre", "EDT": "Ora legale orientale USA", "WIT": "Ora dell’Indonesia orientale", "ACST": "Ora standard dell’Australia centrale", "EAT": "Ora dell’Africa orientale", "LHST": "Ora standard di Lord Howe", "AWDT": "Ora legale dell’Australia occidentale", "GYT": "Ora della Guyana", "NZST": "Ora standard della Nuova Zelanda", "BOT": "Ora della Bolivia", "AEST": "Ora standard dell’Australia orientale", "WAST": "Ora legale dell’Africa occidentale", "HNT": "Ora standard di Terranova", "GFT": "Ora della Guiana francese", "AWST": "Ora standard dell’Australia occidentale", "WIB": "Ora dell’Indonesia occidentale", "VET": "Ora del Venezuela", "AST": "Ora standard dell’Atlantico", "ADT": "Ora legale dell’Atlantico", "OEZ": "Ora standard dell’Europa orientale", "AKST": "Ora standard dell’Alaska", "TMT": "Ora standard del Turkmenistan", "TMST": "Ora legale del Turkmenistan", "EST": "Ora standard orientale USA", "NZDT": "Ora legale della Nuova Zelanda", "CST": "Ora standard centrale USA", "ECT": "Ora dell’Ecuador", "HKT": "Ora standard di Hong Kong", "GMT": "Ora del meridiano di Greenwich", "ART": "Ora standard dell’Argentina", "PDT": "Ora legale del Pacifico USA", "CLST": "Ora legale del Cile", "CAT": "Ora dell’Africa centrale", "HADT": "Ora legale delle Isole Hawaii-Aleutine", "WART": "Ora standard dell’Argentina occidentale", "HAT": "Ora legale di Terranova", "WITA": "Ora dell’Indonesia centrale", "MDT": "Ora legale Montagne Rocciose USA", "CLT": "Ora standard del Cile", "AEDT": "Ora legale dell’Australia orientale"},
+ timezones: map[string]string{"MST": "Ora standard Montagne Rocciose USA", "GMT": "Ora del meridiano di Greenwich", "MYT": "Ora della Malesia", "WIT": "Ora dell’Indonesia orientale", "ECT": "Ora dell’Ecuador", "ACWDT": "Ora legale dell’Australia centroccidentale", "NZDT": "Ora legale della Nuova Zelanda", "SGT": "Ora Singapore", "TMST": "Ora legale del Turkmenistan", "WIB": "Ora dell’Indonesia occidentale", "WARST": "Ora legale dell’Argentina occidentale", "HKT": "Ora standard di Hong Kong", "JDT": "Ora legale del Giappone", "EST": "Ora standard orientale USA", "MEZ": "Ora standard dell’Europa centrale", "WEZ": "Ora standard dell’Europa occidentale", "HAT": "Ora legale di Terranova", "OEZ": "Ora standard dell’Europa orientale", "LHST": "Ora standard di Lord Howe", "LHDT": "Ora legale di Lord Howe", "CLT": "Ora standard del Cile", "CLST": "Ora legale del Cile", "GFT": "Ora della Guiana francese", "AWDT": "Ora legale dell’Australia occidentale", "AEST": "Ora standard dell’Australia orientale", "UYT": "Ora standard dell’Uruguay", "∅∅∅": "Ora legale del Perù", "ADT": "Ora legale dell’Atlantico", "PDT": "Ora legale del Pacifico USA", "HAST": "Ora standard delle Isole Hawaii-Aleutine", "TMT": "Ora standard del Turkmenistan", "CHADT": "Ora legale delle Chatham", "ACWST": "Ora standard dell’Australia centroccidentale", "AKST": "Ora standard dell’Alaska", "ARST": "Ora legale dell’Argentina", "PST": "Ora standard del Pacifico USA", "WAST": "Ora legale dell’Africa occidentale", "WESZ": "Ora legale dell’Europa occidentale", "ACST": "Ora standard dell’Australia centrale", "ACDT": "Ora legale dell’Australia centrale", "EDT": "Ora legale orientale USA", "COT": "Ora standard della Colombia", "CAT": "Ora dell’Africa centrale", "WITA": "Ora dell’Indonesia centrale", "JST": "Ora standard del Giappone", "GYT": "Ora della Guyana", "COST": "Ora legale della Colombia", "CST": "Ora standard centrale USA", "HKST": "Ora legale di Hong Kong", "AKDT": "Ora legale dell’Alaska", "HADT": "Ora legale delle Isole Hawaii-Aleutine", "NZST": "Ora standard della Nuova Zelanda", "SAST": "Ora dell’Africa meridionale", "HNT": "Ora standard di Terranova", "EAT": "Ora dell’Africa orientale", "BT": "Ora del Bhutan", "SRT": "Ora del Suriname", "ART": "Ora standard dell’Argentina", "MESZ": "Ora legale dell’Europa centrale", "ChST": "Ora Chamorro", "MDT": "Ora legale Montagne Rocciose USA", "CDT": "Ora legale centrale USA", "CHAST": "Ora standard delle Chatham", "AST": "Ora standard dell’Atlantico", "AWST": "Ora standard dell’Australia occidentale", "BOT": "Ora della Bolivia", "WAT": "Ora standard dell’Africa occidentale", "UYST": "Ora legale dell’Uruguay", "VET": "Ora del Venezuela", "AEDT": "Ora legale dell’Australia orientale", "OESZ": "Ora legale dell’Europa orientale", "WART": "Ora standard dell’Argentina occidentale", "IST": "Ora standard dell’India"},
}
}
diff --git a/it_CH/it_CH_test.go b/it_CH/it_CH_test.go
new file mode 100644
index 00000000..2de43dc5
--- /dev/null
+++ b/it_CH/it_CH_test.go
@@ -0,0 +1,1120 @@
+package it_CH
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "it_CH"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/it_IT/it_IT.go b/it_IT/it_IT.go
index b1c7af43..31110bee 100644
--- a/it_IT/it_IT.go
+++ b/it_IT/it_IT.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a.C.", "d.C."},
erasNarrow: []string{"aC", "dC"},
erasWide: []string{"a.C.", "d.C."},
- timezones: map[string]string{"COST": "Ora legale della Colombia", "AST": "Ora standard dell’Atlantico", "AWST": "Ora standard dell’Australia occidentale", "GYT": "Ora della Guyana", "BOT": "Ora della Bolivia", "ACWST": "Ora standard dell’Australia centroccidentale", "AEDT": "Ora legale dell’Australia orientale", "MDT": "Ora legale Montagne Rocciose USA", "SGT": "Ora Singapore", "GMT": "Ora del meridiano di Greenwich", "EAT": "Ora dell’Africa orientale", "WEZ": "Ora standard dell’Europa occidentale", "CLT": "Ora standard del Cile", "HKST": "Ora legale di Hong Kong", "PDT": "Ora legale del Pacifico USA", "LHDT": "Ora legale di Lord Howe", "HAST": "Ora standard delle Isole Hawaii-Aleutine", "AWDT": "Ora legale dell’Australia occidentale", "JDT": "Ora legale del Giappone", "MST": "Ora standard Montagne Rocciose USA", "CHADT": "Ora legale delle Chatham", "WESZ": "Ora legale dell’Europa occidentale", "VET": "Ora del Venezuela", "WAST": "Ora legale dell’Africa occidentale", "HKT": "Ora standard di Hong Kong", "GFT": "Ora della Guiana francese", "TMST": "Ora legale del Turkmenistan", "WART": "Ora standard dell’Argentina occidentale", "WIT": "Ora dell’Indonesia orientale", "MYT": "Ora della Malesia", "CDT": "Ora legale centrale USA", "UYT": "Ora standard dell’Uruguay", "CLST": "Ora legale del Cile", "CAT": "Ora dell’Africa centrale", "EST": "Ora standard orientale USA", "ACST": "Ora standard dell’Australia centrale", "LHST": "Ora standard di Lord Howe", "MESZ": "Ora legale dell’Europa centrale", "UYST": "Ora legale dell’Uruguay", "COT": "Ora standard della Colombia", "ACDT": "Ora legale dell’Australia centrale", "CST": "Ora standard centrale USA", "ECT": "Ora dell’Ecuador", "SRT": "Ora del Suriname", "AEST": "Ora standard dell’Australia orientale", "WITA": "Ora dell’Indonesia centrale", "ACWDT": "Ora legale dell’Australia centroccidentale", "ChST": "Ora Chamorro", "WAT": "Ora standard dell’Africa occidentale", "WARST": "Ora legale dell’Argentina occidentale", "IST": "Ora standard dell’India", "OESZ": "Ora legale dell’Europa orientale", "AKST": "Ora standard dell’Alaska", "ADT": "Ora legale dell’Atlantico", "BT": "Ora del Bhutan", "WIB": "Ora dell’Indonesia occidentale", "SAST": "Ora dell’Africa meridionale", "OEZ": "Ora standard dell’Europa orientale", "PST": "Ora standard del Pacifico USA", "JST": "Ora standard del Giappone", "MEZ": "Ora standard dell’Europa centrale", "CHAST": "Ora standard delle Chatham", "EDT": "Ora legale orientale USA", "HADT": "Ora legale delle Isole Hawaii-Aleutine", "ART": "Ora standard dell’Argentina", "AKDT": "Ora legale dell’Alaska", "NZDT": "Ora legale della Nuova Zelanda", "HAT": "Ora legale di Terranova", "∅∅∅": "Ora legale delle Azzorre", "NZST": "Ora standard della Nuova Zelanda", "ARST": "Ora legale dell’Argentina", "HNT": "Ora standard di Terranova", "TMT": "Ora standard del Turkmenistan"},
+ timezones: map[string]string{"CLT": "Ora standard del Cile", "LHDT": "Ora legale di Lord Howe", "HKST": "Ora legale di Hong Kong", "WITA": "Ora dell’Indonesia centrale", "COT": "Ora standard della Colombia", "LHST": "Ora standard di Lord Howe", "ADT": "Ora legale dell’Atlantico", "TMST": "Ora legale del Turkmenistan", "UYST": "Ora legale dell’Uruguay", "JDT": "Ora legale del Giappone", "PDT": "Ora legale del Pacifico USA", "SGT": "Ora Singapore", "WAST": "Ora legale dell’Africa occidentale", "WESZ": "Ora legale dell’Europa occidentale", "AEST": "Ora standard dell’Australia orientale", "UYT": "Ora standard dell’Uruguay", "ECT": "Ora dell’Ecuador", "ARST": "Ora legale dell’Argentina", "IST": "Ora standard dell’India", "CDT": "Ora legale centrale USA", "VET": "Ora del Venezuela", "HKT": "Ora standard di Hong Kong", "CLST": "Ora legale del Cile", "CAT": "Ora dell’Africa centrale", "∅∅∅": "Ora legale delle Azzorre", "AKDT": "Ora legale dell’Alaska", "ACWDT": "Ora legale dell’Australia centroccidentale", "NZDT": "Ora legale della Nuova Zelanda", "AWDT": "Ora legale dell’Australia occidentale", "GFT": "Ora della Guiana francese", "HAT": "Ora legale di Terranova", "MYT": "Ora della Malesia", "WIT": "Ora dell’Indonesia orientale", "SAST": "Ora dell’Africa meridionale", "TMT": "Ora standard del Turkmenistan", "WEZ": "Ora standard dell’Europa occidentale", "GMT": "Ora del meridiano di Greenwich", "ACST": "Ora standard dell’Australia centrale", "MST": "MST", "MESZ": "Ora legale dell’Europa centrale", "HAST": "Ora standard delle Isole Hawaii-Aleutine", "ChST": "Ora Chamorro", "BOT": "Ora della Bolivia", "PST": "Ora standard del Pacifico USA", "WIB": "Ora dell’Indonesia occidentale", "HNT": "Ora standard di Terranova", "CST": "Ora standard centrale USA", "ACDT": "Ora legale dell’Australia centrale", "WARST": "Ora legale dell’Argentina occidentale", "ACWST": "Ora standard dell’Australia centroccidentale", "GYT": "Ora della Guyana", "OEZ": "Ora standard dell’Europa orientale", "OESZ": "Ora legale dell’Europa orientale", "WART": "Ora standard dell’Argentina occidentale", "ART": "Ora standard dell’Argentina", "MEZ": "Ora standard dell’Europa centrale", "NZST": "Ora standard della Nuova Zelanda", "EST": "Ora standard orientale USA", "EDT": "Ora legale orientale USA", "MDT": "MDT", "JST": "Ora standard del Giappone", "AKST": "Ora standard dell’Alaska", "AST": "Ora standard dell’Atlantico", "AEDT": "Ora legale dell’Australia orientale", "EAT": "Ora dell’Africa orientale", "SRT": "Ora del Suriname", "CHADT": "Ora legale delle Chatham", "AWST": "Ora standard dell’Australia occidentale", "HADT": "Ora legale delle Isole Hawaii-Aleutine", "CHAST": "Ora standard delle Chatham", "COST": "Ora legale della Colombia", "WAT": "Ora standard dell’Africa occidentale", "BT": "Ora del Bhutan"},
}
}
diff --git a/it_IT/it_IT_test.go b/it_IT/it_IT_test.go
new file mode 100644
index 00000000..f29cba3f
--- /dev/null
+++ b/it_IT/it_IT_test.go
@@ -0,0 +1,1120 @@
+package it_IT
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "it_IT"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/it_SM/it_SM.go b/it_SM/it_SM.go
index 54ec86c2..deac0262 100644
--- a/it_SM/it_SM.go
+++ b/it_SM/it_SM.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a.C.", "d.C."},
erasNarrow: []string{"aC", "dC"},
erasWide: []string{"a.C.", "d.C."},
- timezones: map[string]string{"LHDT": "Ora legale di Lord Howe", "UYT": "Ora standard dell’Uruguay", "MST": "Ora standard Montagne Rocciose USA", "CHAST": "Ora standard delle Chatham", "OEZ": "Ora standard dell’Europa orientale", "ARST": "Ora legale dell’Argentina", "TMT": "Ora standard del Turkmenistan", "HKT": "Ora standard di Hong Kong", "OESZ": "Ora legale dell’Europa orientale", "TMST": "Ora legale del Turkmenistan", "GYT": "Ora della Guyana", "MYT": "Ora della Malesia", "∅∅∅": "Ora legale delle Azzorre", "WEZ": "Ora standard dell’Europa occidentale", "SAST": "Ora dell’Africa meridionale", "WIT": "Ora dell’Indonesia orientale", "ART": "Ora standard dell’Argentina", "PST": "Ora standard del Pacifico USA", "WESZ": "Ora legale dell’Europa occidentale", "MEZ": "Ora standard dell’Europa centrale", "VET": "Ora del Venezuela", "HADT": "Ora legale delle Isole Hawaii-Aleutine", "IST": "Ora standard dell’India", "NZST": "Ora standard della Nuova Zelanda", "CAT": "Ora dell’Africa centrale", "ADT": "Ora legale dell’Atlantico", "WARST": "Ora legale dell’Argentina occidentale", "ACST": "Ora standard dell’Australia centrale", "MESZ": "Ora legale dell’Europa centrale", "NZDT": "Ora legale della Nuova Zelanda", "JDT": "Ora legale del Giappone", "CLT": "Ora standard del Cile", "CLST": "Ora legale del Cile", "ECT": "Ora dell’Ecuador", "BT": "Ora del Bhutan", "GFT": "Ora della Guiana francese", "EAT": "Ora dell’Africa orientale", "AEDT": "Ora legale dell’Australia orientale", "MDT": "Ora legale Montagne Rocciose USA", "HAST": "Ora standard delle Isole Hawaii-Aleutine", "ACWDT": "Ora legale dell’Australia centroccidentale", "WAST": "Ora legale dell’Africa occidentale", "GMT": "Ora del meridiano di Greenwich", "AKST": "Ora standard dell’Alaska", "BOT": "Ora della Bolivia", "AEST": "Ora standard dell’Australia orientale", "COT": "Ora standard della Colombia", "HKST": "Ora legale di Hong Kong", "WART": "Ora standard dell’Argentina occidentale", "SRT": "Ora del Suriname", "HNT": "Ora standard di Terranova", "WIB": "Ora dell’Indonesia occidentale", "ACDT": "Ora legale dell’Australia centrale", "CST": "Ora standard centrale USA", "CDT": "Ora legale centrale USA", "ACWST": "Ora standard dell’Australia centroccidentale", "COST": "Ora legale della Colombia", "SGT": "Ora Singapore", "WITA": "Ora dell’Indonesia centrale", "HAT": "Ora legale di Terranova", "PDT": "Ora legale del Pacifico USA", "AWST": "Ora standard dell’Australia occidentale", "JST": "Ora standard del Giappone", "AKDT": "Ora legale dell’Alaska", "ChST": "Ora Chamorro", "EST": "Ora standard orientale USA", "WAT": "Ora standard dell’Africa occidentale", "AWDT": "Ora legale dell’Australia occidentale", "LHST": "Ora standard di Lord Howe", "UYST": "Ora legale dell’Uruguay", "CHADT": "Ora legale delle Chatham", "EDT": "Ora legale orientale USA", "AST": "Ora standard dell’Atlantico"},
+ timezones: map[string]string{"EST": "Ora standard orientale USA", "PDT": "Ora legale del Pacifico USA", "WAT": "Ora standard dell’Africa occidentale", "TMST": "Ora legale del Turkmenistan", "MDT": "Ora legale Montagne Rocciose USA", "HKT": "Ora standard di Hong Kong", "VET": "Ora del Venezuela", "HAT": "Ora legale di Terranova", "GMT": "Ora del meridiano di Greenwich", "CLT": "Ora standard del Cile", "UYST": "Ora legale dell’Uruguay", "SRT": "Ora del Suriname", "ACWDT": "Ora legale dell’Australia centroccidentale", "PST": "Ora standard del Pacifico USA", "HAST": "Ora standard delle Isole Hawaii-Aleutine", "WIT": "Ora dell’Indonesia orientale", "ACST": "Ora standard dell’Australia centrale", "AST": "Ora standard dell’Atlantico", "∅∅∅": "Ora legale dell’Amazzonia", "LHDT": "Ora legale di Lord Howe", "AWST": "Ora standard dell’Australia occidentale", "MEZ": "Ora standard dell’Europa centrale", "BOT": "Ora della Bolivia", "AEDT": "Ora legale dell’Australia orientale", "JST": "Ora standard del Giappone", "WAST": "Ora legale dell’Africa occidentale", "MYT": "Ora della Malesia", "ECT": "Ora dell’Ecuador", "AKST": "Ora standard dell’Alaska", "NZST": "Ora standard della Nuova Zelanda", "SGT": "Ora Singapore", "WIB": "Ora dell’Indonesia occidentale", "OESZ": "Ora legale dell’Europa orientale", "MST": "Ora standard Montagne Rocciose USA", "CDT": "Ora legale centrale USA", "WITA": "Ora dell’Indonesia centrale", "NZDT": "Ora legale della Nuova Zelanda", "AKDT": "Ora legale dell’Alaska", "HADT": "Ora legale delle Isole Hawaii-Aleutine", "WEZ": "Ora standard dell’Europa occidentale", "EAT": "Ora dell’Africa orientale", "AWDT": "Ora legale dell’Australia occidentale", "IST": "Ora standard dell’India", "HNT": "Ora standard di Terranova", "GFT": "Ora della Guiana francese", "CHADT": "Ora legale delle Chatham", "CLST": "Ora legale del Cile", "ADT": "Ora legale dell’Atlantico", "ART": "Ora standard dell’Argentina", "MESZ": "Ora legale dell’Europa centrale", "SAST": "Ora dell’Africa meridionale", "COT": "Ora standard della Colombia", "AEST": "Ora standard dell’Australia orientale", "GYT": "Ora della Guyana", "ACWST": "Ora standard dell’Australia centroccidentale", "EDT": "Ora legale orientale USA", "CAT": "Ora dell’Africa centrale", "ChST": "Ora Chamorro", "UYT": "Ora standard dell’Uruguay", "ACDT": "Ora legale dell’Australia centrale", "CHAST": "Ora standard delle Chatham", "WESZ": "Ora legale dell’Europa occidentale", "OEZ": "Ora standard dell’Europa orientale", "WART": "Ora standard dell’Argentina occidentale", "CST": "Ora standard centrale USA", "JDT": "Ora legale del Giappone", "COST": "Ora legale della Colombia", "TMT": "Ora standard del Turkmenistan", "WARST": "Ora legale dell’Argentina occidentale", "HKST": "Ora legale di Hong Kong", "BT": "Ora del Bhutan", "LHST": "Ora standard di Lord Howe", "ARST": "Ora legale dell’Argentina"},
}
}
diff --git a/it_SM/it_SM_test.go b/it_SM/it_SM_test.go
new file mode 100644
index 00000000..daeef3b4
--- /dev/null
+++ b/it_SM/it_SM_test.go
@@ -0,0 +1,1120 @@
+package it_SM
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "it_SM"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ja/ja.go b/ja/ja.go
index 75a5fb1b..3da24adc 100644
--- a/ja/ja.go
+++ b/ja/ja.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"紀元前", "西暦"},
erasNarrow: []string{"BC", "AD"},
erasWide: []string{"紀元前", "西暦"},
- timezones: map[string]string{"CLST": "チリ夏時間", "WARST": "西部アルゼンチン夏時間", "GMT": "グリニッジ標準時", "HAT": "ニューファンドランド夏時間", "ART": "アルゼンチン標準時", "MYT": "マレーシア時間", "NZDT": "ニュージーランド夏時間", "AST": "大西洋標準時", "JDT": "日本夏時間", "NZST": "ニュージーランド標準時", "AEST": "オーストラリア東部標準時", "MDT": "アメリカ山地夏時間", "ARST": "アルゼンチン夏時間", "AWDT": "オーストラリア西部夏時間", "LHST": "ロードハウ標準時", "CAT": "中央アフリカ時間", "HNT": "ニューファンドランド標準時", "AWST": "オーストラリア西部標準時", "VET": "ベネズエラ時間", "ECT": "エクアドル時間", "HADT": "ハワイ・アリューシャン夏時間", "WAST": "西アフリカ夏時間", "AKST": "アラスカ標準時", "PDT": "アメリカ太平洋夏時間", "MEZ": "中央ヨーロッパ標準時", "WEZ": "西ヨーロッパ標準時", "CHADT": "チャタム夏時間", "SAST": "南アフリカ標準時", "SRT": "スリナム時間", "PST": "アメリカ太平洋標準時", "EST": "アメリカ東部標準時", "HAST": "ハワイ・アリューシャン標準時", "OESZ": "東ヨーロッパ夏時間", "ACDT": "オーストラリア中部夏時間", "CLT": "チリ標準時", "COT": "コロンビア標準時", "JST": "日本標準時", "BOT": "ボリビア時間", "AEDT": "オーストラリア東部夏時間", "∅∅∅": "ブラジリア夏時間", "WAT": "西アフリカ標準時", "HKT": "香港標準時", "WIT": "インドネシア東部時間", "CST": "アメリカ中部標準時", "MST": "アメリカ山地標準時", "COST": "コロンビア夏時間", "LHDT": "ロードハウ夏時間", "WART": "西部アルゼンチン標準時", "WITA": "インドネシア中部時間", "TMT": "トルクメニスタン標準時", "ACWDT": "オーストラリア中西部夏時間", "EDT": "アメリカ東部夏時間", "BT": "ブータン時間", "GFT": "仏領ギアナ時間", "EAT": "東アフリカ時間", "TMST": "トルクメニスタン夏時間", "UYT": "ウルグアイ標準時", "WIB": "インドネシア西部時間", "IST": "インド標準時", "OEZ": "東ヨーロッパ標準時", "ACST": "オーストラリア中部標準時", "AKDT": "アラスカ夏時間", "CDT": "アメリカ中部夏時間", "ACWST": "オーストラリア中西部標準時", "ChST": "チャモロ時間", "CHAST": "チャタム標準時", "HKST": "香港夏時間", "GYT": "ガイアナ時間", "ADT": "大西洋夏時間", "UYST": "ウルグアイ夏時間", "WESZ": "西ヨーロッパ夏時間", "SGT": "シンガポール標準時", "MESZ": "中央ヨーロッパ夏時間"},
+ timezones: map[string]string{"MESZ": "中央ヨーロッパ夏時間", "TMT": "トルクメニスタン標準時", "AEDT": "オーストラリア東部夏時間", "EAT": "東アフリカ時間", "UYST": "ウルグアイ夏時間", "ACWDT": "オーストラリア中西部夏時間", "HAST": "ハワイ・アリューシャン標準時", "CAT": "中央アフリカ時間", "CST": "アメリカ中部標準時", "CHAST": "チャタム標準時", "ECT": "エクアドル時間", "SAST": "南アフリカ標準時", "PDT": "アメリカ太平洋夏時間", "NZDT": "ニュージーランド夏時間", "SRT": "スリナム時間", "HKST": "香港夏時間", "WEZ": "西ヨーロッパ標準時", "UYT": "ウルグアイ標準時", "HADT": "ハワイ・アリューシャン夏時間", "WAST": "西アフリカ夏時間", "WIT": "インドネシア東部時間", "ACST": "オーストラリア中部標準時", "AWST": "オーストラリア西部標準時", "ART": "アルゼンチン標準時", "SGT": "シンガポール標準時", "LHST": "ロードハウ標準時", "AKST": "アラスカ標準時", "AST": "大西洋標準時", "BOT": "ボリビア時間", "HNT": "ニューファンドランド標準時", "HAT": "ニューファンドランド夏時間", "OESZ": "東ヨーロッパ夏時間", "ChST": "チャモロ時間", "JDT": "日本夏時間", "WART": "西部アルゼンチン標準時", "HKT": "香港標準時", "EST": "アメリカ東部標準時", "NZST": "ニュージーランド標準時", "COST": "コロンビア夏時間", "CLT": "チリ標準時", "CDT": "アメリカ中部夏時間", "ACDT": "オーストラリア中部夏時間", "CHADT": "チャタム夏時間", "ADT": "大西洋夏時間", "AWDT": "オーストラリア西部夏時間", "WAT": "西アフリカ標準時", "WESZ": "西ヨーロッパ夏時間", "TMST": "トルクメニスタン夏時間", "OEZ": "東ヨーロッパ標準時", "ARST": "アルゼンチン夏時間", "WITA": "インドネシア中部時間", "WIB": "インドネシア西部時間", "GMT": "グリニッジ標準時", "MST": "アメリカ山地標準時", "MDT": "アメリカ山地夏時間", "AKDT": "アラスカ夏時間", "JST": "日本標準時", "WARST": "西部アルゼンチン夏時間", "MEZ": "中央ヨーロッパ標準時", "∅∅∅": "アマゾン夏時間", "COT": "コロンビア標準時", "GYT": "ガイアナ時間", "LHDT": "ロードハウ夏時間", "MYT": "マレーシア時間", "IST": "インド標準時", "EDT": "アメリカ東部夏時間", "AEST": "オーストラリア東部標準時", "BT": "ブータン時間", "VET": "ベネズエラ時間", "ACWST": "オーストラリア中西部標準時", "PST": "アメリカ太平洋標準時", "CLST": "チリ夏時間", "GFT": "仏領ギアナ時間"},
}
}
diff --git a/ja/ja_test.go b/ja/ja_test.go
new file mode 100644
index 00000000..9b82837e
--- /dev/null
+++ b/ja/ja_test.go
@@ -0,0 +1,1120 @@
+package ja
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ja"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ja_JP/ja_JP.go b/ja_JP/ja_JP.go
index 1f04f595..453d1ebc 100644
--- a/ja_JP/ja_JP.go
+++ b/ja_JP/ja_JP.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"紀元前", "西暦"},
erasNarrow: []string{"BC", "AD"},
erasWide: []string{"紀元前", "西暦"},
- timezones: map[string]string{"ART": "アルゼンチン標準時", "AKDT": "アラスカ夏時間", "NZST": "ニュージーランド標準時", "EDT": "アメリカ東部夏時間", "ADT": "大西洋夏時間", "HADT": "ハワイ・アリューシャン夏時間", "WAT": "西アフリカ標準時", "HAT": "ニューファンドランド夏時間", "WESZ": "西ヨーロッパ夏時間", "AEDT": "オーストラリア東部夏時間", "ECT": "エクアドル時間", "OESZ": "東ヨーロッパ夏時間", "GMT": "グリニッジ標準時", "ARST": "アルゼンチン夏時間", "WARST": "西部アルゼンチン夏時間", "WIT": "インドネシア東部時間", "ACWST": "オーストラリア中西部標準時", "AST": "大西洋標準時", "EAT": "東アフリカ時間", "TMT": "トルクメニスタン標準時", "TMST": "トルクメニスタン夏時間", "GYT": "ガイアナ時間", "CAT": "中央アフリカ時間", "HAST": "ハワイ・アリューシャン標準時", "SGT": "シンガポール標準時", "WAST": "西アフリカ夏時間", "HKT": "香港標準時", "AWDT": "オーストラリア西部夏時間", "GFT": "仏領ギアナ時間", "ACST": "オーストラリア中部標準時", "CDT": "アメリカ中部夏時間", "BOT": "ボリビア時間", "MST": "アメリカ山地標準時", "MDT": "アメリカ山地夏時間", "CHAST": "チャタム標準時", "HKST": "香港夏時間", "WEZ": "西ヨーロッパ標準時", "COT": "コロンビア標準時", "OEZ": "東ヨーロッパ標準時", "WITA": "インドネシア中部時間", "ACDT": "オーストラリア中部夏時間", "SAST": "南アフリカ標準時", "HNT": "ニューファンドランド標準時", "SRT": "スリナム時間", "NZDT": "ニュージーランド夏時間", "ACWDT": "オーストラリア中西部夏時間", "ChST": "チャモロ時間", "CHADT": "チャタム夏時間", "IST": "インド標準時", "LHST": "ロードハウ標準時", "BT": "ブータン時間", "AEST": "オーストラリア東部標準時", "WART": "西部アルゼンチン標準時", "WIB": "インドネシア西部時間", "LHDT": "ロードハウ夏時間", "MESZ": "中央ヨーロッパ夏時間", "UYST": "ウルグアイ夏時間", "CLT": "チリ標準時", "CLST": "チリ夏時間", "EST": "アメリカ東部標準時", "COST": "コロンビア夏時間", "MYT": "マレーシア時間", "UYT": "ウルグアイ標準時", "∅∅∅": "ブラジリア夏時間", "AKST": "アラスカ標準時", "PST": "アメリカ太平洋標準時", "PDT": "アメリカ太平洋夏時間", "AWST": "オーストラリア西部標準時", "MEZ": "中央ヨーロッパ標準時", "JDT": "日本夏時間", "CST": "アメリカ中部標準時", "VET": "ベネズエラ時間", "JST": "日本標準時"},
+ timezones: map[string]string{"SRT": "スリナム時間", "HKST": "香港夏時間", "JST": "日本標準時", "IST": "インド標準時", "NZDT": "ニュージーランド夏時間", "COT": "コロンビア標準時", "UYT": "ウルグアイ標準時", "MDT": "アメリカ山地夏時間", "ART": "アルゼンチン標準時", "EST": "アメリカ東部標準時", "SGT": "シンガポール標準時", "ChST": "チャモロ時間", "BT": "ブータン時間", "MESZ": "中央ヨーロッパ夏時間", "VET": "ベネズエラ時間", "ECT": "エクアドル時間", "ACWDT": "オーストラリア中西部夏時間", "MEZ": "中央ヨーロッパ標準時", "WAST": "西アフリカ夏時間", "OESZ": "東ヨーロッパ夏時間", "UYST": "ウルグアイ夏時間", "CDT": "アメリカ中部夏時間", "OEZ": "東ヨーロッパ標準時", "AEDT": "オーストラリア東部夏時間", "ACDT": "オーストラリア中部夏時間", "ACST": "オーストラリア中部標準時", "WARST": "西部アルゼンチン夏時間", "CHAST": "チャタム標準時", "JDT": "日本夏時間", "TMST": "トルクメニスタン夏時間", "WEZ": "西ヨーロッパ標準時", "WESZ": "西ヨーロッパ夏時間", "MYT": "マレーシア時間", "AST": "大西洋標準時", "AWDT": "オーストラリア西部夏時間", "PDT": "アメリカ太平洋夏時間", "COST": "コロンビア夏時間", "MST": "アメリカ山地標準時", "∅∅∅": "ブラジリア夏時間", "GFT": "仏領ギアナ時間", "AKDT": "アラスカ夏時間", "ACWST": "オーストラリア中西部標準時", "CLST": "チリ夏時間", "WIT": "インドネシア東部時間", "EAT": "東アフリカ時間", "LHDT": "ロードハウ夏時間", "HKT": "香港標準時", "AKST": "アラスカ標準時", "WIB": "インドネシア西部時間", "CAT": "中央アフリカ時間", "HAT": "ニューファンドランド夏時間", "LHST": "ロードハウ標準時", "BOT": "ボリビア時間", "EDT": "アメリカ東部夏時間", "SAST": "南アフリカ標準時", "GMT": "グリニッジ標準時", "WART": "西部アルゼンチン標準時", "WITA": "インドネシア中部時間", "ADT": "大西洋夏時間", "HNT": "ニューファンドランド標準時", "HADT": "ハワイ・アリューシャン夏時間", "AEST": "オーストラリア東部標準時", "HAST": "ハワイ・アリューシャン標準時", "PST": "アメリカ太平洋標準時", "ARST": "アルゼンチン夏時間", "TMT": "トルクメニスタン標準時", "WAT": "西アフリカ標準時", "CST": "アメリカ中部標準時", "CHADT": "チャタム夏時間", "GYT": "ガイアナ時間", "CLT": "チリ標準時", "AWST": "オーストラリア西部標準時", "NZST": "ニュージーランド標準時"},
}
}
diff --git a/ja_JP/ja_JP_test.go b/ja_JP/ja_JP_test.go
new file mode 100644
index 00000000..1a94dacf
--- /dev/null
+++ b/ja_JP/ja_JP_test.go
@@ -0,0 +1,1120 @@
+package ja_JP
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ja_JP"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/jgo/jgo.go b/jgo/jgo.go
index af6832df..8d7da8bf 100644
--- a/jgo/jgo.go
+++ b/jgo/jgo.go
@@ -69,7 +69,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BCE", "CE"},
erasNarrow: []string{"", ""},
erasWide: []string{"tsɛttsɛt mɛŋguꞌ mi ɛ́ lɛɛnɛ Kɛlísɛtɔ gɔ ńɔ́", "tsɛttsɛt mɛŋguꞌ mi ɛ́ fúnɛ Kɛlísɛtɔ tɔ́ mɔ́"},
- timezones: map[string]string{"WITA": "WITA", "ACDT": "ACDT", "UYST": "UYST", "CHAST": "CHAST", "JST": "JST", "CDT": "CDT", "CLT": "CLT", "AEDT": "AEDT", "EST": "EST", "GMT": "GMT", "SRT": "SRT", "ECT": "ECT", "AKDT": "AKDT", "NZST": "NZST", "ACWST": "ACWST", "WIT": "WIT", "WIB": "WIB", "ARST": "ARST", "LHDT": "LHDT", "MYT": "MYT", "EDT": "EDT", "HAST": "HAST", "CST": "CST", "CHADT": "CHADT", "COST": "COST", "MST": "MST", "MEZ": "MEZ", "ChST": "ChST", "ART": "ART", "TMST": "TMST", "PDT": "PDT", "AWST": "AWST", "UYT": "UYT", "NZDT": "NZDT", "HKST": "HKST", "WAT": "WAT", "HNT": "HNT", "OEZ": "OEZ", "MDT": "MDT", "BOT": "BOT", "∅∅∅": "∅∅∅", "ADT": "ADT", "LHST": "LHST", "MESZ": "MESZ", "WEZ": "WEZ", "CLST": "CLST", "VET": "VET", "ACWDT": "ACWDT", "AST": "AST", "WARST": "WARST", "GFT": "GFT", "EAT": "EAT", "AWDT": "AWDT", "COT": "COT", "WESZ": "WESZ", "SGT": "SGT", "HKT": "HKT", "WAST": "WAST", "IST": "IST", "JDT": "JDT", "PST": "PST", "HADT": "HADT", "WART": "WART", "BT": "BT", "ACST": "ACST", "AKST": "AKST", "SAST": "SAST", "HAT": "HAT", "OESZ": "OESZ", "CAT": "CAT", "TMT": "TMT", "GYT": "GYT", "AEST": "AEST"},
+ timezones: map[string]string{"OEZ": "OEZ", "LHST": "LHST", "CDT": "CDT", "PST": "PST", "WAST": "WAST", "CAT": "CAT", "PDT": "PDT", "MESZ": "MESZ", "WARST": "WARST", "WAT": "WAT", "ChST": "ChST", "AEDT": "AEDT", "SGT": "SGT", "TMT": "TMT", "HAST": "HAST", "GYT": "GYT", "BT": "BT", "MST": "MST", "EST": "EST", "COT": "COT", "MYT": "MYT", "EAT": "EAT", "JST": "JST", "WEZ": "WEZ", "COST": "COST", "WIB": "WIB", "LHDT": "LHDT", "WART": "WART", "ACWST": "ACWST", "EDT": "EDT", "SAST": "SAST", "HAT": "HAT", "UYT": "UYT", "CST": "CST", "CHAST": "CHAST", "AKDT": "AKDT", "HNT": "HNT", "ARST": "ARST", "JDT": "JDT", "AST": "AST", "UYST": "UYST", "WIT": "WIT", "ACDT": "ACDT", "HKT": "HKT", "WITA": "WITA", "MEZ": "MEZ", "TMST": "TMST", "GMT": "GMT", "ART": "ART", "AKST": "AKST", "CLT": "CLT", "NZDT": "NZDT", "OESZ": "OESZ", "VET": "VET", "HKST": "HKST", "AWDT": "AWDT", "IST": "IST", "CLST": "CLST", "GFT": "GFT", "ECT": "ECT", "NZST": "NZST", "AEST": "AEST", "SRT": "SRT", "MDT": "MDT", "AWST": "AWST", "BOT": "BOT", "WESZ": "WESZ", "ACST": "ACST", "CHADT": "CHADT", "ACWDT": "ACWDT", "HADT": "HADT", "∅∅∅": "∅∅∅", "ADT": "ADT"},
}
}
diff --git a/jgo/jgo_test.go b/jgo/jgo_test.go
new file mode 100644
index 00000000..52b477e1
--- /dev/null
+++ b/jgo/jgo_test.go
@@ -0,0 +1,1120 @@
+package jgo
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "jgo"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/jgo_CM/jgo_CM.go b/jgo_CM/jgo_CM.go
index 3b6d6ca1..3989a207 100644
--- a/jgo_CM/jgo_CM.go
+++ b/jgo_CM/jgo_CM.go
@@ -69,7 +69,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BCE", "CE"},
erasNarrow: []string{"", ""},
erasWide: []string{"tsɛttsɛt mɛŋguꞌ mi ɛ́ lɛɛnɛ Kɛlísɛtɔ gɔ ńɔ́", "tsɛttsɛt mɛŋguꞌ mi ɛ́ fúnɛ Kɛlísɛtɔ tɔ́ mɔ́"},
- timezones: map[string]string{"LHST": "LHST", "CST": "CST", "MDT": "MDT", "EDT": "EDT", "SGT": "SGT", "GMT": "GMT", "HNT": "HNT", "MYT": "MYT", "NZST": "NZST", "ACWST": "ACWST", "CLST": "CLST", "HAT": "HAT", "WESZ": "WESZ", "CLT": "CLT", "IST": "IST", "HAST": "HAST", "ART": "ART", "GYT": "GYT", "∅∅∅": "∅∅∅", "WIT": "WIT", "SRT": "SRT", "MEZ": "MEZ", "WEZ": "WEZ", "SAST": "SAST", "AKST": "AKST", "PDT": "PDT", "MST": "MST", "AKDT": "AKDT", "AWST": "AWST", "LHDT": "LHDT", "UYST": "UYST", "HADT": "HADT", "JDT": "JDT", "MESZ": "MESZ", "ChST": "ChST", "AST": "AST", "WAT": "WAT", "WART": "WART", "OEZ": "OEZ", "ACST": "ACST", "ACWDT": "ACWDT", "HKST": "HKST", "WITA": "WITA", "TMT": "TMT", "TMST": "TMST", "JST": "JST", "NZDT": "NZDT", "AEST": "AEST", "ECT": "ECT", "GFT": "GFT", "ACDT": "ACDT", "ARST": "ARST", "UYT": "UYT", "EST": "EST", "OESZ": "OESZ", "PST": "PST", "AWDT": "AWDT", "BOT": "BOT", "AEDT": "AEDT", "VET": "VET", "CAT": "CAT", "COST": "COST", "CHAST": "CHAST", "CHADT": "CHADT", "ADT": "ADT", "WAST": "WAST", "WARST": "WARST", "WIB": "WIB", "EAT": "EAT", "CDT": "CDT", "COT": "COT", "BT": "BT", "HKT": "HKT"},
+ timezones: map[string]string{"BT": "BT", "JST": "JST", "MESZ": "MESZ", "HADT": "HADT", "WEZ": "WEZ", "OEZ": "OEZ", "UYST": "UYST", "SRT": "SRT", "HKT": "HKT", "MEZ": "MEZ", "HAST": "HAST", "COST": "COST", "AKST": "AKST", "ART": "ART", "CLT": "CLT", "CHAST": "CHAST", "ACWDT": "ACWDT", "HKST": "HKST", "ACWST": "ACWST", "ChST": "ChST", "CST": "CST", "WARST": "WARST", "AWDT": "AWDT", "TMT": "TMT", "CAT": "CAT", "MYT": "MYT", "AWST": "AWST", "PDT": "PDT", "NZDT": "NZDT", "GYT": "GYT", "LHST": "LHST", "LHDT": "LHDT", "BOT": "BOT", "IST": "IST", "EDT": "EDT", "GFT": "GFT", "GMT": "GMT", "EAT": "EAT", "CDT": "CDT", "ECT": "ECT", "VET": "VET", "NZST": "NZST", "HNT": "HNT", "AEDT": "AEDT", "CLST": "CLST", "WART": "WART", "AST": "AST", "JDT": "JDT", "EST": "EST", "WESZ": "WESZ", "HAT": "HAT", "WIT": "WIT", "ADT": "ADT", "WIB": "WIB", "AEST": "AEST", "MST": "MST", "ACST": "ACST", "ARST": "ARST", "SAST": "SAST", "ACDT": "ACDT", "TMST": "TMST", "WAT": "WAT", "SGT": "SGT", "COT": "COT", "OESZ": "OESZ", "MDT": "MDT", "UYT": "UYT", "CHADT": "CHADT", "WITA": "WITA", "WAST": "WAST", "∅∅∅": "∅∅∅", "AKDT": "AKDT", "PST": "PST"},
}
}
diff --git a/jgo_CM/jgo_CM_test.go b/jgo_CM/jgo_CM_test.go
new file mode 100644
index 00000000..9882c0e9
--- /dev/null
+++ b/jgo_CM/jgo_CM_test.go
@@ -0,0 +1,1120 @@
+package jgo_CM
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "jgo_CM"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/jmc/jmc.go b/jmc/jmc.go
index 92d90dd9..d446bd12 100644
--- a/jmc/jmc.go
+++ b/jmc/jmc.go
@@ -59,7 +59,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"KK", "BK"},
erasNarrow: []string{"", ""},
erasWide: []string{"Kabla ya Kristu", "Baada ya Kristu"},
- timezones: map[string]string{"HAST": "HAST", "WAST": "WAST", "EDT": "EDT", "WART": "WART", "OEZ": "OEZ", "GMT": "GMT", "AWST": "AWST", "JDT": "JDT", "CST": "CST", "CLT": "CLT", "AWDT": "AWDT", "MESZ": "MESZ", "WEZ": "WEZ", "ECT": "ECT", "HNT": "HNT", "GFT": "GFT", "JST": "JST", "UYST": "UYST", "ACWDT": "ACWDT", "AST": "AST", "BOT": "BOT", "UYT": "UYT", "COT": "COT", "HKT": "HKT", "HKST": "HKST", "LHST": "LHST", "ChST": "ChST", "CHAST": "CHAST", "CHADT": "CHADT", "WIB": "WIB", "MYT": "MYT", "∅∅∅": "∅∅∅", "ADT": "ADT", "WIT": "WIT", "ACDT": "ACDT", "WESZ": "WESZ", "ACWST": "ACWST", "AEST": "AEST", "EAT": "EAT", "TMT": "TMT", "TMST": "TMST", "AKST": "AKST", "SRT": "SRT", "AEDT": "AEDT", "SGT": "SGT", "IST": "IST", "OESZ": "OESZ", "ART": "ART", "NZDT": "NZDT", "WARST": "WARST", "AKDT": "AKDT", "PDT": "PDT", "CDT": "CDT", "EST": "EST", "HADT": "HADT", "MEZ": "MEZ", "MST": "MST", "CLST": "CLST", "GYT": "GYT", "NZST": "NZST", "VET": "VET", "CAT": "CAT", "COST": "COST", "WITA": "WITA", "ACST": "ACST", "SAST": "SAST", "WAT": "WAT", "HAT": "HAT", "MDT": "MDT", "BT": "BT", "ARST": "ARST", "PST": "PST", "LHDT": "LHDT"},
+ timezones: map[string]string{"CHADT": "CHADT", "AWDT": "AWDT", "TMT": "TMT", "LHST": "LHST", "HKT": "HKT", "CST": "CST", "ADT": "ADT", "HAT": "HAT", "MST": "MST", "∅∅∅": "∅∅∅", "JST": "JST", "HNT": "HNT", "AEST": "AEST", "SAST": "SAST", "TMST": "TMST", "COST": "COST", "WIB": "WIB", "GMT": "GMT", "AST": "AST", "HAST": "HAST", "EAT": "EAT", "ACST": "ACST", "MEZ": "MEZ", "PDT": "PDT", "WESZ": "WESZ", "OEZ": "OEZ", "CLST": "CLST", "WIT": "WIT", "SRT": "SRT", "ARST": "ARST", "WITA": "WITA", "HADT": "HADT", "GYT": "GYT", "AEDT": "AEDT", "MYT": "MYT", "MDT": "MDT", "WEZ": "WEZ", "LHDT": "LHDT", "AKST": "AKST", "ECT": "ECT", "AKDT": "AKDT", "SGT": "SGT", "COT": "COT", "WAT": "WAT", "OESZ": "OESZ", "CLT": "CLT", "ACDT": "ACDT", "NZST": "NZST", "BOT": "BOT", "WAST": "WAST", "ChST": "ChST", "VET": "VET", "ACWDT": "ACWDT", "CHAST": "CHAST", "ART": "ART", "JDT": "JDT", "BT": "BT", "WART": "WART", "AWST": "AWST", "MESZ": "MESZ", "IST": "IST", "UYST": "UYST", "WARST": "WARST", "GFT": "GFT", "EDT": "EDT", "ACWST": "ACWST", "EST": "EST", "PST": "PST", "UYT": "UYT", "CDT": "CDT", "CAT": "CAT", "HKST": "HKST", "NZDT": "NZDT"},
}
}
diff --git a/jmc/jmc_test.go b/jmc/jmc_test.go
new file mode 100644
index 00000000..c3341dc1
--- /dev/null
+++ b/jmc/jmc_test.go
@@ -0,0 +1,1120 @@
+package jmc
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "jmc"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/jmc_TZ/jmc_TZ.go b/jmc_TZ/jmc_TZ.go
index 86daa56b..62a7f3d3 100644
--- a/jmc_TZ/jmc_TZ.go
+++ b/jmc_TZ/jmc_TZ.go
@@ -59,7 +59,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"KK", "BK"},
erasNarrow: []string{"", ""},
erasWide: []string{"Kabla ya Kristu", "Baada ya Kristu"},
- timezones: map[string]string{"LHST": "LHST", "GYT": "GYT", "CHADT": "CHADT", "COT": "COT", "SAST": "SAST", "WART": "WART", "OESZ": "OESZ", "EDT": "EDT", "OEZ": "OEZ", "WIT": "WIT", "ACDT": "ACDT", "WEZ": "WEZ", "ECT": "ECT", "TMST": "TMST", "HAT": "HAT", "LHDT": "LHDT", "UYT": "UYT", "WESZ": "WESZ", "ACWST": "ACWST", "MST": "MST", "COST": "COST", "HNT": "HNT", "TMT": "TMT", "PDT": "PDT", "AEST": "AEST", "AST": "AST", "HKST": "HKST", "GFT": "GFT", "EAT": "EAT", "ART": "ART", "AEDT": "AEDT", "ChST": "ChST", "WAST": "WAST", "SRT": "SRT", "AWDT": "AWDT", "ACWDT": "ACWDT", "CAT": "CAT", "HAST": "HAST", "IST": "IST", "JDT": "JDT", "CLST": "CLST", "AKST": "AKST", "∅∅∅": "∅∅∅", "UYST": "UYST", "HADT": "HADT", "BOT": "BOT", "VET": "VET", "EST": "EST", "BT": "BT", "PST": "PST", "AWST": "AWST", "ADT": "ADT", "WAT": "WAT", "HKT": "HKT", "WITA": "WITA", "ARST": "ARST", "JST": "JST", "CLT": "CLT", "WARST": "WARST", "MYT": "MYT", "CST": "CST", "CDT": "CDT", "MEZ": "MEZ", "CHAST": "CHAST", "MESZ": "MESZ", "SGT": "SGT", "WIB": "WIB", "AKDT": "AKDT", "NZST": "NZST", "MDT": "MDT", "NZDT": "NZDT", "GMT": "GMT", "ACST": "ACST"},
+ timezones: map[string]string{"MDT": "MDT", "AKDT": "AKDT", "CLST": "CLST", "TMT": "TMT", "AEDT": "AEDT", "ACST": "ACST", "WARST": "WARST", "AWDT": "AWDT", "ART": "ART", "SAST": "SAST", "WIB": "WIB", "MST": "MST", "HKT": "HKT", "CHAST": "CHAST", "GMT": "GMT", "UYST": "UYST", "WIT": "WIT", "ACDT": "ACDT", "ARST": "ARST", "HNT": "HNT", "OEZ": "OEZ", "CLT": "CLT", "IST": "IST", "EDT": "EDT", "WAST": "WAST", "HAT": "HAT", "MYT": "MYT", "JDT": "JDT", "PDT": "PDT", "WEZ": "WEZ", "OESZ": "OESZ", "UYT": "UYT", "BT": "BT", "VET": "VET", "NZST": "NZST", "WAT": "WAT", "AEST": "AEST", "CAT": "CAT", "ChST": "ChST", "GYT": "GYT", "LHST": "LHST", "HKST": "HKST", "ECT": "ECT", "EST": "EST", "MESZ": "MESZ", "TMST": "TMST", "SGT": "SGT", "CST": "CST", "GFT": "GFT", "HADT": "HADT", "WESZ": "WESZ", "LHDT": "LHDT", "WART": "WART", "∅∅∅": "∅∅∅", "CHADT": "CHADT", "JST": "JST", "NZDT": "NZDT", "EAT": "EAT", "AKST": "AKST", "AST": "AST", "WITA": "WITA", "MEZ": "MEZ", "COT": "COT", "COST": "COST", "CDT": "CDT", "SRT": "SRT", "ADT": "ADT", "BOT": "BOT", "PST": "PST", "ACWST": "ACWST", "ACWDT": "ACWDT", "AWST": "AWST", "HAST": "HAST"},
}
}
diff --git a/jmc_TZ/jmc_TZ_test.go b/jmc_TZ/jmc_TZ_test.go
new file mode 100644
index 00000000..b4c33bca
--- /dev/null
+++ b/jmc_TZ/jmc_TZ_test.go
@@ -0,0 +1,1120 @@
+package jmc_TZ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "jmc_TZ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ka/ka.go b/ka/ka.go
index 11d61301..3e23f3c1 100644
--- a/ka/ka.go
+++ b/ka/ka.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ძვ. წ.", "ახ. წ."},
erasNarrow: []string{"", ""},
erasWide: []string{"ძველი წელთაღრიცხვით", "ახალი წელთაღრიცხვით"},
- timezones: map[string]string{"NZST": "ახალი ზელანდიის სტანდარტული დრო", "WARST": "დასავლეთ არგენტინის ზაფხულის დრო", "ARST": "არგენტინის ზაფხულის დრო", "EAT": "აღმოსავლეთ აფრიკის დრო", "SRT": "სურინამის დრო", "PST": "ჩრდილოეთ ამერიკის წყნარი ოკეანის სტანდარტული დრო", "ART": "არგენტინის სტანდარტული დრო", "AWDT": "დასავლეთ ავსტრალიის ზაფხულის დრო", "MYT": "მალაიზიის დრო", "HAT": "ნიუფაუნდლენდის ზაფხულის დრო", "TMST": "თურქმენეთის ზაფხულის დრო", "CAT": "ცენტრალური აფრიკის დრო", "WITA": "ცენტრალური ინდონეზიის დრო", "CHADT": "ჩატემის ზაფხულის დრო", "BT": "ბუტანის დრო", "WIB": "დასავლეთ ინდონეზიის დრო", "MST": "MST", "AWST": "დასავლეთ ავსტრალიის სტანდარტული დრო", "NZDT": "ახალი ზელანდიის ზაფხულის დრო", "CDT": "ჩრდილოეთ ამერიკის ცენტრალური ზაფხულის დრო", "AKST": "ალასკას სტანდარტული დრო", "AEDT": "აღმოსავლეთ ავსტრალიის ზაფხულის დრო", "ChST": "ჩამოროს დრო", "CHAST": "ჩატემის სტანდარტული დრო", "GMT": "გრინვიჩის საშუალო დრო", "ACDT": "ავსტრალიის ცენტრალური ზაფხულის დრო", "GYT": "გაიანის დრო", "UYST": "ურუგვაის ზაფხულის დრო", "MESZ": "ცენტრალური ევროპის ზაფხულის დრო", "CLST": "ჩილეს ზაფხულის დრო", "ACWST": "ცენტრალური და დასავლეთ ავსტრალიის სტანდარტული დრო", "SGT": "სინგაპურის დრო", "WIT": "აღმოსავლეთ ინდონეზიის დრო", "∅∅∅": "ამაზონიის ზაფხულის დრო", "TMT": "თურქმენეთის სტანდარტული დრო", "LHDT": "ლორდ-ჰაუს ზაფხულის დრო", "BOT": "ბოლივიის დრო", "ACWDT": "ცენტრალური და დასავლეთ ავსტრალიის ზაფხულის დრო", "EST": "ჩრდილოეთ ამერიკის აღმოსავლეთის სტანდარტული დრო", "HADT": "ჰავაის და ალეუტის ზაფხულის დრო", "ACST": "ავსტრალიის ცენტრალური სტანდარტული დრო", "MDT": "MDT", "JDT": "იაპონიის ზაფხულის დრო", "MEZ": "ცენტრალური ევროპის სტანდარტული დრო", "WAT": "დასავლეთ აფრიკის სტანდარტული დრო", "HNT": "ნიუფაუნდლენდის სტანდარტული დრო", "SAST": "სამხრეთ აფრიკის დრო", "JST": "იაპონიის სტანდარტული დრო", "CLT": "ჩილეს სტანდარტული დრო", "WESZ": "დასავლეთ ევროპის ზაფხულის დრო", "ECT": "ეკვადორის დრო", "HAST": "ჰავაის და ალეუტის სტანდარტული დრო", "WART": "დასავლეთ არგენტინის სტანდარტული დრო", "PDT": "ჩრდილოეთ ამერიკის წყნარი ოკეანის ზაფხულის დრო", "UYT": "ურუგვაის სტანდარტული დრო", "WEZ": "დასავლეთ ევროპის სტანდარტული დრო", "EDT": "ჩრდილოეთ ამერიკის აღმოსავლეთის ზაფხულის დრო", "WAST": "დასავლეთ აფრიკის ზაფხულის დრო", "GFT": "საფრანგეთის გვიანის დრო", "OESZ": "აღმოსავლეთ ევროპის ზაფხულის დრო", "LHST": "ლორდ-ჰაუს სტანდარტული დრო", "COST": "კოლუმბიის ზაფხულის დრო", "AST": "ატლანტიკის ოკეანის სტანდარტული დრო", "HKST": "ჰონკონგის ზაფხულის დრო", "OEZ": "აღმოსავლეთ ევროპის სტანდარტული დრო", "CST": "ჩრდილოეთ ამერიკის ცენტრალური სტანდარტული დრო", "AEST": "აღმოსავლეთ ავსტრალიის სტანდარტული დრო", "VET": "ვენესუელის დრო", "COT": "კოლუმბიის სტანდარტული დრო", "AKDT": "ალასკას ზაფხულის დრო", "ADT": "ატლანტიკის ოკეანის ზაფხულის დრო", "HKT": "ჰონკონგის სტანდარტული დრო", "IST": "ინდოეთის დრო"},
+ timezones: map[string]string{"AST": "ატლანტიკის ოკეანის სტანდარტული დრო", "JST": "იაპონიის სტანდარტული დრო", "HAST": "ჰავაის და ალეუტის სტანდარტული დრო", "AEST": "აღმოსავლეთ ავსტრალიის სტანდარტული დრო", "SRT": "სურინამის დრო", "EDT": "ჩრდილოეთ ამერიკის აღმოსავლეთის ზაფხულის დრო", "HAT": "ნიუფაუნდლენდის ზაფხულის დრო", "OESZ": "აღმოსავლეთ ევროპის ზაფხულის დრო", "GFT": "საფრანგეთის გვიანის დრო", "AWDT": "დასავლეთ ავსტრალიის ზაფხულის დრო", "AWST": "დასავლეთ ავსტრალიის სტანდარტული დრო", "HNT": "ნიუფაუნდლენდის სტანდარტული დრო", "UYST": "ურუგვაის ზაფხულის დრო", "EAT": "აღმოსავლეთ აფრიკის დრო", "MDT": "MDT", "WAT": "დასავლეთ აფრიკის სტანდარტული დრო", "CAT": "ცენტრალური აფრიკის დრო", "ARST": "არგენტინის ზაფხულის დრო", "VET": "ვენესუელის დრო", "PST": "ჩრდილოეთ ამერიკის წყნარი ოკეანის სტანდარტული დრო", "WEZ": "დასავლეთ ევროპის სტანდარტული დრო", "GYT": "გაიანის დრო", "LHDT": "ლორდ-ჰაუს ზაფხულის დრო", "CLT": "ჩილეს სტანდარტული დრო", "ECT": "ეკვადორის დრო", "ART": "არგენტინის სტანდარტული დრო", "WAST": "დასავლეთ აფრიკის ზაფხულის დრო", "COST": "კოლუმბიის ზაფხულის დრო", "ACWST": "ცენტრალური და დასავლეთ ავსტრალიის სტანდარტული დრო", "AKDT": "ალასკას ზაფხულის დრო", "IST": "ინდოეთის დრო", "TMST": "თურქმენეთის ზაფხულის დრო", "UYT": "ურუგვაის სტანდარტული დრო", "WIT": "აღმოსავლეთ ინდონეზიის დრო", "JDT": "იაპონიის ზაფხულის დრო", "CDT": "ჩრდილოეთ ამერიკის ცენტრალური ზაფხულის დრო", "HKST": "ჰონკონგის ზაფხულის დრო", "CHADT": "ჩატემის ზაფხულის დრო", "AKST": "ალასკას სტანდარტული დრო", "MESZ": "ცენტრალური ევროპის ზაფხულის დრო", "TMT": "თურქმენეთის სტანდარტული დრო", "OEZ": "აღმოსავლეთ ევროპის სტანდარტული დრო", "WARST": "დასავლეთ არგენტინის ზაფხულის დრო", "EST": "ჩრდილოეთ ამერიკის აღმოსავლეთის სტანდარტული დრო", "∅∅∅": "აზორის კუნძულების ზაფხულის დრო", "ADT": "ატლანტიკის ოკეანის ზაფხულის დრო", "WITA": "ცენტრალური ინდონეზიის დრო", "MEZ": "ცენტრალური ევროპის სტანდარტული დრო", "HADT": "ჰავაის და ალეუტის ზაფხულის დრო", "LHST": "ლორდ-ჰაუს სტანდარტული დრო", "CST": "ჩრდილოეთ ამერიკის ცენტრალური სტანდარტული დრო", "CHAST": "ჩატემის სტანდარტული დრო", "PDT": "ჩრდილოეთ ამერიკის წყნარი ოკეანის ზაფხულის დრო", "NZDT": "ახალი ზელანდიის ზაფხულის დრო", "SGT": "სინგაპურის დრო", "AEDT": "აღმოსავლეთ ავსტრალიის ზაფხულის დრო", "BT": "ბუტანის დრო", "MYT": "მალაიზიის დრო", "HKT": "ჰონკონგის სტანდარტული დრო", "CLST": "ჩილეს ზაფხულის დრო", "MST": "MST", "BOT": "ბოლივიის დრო", "ACDT": "ავსტრალიის ცენტრალური ზაფხულის დრო", "ACWDT": "ცენტრალური და დასავლეთ ავსტრალიის ზაფხულის დრო", "NZST": "ახალი ზელანდიის სტანდარტული დრო", "SAST": "სამხრეთ აფრიკის დრო", "WESZ": "დასავლეთ ევროპის ზაფხულის დრო", "WIB": "დასავლეთ ინდონეზიის დრო", "GMT": "გრინვიჩის საშუალო დრო", "ChST": "ჩამოროს დრო", "ACST": "ავსტრალიის ცენტრალური სტანდარტული დრო", "COT": "კოლუმბიის სტანდარტული დრო", "WART": "დასავლეთ არგენტინის სტანდარტული დრო"},
}
}
diff --git a/ka/ka_test.go b/ka/ka_test.go
new file mode 100644
index 00000000..b71e2503
--- /dev/null
+++ b/ka/ka_test.go
@@ -0,0 +1,1120 @@
+package ka
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ka"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ka_GE/ka_GE.go b/ka_GE/ka_GE.go
index 8236b077..cf6a8b1b 100644
--- a/ka_GE/ka_GE.go
+++ b/ka_GE/ka_GE.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ძვ. წ.", "ახ. წ."},
erasNarrow: []string{"", ""},
erasWide: []string{"ძველი წელთაღრიცხვით", "ახალი წელთაღრიცხვით"},
- timezones: map[string]string{"LHST": "ლორდ-ჰაუს სტანდარტული დრო", "NZST": "ახალი ზელანდიის სტანდარტული დრო", "MDT": "ჩრდილოეთ ამერიკის მაუნთინის ზაფხულის დრო", "AEST": "აღმოსავლეთ ავსტრალიის სტანდარტული დრო", "ChST": "ჩამოროს დრო", "EDT": "ჩრდილოეთ ამერიკის აღმოსავლეთის ზაფხულის დრო", "HNT": "ნიუფაუნდლენდის სტანდარტული დრო", "MYT": "მალაიზიის დრო", "CDT": "ჩრდილოეთ ამერიკის ცენტრალური ზაფხულის დრო", "UYT": "ურუგვაის სტანდარტული დრო", "AEDT": "აღმოსავლეთ ავსტრალიის ზაფხულის დრო", "WIB": "დასავლეთ ინდონეზიის დრო", "AKST": "ალასკას სტანდარტული დრო", "PST": "ჩრდილოეთ ამერიკის წყნარი ოკეანის სტანდარტული დრო", "GYT": "გაიანის დრო", "UYST": "ურუგვაის ზაფხულის დრო", "WESZ": "დასავლეთ ევროპის ზაფხულის დრო", "COT": "კოლუმბიის სტანდარტული დრო", "EAT": "აღმოსავლეთ აფრიკის დრო", "MST": "ჩრდილოეთ ამერიკის მაუნთინის სტანდარტული დრო", "VET": "ვენესუელის დრო", "ADT": "ატლანტიკის ოკეანის ზაფხულის დრო", "WITA": "ცენტრალური ინდონეზიის დრო", "ACST": "ავსტრალიის ცენტრალური სტანდარტული დრო", "ACDT": "ავსტრალიის ცენტრალური ზაფხულის დრო", "TMT": "თურქმენეთის სტანდარტული დრო", "∅∅∅": "აზორის კუნძულების ზაფხულის დრო", "MESZ": "ცენტრალური ევროპის ზაფხულის დრო", "CHAST": "ჩატემის სტანდარტული დრო", "COST": "კოლუმბიის ზაფხულის დრო", "WAST": "დასავლეთ აფრიკის ზაფხულის დრო", "GMT": "გრინვიჩის საშუალო დრო", "WIT": "აღმოსავლეთ ინდონეზიის დრო", "CLST": "ჩილეს ზაფხულის დრო", "EST": "ჩრდილოეთ ამერიკის აღმოსავლეთის სტანდარტული დრო", "IST": "ინდოეთის დრო", "SRT": "სურინამის დრო", "HKT": "ჰონკონგის სტანდარტული დრო", "WART": "დასავლეთ არგენტინის სტანდარტული დრო", "OESZ": "აღმოსავლეთ ევროპის ზაფხულის დრო", "HAT": "ნიუფაუნდლენდის ზაფხულის დრო", "AKDT": "ალასკას ზაფხულის დრო", "MEZ": "ცენტრალური ევროპის სტანდარტული დრო", "CAT": "ცენტრალური აფრიკის დრო", "WARST": "დასავლეთ არგენტინის ზაფხულის დრო", "CHADT": "ჩატემის ზაფხულის დრო", "SGT": "სინგაპურის დრო", "AWDT": "დასავლეთ ავსტრალიის ზაფხულის დრო", "JST": "იაპონიის სტანდარტული დრო", "ACWDT": "ცენტრალური და დასავლეთ ავსტრალიის ზაფხულის დრო", "ECT": "ეკვადორის დრო", "AST": "ატლანტიკის ოკეანის სტანდარტული დრო", "GFT": "საფრანგეთის გვიანის დრო", "ART": "არგენტინის სტანდარტული დრო", "ARST": "არგენტინის ზაფხულის დრო", "PDT": "ჩრდილოეთ ამერიკის წყნარი ოკეანის ზაფხულის დრო", "BT": "ბუტანის დრო", "TMST": "თურქმენეთის ზაფხულის დრო", "ACWST": "ცენტრალური და დასავლეთ ავსტრალიის სტანდარტული დრო", "OEZ": "აღმოსავლეთ ევროპის სტანდარტული დრო", "AWST": "დასავლეთ ავსტრალიის სტანდარტული დრო", "BOT": "ბოლივიის დრო", "LHDT": "ლორდ-ჰაუს ზაფხულის დრო", "CST": "ჩრდილოეთ ამერიკის ცენტრალური სტანდარტული დრო", "NZDT": "ახალი ზელანდიის ზაფხულის დრო", "HAST": "ჰავაის და ალეუტის სტანდარტული დრო", "SAST": "სამხრეთ აფრიკის დრო", "HKST": "ჰონკონგის ზაფხულის დრო", "JDT": "იაპონიის ზაფხულის დრო", "WEZ": "დასავლეთ ევროპის სტანდარტული დრო", "CLT": "ჩილეს სტანდარტული დრო", "HADT": "ჰავაის და ალეუტის ზაფხულის დრო", "WAT": "დასავლეთ აფრიკის სტანდარტული დრო"},
+ timezones: map[string]string{"ACDT": "ავსტრალიის ცენტრალური ზაფხულის დრო", "AKST": "ალასკას სტანდარტული დრო", "NZST": "ახალი ზელანდიის სტანდარტული დრო", "WESZ": "დასავლეთ ევროპის ზაფხულის დრო", "MYT": "მალაიზიის დრო", "UYT": "ურუგვაის სტანდარტული დრო", "AWDT": "დასავლეთ ავსტრალიის ზაფხულის დრო", "ART": "არგენტინის სტანდარტული დრო", "MEZ": "ცენტრალური ევროპის სტანდარტული დრო", "ChST": "ჩამოროს დრო", "CLT": "ჩილეს სტანდარტული დრო", "UYST": "ურუგვაის ზაფხულის დრო", "VET": "ვენესუელის დრო", "WEZ": "დასავლეთ ევროპის სტანდარტული დრო", "HNT": "ნიუფაუნდლენდის სტანდარტული დრო", "GYT": "გაიანის დრო", "WART": "დასავლეთ არგენტინის სტანდარტული დრო", "CHAST": "ჩატემის სტანდარტული დრო", "ECT": "ეკვადორის დრო", "PDT": "ჩრდილოეთ ამერიკის წყნარი ოკეანის ზაფხულის დრო", "COST": "კოლუმბიის ზაფხულის დრო", "CAT": "ცენტრალური აფრიკის დრო", "AEDT": "აღმოსავლეთ ავსტრალიის ზაფხულის დრო", "CDT": "ჩრდილოეთ ამერიკის ცენტრალური ზაფხულის დრო", "HKST": "ჰონკონგის ზაფხულის დრო", "ARST": "არგენტინის ზაფხულის დრო", "EST": "ჩრდილოეთ ამერიკის აღმოსავლეთის სტანდარტული დრო", "MESZ": "ცენტრალური ევროპის ზაფხულის დრო", "SRT": "სურინამის დრო", "WAT": "დასავლეთ აფრიკის სტანდარტული დრო", "OESZ": "აღმოსავლეთ ევროპის ზაფხულის დრო", "CST": "ჩრდილოეთ ამერიკის ცენტრალური სტანდარტული დრო", "JST": "იაპონიის სტანდარტული დრო", "EDT": "ჩრდილოეთ ამერიკის აღმოსავლეთის ზაფხულის დრო", "BT": "ბუტანის დრო", "LHST": "ლორდ-ჰაუს სტანდარტული დრო", "MDT": "ჩრდილოეთ ამერიკის მაუნთინის ზაფხულის დრო", "ADT": "ატლანტიკის ოკეანის ზაფხულის დრო", "HADT": "ჰავაის და ალეუტის ზაფხულის დრო", "WITA": "ცენტრალური ინდონეზიის დრო", "IST": "ინდოეთის დრო", "JDT": "იაპონიის ზაფხულის დრო", "WAST": "დასავლეთ აფრიკის ზაფხულის დრო", "TMT": "თურქმენეთის სტანდარტული დრო", "WIT": "აღმოსავლეთ ინდონეზიის დრო", "GFT": "საფრანგეთის გვიანის დრო", "AST": "ატლანტიკის ოკეანის სტანდარტული დრო", "ACWST": "ცენტრალური და დასავლეთ ავსტრალიის სტანდარტული დრო", "ACWDT": "ცენტრალური და დასავლეთ ავსტრალიის ზაფხულის დრო", "PST": "ჩრდილოეთ ამერიკის წყნარი ოკეანის სტანდარტული დრო", "EAT": "აღმოსავლეთ აფრიკის დრო", "ACST": "ავსტრალიის ცენტრალური სტანდარტული დრო", "HKT": "ჰონკონგის სტანდარტული დრო", "BOT": "ბოლივიის დრო", "HAT": "ნიუფაუნდლენდის ზაფხულის დრო", "WIB": "დასავლეთ ინდონეზიის დრო", "TMST": "თურქმენეთის ზაფხულის დრო", "SGT": "სინგაპურის დრო", "LHDT": "ლორდ-ჰაუს ზაფხულის დრო", "CLST": "ჩილეს ზაფხულის დრო", "∅∅∅": "პერუს ზაფხულის დრო", "WARST": "დასავლეთ არგენტინის ზაფხულის დრო", "AWST": "დასავლეთ ავსტრალიის სტანდარტული დრო", "MST": "ჩრდილოეთ ამერიკის მაუნთინის სტანდარტული დრო", "GMT": "გრინვიჩის საშუალო დრო", "CHADT": "ჩატემის ზაფხულის დრო", "AKDT": "ალასკას ზაფხულის დრო", "HAST": "ჰავაის და ალეუტის სტანდარტული დრო", "NZDT": "ახალი ზელანდიის ზაფხულის დრო", "COT": "კოლუმბიის სტანდარტული დრო", "AEST": "აღმოსავლეთ ავსტრალიის სტანდარტული დრო", "OEZ": "აღმოსავლეთ ევროპის სტანდარტული დრო", "SAST": "სამხრეთ აფრიკის დრო"},
}
}
diff --git a/ka_GE/ka_GE_test.go b/ka_GE/ka_GE_test.go
new file mode 100644
index 00000000..7146c3b5
--- /dev/null
+++ b/ka_GE/ka_GE_test.go
@@ -0,0 +1,1120 @@
+package ka_GE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ka_GE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/kab/kab.go b/kab/kab.go
index a032565c..05bdabf2 100644
--- a/kab/kab.go
+++ b/kab/kab.go
@@ -61,7 +61,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"snd. T.Ɛ", "sld. T.Ɛ"},
erasNarrow: []string{"", ""},
erasWide: []string{"send talalit n Ɛisa", "seld talalit n Ɛisa"},
- timezones: map[string]string{"COT": "COT", "AST": "AST", "OEZ": "OEZ", "HAT": "HAT", "TMST": "TMST", "LHST": "LHST", "UYT": "UYT", "MESZ": "MESZ", "CHAST": "CHAST", "COST": "COST", "SAST": "SAST", "GMT": "GMT", "NZST": "NZST", "PST": "PST", "BOT": "BOT", "MDT": "MDT", "ACWST": "ACWST", "CAT": "CAT", "EST": "EST", "AWST": "AWST", "AWDT": "AWDT", "SGT": "SGT", "IST": "IST", "ACST": "ACST", "ACDT": "ACDT", "OESZ": "OESZ", "CST": "CST", "MEZ": "MEZ", "ECT": "ECT", "WAST": "WAST", "GFT": "GFT", "GYT": "GYT", "MST": "MST", "ACWDT": "ACWDT", "AEDT": "AEDT", "∅∅∅": "∅∅∅", "NZDT": "NZDT", "HKST": "HKST", "VET": "VET", "TMT": "TMT", "WIT": "WIT", "MYT": "MYT", "AKST": "AKST", "WEZ": "WEZ", "AEST": "AEST", "EDT": "EDT", "HADT": "HADT", "CLT": "CLT", "ADT": "ADT", "WAT": "WAT", "HNT": "HNT", "EAT": "EAT", "JDT": "JDT", "CHADT": "CHADT", "WESZ": "WESZ", "BT": "BT", "WITA": "WITA", "ChST": "ChST", "AKDT": "AKDT", "LHDT": "LHDT", "SRT": "SRT", "UYST": "UYST", "HAST": "HAST", "WART": "WART", "HKT": "HKT", "ARST": "ARST", "CLST": "CLST", "WIB": "WIB", "ART": "ART", "WARST": "WARST", "JST": "JST", "PDT": "PDT", "CDT": "CDT"},
+ timezones: map[string]string{"WITA": "WITA", "ADT": "ADT", "NZDT": "NZDT", "WIB": "WIB", "CAT": "CAT", "ACST": "ACST", "ART": "ART", "CHAST": "CHAST", "∅∅∅": "∅∅∅", "SRT": "SRT", "ECT": "ECT", "HKST": "HKST", "ACWST": "ACWST", "PST": "PST", "CLT": "CLT", "BT": "BT", "HADT": "HADT", "NZST": "NZST", "ACWDT": "ACWDT", "JDT": "JDT", "AKDT": "AKDT", "MESZ": "MESZ", "IST": "IST", "AEDT": "AEDT", "MST": "MST", "MYT": "MYT", "AKST": "AKST", "GMT": "GMT", "WART": "WART", "HKT": "HKT", "WAST": "WAST", "OEZ": "OEZ", "EAT": "EAT", "SGT": "SGT", "WARST": "WARST", "WEZ": "WEZ", "OESZ": "OESZ", "AST": "AST", "BOT": "BOT", "MEZ": "MEZ", "HNT": "HNT", "CDT": "CDT", "ACDT": "ACDT", "JST": "JST", "EST": "EST", "SAST": "SAST", "UYST": "UYST", "GFT": "GFT", "WESZ": "WESZ", "COT": "COT", "GYT": "GYT", "VET": "VET", "EDT": "EDT", "CST": "CST", "TMST": "TMST", "AEST": "AEST", "CLST": "CLST", "UYT": "UYT", "AWDT": "AWDT", "HAST": "HAST", "HAT": "HAT", "COST": "COST", "LHST": "LHST", "LHDT": "LHDT", "ARST": "ARST", "MDT": "MDT", "WIT": "WIT", "AWST": "AWST", "PDT": "PDT", "WAT": "WAT", "ChST": "ChST", "CHADT": "CHADT", "TMT": "TMT"},
}
}
diff --git a/kab/kab_test.go b/kab/kab_test.go
new file mode 100644
index 00000000..0d2fc32a
--- /dev/null
+++ b/kab/kab_test.go
@@ -0,0 +1,1120 @@
+package kab
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "kab"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/kab_DZ/kab_DZ.go b/kab_DZ/kab_DZ.go
index d8d16088..7a2ff8f2 100644
--- a/kab_DZ/kab_DZ.go
+++ b/kab_DZ/kab_DZ.go
@@ -61,7 +61,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"snd. T.Ɛ", "sld. T.Ɛ"},
erasNarrow: []string{"", ""},
erasWide: []string{"send talalit n Ɛisa", "seld talalit n Ɛisa"},
- timezones: map[string]string{"JDT": "JDT", "∅∅∅": "∅∅∅", "MDT": "MDT", "COT": "COT", "COST": "COST", "AST": "AST", "WITA": "WITA", "LHDT": "LHDT", "ARST": "ARST", "EAT": "EAT", "WIT": "WIT", "AEST": "AEST", "CHADT": "CHADT", "CLST": "CLST", "EST": "EST", "SRT": "SRT", "LHST": "LHST", "AKDT": "AKDT", "SGT": "SGT", "OEZ": "OEZ", "HNT": "HNT", "PDT": "PDT", "BT": "BT", "SAST": "SAST", "ART": "ART", "MEZ": "MEZ", "WAST": "WAST", "HAT": "HAT", "TMT": "TMT", "WEZ": "WEZ", "CDT": "CDT", "CAT": "CAT", "HAST": "HAST", "GMT": "GMT", "JST": "JST", "HADT": "HADT", "ChST": "ChST", "ACST": "ACST", "AWDT": "AWDT", "CHAST": "CHAST", "WIB": "WIB", "GYT": "GYT", "WESZ": "WESZ", "CLT": "CLT", "AEDT": "AEDT", "HKT": "HKT", "HKST": "HKST", "PST": "PST", "UYST": "UYST", "ACWDT": "ACWDT", "ADT": "ADT", "WARST": "WARST", "GFT": "GFT", "AWST": "AWST", "NZST": "NZST", "CST": "CST", "ACWST": "ACWST", "WAT": "WAT", "MYT": "MYT", "BOT": "BOT", "EDT": "EDT", "WART": "WART", "OESZ": "OESZ", "ACDT": "ACDT", "NZDT": "NZDT", "UYT": "UYT", "IST": "IST", "TMST": "TMST", "MESZ": "MESZ", "MST": "MST", "VET": "VET", "ECT": "ECT", "AKST": "AKST"},
+ timezones: map[string]string{"HKT": "HKT", "HKST": "HKST", "AST": "AST", "MEZ": "MEZ", "COST": "COST", "WEZ": "WEZ", "MYT": "MYT", "CLT": "CLT", "ACDT": "ACDT", "CHADT": "CHADT", "IST": "IST", "WAST": "WAST", "HADT": "HADT", "AWDT": "AWDT", "MDT": "MDT", "CST": "CST", "VET": "VET", "AKST": "AKST", "ART": "ART", "OEZ": "OEZ", "SAST": "SAST", "EDT": "EDT", "HAST": "HAST", "NZST": "NZST", "WESZ": "WESZ", "BOT": "BOT", "WART": "WART", "GYT": "GYT", "UYST": "UYST", "ACST": "ACST", "WITA": "WITA", "PST": "PST", "NZDT": "NZDT", "COT": "COT", "UYT": "UYT", "CDT": "CDT", "GFT": "GFT", "ChST": "ChST", "HAT": "HAT", "AKDT": "AKDT", "TMST": "TMST", "ECT": "ECT", "ACWDT": "ACWDT", "ARST": "ARST", "EST": "EST", "MESZ": "MESZ", "OESZ": "OESZ", "JST": "JST", "WIT": "WIT", "BT": "BT", "MST": "MST", "CLST": "CLST", "∅∅∅": "∅∅∅", "WARST": "WARST", "ACWST": "ACWST", "CAT": "CAT", "WAT": "WAT", "CHAST": "CHAST", "AWST": "AWST", "PDT": "PDT", "TMT": "TMT", "AEDT": "AEDT", "LHDT": "LHDT", "HNT": "HNT", "WIB": "WIB", "EAT": "EAT", "SRT": "SRT", "JDT": "JDT", "SGT": "SGT", "AEST": "AEST", "LHST": "LHST", "ADT": "ADT", "GMT": "GMT"},
}
}
diff --git a/kab_DZ/kab_DZ_test.go b/kab_DZ/kab_DZ_test.go
new file mode 100644
index 00000000..856e91e3
--- /dev/null
+++ b/kab_DZ/kab_DZ_test.go
@@ -0,0 +1,1120 @@
+package kab_DZ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "kab_DZ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/kam/kam.go b/kam/kam.go
index de9a87b7..0532c0e8 100644
--- a/kam/kam.go
+++ b/kam/kam.go
@@ -63,7 +63,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"MY", "IY"},
erasNarrow: []string{"", ""},
erasWide: []string{"Mbee wa Yesũ", "Ĩtina wa Yesũ"},
- timezones: map[string]string{"HNT": "HNT", "WIT": "WIT", "ACST": "ACST", "EAT": "EAT", "MYT": "MYT", "COST": "COST", "WITA": "WITA", "WIB": "WIB", "AKST": "AKST", "EDT": "EDT", "TMT": "TMT", "TMST": "TMST", "BT": "BT", "HKT": "HKT", "ADT": "ADT", "HADT": "HADT", "NZDT": "NZDT", "MDT": "MDT", "AWDT": "AWDT", "WESZ": "WESZ", "GYT": "GYT", "AEST": "AEST", "LHST": "LHST", "EST": "EST", "GFT": "GFT", "WART": "WART", "WAST": "WAST", "OEZ": "OEZ", "ART": "ART", "PDT": "PDT", "NZST": "NZST", "∅∅∅": "∅∅∅", "HKST": "HKST", "WEZ": "WEZ", "CDT": "CDT", "MESZ": "MESZ", "ACWDT": "ACWDT", "ECT": "ECT", "ACDT": "ACDT", "CLT": "CLT", "AKDT": "AKDT", "CHADT": "CHADT", "CAT": "CAT", "SAST": "SAST", "LHDT": "LHDT", "WAT": "WAT", "GMT": "GMT", "MST": "MST", "BOT": "BOT", "MEZ": "MEZ", "CHAST": "CHAST", "AST": "AST", "WARST": "WARST", "VET": "VET", "ARST": "ARST", "AWST": "AWST", "UYST": "UYST", "ACWST": "ACWST", "COT": "COT", "SGT": "SGT", "IST": "IST", "OESZ": "OESZ", "JST": "JST", "JDT": "JDT", "SRT": "SRT", "PST": "PST", "CST": "CST", "HAST": "HAST", "HAT": "HAT", "CLST": "CLST", "AEDT": "AEDT", "ChST": "ChST", "UYT": "UYT"},
+ timezones: map[string]string{"VET": "VET", "HKST": "HKST", "TMT": "TMT", "HNT": "HNT", "EAT": "EAT", "HAST": "HAST", "SGT": "SGT", "AWDT": "AWDT", "CDT": "CDT", "ART": "ART", "AKST": "AKST", "SRT": "SRT", "GFT": "GFT", "TMST": "TMST", "UYT": "UYT", "COT": "COT", "OESZ": "OESZ", "ACWDT": "ACWDT", "MESZ": "MESZ", "PDT": "PDT", "HAT": "HAT", "ChST": "ChST", "HKT": "HKT", "AKDT": "AKDT", "BOT": "BOT", "CHADT": "CHADT", "ECT": "ECT", "COST": "COST", "WARST": "WARST", "WEZ": "WEZ", "WIT": "WIT", "BT": "BT", "ACST": "ACST", "JDT": "JDT", "∅∅∅": "∅∅∅", "GYT": "GYT", "JST": "JST", "NZST": "NZST", "WESZ": "WESZ", "GMT": "GMT", "CLT": "CLT", "WART": "WART", "CHAST": "CHAST", "AST": "AST", "PST": "PST", "AWST": "AWST", "HADT": "HADT", "WIB": "WIB", "OEZ": "OEZ", "CLST": "CLST", "UYST": "UYST", "WITA": "WITA", "ADT": "ADT", "NZDT": "NZDT", "WAT": "WAT", "MDT": "MDT", "ACDT": "ACDT", "ARST": "ARST", "MEZ": "MEZ", "CAT": "CAT", "CST": "CST", "EST": "EST", "EDT": "EDT", "MYT": "MYT", "LHST": "LHST", "MST": "MST", "ACWST": "ACWST", "AEST": "AEST", "WAST": "WAST", "AEDT": "AEDT", "LHDT": "LHDT", "SAST": "SAST", "IST": "IST"},
}
}
diff --git a/kam/kam_test.go b/kam/kam_test.go
new file mode 100644
index 00000000..43d5d95e
--- /dev/null
+++ b/kam/kam_test.go
@@ -0,0 +1,1120 @@
+package kam
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "kam"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/kam_KE/kam_KE.go b/kam_KE/kam_KE.go
index 5181a245..10af86b1 100644
--- a/kam_KE/kam_KE.go
+++ b/kam_KE/kam_KE.go
@@ -63,7 +63,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"MY", "IY"},
erasNarrow: []string{"", ""},
erasWide: []string{"Mbee wa Yesũ", "Ĩtina wa Yesũ"},
- timezones: map[string]string{"VET": "VET", "AEDT": "AEDT", "ACST": "ACST", "CDT": "CDT", "BOT": "BOT", "HKT": "HKT", "HKST": "HKST", "OEZ": "OEZ", "MYT": "MYT", "PST": "PST", "CAT": "CAT", "AST": "AST", "AWDT": "AWDT", "AEST": "AEST", "ECT": "ECT", "LHST": "LHST", "CLST": "CLST", "ACDT": "ACDT", "IST": "IST", "TMT": "TMT", "AKDT": "AKDT", "WESZ": "WESZ", "WART": "WART", "WIT": "WIT", "JST": "JST", "CLT": "CLT", "WEZ": "WEZ", "TMST": "TMST", "WARST": "WARST", "WITA": "WITA", "GMT": "GMT", "JDT": "JDT", "AKST": "AKST", "LHDT": "LHDT", "MST": "MST", "CHADT": "CHADT", "CHAST": "CHAST", "WAST": "WAST", "HNT": "HNT", "HAT": "HAT", "CST": "CST", "MDT": "MDT", "ARST": "ARST", "GYT": "GYT", "ADT": "ADT", "SGT": "SGT", "WIB": "WIB", "ART": "ART", "AWST": "AWST", "WAT": "WAT", "BT": "BT", "COST": "COST", "SAST": "SAST", "GFT": "GFT", "SRT": "SRT", "∅∅∅": "∅∅∅", "EST": "EST", "ChST": "ChST", "EAT": "EAT", "PDT": "PDT", "UYT": "UYT", "UYST": "UYST", "OESZ": "OESZ", "NZDT": "NZDT", "HAST": "HAST", "ACWST": "ACWST", "ACWDT": "ACWDT", "COT": "COT", "HADT": "HADT", "MESZ": "MESZ", "NZST": "NZST", "MEZ": "MEZ", "EDT": "EDT"},
+ timezones: map[string]string{"LHST": "LHST", "AKST": "AKST", "HNT": "HNT", "ACST": "ACST", "VET": "VET", "AWST": "AWST", "AEST": "AEST", "HKST": "HKST", "AWDT": "AWDT", "ADT": "ADT", "NZST": "NZST", "CAT": "CAT", "GMT": "GMT", "EST": "EST", "MEZ": "MEZ", "TMT": "TMT", "TMST": "TMST", "CHADT": "CHADT", "ART": "ART", "NZDT": "NZDT", "WEZ": "WEZ", "OESZ": "OESZ", "BT": "BT", "CDT": "CDT", "IST": "IST", "CLT": "CLT", "WITA": "WITA", "JST": "JST", "AST": "AST", "MDT": "MDT", "JDT": "JDT", "HAT": "HAT", "WIB": "WIB", "WAT": "WAT", "ChST": "ChST", "SGT": "SGT", "WARST": "WARST", "GFT": "GFT", "CHAST": "CHAST", "WIT": "WIT", "CST": "CST", "HADT": "HADT", "SAST": "SAST", "WESZ": "WESZ", "MST": "MST", "CLST": "CLST", "WART": "WART", "HAST": "HAST", "COT": "COT", "WAST": "WAST", "LHDT": "LHDT", "MYT": "MYT", "ACWDT": "ACWDT", "AKDT": "AKDT", "PST": "PST", "AEDT": "AEDT", "EAT": "EAT", "SRT": "SRT", "HKT": "HKT", "COST": "COST", "OEZ": "OEZ", "UYT": "UYT", "ACWST": "ACWST", "ECT": "ECT", "ARST": "ARST", "EDT": "EDT", "PDT": "PDT", "GYT": "GYT", "UYST": "UYST", "∅∅∅": "∅∅∅", "ACDT": "ACDT", "MESZ": "MESZ", "BOT": "BOT"},
}
}
diff --git a/kam_KE/kam_KE_test.go b/kam_KE/kam_KE_test.go
new file mode 100644
index 00000000..bf7bc465
--- /dev/null
+++ b/kam_KE/kam_KE_test.go
@@ -0,0 +1,1120 @@
+package kam_KE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "kam_KE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/kde/kde.go b/kde/kde.go
index 670f80b4..ec2be1db 100644
--- a/kde/kde.go
+++ b/kde/kde.go
@@ -63,7 +63,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"AY", "NY"},
erasNarrow: []string{"", ""},
erasWide: []string{"Akanapawa Yesu", "Nankuida Yesu"},
- timezones: map[string]string{"CLT": "CLT", "CLST": "CLST", "ADT": "ADT", "WIT": "WIT", "EAT": "EAT", "LHST": "LHST", "UYT": "UYT", "GFT": "GFT", "ChST": "ChST", "HKT": "HKT", "AWST": "AWST", "CDT": "CDT", "NZDT": "NZDT", "ART": "ART", "MYT": "MYT", "PDT": "PDT", "ECT": "ECT", "HADT": "HADT", "WART": "WART", "WAST": "WAST", "WIB": "WIB", "HAT": "HAT", "AEST": "AEST", "WITA": "WITA", "IST": "IST", "JST": "JST", "AKST": "AKST", "AEDT": "AEDT", "GMT": "GMT", "ACST": "ACST", "AST": "AST", "JDT": "JDT", "NZST": "NZST", "WARST": "WARST", "WAT": "WAT", "OESZ": "OESZ", "TMT": "TMT", "EDT": "EDT", "COT": "COT", "HAST": "HAST", "AKDT": "AKDT", "PST": "PST", "BOT": "BOT", "VET": "VET", "MST": "MST", "ACDT": "ACDT", "CHAST": "CHAST", "CHADT": "CHADT", "BT": "BT", "HKST": "HKST", "HNT": "HNT", "TMST": "TMST", "WEZ": "WEZ", "UYST": "UYST", "WESZ": "WESZ", "ARST": "ARST", "GYT": "GYT", "SRT": "SRT", "AWDT": "AWDT", "∅∅∅": "∅∅∅", "MEZ": "MEZ", "ACWDT": "ACWDT", "SGT": "SGT", "COST": "COST", "SAST": "SAST", "OEZ": "OEZ", "MDT": "MDT", "LHDT": "LHDT", "CST": "CST", "MESZ": "MESZ", "ACWST": "ACWST", "CAT": "CAT", "EST": "EST"},
+ timezones: map[string]string{"WIT": "WIT", "ACWDT": "ACWDT", "ART": "ART", "MST": "MST", "CLST": "CLST", "MESZ": "MESZ", "WAST": "WAST", "HNT": "HNT", "ChST": "ChST", "HKST": "HKST", "EST": "EST", "PST": "PST", "COT": "COT", "ACDT": "ACDT", "CHAST": "CHAST", "CHADT": "CHADT", "ARST": "ARST", "HAT": "HAT", "OEZ": "OEZ", "ECT": "ECT", "ACWST": "ACWST", "MEZ": "MEZ", "COST": "COST", "TMT": "TMT", "CLT": "CLT", "NZDT": "NZDT", "TMST": "TMST", "CAT": "CAT", "SGT": "SGT", "AEDT": "AEDT", "MYT": "MYT", "CDT": "CDT", "WART": "WART", "AKST": "AKST", "HAST": "HAST", "GMT": "GMT", "AEST": "AEST", "UYST": "UYST", "∅∅∅": "∅∅∅", "WAT": "WAT", "WIB": "WIB", "OESZ": "OESZ", "LHDT": "LHDT", "ADT": "ADT", "IST": "IST", "SRT": "SRT", "VET": "VET", "AWST": "AWST", "NZST": "NZST", "MDT": "MDT", "UYT": "UYT", "AWDT": "AWDT", "PDT": "PDT", "JDT": "JDT", "EDT": "EDT", "LHST": "LHST", "SAST": "SAST", "HADT": "HADT", "WEZ": "WEZ", "WESZ": "WESZ", "ACST": "ACST", "WARST": "WARST", "AKDT": "AKDT", "WITA": "WITA", "JST": "JST", "BOT": "BOT", "GYT": "GYT", "CST": "CST", "GFT": "GFT", "AST": "AST", "EAT": "EAT", "BT": "BT", "HKT": "HKT"},
}
}
diff --git a/kde/kde_test.go b/kde/kde_test.go
new file mode 100644
index 00000000..e1025983
--- /dev/null
+++ b/kde/kde_test.go
@@ -0,0 +1,1120 @@
+package kde
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "kde"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/kde_TZ/kde_TZ.go b/kde_TZ/kde_TZ.go
index 4fe1d29a..f8b8ceec 100644
--- a/kde_TZ/kde_TZ.go
+++ b/kde_TZ/kde_TZ.go
@@ -63,7 +63,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"AY", "NY"},
erasNarrow: []string{"", ""},
erasWide: []string{"Akanapawa Yesu", "Nankuida Yesu"},
- timezones: map[string]string{"PDT": "PDT", "JST": "JST", "MEZ": "MEZ", "UYST": "UYST", "EST": "EST", "ACST": "ACST", "BT": "BT", "EAT": "EAT", "SRT": "SRT", "AKDT": "AKDT", "CST": "CST", "UYT": "UYT", "OESZ": "OESZ", "LHST": "LHST", "MESZ": "MESZ", "WESZ": "WESZ", "ACWDT": "ACWDT", "MDT": "MDT", "CHAST": "CHAST", "AST": "AST", "GYT": "GYT", "ACWST": "ACWST", "AWST": "AWST", "NZDT": "NZDT", "WEZ": "WEZ", "AEST": "AEST", "ChST": "ChST", "TMT": "TMT", "∅∅∅": "∅∅∅", "NZST": "NZST", "CAT": "CAT", "COT": "COT", "COST": "COST", "WART": "WART", "HADT": "HADT", "ARST": "ARST", "ADT": "ADT", "HAST": "HAST", "HKST": "HKST", "HNT": "HNT", "WIT": "WIT", "ART": "ART", "CHADT": "CHADT", "ECT": "ECT", "HKT": "HKT", "OEZ": "OEZ", "GFT": "GFT", "WIB": "WIB", "AWDT": "AWDT", "MYT": "MYT", "CLT": "CLT", "SGT": "SGT", "SAST": "SAST", "WAST": "WAST", "WARST": "WARST", "IST": "IST", "JDT": "JDT", "AEDT": "AEDT", "CLST": "CLST", "EDT": "EDT", "GMT": "GMT", "WITA": "WITA", "ACDT": "ACDT", "AKST": "AKST", "LHDT": "LHDT", "VET": "VET", "MST": "MST", "WAT": "WAT", "TMST": "TMST", "PST": "PST", "CDT": "CDT", "BOT": "BOT", "HAT": "HAT"},
+ timezones: map[string]string{"LHDT": "LHDT", "ADT": "ADT", "ACWDT": "ACWDT", "AWST": "AWST", "IST": "IST", "HAT": "HAT", "MDT": "MDT", "MST": "MST", "JDT": "JDT", "COT": "COT", "WIB": "WIB", "WARST": "WARST", "EST": "EST", "NZST": "NZST", "CAT": "CAT", "MYT": "MYT", "GFT": "GFT", "NZDT": "NZDT", "BOT": "BOT", "WART": "WART", "AST": "AST", "MEZ": "MEZ", "HAST": "HAST", "TMT": "TMT", "GMT": "GMT", "CLST": "CLST", "∅∅∅": "∅∅∅", "CDT": "CDT", "ACST": "ACST", "HKST": "HKST", "TMST": "TMST", "WIT": "WIT", "VET": "VET", "AKST": "AKST", "PDT": "PDT", "CST": "CST", "SAST": "SAST", "SGT": "SGT", "BT": "BT", "ACDT": "ACDT", "HKT": "HKT", "WITA": "WITA", "EDT": "EDT", "OEZ": "OEZ", "CLT": "CLT", "SRT": "SRT", "ECT": "ECT", "PST": "PST", "WEZ": "WEZ", "AEDT": "AEDT", "MESZ": "MESZ", "COST": "COST", "OESZ": "OESZ", "HADT": "HADT", "WAST": "WAST", "HNT": "HNT", "AEST": "AEST", "GYT": "GYT", "CHAST": "CHAST", "AKDT": "AKDT", "AWDT": "AWDT", "JST": "JST", "WAT": "WAT", "ACWST": "ACWST", "ART": "ART", "ARST": "ARST", "ChST": "ChST", "EAT": "EAT", "LHST": "LHST", "UYT": "UYT", "UYST": "UYST", "CHADT": "CHADT", "WESZ": "WESZ"},
}
}
diff --git a/kde_TZ/kde_TZ_test.go b/kde_TZ/kde_TZ_test.go
new file mode 100644
index 00000000..c32cf8e5
--- /dev/null
+++ b/kde_TZ/kde_TZ_test.go
@@ -0,0 +1,1120 @@
+package kde_TZ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "kde_TZ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/kea/kea.go b/kea/kea.go
index 4adb40cb..64b0c5c1 100644
--- a/kea/kea.go
+++ b/kea/kea.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"AK", "DK"},
erasNarrow: []string{"", ""},
erasWide: []string{"Antis di Kristu", "Dispos di Kristu"},
- timezones: map[string]string{"ACST": "Ora Padrãu di Australia Sentral", "HKST": "HKST", "ChST": "ChST", "PDT": "Ora di Pasifiku di Verãu", "AWST": "Ora Padrãu di Australia Osidental", "NZDT": "NZDT", "AST": "Ora Padrãu di Atlantiku", "SGT": "SGT", "WAST": "Ora di Verão di Afrika Osidental", "JDT": "JDT", "NZST": "NZST", "ECT": "ECT", "CLT": "CLT", "ADT": "Ora di Verãu di Atlantiku", "HAST": "HAST", "SAST": "Ora di Sul di Afrika", "BT": "BT", "EAT": "Ora di Afrika Oriental", "JST": "JST", "SRT": "SRT", "MEZ": "Ora Padrãu di Europa Sentral", "WESZ": "Ora di Verãu di Europa Osidental", "EST": "Ora Oriental Padrãu", "ACDT": "Ora di Verãu di Australia Sentral", "GYT": "GYT", "AKST": "AKST", "MESZ": "Ora di Verãu di Europa Sentral", "AEST": "Ora Padrãu di Australia Oriental", "MST": "MST", "PST": "Ora di Pasifiku Padrãu", "UYT": "UYT", "CLST": "CLST", "AEDT": "Ora di Verãu di Australia Oriental", "CAT": "Ora di Afrika Sentral", "COT": "COT", "HADT": "HADT", "WIT": "WIT", "IST": "IST", "TMST": "TMST", "BOT": "BOT", "EDT": "Ora Oriental di Verãu", "HKT": "HKT", "HAT": "HAT", "TMT": "TMT", "MDT": "MDT", "HNT": "HNT", "GFT": "GFT", "OEZ": "Ora Padrãu di Europa Oriental", "VET": "VET", "WARST": "WARST", "GMT": "GMT", "ARST": "ARST", "CDT": "Ora Sentral di Verãu", "WART": "WART", "WAT": "Ora Padrãu di Afrika Osidental", "MYT": "MYT", "AWDT": "Ora di Verãu di Australia Osidental", "WEZ": "Ora Padrãu di Europa Osidental", "WITA": "WITA", "WIB": "WIB", "LHDT": "LHDT", "ACWDT": "Ora di Verãu di Australia Sentru-Osidental", "COST": "COST", "LHST": "LHST", "CST": "Ora Sentral Padrãu", "CHAST": "CHAST", "∅∅∅": "∅∅∅", "UYST": "UYST", "ART": "ART", "ACWST": "Ora Padrãu di Australia Sentru-Osidental", "OESZ": "Ora di Verãu di Europa Oriental", "AKDT": "AKDT", "CHADT": "CHADT"},
+ timezones: map[string]string{"WAST": "Ora di Verão di Afrika Osidental", "HAT": "HAT", "LHDT": "LHDT", "MDT": "Ora di Verãu di Montanha", "SRT": "SRT", "ACWST": "Ora Padrãu di Australia Sentru-Osidental", "AWDT": "Ora di Verãu di Australia Osidental", "COT": "COT", "AEST": "Ora Padrãu di Australia Oriental", "UYT": "UYT", "CST": "Ora Sentral Padrãu", "ARST": "ARST", "HAST": "HAST", "ACDT": "Ora di Verãu di Australia Sentral", "ECT": "ECT", "ACWDT": "Ora di Verãu di Australia Sentru-Osidental", "SAST": "Ora di Sul di Afrika", "MEZ": "Ora Padrãu di Europa Sentral", "∅∅∅": "∅∅∅", "WAT": "Ora Padrãu di Afrika Osidental", "LHST": "LHST", "MYT": "MYT", "CLT": "CLT", "GMT": "GMT", "AEDT": "Ora di Verãu di Australia Oriental", "CLST": "CLST", "WARST": "WARST", "AKST": "AKST", "AKDT": "AKDT", "CAT": "Ora di Afrika Sentral", "EDT": "Ora Oriental di Verãu", "NZST": "NZST", "NZDT": "NZDT", "SGT": "SGT", "TMT": "TMT", "GYT": "GYT", "ACST": "Ora Padrãu di Australia Sentral", "CHADT": "CHADT", "HNT": "HNT", "CHAST": "CHAST", "AWST": "Ora Padrãu di Australia Osidental", "IST": "IST", "PDT": "Ora di Pasifiku di Verãu", "TMST": "TMST", "EAT": "Ora di Afrika Oriental", "MST": "Ora di Montanha Padrãu", "BOT": "BOT", "WESZ": "Ora di Verãu di Europa Osidental", "AST": "Ora Padrãu di Atlantiku", "EST": "Ora Oriental Padrãu", "MESZ": "Ora di Verãu di Europa Sentral", "HADT": "HADT", "WEZ": "Ora Padrãu di Europa Osidental", "WIB": "WIB", "OEZ": "Ora Padrãu di Europa Oriental", "GFT": "GFT", "VET": "VET", "COST": "COST", "ART": "ART", "UYST": "UYST", "PST": "Ora di Pasifiku Padrãu", "WIT": "WIT", "WART": "WART", "OESZ": "Ora di Verãu di Europa Oriental", "BT": "BT", "CDT": "Ora Sentral di Verãu", "HKT": "HKT", "HKST": "HKST", "ChST": "ChST", "ADT": "Ora di Verãu di Atlantiku", "WITA": "WITA", "JST": "JST", "JDT": "JDT"},
}
}
diff --git a/kea/kea_test.go b/kea/kea_test.go
new file mode 100644
index 00000000..e64e661a
--- /dev/null
+++ b/kea/kea_test.go
@@ -0,0 +1,1120 @@
+package kea
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "kea"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/kea_CV/kea_CV.go b/kea_CV/kea_CV.go
index 194280ee..bbc63af5 100644
--- a/kea_CV/kea_CV.go
+++ b/kea_CV/kea_CV.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"AK", "DK"},
erasNarrow: []string{"", ""},
erasWide: []string{"Antis di Kristu", "Dispos di Kristu"},
- timezones: map[string]string{"AEDT": "Ora di Verãu di Australia Oriental", "HKST": "HKST", "∅∅∅": "∅∅∅", "AWDT": "Ora di Verãu di Australia Osidental", "GYT": "GYT", "MYT": "MYT", "MEZ": "Ora Padrãu di Europa Sentral", "AEST": "Ora Padrãu di Australia Oriental", "WART": "WART", "ARST": "ARST", "HAST": "HAST", "WIT": "WIT", "NZST": "NZST", "BOT": "BOT", "UYT": "UYT", "ChST": "ChST", "EDT": "Ora Oriental di Verãu", "AKST": "AKST", "LHDT": "LHDT", "VET": "VET", "WESZ": "Ora di Verãu di Europa Osidental", "EAT": "Ora di Afrika Oriental", "ACST": "Ora Padrãu di Australia Sentral", "SRT": "SRT", "PST": "Ora di Pasifiku Padrãu", "NZDT": "NZDT", "UYST": "UYST", "WIB": "WIB", "IST": "IST", "GMT": "GMT", "MST": "MST", "TMT": "TMT", "WAST": "Ora di Verão di Afrika Osidental", "HNT": "HNT", "ART": "ART", "CLT": "CLT", "COT": "COT", "COST": "COST", "WAT": "Ora Padrãu di Afrika Osidental", "AKDT": "AKDT", "WEZ": "Ora Padrãu di Europa Osidental", "ECT": "ECT", "ADT": "Ora di Verãu di Atlantiku", "SGT": "SGT", "SAST": "Ora di Sul di Afrika", "WITA": "WITA", "JST": "JST", "JDT": "JDT", "CHAST": "CHAST", "HKT": "HKT", "OEZ": "Ora Padrãu di Europa Oriental", "PDT": "Ora di Pasifiku di Verãu", "CLST": "CLST", "WARST": "WARST", "OESZ": "Ora di Verãu di Europa Oriental", "GFT": "GFT", "LHST": "LHST", "CST": "Ora Sentral Padrãu", "ACWDT": "Ora di Verãu di Australia Sentru-Osidental", "CAT": "Ora di Afrika Sentral", "MDT": "MDT", "AWST": "Ora Padrãu di Australia Osidental", "TMST": "TMST", "CDT": "Ora Sentral di Verãu", "EST": "Ora Oriental Padrãu", "AST": "Ora Padrãu di Atlantiku", "HAT": "HAT", "ACDT": "Ora di Verãu di Australia Sentral", "MESZ": "Ora di Verãu di Europa Sentral", "HADT": "HADT", "BT": "BT", "ACWST": "Ora Padrãu di Australia Sentru-Osidental", "CHADT": "CHADT"},
+ timezones: map[string]string{"ART": "ART", "NZDT": "NZDT", "JDT": "JDT", "MEZ": "Ora Padrãu di Europa Sentral", "SGT": "SGT", "LHST": "LHST", "PDT": "Ora di Pasifiku di Verãu", "OEZ": "Ora Padrãu di Europa Oriental", "AEST": "Ora Padrãu di Australia Oriental", "GYT": "GYT", "MDT": "Ora di Verãu di Montanha", "ACDT": "Ora di Verãu di Australia Sentral", "GFT": "GFT", "HADT": "HADT", "OESZ": "Ora di Verãu di Europa Oriental", "BT": "BT", "MST": "Ora di Montanha Padrãu", "CLST": "CLST", "CDT": "Ora Sentral di Verãu", "JST": "JST", "IST": "IST", "CHADT": "CHADT", "ADT": "Ora di Verãu di Atlantiku", "ACWDT": "Ora di Verãu di Australia Sentru-Osidental", "HNT": "HNT", "UYT": "UYT", "CST": "Ora Sentral Padrãu", "TMT": "TMT", "GMT": "GMT", "LHDT": "LHDT", "CLT": "CLT", "UYST": "UYST", "HKST": "HKST", "CAT": "Ora di Afrika Sentral", "WESZ": "Ora di Verãu di Europa Osidental", "TMST": "TMST", "WARST": "WARST", "AWDT": "Ora di Verãu di Australia Osidental", "EDT": "Ora Oriental di Verãu", "∅∅∅": "∅∅∅", "HKT": "HKT", "AKST": "AKST", "ARST": "ARST", "PST": "Ora di Pasifiku Padrãu", "BOT": "BOT", "WEZ": "Ora Padrãu di Europa Osidental", "CHAST": "CHAST", "AST": "Ora Padrãu di Atlantiku", "HAST": "HAST", "NZST": "NZST", "WIT": "WIT", "ACST": "Ora Padrãu di Australia Sentral", "SRT": "SRT", "WAT": "Ora Padrãu di Afrika Osidental", "ECT": "ECT", "AWST": "Ora Padrãu di Australia Osidental", "HAT": "HAT", "COST": "COST", "AEDT": "Ora di Verãu di Australia Oriental", "COT": "COT", "WIB": "WIB", "ChST": "ChST", "ACWST": "Ora Padrãu di Australia Sentru-Osidental", "SAST": "Ora di Sul di Afrika", "EST": "Ora Oriental Padrãu", "MESZ": "Ora di Verãu di Europa Sentral", "WAST": "Ora di Verão di Afrika Osidental", "AKDT": "AKDT", "WITA": "WITA", "EAT": "Ora di Afrika Oriental", "MYT": "MYT", "WART": "WART", "VET": "VET"},
}
}
diff --git a/kea_CV/kea_CV_test.go b/kea_CV/kea_CV_test.go
new file mode 100644
index 00000000..efc2a9fc
--- /dev/null
+++ b/kea_CV/kea_CV_test.go
@@ -0,0 +1,1120 @@
+package kea_CV
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "kea_CV"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/khq/khq.go b/khq/khq.go
index 1e0447a4..70c91366 100644
--- a/khq/khq.go
+++ b/khq/khq.go
@@ -60,7 +60,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"IJ", "IZ"},
erasNarrow: []string{"", ""},
erasWide: []string{"Isaa jine", "Isaa jamanoo"},
- timezones: map[string]string{"WIB": "WIB", "OEZ": "OEZ", "JST": "JST", "AKDT": "AKDT", "NZST": "NZST", "ARST": "ARST", "WESZ": "WESZ", "ADT": "ADT", "HADT": "HADT", "SGT": "SGT", "SAST": "SAST", "WITA": "WITA", "BOT": "BOT", "ChST": "ChST", "WART": "WART", "UYST": "UYST", "ECT": "ECT", "OESZ": "OESZ", "MST": "MST", "ACST": "ACST", "CLT": "CLT", "AEDT": "AEDT", "AST": "AST", "AWST": "AWST", "CDT": "CDT", "VET": "VET", "CAT": "CAT", "COT": "COT", "HAST": "HAST", "WEZ": "WEZ", "ACWDT": "ACWDT", "EST": "EST", "WAT": "WAT", "HNT": "HNT", "HKST": "HKST", "SRT": "SRT", "LHDT": "LHDT", "GYT": "GYT", "MEZ": "MEZ", "UYT": "UYT", "AEST": "AEST", "WIT": "WIT", "TMST": "TMST", "CLST": "CLST", "BT": "BT", "HKT": "HKT", "GFT": "GFT", "∅∅∅": "∅∅∅", "CST": "CST", "NZDT": "NZDT", "CHAST": "CHAST", "EDT": "EDT", "TMT": "TMT", "HAT": "HAT", "JDT": "JDT", "MYT": "MYT", "ACWST": "ACWST", "CHADT": "CHADT", "WAST": "WAST", "IST": "IST", "GMT": "GMT", "MDT": "MDT", "AKST": "AKST", "PST": "PST", "COST": "COST", "ACDT": "ACDT", "MESZ": "MESZ", "EAT": "EAT", "ART": "ART", "PDT": "PDT", "AWDT": "AWDT", "LHST": "LHST", "WARST": "WARST"},
+ timezones: map[string]string{"WEZ": "WEZ", "WIB": "WIB", "AEST": "AEST", "CDT": "CDT", "EST": "EST", "COT": "COT", "UYST": "UYST", "CAT": "CAT", "WAT": "WAT", "WESZ": "WESZ", "LHDT": "LHDT", "UYT": "UYT", "CHAST": "CHAST", "AKST": "AKST", "SAST": "SAST", "NZST": "NZST", "ACST": "ACST", "MDT": "MDT", "AKDT": "AKDT", "ACWST": "ACWST", "ACWDT": "ACWDT", "ARST": "ARST", "NZDT": "NZDT", "TMT": "TMT", "BT": "BT", "∅∅∅": "∅∅∅", "AEDT": "AEDT", "WIT": "WIT", "ECT": "ECT", "PDT": "PDT", "WAST": "WAST", "OEZ": "OEZ", "EAT": "EAT", "CLT": "CLT", "CHADT": "CHADT", "LHST": "LHST", "SRT": "SRT", "MEZ": "MEZ", "AST": "AST", "PST": "PST", "HADT": "HADT", "WARST": "WARST", "HKST": "HKST", "AWDT": "AWDT", "JDT": "JDT", "EDT": "EDT", "GMT": "GMT", "MYT": "MYT", "GFT": "GFT", "HAST": "HAST", "JST": "JST", "TMST": "TMST", "HNT": "HNT", "ACDT": "ACDT", "WITA": "WITA", "ADT": "ADT", "MESZ": "MESZ", "SGT": "SGT", "COST": "COST", "HKT": "HKT", "VET": "VET", "AWST": "AWST", "BOT": "BOT", "IST": "IST", "ChST": "ChST", "CLST": "CLST", "MST": "MST", "OESZ": "OESZ", "WART": "WART", "HAT": "HAT", "GYT": "GYT", "CST": "CST", "ART": "ART"},
}
}
diff --git a/khq/khq_test.go b/khq/khq_test.go
new file mode 100644
index 00000000..17498b31
--- /dev/null
+++ b/khq/khq_test.go
@@ -0,0 +1,1120 @@
+package khq
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "khq"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/khq_ML/khq_ML.go b/khq_ML/khq_ML.go
index 3424a30c..07f0d018 100644
--- a/khq_ML/khq_ML.go
+++ b/khq_ML/khq_ML.go
@@ -60,7 +60,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"IJ", "IZ"},
erasNarrow: []string{"", ""},
erasWide: []string{"Isaa jine", "Isaa jamanoo"},
- timezones: map[string]string{"IST": "IST", "TMST": "TMST", "ARST": "ARST", "UYST": "UYST", "BT": "BT", "WIB": "WIB", "JST": "JST", "AWST": "AWST", "ACWDT": "ACWDT", "EAT": "EAT", "MST": "MST", "WAT": "WAT", "PST": "PST", "BOT": "BOT", "CAT": "CAT", "JDT": "JDT", "NZST": "NZST", "SGT": "SGT", "WART": "WART", "HAT": "HAT", "ACST": "ACST", "ART": "ART", "GYT": "GYT", "MEZ": "MEZ", "ACWST": "ACWST", "GFT": "GFT", "WIT": "WIT", "CDT": "CDT", "MESZ": "MESZ", "CLST": "CLST", "WAST": "WAST", "HKT": "HKT", "PDT": "PDT", "NZDT": "NZDT", "EST": "EST", "ECT": "ECT", "WITA": "WITA", "MDT": "MDT", "WARST": "WARST", "VET": "VET", "TMT": "TMT", "AKST": "AKST", "SAST": "SAST", "OEZ": "OEZ", "GMT": "GMT", "CST": "CST", "WESZ": "WESZ", "AEDT": "AEDT", "ChST": "ChST", "COT": "COT", "HAST": "HAST", "HADT": "HADT", "EDT": "EDT", "AST": "AST", "HKST": "HKST", "AWDT": "AWDT", "LHDT": "LHDT", "CHADT": "CHADT", "∅∅∅": "∅∅∅", "ACDT": "ACDT", "CHAST": "CHAST", "AEST": "AEST", "COST": "COST", "ADT": "ADT", "OESZ": "OESZ", "UYT": "UYT", "SRT": "SRT", "AKDT": "AKDT", "LHST": "LHST", "CLT": "CLT", "WEZ": "WEZ", "HNT": "HNT", "MYT": "MYT"},
+ timezones: map[string]string{"SAST": "SAST", "EST": "EST", "AEST": "AEST", "ACST": "ACST", "CHAST": "CHAST", "CHADT": "CHADT", "CLT": "CLT", "LHDT": "LHDT", "COST": "COST", "WAT": "WAT", "HNT": "HNT", "WART": "WART", "MEZ": "MEZ", "OEZ": "OEZ", "TMST": "TMST", "WESZ": "WESZ", "MYT": "MYT", "AST": "AST", "AWST": "AWST", "COT": "COT", "HADT": "HADT", "EDT": "EDT", "PST": "PST", "TMT": "TMT", "VET": "VET", "ART": "ART", "HAST": "HAST", "SGT": "SGT", "GMT": "GMT", "EAT": "EAT", "WARST": "WARST", "SRT": "SRT", "HKST": "HKST", "HAT": "HAT", "CST": "CST", "JST": "JST", "AKDT": "AKDT", "GFT": "GFT", "WIB": "WIB", "UYST": "UYST", "LHST": "LHST", "WITA": "WITA", "AKST": "AKST", "ADT": "ADT", "HKT": "HKT", "AEDT": "AEDT", "CLST": "CLST", "NZST": "NZST", "PDT": "PDT", "WIT": "WIT", "BT": "BT", "CDT": "CDT", "ACWDT": "ACWDT", "AWDT": "AWDT", "MST": "MST", "ACWST": "ACWST", "IST": "IST", "CAT": "CAT", "WEZ": "WEZ", "OESZ": "OESZ", "GYT": "GYT", "ACDT": "ACDT", "∅∅∅": "∅∅∅", "ARST": "ARST", "UYT": "UYT", "JDT": "JDT", "MESZ": "MESZ", "ChST": "ChST", "BOT": "BOT", "WAST": "WAST", "MDT": "MDT", "ECT": "ECT", "NZDT": "NZDT"},
}
}
diff --git a/khq_ML/khq_ML_test.go b/khq_ML/khq_ML_test.go
new file mode 100644
index 00000000..2fcd5da5
--- /dev/null
+++ b/khq_ML/khq_ML_test.go
@@ -0,0 +1,1120 @@
+package khq_ML
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "khq_ML"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ki/ki.go b/ki/ki.go
index 9a6f8bb0..62602cf3 100644
--- a/ki/ki.go
+++ b/ki/ki.go
@@ -63,7 +63,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"MK", "TK"},
erasNarrow: []string{"", ""},
erasWide: []string{"Mbere ya Kristo", "Thutha wa Kristo"},
- timezones: map[string]string{"SAST": "SAST", "JST": "JST", "CST": "CST", "CLST": "CLST", "CAT": "CAT", "BT": "BT", "BOT": "BOT", "LHDT": "LHDT", "AKST": "AKST", "EST": "EST", "AST": "AST", "WIB": "WIB", "ACST": "ACST", "EDT": "EDT", "WART": "WART", "ARST": "ARST", "TMST": "TMST", "NZDT": "NZDT", "UYST": "UYST", "HAST": "HAST", "ADT": "ADT", "IST": "IST", "LHST": "LHST", "AEST": "AEST", "GMT": "GMT", "ACDT": "ACDT", "GYT": "GYT", "MYT": "MYT", "WESZ": "WESZ", "ECT": "ECT", "HNT": "HNT", "HADT": "HADT", "WAT": "WAT", "HAT": "HAT", "TMT": "TMT", "SRT": "SRT", "HKT": "HKT", "WARST": "WARST", "COST": "COST", "ACWST": "ACWST", "WAST": "WAST", "HKST": "HKST", "MST": "MST", "EAT": "EAT", "PDT": "PDT", "AWST": "AWST", "AWDT": "AWDT", "ACWDT": "ACWDT", "AEDT": "AEDT", "OEZ": "OEZ", "WIT": "WIT", "ART": "ART", "PST": "PST", "AKDT": "AKDT", "MESZ": "MESZ", "SGT": "SGT", "OESZ": "OESZ", "GFT": "GFT", "WITA": "WITA", "MDT": "MDT", "CLT": "CLT", "UYT": "UYT", "CHADT": "CHADT", "MEZ": "MEZ", "CDT": "CDT", "CHAST": "CHAST", "COT": "COT", "∅∅∅": "∅∅∅", "JDT": "JDT", "NZST": "NZST", "ChST": "ChST", "VET": "VET", "WEZ": "WEZ"},
+ timezones: map[string]string{"ADT": "ADT", "PST": "PST", "COT": "COT", "CLST": "CLST", "ACWDT": "ACWDT", "EDT": "EDT", "WARST": "WARST", "HKST": "HKST", "CHAST": "CHAST", "OESZ": "OESZ", "GYT": "GYT", "ACDT": "ACDT", "HADT": "HADT", "WAT": "WAT", "UYST": "UYST", "BT": "BT", "AKDT": "AKDT", "PDT": "PDT", "CDT": "CDT", "ECT": "ECT", "MDT": "MDT", "SAST": "SAST", "ACST": "ACST", "LHST": "LHST", "SRT": "SRT", "CHADT": "CHADT", "AWDT": "AWDT", "AKST": "AKST", "ACWST": "ACWST", "WEZ": "WEZ", "ARST": "ARST", "ChST": "ChST", "AEST": "AEST", "UYT": "UYT", "GFT": "GFT", "MESZ": "MESZ", "NZDT": "NZDT", "WESZ": "WESZ", "MYT": "MYT", "NZST": "NZST", "SGT": "SGT", "OEZ": "OEZ", "WIT": "WIT", "CST": "CST", "WART": "WART", "VET": "VET", "MST": "MST", "MEZ": "MEZ", "IST": "IST", "TMST": "TMST", "AWST": "AWST", "AST": "AST", "BOT": "BOT", "EST": "EST", "COST": "COST", "ART": "ART", "TMT": "TMT", "WAST": "WAST", "HKT": "HKT", "WITA": "WITA", "HAST": "HAST", "HAT": "HAT", "LHDT": "LHDT", "CAT": "CAT", "GMT": "GMT", "AEDT": "AEDT", "∅∅∅": "∅∅∅", "JST": "JST", "JDT": "JDT", "HNT": "HNT", "WIB": "WIB", "CLT": "CLT", "EAT": "EAT"},
}
}
diff --git a/ki/ki_test.go b/ki/ki_test.go
new file mode 100644
index 00000000..70990041
--- /dev/null
+++ b/ki/ki_test.go
@@ -0,0 +1,1120 @@
+package ki
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ki"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ki_KE/ki_KE.go b/ki_KE/ki_KE.go
index ae941d45..0125fe44 100644
--- a/ki_KE/ki_KE.go
+++ b/ki_KE/ki_KE.go
@@ -63,7 +63,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"MK", "TK"},
erasNarrow: []string{"", ""},
erasWide: []string{"Mbere ya Kristo", "Thutha wa Kristo"},
- timezones: map[string]string{"COT": "COT", "COST": "COST", "GMT": "GMT", "HAT": "HAT", "ARST": "ARST", "AKDT": "AKDT", "SAST": "SAST", "WITA": "WITA", "WIT": "WIT", "NZDT": "NZDT", "CHAST": "CHAST", "EDT": "EDT", "ECT": "ECT", "AST": "AST", "OEZ": "OEZ", "EAT": "EAT", "MYT": "MYT", "UYT": "UYT", "GFT": "GFT", "AKST": "AKST", "BOT": "BOT", "CLT": "CLT", "HADT": "HADT", "SGT": "SGT", "ACST": "ACST", "AEDT": "AEDT", "BT": "BT", "CLST": "CLST", "HNT": "HNT", "WIB": "WIB", "PDT": "PDT", "ART": "ART", "AWST": "AWST", "SRT": "SRT", "WESZ": "WESZ", "CAT": "CAT", "CDT": "CDT", "ACWST": "ACWST", "AEST": "AEST", "EST": "EST", "TMT": "TMT", "CST": "CST", "WAT": "WAT", "UYST": "UYST", "WEZ": "WEZ", "WART": "WART", "WARST": "WARST", "IST": "IST", "MDT": "MDT", "LHDT": "LHDT", "GYT": "GYT", "MEZ": "MEZ", "WAST": "WAST", "MST": "MST", "TMST": "TMST", "JDT": "JDT", "NZST": "NZST", "ChST": "ChST", "CHADT": "CHADT", "∅∅∅": "∅∅∅", "PST": "PST", "MESZ": "MESZ", "HAST": "HAST", "ADT": "ADT", "HKT": "HKT", "OESZ": "OESZ", "ACDT": "ACDT", "AWDT": "AWDT", "JST": "JST", "VET": "VET", "HKST": "HKST", "LHST": "LHST", "ACWDT": "ACWDT"},
+ timezones: map[string]string{"HKST": "HKST", "AWST": "AWST", "HAST": "HAST", "EDT": "EDT", "WESZ": "WESZ", "ACST": "ACST", "SRT": "SRT", "CST": "CST", "JST": "JST", "PDT": "PDT", "TMST": "TMST", "WIT": "WIT", "EAT": "EAT", "ARST": "ARST", "ADT": "ADT", "WAST": "WAST", "AEDT": "AEDT", "LHST": "LHST", "ACDT": "ACDT", "PST": "PST", "ChST": "ChST", "MST": "MST", "WITA": "WITA", "COST": "COST", "TMT": "TMT", "AKDT": "AKDT", "COT": "COT", "EST": "EST", "ACWST": "ACWST", "IST": "IST", "JDT": "JDT", "HAT": "HAT", "MYT": "MYT", "CDT": "CDT", "WEZ": "WEZ", "GYT": "GYT", "GMT": "GMT", "CHADT": "CHADT", "AST": "AST", "WAT": "WAT", "AKST": "AKST", "NZDT": "NZDT", "WARST": "WARST", "HNT": "HNT", "GFT": "GFT", "MESZ": "MESZ", "NZST": "NZST", "SAST": "SAST", "WIB": "WIB", "AEST": "AEST", "LHDT": "LHDT", "WART": "WART", "∅∅∅": "∅∅∅", "VET": "VET", "HKT": "HKT", "ACWDT": "ACWDT", "AWDT": "AWDT", "HADT": "HADT", "CLT": "CLT", "MDT": "MDT", "SGT": "SGT", "OESZ": "OESZ", "MEZ": "MEZ", "CAT": "CAT", "ECT": "ECT", "BOT": "BOT", "CLST": "CLST", "CHAST": "CHAST", "BT": "BT", "ART": "ART", "OEZ": "OEZ", "UYT": "UYT", "UYST": "UYST"},
}
}
diff --git a/ki_KE/ki_KE_test.go b/ki_KE/ki_KE_test.go
new file mode 100644
index 00000000..e03393b9
--- /dev/null
+++ b/ki_KE/ki_KE_test.go
@@ -0,0 +1,1120 @@
+package ki_KE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ki_KE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/kk/kk.go b/kk/kk.go
index 7fbd26f0..683e5731 100644
--- a/kk/kk.go
+++ b/kk/kk.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"б.з.д.", "б.з."},
erasNarrow: []string{"", ""},
erasWide: []string{"Біздің заманымызға дейін", "Біздің заманымыз"},
- timezones: map[string]string{"CLST": "Чили жазғы уақыты", "EDT": "Солтүстік Америка жазғы шығыс уақыты", "HAST": "Гавай және Алеут аралдары стандартты уақыты", "WARST": "Батыс Аргентина жазғы уақыты", "MYT": "Малайзия уақыты", "COT": "Колумбия стандартты уақыты", "ECT": "Эквадор уақыты", "WAT": "Батыс Африка стандартты уақыты", "MESZ": "Орталық Еуропа жазғы уақыты", "LHST": "Лорд-Хау стандартты уақыты", "ChST": "Чаморро стандартты уақыты", "VET": "Венесуэла уақыты", "WEZ": "Батыс Еуропа стандартты уақыты", "HADT": "Гавай және Алеут аралдары жазғы уақыты", "WART": "Батыс Аргентина стандартты уақыты", "ARST": "Аргентина жазғы уақыты", "EAT": "Шығыс Африка уақыты", "AKST": "Аляска стандартты уақыты", "PST": "Солтүстік Америка стандартты Тынық мұхиты уақыты", "MEZ": "Орталық Еуропа стандартты уақыты", "UYT": "Уругвай стандартты уақыты", "∅∅∅": "Бразилия жазғы уақыты", "HKST": "Гонконг жазғы уақыты", "GMT": "Гринвич уақыты", "HNT": "Ньюфаундленд стандартты уақыты", "WIT": "Шығыс Индонезия уақыты", "JST": "Жапония стандартты уақыты", "CST": "Солтүстік Америка стандартты орталық уақыты", "MDT": "Солтүстік Америка жазғы тау уақыты", "WESZ": "Батыс Еуропа жазғы уақыты", "AWDT": "Австралия жазғы батыс уақыты", "AST": "Атлантика стандартты уақыты", "HAT": "Ньюфаундленд жазғы уақыты", "ART": "Аргентина стандартты уақыты", "CHAST": "Чатем стандартты уақыты", "WAST": "Батыс Африка жазғы уақыты", "GFT": "Француз Гвианасы уақыты", "CDT": "Солтүстік Америка жазғы орталық уақыты", "ACST": "Австралия стандартты орталық уақыты", "ACWDT": "Австралия жазғы орталық-батыс уақыты", "MST": "Солтүстік Америка стандартты тау уақыты", "COST": "Колумбия жазғы уақыты", "CAT": "Орталық Африка уақыты", "SGT": "Сингапур уақыты", "OEZ": "Шығыс Еуропа стандартты уақыты", "WIB": "Батыс Индонезия уақыты", "AEST": "Австралия стандартты шығыс уақыты", "CLT": "Чили стандартты уақыты", "HKT": "Гонконг стандартты уақыты", "TMST": "Түрікменстан жазғы уақыты", "ACWST": "Австралия стандартты орталық-батыс уақыты", "CHADT": "Чатем жазғы уақыты", "SAST": "Оңтүстік Африка уақыты", "TMT": "Түрікменстан стандартты уақыты", "PDT": "Солтүстік Америка жазғы Тынық мұхиты уақыты", "LHDT": "Лорд-Хау жазғы уақыты", "UYST": "Уругвай жазғы уақыты", "AEDT": "Австралия жазғы шығыс уақыты", "NZDT": "Жаңа Зеландия жазғы уақыты", "BOT": "Боливия уақыты", "BT": "Бутан уақыты", "OESZ": "Шығыс Еуропа жазғы уақыты", "IST": "Үндістан стандартты уақыты", "ACDT": "Австралия жазғы орталық уақыты", "AWST": "Австралия стандартты батыс уақыты", "GYT": "Гайана уақыты", "AKDT": "Аляска жазғы уақыты", "ADT": "Атлантика жазғы уақыты", "WITA": "Орталық Индонезия уақыты", "SRT": "Суринам уақыты", "EST": "Солтүстік Америка стандартты шығыс уақыты", "JDT": "Жапония жазғы уақыты", "NZST": "Жаңа Зеландия стандартты уақыты"},
+ timezones: map[string]string{"AWDT": "Австралия жазғы батыс уақыты", "NZDT": "Жаңа Зеландия жазғы уақыты", "GYT": "Гайана уақыты", "AEST": "Австралия стандартты шығыс уақыты", "WIT": "Шығыс Индонезия уақыты", "GFT": "Француз Гвианасы уақыты", "COT": "Колумбия стандартты уақыты", "EAT": "Шығыс Африка уақыты", "HADT": "Гавай және Алеут аралдары жазғы уақыты", "WAST": "Батыс Африка жазғы уақыты", "WITA": "Орталық Индонезия уақыты", "GMT": "Гринвич уақыты", "JST": "Жапония стандартты уақыты", "MESZ": "Орталық Еуропа жазғы уақыты", "CHAST": "Чатем стандартты уақыты", "CHADT": "Чатем жазғы уақыты", "AEDT": "Австралия жазғы шығыс уақыты", "CLST": "Чили жазғы уақыты", "LHST": "Лорд-Хау стандартты уақыты", "WARST": "Батыс Аргентина жазғы уақыты", "∅∅∅": "Азор аралдары жазғы уақыты", "JDT": "Жапония жазғы уақыты", "PST": "Солтүстік Америка стандартты Тынық мұхиты уақыты", "ACWDT": "Австралия жазғы орталық-батыс уақыты", "MEZ": "Орталық Еуропа стандартты уақыты", "ChST": "Чаморро стандартты уақыты", "BT": "Бутан уақыты", "SGT": "Сингапур уақыты", "OESZ": "Шығыс Еуропа жазғы уақыты", "ADT": "Атлантика жазғы уақыты", "TMST": "Түрікменстан жазғы уақыты", "ARST": "Аргентина жазғы уақыты", "AWST": "Австралия стандартты батыс уақыты", "HNT": "Ньюфаундленд стандартты уақыты", "SRT": "Суринам уақыты", "MST": "MST", "HKST": "Гонконг жазғы уақыты", "EDT": "Солтүстік Америка жазғы шығыс уақыты", "COST": "Колумбия жазғы уақыты", "WIB": "Батыс Индонезия уақыты", "WESZ": "Батыс Еуропа жазғы уақыты", "HAT": "Ньюфаундленд жазғы уақыты", "OEZ": "Шығыс Еуропа стандартты уақыты", "ART": "Аргентина стандартты уақыты", "BOT": "Боливия уақыты", "ACST": "Австралия стандартты орталық уақыты", "MYT": "Малайзия уақыты", "UYT": "Уругвай стандартты уақыты", "MDT": "MDT", "PDT": "Солтүстік Америка жазғы Тынық мұхиты уақыты", "NZST": "Жаңа Зеландия стандартты уақыты", "SAST": "Оңтүстік Африка уақыты", "TMT": "Түрікменстан стандартты уақыты", "WAT": "Батыс Африка стандартты уақыты", "ACDT": "Австралия жазғы орталық уақыты", "ECT": "Эквадор уақыты", "HAST": "Гавай және Алеут аралдары стандартты уақыты", "WEZ": "Батыс Еуропа стандартты уақыты", "CLT": "Чили стандартты уақыты", "UYST": "Уругвай жазғы уақыты", "CST": "Солтүстік Америка стандартты орталық уақыты", "CDT": "Солтүстік Америка жазғы орталық уақыты", "AKST": "Аляска стандартты уақыты", "ACWST": "Австралия стандартты орталық-батыс уақыты", "AST": "Атлантика стандартты уақыты", "IST": "Үндістан стандартты уақыты", "EST": "Солтүстік Америка стандартты шығыс уақыты", "CAT": "Орталық Африка уақыты", "VET": "Венесуэла уақыты", "HKT": "Гонконг стандартты уақыты", "WART": "Батыс Аргентина стандартты уақыты", "AKDT": "Аляска жазғы уақыты", "LHDT": "Лорд-Хау жазғы уақыты"},
}
}
diff --git a/kk/kk_test.go b/kk/kk_test.go
new file mode 100644
index 00000000..ccd83e78
--- /dev/null
+++ b/kk/kk_test.go
@@ -0,0 +1,1120 @@
+package kk
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "kk"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/kk_KZ/kk_KZ.go b/kk_KZ/kk_KZ.go
index 0a3612d7..2a3cb7ef 100644
--- a/kk_KZ/kk_KZ.go
+++ b/kk_KZ/kk_KZ.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"б.з.д.", "б.з."},
erasNarrow: []string{"", ""},
erasWide: []string{"Біздің заманымызға дейін", "Біздің заманымыз"},
- timezones: map[string]string{"CHADT": "Чатем жазғы уақыты", "HKST": "Гонконг жазғы уақыты", "ACST": "Австралия стандартты орталық уақыты", "PDT": "Солтүстік Америка жазғы Тынық мұхиты уақыты", "MST": "Солтүстік Америка стандартты тау уақыты", "MDT": "Солтүстік Америка жазғы тау уақыты", "∅∅∅": "Бразилия жазғы уақыты", "UYST": "Уругвай жазғы уақыты", "NZDT": "Жаңа Зеландия жазғы уақыты", "CLST": "Чили жазғы уақыты", "WESZ": "Батыс Еуропа жазғы уақыты", "EST": "Солтүстік Америка стандартты шығыс уақыты", "AWST": "Австралия стандартты батыс уақыты", "BOT": "Боливия уақыты", "HADT": "Гавай және Алеут аралдары жазғы уақыты", "AKDT": "Аляска жазғы уақыты", "MESZ": "Орталық Еуропа жазғы уақыты", "NZST": "Жаңа Зеландия стандартты уақыты", "EDT": "Солтүстік Америка жазғы шығыс уақыты", "SAST": "Оңтүстік Африка уақыты", "WAT": "Батыс Африка стандартты уақыты", "OEZ": "Шығыс Еуропа стандартты уақыты", "GYT": "Гайана уақыты", "VET": "Венесуэла уақыты", "WEZ": "Батыс Еуропа стандартты уақыты", "AEST": "Австралия стандартты шығыс уақыты", "WIT": "Шығыс Индонезия уақыты", "ACWDT": "Австралия жазғы орталық-батыс уақыты", "HKT": "Гонконг стандартты уақыты", "ARST": "Аргентина жазғы уақыты", "JST": "Жапония стандартты уақыты", "PST": "Солтүстік Америка стандартты Тынық мұхиты уақыты", "CHAST": "Чатем стандартты уақыты", "AEDT": "Австралия жазғы шығыс уақыты", "WART": "Батыс Аргентина стандартты уақыты", "WITA": "Орталық Индонезия уақыты", "UYT": "Уругвай стандартты уақыты", "HAT": "Ньюфаундленд жазғы уақыты", "MEZ": "Орталық Еуропа стандартты уақыты", "ChST": "Чаморро стандартты уақыты", "ECT": "Эквадор уақыты", "GFT": "Француз Гвианасы уақыты", "ACDT": "Австралия жазғы орталық уақыты", "AWDT": "Австралия жазғы батыс уақыты", "AST": "Атлантика стандартты уақыты", "AKST": "Аляска стандартты уақыты", "ACWST": "Австралия стандартты орталық-батыс уақыты", "BT": "Бутан уақыты", "IST": "Үндістан стандартты уақыты", "ART": "Аргентина стандартты уақыты", "CDT": "Солтүстік Америка жазғы орталық уақыты", "MYT": "Малайзия уақыты", "COST": "Колумбия жазғы уақыты", "HNT": "Ньюфаундленд стандартты уақыты", "TMST": "Түрікменстан жазғы уақыты", "LHST": "Лорд-Хау стандартты уақыты", "LHDT": "Лорд-Хау жазғы уақыты", "CAT": "Орталық Африка уақыты", "WAST": "Батыс Африка жазғы уақыты", "EAT": "Шығыс Африка уақыты", "JDT": "Жапония жазғы уақыты", "SRT": "Суринам уақыты", "CLT": "Чили стандартты уақыты", "COT": "Колумбия стандартты уақыты", "ADT": "Атлантика жазғы уақыты", "WIB": "Батыс Индонезия уақыты", "TMT": "Түрікменстан стандартты уақыты", "CST": "Солтүстік Америка стандартты орталық уақыты", "HAST": "Гавай және Алеут аралдары стандартты уақыты", "SGT": "Сингапур уақыты", "WARST": "Батыс Аргентина жазғы уақыты", "OESZ": "Шығыс Еуропа жазғы уақыты", "GMT": "Гринвич уақыты"},
+ timezones: map[string]string{"ACDT": "Австралия жазғы орталық уақыты", "GFT": "Француз Гвианасы уақыты", "AST": "Атлантика стандартты уақыты", "ACWDT": "Австралия жазғы орталық-батыс уақыты", "HADT": "Гавай және Алеут аралдары жазғы уақыты", "WESZ": "Батыс Еуропа жазғы уақыты", "GMT": "Гринвич уақыты", "MST": "Солтүстік Америка стандартты тау уақыты", "JST": "Жапония стандартты уақыты", "HNT": "Ньюфаундленд стандартты уақыты", "AEDT": "Австралия жазғы шығыс уақыты", "GYT": "Гайана уақыты", "LHST": "Лорд-Хау стандартты уақыты", "JDT": "Жапония жазғы уақыты", "SAST": "Оңтүстік Африка уақыты", "WIB": "Батыс Индонезия уақыты", "WAST": "Батыс Африка жазғы уақыты", "CST": "Солтүстік Америка стандартты орталық уақыты", "CDT": "Солтүстік Америка жазғы орталық уақыты", "ADT": "Атлантика жазғы уақыты", "AWST": "Австралия стандартты батыс уақыты", "WITA": "Орталық Индонезия уақыты", "NZST": "Жаңа Зеландия стандартты уақыты", "CAT": "Орталық Африка уақыты", "UYST": "Уругвай жазғы уақыты", "WARST": "Батыс Аргентина жазғы уақыты", "VET": "Венесуэла уақыты", "IST": "Үндістан стандартты уақыты", "PST": "Солтүстік Америка стандартты Тынық мұхиты уақыты", "NZDT": "Жаңа Зеландия жазғы уақыты", "MEZ": "Орталық Еуропа стандартты уақыты", "COST": "Колумбия жазғы уақыты", "ChST": "Чаморро стандартты уақыты", "CLT": "Чили стандартты уақыты", "SRT": "Суринам уақыты", "ART": "Аргентина стандартты уақыты", "SGT": "Сингапур уақыты", "EAT": "Шығыс Африка уақыты", "HKT": "Гонконг стандартты уақыты", "ACWST": "Австралия стандартты орталық-батыс уақыты", "HAT": "Ньюфаундленд жазғы уақыты", "UYT": "Уругвай стандартты уақыты", "WEZ": "Батыс Еуропа стандартты уақыты", "MDT": "Солтүстік Америка жазғы тау уақыты", "ACST": "Австралия стандартты орталық уақыты", "WART": "Батыс Аргентина стандартты уақыты", "AKDT": "Аляска жазғы уақыты", "ARST": "Аргентина жазғы уақыты", "BOT": "Боливия уақыты", "EDT": "Солтүстік Америка жазғы шығыс уақыты", "CLST": "Чили жазғы уақыты", "AWDT": "Австралия жазғы батыс уақыты", "HAST": "Гавай және Алеут аралдары стандартты уақыты", "OESZ": "Шығыс Еуропа жазғы уақыты", "MYT": "Малайзия уақыты", "CHADT": "Чатем жазғы уақыты", "AEST": "Австралия стандартты шығыс уақыты", "CHAST": "Чатем стандартты уақыты", "TMT": "Түрікменстан стандартты уақыты", "WAT": "Батыс Африка стандартты уақыты", "HKST": "Гонконг жазғы уақыты", "ECT": "Эквадор уақыты", "AKST": "Аляска стандартты уақыты", "EST": "Солтүстік Америка стандартты шығыс уақыты", "MESZ": "Орталық Еуропа жазғы уақыты", "BT": "Бутан уақыты", "∅∅∅": "Бразилия жазғы уақыты", "PDT": "Солтүстік Америка жазғы Тынық мұхиты уақыты", "TMST": "Түрікменстан жазғы уақыты", "OEZ": "Шығыс Еуропа стандартты уақыты", "WIT": "Шығыс Индонезия уақыты", "LHDT": "Лорд-Хау жазғы уақыты", "COT": "Колумбия стандартты уақыты"},
}
}
diff --git a/kk_KZ/kk_KZ_test.go b/kk_KZ/kk_KZ_test.go
new file mode 100644
index 00000000..71c78e4f
--- /dev/null
+++ b/kk_KZ/kk_KZ_test.go
@@ -0,0 +1,1120 @@
+package kk_KZ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "kk_KZ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/kkj/kkj.go b/kkj/kkj.go
index 1f2aa143..1f73f020 100644
--- a/kkj/kkj.go
+++ b/kkj/kkj.go
@@ -63,7 +63,7 @@ func New() locales.Translator {
daysNarrow: []string{"so", "lu", "ma", "mɛ", "ye", "va", "ms"},
daysShort: []string{"sɔndi", "lundi", "mardi", "mɛrkɛrɛdi", "yedi", "vaŋdɛrɛdi", "mɔnɔ sɔndi"},
daysWide: []string{"sɔndi", "lundi", "mardi", "mɛrkɛrɛdi", "yedi", "vaŋdɛrɛdi", "mɔnɔ sɔndi"},
- timezones: map[string]string{"NZST": "NZST", "CHADT": "CHADT", "AST": "AST", "PST": "PST", "CST": "CST", "AEST": "AEST", "MDT": "MDT", "WAST": "WAST", "AWST": "AWST", "WART": "WART", "GMT": "GMT", "HNT": "HNT", "HAT": "HAT", "LHST": "LHST", "COT": "COT", "WIB": "WIB", "AKST": "AKST", "MESZ": "MESZ", "CLST": "CLST", "ECT": "ECT", "WARST": "WARST", "ARST": "ARST", "GYT": "GYT", "ACWDT": "ACWDT", "HADT": "HADT", "HKST": "HKST", "AWDT": "AWDT", "ACDT": "ACDT", "TMT": "TMT", "JST": "JST", "SRT": "SRT", "UYST": "UYST", "SGT": "SGT", "IST": "IST", "BOT": "BOT", "ACWST": "ACWST", "CHAST": "CHAST", "WAT": "WAT", "WIT": "WIT", "ACST": "ACST", "TMST": "TMST", "AKDT": "AKDT", "JDT": "JDT", "MST": "MST", "EST": "EST", "OESZ": "OESZ", "EAT": "EAT", "UYT": "UYT", "CAT": "CAT", "OEZ": "OEZ", "PDT": "PDT", "LHDT": "LHDT", "NZDT": "NZDT", "WESZ": "WESZ", "AEDT": "AEDT", "VET": "VET", "HKT": "HKT", "ART": "ART", "MYT": "MYT", "∅∅∅": "∅∅∅", "CDT": "CDT", "MEZ": "MEZ", "HAST": "HAST", "BT": "BT", "WEZ": "WEZ", "ChST": "ChST", "GFT": "GFT", "CLT": "CLT", "EDT": "EDT", "COST": "COST", "ADT": "ADT", "SAST": "SAST", "WITA": "WITA"},
+ timezones: map[string]string{"OESZ": "OESZ", "PST": "PST", "CAT": "CAT", "WESZ": "WESZ", "WITA": "WITA", "AST": "AST", "EDT": "EDT", "HNT": "HNT", "WAT": "WAT", "CHAST": "CHAST", "HAST": "HAST", "IST": "IST", "ACWST": "ACWST", "NZDT": "NZDT", "WEZ": "WEZ", "OEZ": "OEZ", "UYST": "UYST", "∅∅∅": "∅∅∅", "HKST": "HKST", "ARST": "ARST", "WIT": "WIT", "SGT": "SGT", "WART": "WART", "HKT": "HKT", "ADT": "ADT", "NZST": "NZST", "ART": "ART", "UYT": "UYT", "ChST": "ChST", "CLST": "CLST", "VET": "VET", "ACWDT": "ACWDT", "MEZ": "MEZ", "GMT": "GMT", "CHADT": "CHADT", "JDT": "JDT", "TMST": "TMST", "BOT": "BOT", "WAST": "WAST", "LHST": "LHST", "MDT": "MDT", "JST": "JST", "HADT": "HADT", "AKDT": "AKDT", "ACST": "ACST", "AEST": "AEST", "CST": "CST", "CDT": "CDT", "EAT": "EAT", "MESZ": "MESZ", "COST": "COST", "MYT": "MYT", "COT": "COT", "CLT": "CLT", "MST": "MST", "AWDT": "AWDT", "SAST": "SAST", "AWST": "AWST", "TMT": "TMT", "ACDT": "ACDT", "EST": "EST", "WIB": "WIB", "GYT": "GYT", "AEDT": "AEDT", "LHDT": "LHDT", "ECT": "ECT", "AKST": "AKST", "PDT": "PDT", "WARST": "WARST", "SRT": "SRT", "GFT": "GFT", "HAT": "HAT", "BT": "BT"},
}
}
@@ -116,7 +116,7 @@ func (kkj *kkj) MonthAbbreviated(month time.Month) string {
// MonthsAbbreviated returns the locales abbreviated months
func (kkj *kkj) MonthsAbbreviated() []string {
- return kkj.monthsAbbreviated[1:]
+ return nil
}
// MonthNarrow returns the locales narrow month given the 'month' provided
@@ -126,7 +126,7 @@ func (kkj *kkj) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (kkj *kkj) MonthsNarrow() []string {
- return kkj.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/kkj/kkj_test.go b/kkj/kkj_test.go
new file mode 100644
index 00000000..bfab5ad0
--- /dev/null
+++ b/kkj/kkj_test.go
@@ -0,0 +1,1120 @@
+package kkj
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "kkj"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/kkj_CM/kkj_CM.go b/kkj_CM/kkj_CM.go
index 84b9d199..435e3e66 100644
--- a/kkj_CM/kkj_CM.go
+++ b/kkj_CM/kkj_CM.go
@@ -63,7 +63,7 @@ func New() locales.Translator {
daysNarrow: []string{"so", "lu", "ma", "mɛ", "ye", "va", "ms"},
daysShort: []string{"sɔndi", "lundi", "mardi", "mɛrkɛrɛdi", "yedi", "vaŋdɛrɛdi", "mɔnɔ sɔndi"},
daysWide: []string{"sɔndi", "lundi", "mardi", "mɛrkɛrɛdi", "yedi", "vaŋdɛrɛdi", "mɔnɔ sɔndi"},
- timezones: map[string]string{"TMST": "TMST", "CLT": "CLT", "WESZ": "WESZ", "CHAST": "CHAST", "EDT": "EDT", "BT": "BT", "HAT": "HAT", "PDT": "PDT", "AEDT": "AEDT", "SGT": "SGT", "AKDT": "AKDT", "UYT": "UYT", "MST": "MST", "JDT": "JDT", "NZDT": "NZDT", "CHADT": "CHADT", "WART": "WART", "EAT": "EAT", "MEZ": "MEZ", "ARST": "ARST", "MESZ": "MESZ", "HADT": "HADT", "MDT": "MDT", "AWST": "AWST", "AWDT": "AWDT", "LHDT": "LHDT", "GYT": "GYT", "UYST": "UYST", "WEZ": "WEZ", "ACWST": "ACWST", "ChST": "ChST", "COST": "COST", "ADT": "ADT", "OEZ": "OEZ", "NZST": "NZST", "CLST": "CLST", "WAT": "WAT", "WAST": "WAST", "HKST": "HKST", "GMT": "GMT", "HNT": "HNT", "ACST": "ACST", "EST": "EST", "IST": "IST", "JST": "JST", "BOT": "BOT", "ACWDT": "ACWDT", "MYT": "MYT", "COT": "COT", "WARST": "WARST", "GFT": "GFT", "WITA": "WITA", "ACDT": "ACDT", "ART": "ART", "∅∅∅": "∅∅∅", "PST": "PST", "CDT": "CDT", "VET": "VET", "CAT": "CAT", "ECT": "ECT", "OESZ": "OESZ", "SRT": "SRT", "AST": "AST", "SAST": "SAST", "HKT": "HKT", "WIB": "WIB", "TMT": "TMT", "AEST": "AEST", "HAST": "HAST", "CST": "CST", "WIT": "WIT", "AKST": "AKST", "LHST": "LHST"},
+ timezones: map[string]string{"GMT": "GMT", "CLT": "CLT", "HKST": "HKST", "ART": "ART", "BOT": "BOT", "HAST": "HAST", "UYST": "UYST", "HKT": "HKT", "WITA": "WITA", "IST": "IST", "TMST": "TMST", "WAT": "WAT", "WEZ": "WEZ", "WIT": "WIT", "ACDT": "ACDT", "ACWDT": "ACWDT", "ARST": "ARST", "CAT": "CAT", "OESZ": "OESZ", "JST": "JST", "EST": "EST", "PDT": "PDT", "HNT": "HNT", "COT": "COT", "WIB": "WIB", "AEDT": "AEDT", "LHST": "LHST", "CDT": "CDT", "WARST": "WARST", "SGT": "SGT", "AKDT": "AKDT", "ACWST": "ACWST", "JDT": "JDT", "PST": "PST", "NZST": "NZST", "WAST": "WAST", "HAT": "HAT", "AEST": "AEST", "WART": "WART", "AWDT": "AWDT", "GFT": "GFT", "WESZ": "WESZ", "OEZ": "OEZ", "GYT": "GYT", "BT": "BT", "CLST": "CLST", "CST": "CST", "ACST": "ACST", "MST": "MST", "NZDT": "NZDT", "SRT": "SRT", "CHAST": "CHAST", "CHADT": "CHADT", "SAST": "SAST", "TMT": "TMT", "COST": "COST", "LHDT": "LHDT", "MDT": "MDT", "∅∅∅": "∅∅∅", "AST": "AST", "ADT": "ADT", "HADT": "HADT", "ChST": "ChST", "EAT": "EAT", "MYT": "MYT", "VET": "VET", "AKST": "AKST", "MEZ": "MEZ", "MESZ": "MESZ", "UYT": "UYT", "ECT": "ECT", "AWST": "AWST", "EDT": "EDT"},
}
}
@@ -116,7 +116,7 @@ func (kkj *kkj_CM) MonthAbbreviated(month time.Month) string {
// MonthsAbbreviated returns the locales abbreviated months
func (kkj *kkj_CM) MonthsAbbreviated() []string {
- return kkj.monthsAbbreviated[1:]
+ return nil
}
// MonthNarrow returns the locales narrow month given the 'month' provided
@@ -126,7 +126,7 @@ func (kkj *kkj_CM) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (kkj *kkj_CM) MonthsNarrow() []string {
- return kkj.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/kkj_CM/kkj_CM_test.go b/kkj_CM/kkj_CM_test.go
new file mode 100644
index 00000000..eb9a7aa1
--- /dev/null
+++ b/kkj_CM/kkj_CM_test.go
@@ -0,0 +1,1120 @@
+package kkj_CM
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "kkj_CM"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/kl/kl.go b/kl/kl.go
index b564c130..371f89bc 100644
--- a/kl/kl.go
+++ b/kl/kl.go
@@ -68,7 +68,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"Kr.in.si.", "Kr.in.king."},
erasNarrow: []string{"Kr.s.", "Kr.k."},
erasWide: []string{"Kristusip inunngornerata siornagut", "Kristusip inunngornerata kingornagut"},
- timezones: map[string]string{"HAT": "HAT", "ARST": "ARST", "AWDT": "AWDT", "CHAST": "CHAST", "AKDT": "AKDT", "PDT": "PDT", "ChST": "ChST", "HNT": "HNT", "EAT": "EAT", "ACST": "ACST", "ACDT": "ACDT", "∅∅∅": "∅∅∅", "HKST": "HKST", "UYT": "UYT", "UYST": "UYST", "VET": "VET", "AST": "AST", "HADT": "HADT", "COT": "COT", "ADT": "ADT", "HAST": "HAST", "MDT": "MDT", "CLT": "CLT", "WESZ": "WESZ", "ACWST": "ACWST", "AEDT": "AEDT", "GMT": "GMT", "ACWDT": "ACWDT", "OEZ": "OEZ", "JDT": "JDT", "AKST": "AKST", "LHST": "LHST", "CAT": "CAT", "WIB": "WIB", "TMST": "TMST", "PST": "PST", "WART": "WART", "MEZ": "MEZ", "MESZ": "MESZ", "ART": "ART", "BOT": "BOT", "CHADT": "CHADT", "AEST": "AEST", "NZDT": "NZDT", "SGT": "SGT", "WAT": "WAT", "WIT": "WIT", "IST": "IST", "GFT": "GFT", "MST": "MST", "MYT": "MYT", "EST": "EST", "ECT": "ECT", "WARST": "WARST", "TMT": "TMT", "JST": "JST", "GYT": "GYT", "COST": "COST", "WAST": "WAST", "AWST": "AWST", "CLST": "CLST", "SAST": "SAST", "HKT": "HKT", "SRT": "SRT", "CDT": "CDT", "WEZ": "WEZ", "EDT": "EDT", "WITA": "WITA", "LHDT": "LHDT", "OESZ": "OESZ", "CST": "CST", "NZST": "NZST", "BT": "BT"},
+ timezones: map[string]string{"SAST": "SAST", "EAT": "EAT", "MYT": "MYT", "WIT": "WIT", "ACWDT": "ACWDT", "NZST": "NZST", "WAST": "WAST", "UYST": "UYST", "CHADT": "CHADT", "HADT": "HADT", "WARST": "WARST", "HKT": "HKT", "CHAST": "CHAST", "AWDT": "AWDT", "BT": "BT", "CDT": "CDT", "AWST": "AWST", "NZDT": "NZDT", "∅∅∅": "∅∅∅", "WIB": "WIB", "MST": "MST", "CLST": "CLST", "ECT": "ECT", "ARST": "ARST", "EDT": "EDT", "WEZ": "WEZ", "WESZ": "WESZ", "OEZ": "OEZ", "GMT": "GMT", "GYT": "GYT", "LHDT": "LHDT", "ACDT": "ACDT", "WART": "WART", "GFT": "GFT", "MEZ": "MEZ", "CLT": "CLT", "ACWST": "ACWST", "PDT": "PDT", "SGT": "SGT", "ChST": "ChST", "JDT": "JDT", "BOT": "BOT", "COST": "COST", "MDT": "MDT", "UYT": "UYT", "AKDT": "AKDT", "IST": "IST", "EST": "EST", "MESZ": "MESZ", "HAT": "HAT", "TMT": "TMT", "ART": "ART", "TMST": "TMST", "AEST": "AEST", "CST": "CST", "SRT": "SRT", "VET": "VET", "PST": "PST", "CAT": "CAT", "AKST": "AKST", "AST": "AST", "COT": "COT", "LHST": "LHST", "HKST": "HKST", "JST": "JST", "HAST": "HAST", "HNT": "HNT", "OESZ": "OESZ", "ACST": "ACST", "ADT": "ADT", "WAT": "WAT", "AEDT": "AEDT", "WITA": "WITA"},
}
}
diff --git a/kl/kl_test.go b/kl/kl_test.go
new file mode 100644
index 00000000..acd084e5
--- /dev/null
+++ b/kl/kl_test.go
@@ -0,0 +1,1120 @@
+package kl
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "kl"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/kl_GL/kl_GL.go b/kl_GL/kl_GL.go
index bde865eb..84f81c15 100644
--- a/kl_GL/kl_GL.go
+++ b/kl_GL/kl_GL.go
@@ -68,7 +68,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"Kr.in.si.", "Kr.in.king."},
erasNarrow: []string{"Kr.s.", "Kr.k."},
erasWide: []string{"Kristusip inunngornerata siornagut", "Kristusip inunngornerata kingornagut"},
- timezones: map[string]string{"CST": "CST", "CHADT": "CHADT", "SGT": "SGT", "PDT": "PDT", "ECT": "ECT", "SAST": "SAST", "GFT": "GFT", "TMT": "TMT", "MESZ": "MESZ", "MST": "MST", "MDT": "MDT", "AEST": "AEST", "JST": "JST", "SRT": "SRT", "AWDT": "AWDT", "GYT": "GYT", "AKDT": "AKDT", "NZST": "NZST", "CHAST": "CHAST", "HAT": "HAT", "EAT": "EAT", "BT": "BT", "GMT": "GMT", "ACDT": "ACDT", "JDT": "JDT", "VET": "VET", "ACWDT": "ACWDT", "COT": "COT", "AST": "AST", "PST": "PST", "WARST": "WARST", "CDT": "CDT", "MEZ": "MEZ", "WEZ": "WEZ", "ACWST": "ACWST", "∅∅∅": "∅∅∅", "WITA": "WITA", "ACST": "ACST", "LHDT": "LHDT", "CAT": "CAT", "HADT": "HADT", "CLT": "CLT", "AWST": "AWST", "ADT": "ADT", "OEZ": "OEZ", "OESZ": "OESZ", "AKST": "AKST", "HKST": "HKST", "IST": "IST", "MYT": "MYT", "LHST": "LHST", "TMST": "TMST", "ART": "ART", "ARST": "ARST", "UYT": "UYT", "ChST": "ChST", "HAST": "HAST", "WIB": "WIB", "WESZ": "WESZ", "WART": "WART", "UYST": "UYST", "COST": "COST", "WAST": "WAST", "NZDT": "NZDT", "CLST": "CLST", "EDT": "EDT", "HKT": "HKT", "BOT": "BOT", "WIT": "WIT", "HNT": "HNT", "AEDT": "AEDT", "EST": "EST", "WAT": "WAT"},
+ timezones: map[string]string{"PDT": "PDT", "MST": "MST", "MDT": "MDT", "WESZ": "WESZ", "OEZ": "OEZ", "WIT": "WIT", "CDT": "CDT", "GFT": "GFT", "HKST": "HKST", "JDT": "JDT", "CAT": "CAT", "BT": "BT", "COT": "COT", "LHDT": "LHDT", "TMT": "TMT", "SAST": "SAST", "PST": "PST", "MESZ": "MESZ", "WARST": "WARST", "CHAST": "CHAST", "IST": "IST", "EDT": "EDT", "ACST": "ACST", "ACDT": "ACDT", "WART": "WART", "CHADT": "CHADT", "WEZ": "WEZ", "HAT": "HAT", "WITA": "WITA", "AWDT": "AWDT", "WAT": "WAT", "SGT": "SGT", "EAT": "EAT", "MYT": "MYT", "AKDT": "AKDT", "ADT": "ADT", "HNT": "HNT", "UYT": "UYT", "NZST": "NZST", "WAST": "WAST", "GMT": "GMT", "GYT": "GYT", "CLST": "CLST", "ECT": "ECT", "ART": "ART", "HADT": "HADT", "∅∅∅": "∅∅∅", "BOT": "BOT", "UYST": "UYST", "ACWST": "ACWST", "TMST": "TMST", "VET": "VET", "COST": "COST", "AEST": "AEST", "ChST": "ChST", "LHST": "LHST", "CST": "CST", "JST": "JST", "ARST": "ARST", "EST": "EST", "HKT": "HKT", "MEZ": "MEZ", "OESZ": "OESZ", "CLT": "CLT", "SRT": "SRT", "AKST": "AKST", "AWST": "AWST", "NZDT": "NZDT", "WIB": "WIB", "AEDT": "AEDT", "AST": "AST", "ACWDT": "ACWDT", "HAST": "HAST"},
}
}
diff --git a/kl_GL/kl_GL_test.go b/kl_GL/kl_GL_test.go
new file mode 100644
index 00000000..6e968392
--- /dev/null
+++ b/kl_GL/kl_GL_test.go
@@ -0,0 +1,1120 @@
+package kl_GL
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "kl_GL"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/kln/kln.go b/kln/kln.go
index b32691de..560328f2 100644
--- a/kln/kln.go
+++ b/kln/kln.go
@@ -63,7 +63,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"AM", "KO"},
erasNarrow: []string{"", ""},
erasWide: []string{"Amait kesich Jesu", "Kokakesich Jesu"},
- timezones: map[string]string{"ACST": "ACST", "JST": "JST", "UYT": "UYT", "WART": "WART", "HAST": "HAST", "IST": "IST", "MDT": "MDT", "SRT": "SRT", "CDT": "CDT", "BT": "BT", "MYT": "MYT", "PDT": "PDT", "LHST": "LHST", "UYST": "UYST", "HNT": "HNT", "MST": "MST", "AWST": "AWST", "ACWST": "ACWST", "NZDT": "NZDT", "CLT": "CLT", "WARST": "WARST", "WAT": "WAT", "GMT": "GMT", "HAT": "HAT", "TMT": "TMT", "TMST": "TMST", "HKT": "HKT", "CHAST": "CHAST", "CAT": "CAT", "WAST": "WAST", "WIB": "WIB", "AWDT": "AWDT", "GFT": "GFT", "CHADT": "CHADT", "AEDT": "AEDT", "HADT": "HADT", "CST": "CST", "NZST": "NZST", "WEZ": "WEZ", "COST": "COST", "OESZ": "OESZ", "∅∅∅": "∅∅∅", "AEST": "AEST", "EDT": "EDT", "ChST": "ChST", "EAT": "EAT", "ACDT": "ACDT", "MESZ": "MESZ", "CLST": "CLST", "SAST": "SAST", "WITA": "WITA", "OEZ": "OEZ", "BOT": "BOT", "SGT": "SGT", "WIT": "WIT", "ACWDT": "ACWDT", "COT": "COT", "JDT": "JDT", "AKST": "AKST", "VET": "VET", "WESZ": "WESZ", "ADT": "ADT", "HKST": "HKST", "ART": "ART", "EST": "EST", "ECT": "ECT", "AST": "AST", "LHDT": "LHDT", "MEZ": "MEZ", "ARST": "ARST", "GYT": "GYT", "AKDT": "AKDT", "PST": "PST"},
+ timezones: map[string]string{"HAT": "HAT", "AEST": "AEST", "HKST": "HKST", "ECT": "ECT", "VET": "VET", "AST": "AST", "TMT": "TMT", "WEZ": "WEZ", "HNT": "HNT", "ARST": "ARST", "JST": "JST", "EDT": "EDT", "TMST": "TMST", "EAT": "EAT", "CDT": "CDT", "ACDT": "ACDT", "ChST": "ChST", "LHDT": "LHDT", "CST": "CST", "HKT": "HKT", "EST": "EST", "NZDT": "NZDT", "CAT": "CAT", "CHADT": "CHADT", "ADT": "ADT", "ART": "ART", "MESZ": "MESZ", "HADT": "HADT", "MDT": "MDT", "ACWST": "ACWST", "ACWDT": "ACWDT", "OEZ": "OEZ", "AEDT": "AEDT", "BT": "BT", "SGT": "SGT", "WIT": "WIT", "UYST": "UYST", "WART": "WART", "SRT": "SRT", "COST": "COST", "LHST": "LHST", "∅∅∅": "∅∅∅", "GFT": "GFT", "GMT": "GMT", "WARST": "WARST", "PST": "PST", "MST": "MST", "WITA": "WITA", "SAST": "SAST", "MEZ": "MEZ", "NZST": "NZST", "WIB": "WIB", "OESZ": "OESZ", "AWST": "AWST", "WAT": "WAT", "ACST": "ACST", "COT": "COT", "MYT": "MYT", "CLST": "CLST", "UYT": "UYT", "CHAST": "CHAST", "AKST": "AKST", "PDT": "PDT", "HAST": "HAST", "WAST": "WAST", "CLT": "CLT", "IST": "IST", "WESZ": "WESZ", "AKDT": "AKDT", "AWDT": "AWDT", "JDT": "JDT", "BOT": "BOT", "GYT": "GYT"},
}
}
diff --git a/kln/kln_test.go b/kln/kln_test.go
new file mode 100644
index 00000000..b5e4e7d9
--- /dev/null
+++ b/kln/kln_test.go
@@ -0,0 +1,1120 @@
+package kln
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "kln"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/kln_KE/kln_KE.go b/kln_KE/kln_KE.go
index f7964a2a..9e295952 100644
--- a/kln_KE/kln_KE.go
+++ b/kln_KE/kln_KE.go
@@ -63,7 +63,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"AM", "KO"},
erasNarrow: []string{"", ""},
erasWide: []string{"Amait kesich Jesu", "Kokakesich Jesu"},
- timezones: map[string]string{"MDT": "MDT", "CHADT": "CHADT", "WITA": "WITA", "IST": "IST", "SAST": "SAST", "ARST": "ARST", "EAT": "EAT", "BOT": "BOT", "AEDT": "AEDT", "HADT": "HADT", "BT": "BT", "HKT": "HKT", "TMT": "TMT", "ECT": "ECT", "AST": "AST", "JDT": "JDT", "MEZ": "MEZ", "CLT": "CLT", "CAT": "CAT", "HAST": "HAST", "GMT": "GMT", "MST": "MST", "PDT": "PDT", "ACWDT": "ACWDT", "EDT": "EDT", "JST": "JST", "GFT": "GFT", "ACDT": "ACDT", "MYT": "MYT", "NZDT": "NZDT", "ChST": "ChST", "COST": "COST", "WAST": "WAST", "OESZ": "OESZ", "AWDT": "AWDT", "AKDT": "AKDT", "MESZ": "MESZ", "AEST": "AEST", "WIT": "WIT", "PST": "PST", "CDT": "CDT", "COT": "COT", "HKST": "HKST", "∅∅∅": "∅∅∅", "SRT": "SRT", "ADT": "ADT", "ART": "ART", "NZST": "NZST", "CST": "CST", "VET": "VET", "WAT": "WAT", "AKST": "AKST", "UYT": "UYT", "WEZ": "WEZ", "HNT": "HNT", "TMST": "TMST", "GYT": "GYT", "UYST": "UYST", "WESZ": "WESZ", "WART": "WART", "LHDT": "LHDT", "SGT": "SGT", "WIB": "WIB", "AWST": "AWST", "LHST": "LHST", "ACWST": "ACWST", "CHAST": "CHAST", "CLST": "CLST", "EST": "EST", "ACST": "ACST", "WARST": "WARST", "OEZ": "OEZ", "HAT": "HAT"},
+ timezones: map[string]string{"MEZ": "MEZ", "TMT": "TMT", "MYT": "MYT", "CLST": "CLST", "GFT": "GFT", "OEZ": "OEZ", "OESZ": "OESZ", "SAST": "SAST", "VET": "VET", "ADT": "ADT", "CST": "CST", "HKST": "HKST", "WIB": "WIB", "GMT": "GMT", "BT": "BT", "SRT": "SRT", "PDT": "PDT", "WEZ": "WEZ", "GYT": "GYT", "AEST": "AEST", "PST": "PST", "SGT": "SGT", "WESZ": "WESZ", "AWST": "AWST", "NZST": "NZST", "EST": "EST", "TMST": "TMST", "ChST": "ChST", "WART": "WART", "AWDT": "AWDT", "WIT": "WIT", "LHST": "LHST", "JDT": "JDT", "AEDT": "AEDT", "CHAST": "CHAST", "UYT": "UYT", "COT": "COT", "CDT": "CDT", "IST": "IST", "EDT": "EDT", "HKT": "HKT", "ACWST": "ACWST", "ACWDT": "ACWDT", "HADT": "HADT", "HNT": "HNT", "UYST": "UYST", "EAT": "EAT", "LHDT": "LHDT", "CAT": "CAT", "WAST": "WAST", "ART": "ART", "ARST": "ARST", "AKST": "AKST", "MESZ": "MESZ", "COST": "COST", "CLT": "CLT", "ACST": "ACST", "ACDT": "ACDT", "AST": "AST", "HAT": "HAT", "WAT": "WAT", "MST": "MST", "MDT": "MDT", "ECT": "ECT", "HAST": "HAST", "NZDT": "NZDT", "BOT": "BOT", "WARST": "WARST", "WITA": "WITA", "JST": "JST", "∅∅∅": "∅∅∅", "CHADT": "CHADT", "AKDT": "AKDT"},
}
}
diff --git a/kln_KE/kln_KE_test.go b/kln_KE/kln_KE_test.go
new file mode 100644
index 00000000..b8c5cbfb
--- /dev/null
+++ b/kln_KE/kln_KE_test.go
@@ -0,0 +1,1120 @@
+package kln_KE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "kln_KE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/km/km.go b/km/km.go
index 8af43002..fef8d9bf 100644
--- a/km/km.go
+++ b/km/km.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"មុន គ.ស.", "គ.ស."},
erasNarrow: []string{"", ""},
erasWide: []string{"មុន\u200bគ្រិស្តសករាជ", "គ្រិស្តសករាជ"},
- timezones: map[string]string{"JDT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bនៅជប៉ុន", "SGT": "ម៉ោង\u200bនៅ\u200bសិង្ហបូរី", "SAST": "ម៉ោង\u200bនៅ\u200bអាហ្វ្រិក\u200bខាង\u200bត្បូង", "CDT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bភាគ\u200bកណ្ដាល\u200bនៅ\u200bអាមេរិក\u200bខាង\u200bជើង", "ChST": "ម៉ោង\u200bនៅ\u200bចាំម៉ូរ៉ូ", "AKST": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bអាឡាស្កា", "EDT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bភាគខាង\u200bកើតនៅ\u200bអាមេរិក\u200bខាង\u200bជើង", "ACST": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bអូស្ត្រាលី\u200bកណ្ដាល", "MYT": "ម៉ោង\u200bនៅ\u200bម៉ាឡេស៊ី", "CHAST": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bចាថាំ", "ECT": "ម៉ោង\u200bនៅ\u200bអេក្វាទ័រ", "AWDT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bនៅ\u200bអូស្ត្រាលី\u200bខាង\u200bលិច", "PST": "ម៉ោង\u200bស្តង់ដារ\u200bភាគ\u200bខាង\u200bលិច\u200bនៅ\u200bអាមេរិក\u200bខាង\u200bជើង", "MEZ": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bអឺរ៉ុប\u200bកណ្ដាល", "CHADT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bនៅ\u200bចាថាំ", "HAST": "ម៉ោង\u200bស្តង់ដារ\u200b\u200bនៅ\u200bហាវៃ-អាល់ដ្យូសិន", "COT": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bកូឡុំប៊ី", "COST": "ម៉ោង\u200bរដូវ\u200bក្ដៅ\u200bនៅ\u200bកូឡុំប៊ី", "CAT": "ម៉ោង\u200bនៅ\u200bអាហ្វ្រិក\u200bកណ្ដាល", "WITA": "ម៉ោង\u200bនៅ\u200bឥណ្ឌូណេស៊ី\u200b\u200b\u200bកណ្ដាល", "AEST": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bអូស្ត្រាលី\u200bខាង\u200bកើត", "CLST": "ម៉ោងរដូវក្តៅនៅឈីលី", "WEZ": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bអឺរ៉ុប\u200bខាង\u200bលិច", "ADT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bនៅ\u200bអាត្លង់ទិក", "AWST": "ម៉ោង\u200b\u200bស្តង់ដារ\u200bនៅ\u200bអូស្ត្រាលី\u200bខាង\u200bលិច", "PDT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200b\u200bភាគ\u200bខាងលិច\u200bនៅ\u200bអាមេរិក\u200bភាគ\u200bខាង\u200bជើង", "MDT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bនៅ\u200bតំបន់\u200bភ្នំ\u200bអាមេរិក\u200bភាគ\u200bខាង\u200bជើង", "∅∅∅": "ម៉ោង\u200b\u200bរដូវ\u200bក្ដៅ\u200bនៅ\u200bប្រាស៊ីលីយ៉ា", "EST": "ម៉ោង\u200bស្តង់ដារ\u200bភាគ\u200bខាង\u200bកើត\u200bនៅ\u200bអាមេរិក\u200bខាង\u200bជើង", "AST": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bអាត្លង់ទិក", "WAT": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bអាហ្វ្រិក\u200bខាង\u200bលិច", "WAST": "ម៉ោង\u200b\u200bរដូវ\u200bក្ដៅ\u200bនៅ\u200bអាហ្វ្រិក\u200b\u200b\u200bខាងលិច", "AEDT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bនៅ\u200bអូស្ត្រាលី\u200bខាង\u200bកើត", "ACWST": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bភាគ\u200bខាង\u200bលិច\u200bនៃ\u200bអូស្ត្រាលី\u200bកណ្ដាល", "CST": "ម៉ោង\u200bស្តង់ដារ\u200bភាគ\u200bកណ្ដាល\u200bនៅ\u200bអាមេរិក\u200bខាង\u200bជើង", "HKST": "ម៉ោង\u200bរដូវ\u200bក្ដៅ\u200bនៅ\u200bហុងកុង", "AKDT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bនៅ\u200b\u200bអាឡាស្កា", "NZDT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bនៅ\u200bនូវែលសេឡង់", "UYST": "ម៉ោង\u200b\u200bរដូវ\u200bក្ដៅ\u200bនៅ\u200bអ៊ុយរូហ្គាយ", "TMT": "ម៉ោង\u200bស្តង់ដារ\u200bនៅតួកម៉េនីស្ថាន", "EAT": "ម៉ោង\u200bនៅ\u200bអាហ្វ្រិក\u200bខាង\u200bកើត", "WARST": "ម៉ោង\u200bរដូវ\u200bក្ដៅ\u200bនៅ\u200bអាសង់ទីន\u200b\u200bខាង\u200bលិច", "NZST": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bនូវែលសេឡង់", "ART": "ម៉ោង\u200b\u200bស្តង់ដារ\u200bនៅ\u200bអាសង់ទីន", "CLT": "ម៉ោងស្តង់ដារនៅឈីលី", "BT": "ម៉ោងនៅប៊ូតាន", "HKT": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bហុងកុង", "WIB": "ម៉ោង\u200bនៅ\u200bឥណ្ឌូណេស៊ី\u200b\u200bខាង\u200bលិច", "ACDT": "ម៉ោង\u200bពេលថ្ងៃ\u200b\u200b\u200b\u200bនៅ\u200bអូស្ត្រាលី\u200bកណ្ដាល", "TMST": "ម៉ោង\u200bរដូវ\u200bក្ដៅ\u200bនៅ\u200bតួកម៉េនីស្ថាន\u200b", "MST": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bតំបន់\u200bភ្នំ\u200bអាមេរិក\u200bខាង\u200bជើង", "WESZ": "ម៉ោង\u200bរដូវ\u200bក្ដៅ\u200bនៅ\u200bអឺរ៉ុប\u200bខាង\u200bលិច", "WIT": "ម៉ោង\u200bនៅ\u200bឥណ្ឌូណេស៊ី\u200b\u200bខាង\u200bកើត", "OESZ": "ម៉ោង\u200bរដូវ\u200bក្ដៅ\u200bនៅ\u200bអឺរ៉ុប\u200b\u200bខាង\u200bកើត\u200b", "GYT": "ម៉ោង\u200bនៅ\u200bឃ្វីយ៉ាន", "SRT": "ម៉ោង\u200bនៅ\u200bសូរីណាម", "MESZ": "ម៉ោង\u200bរដូវ\u200bក្ដៅ\u200bនៅ\u200bអឺរ៉ុប\u200bកណ្ដាល", "ACWDT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bនៅ\u200b\u200bភាគ\u200bខាង\u200bលិច\u200bនៃ\u200bអូស្ត្រាលី\u200bកណ្ដាល", "HADT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bនៅ\u200bហាវៃ-អាល់ដ្យូសិន", "ARST": "ម៉ោង\u200bរដូវ\u200bក្ដៅ\u200bនៅ\u200bអាសង់ទីន", "GMT": "ម៉ោងនៅគ្រីនវិច", "IST": "ម៉ោង\u200bនៅ\u200bឥណ្ឌា", "HNT": "ម៉ោង\u200b\u200bស្តង់ដារ\u200b\u200bនៅ\u200bញូហ្វោនឡែន", "HAT": "ម៉ោង\u200bពេលថ្ងៃ\u200bនៅ\u200bញូហ្វោនឡែន", "GFT": "ម៉ោង\u200bនៅ\u200bឃ្វីយ៉ាន\u200bបារាំង", "OEZ": "ម៉ោង\u200bស្តង់ដារ\u200b\u200bនៅ\u200bអឺរ៉ុប\u200b\u200bខាង\u200bកើត\u200b", "LHST": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bឡត\u200bហៅ", "LHDT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bនៅ\u200bឡតហៅ", "VET": "ម៉ោង\u200bនៅ\u200bវ៉េណេស៊ុយអេឡា", "WART": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bអាសង់ទីន\u200b\u200bខាង\u200bលិច", "UYT": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bអ៊ុយរូហ្គាយ", "JST": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bជប៉ុន", "BOT": "ម៉ោង\u200bនៅ\u200bបូលីវី"},
+ timezones: map[string]string{"AEDT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bនៅ\u200bអូស្ត្រាលី\u200bខាង\u200bកើត", "CLST": "ម៉ោងរដូវក្តៅនៅឈីលី", "UYST": "ម៉ោង\u200b\u200bរដូវ\u200bក្ដៅ\u200bនៅ\u200bអ៊ុយរូហ្គាយ", "AST": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bអាត្លង់ទិក", "PST": "ម៉ោង\u200bស្តង់ដារ\u200bភាគ\u200bខាង\u200bលិច\u200bនៅ\u200bអាមេរិក\u200bខាង\u200bជើង", "HADT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bនៅ\u200bហាវៃ-អាល់ដ្យូសិន", "UYT": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bអ៊ុយរូហ្គាយ", "HKT": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bហុងកុង", "ADT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bនៅ\u200bអាត្លង់ទិក", "WAST": "ម៉ោង\u200b\u200bរដូវ\u200bក្ដៅ\u200bនៅ\u200bអាហ្វ្រិក\u200b\u200b\u200bខាងលិច", "WIB": "ម៉ោង\u200bនៅ\u200bឥណ្ឌូណេស៊ី\u200b\u200bខាង\u200bលិច", "GYT": "ម៉ោង\u200bនៅ\u200bឃ្វីយ៉ាន", "CHADT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bនៅ\u200bចាថាំ", "ARST": "ម៉ោង\u200bរដូវ\u200bក្ដៅ\u200bនៅ\u200bអាសង់ទីន", "WITA": "ម៉ោង\u200bនៅ\u200bឥណ្ឌូណេស៊ី\u200b\u200b\u200bកណ្ដាល", "JST": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bជប៉ុន", "AEST": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bអូស្ត្រាលី\u200bខាង\u200bកើត", "∅∅∅": "ម៉ោង\u200b\u200bរដូវ\u200bក្ដៅ\u200bនៅ\u200bប្រាស៊ីលីយ៉ា", "SAST": "ម៉ោង\u200bនៅ\u200bអាហ្វ្រិក\u200bខាង\u200bត្បូង", "ACDT": "ម៉ោង\u200bពេលថ្ងៃ\u200b\u200b\u200b\u200bនៅ\u200bអូស្ត្រាលី\u200bកណ្ដាល", "EST": "ម៉ោង\u200bស្តង់ដារ\u200bភាគ\u200bខាង\u200bកើត\u200bនៅ\u200bអាមេរិក\u200bខាង\u200bជើង", "EDT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bភាគខាង\u200bកើតនៅ\u200bអាមេរិក\u200bខាង\u200bជើង", "WEZ": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bអឺរ៉ុប\u200bខាង\u200bលិច", "OEZ": "ម៉ោង\u200bស្តង់ដារ\u200b\u200bនៅ\u200bអឺរ៉ុប\u200b\u200bខាង\u200bកើត\u200b", "WARST": "ម៉ោង\u200bរដូវ\u200bក្ដៅ\u200bនៅ\u200bអាសង់ទីន\u200b\u200bខាង\u200bលិច", "AKDT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bនៅ\u200b\u200bអាឡាស្កា", "OESZ": "ម៉ោង\u200bរដូវ\u200bក្ដៅ\u200bនៅ\u200bអឺរ៉ុប\u200b\u200bខាង\u200bកើត\u200b", "EAT": "ម៉ោង\u200bនៅ\u200bអាហ្វ្រិក\u200bខាង\u200bកើត", "MST": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bតំបន់\u200bភ្នំ\u200bអាមេរិក\u200bខាង\u200bជើង", "ECT": "ម៉ោង\u200bនៅ\u200bអេក្វាទ័រ", "ART": "ម៉ោង\u200b\u200bស្តង់ដារ\u200bនៅ\u200bអាសង់ទីន", "NZDT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bនៅ\u200bនូវែលសេឡង់", "CAT": "ម៉ោង\u200bនៅ\u200bអាហ្វ្រិក\u200bកណ្ដាល", "LHDT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bនៅ\u200bឡតហៅ", "COT": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bកូឡុំប៊ី", "MEZ": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bអឺរ៉ុប\u200bកណ្ដាល", "HAT": "ម៉ោង\u200bពេលថ្ងៃ\u200bនៅ\u200bញូហ្វោនឡែន", "BT": "ម៉ោងនៅប៊ូតាន", "ACWDT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bនៅ\u200b\u200bភាគ\u200bខាង\u200bលិច\u200bនៃ\u200bអូស្ត្រាលី\u200bកណ្ដាល", "AWST": "ម៉ោង\u200b\u200bស្តង់ដារ\u200bនៅ\u200bអូស្ត្រាលី\u200bខាង\u200bលិច", "JDT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bនៅជប៉ុន", "NZST": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bនូវែលសេឡង់", "WAT": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bអាហ្វ្រិក\u200bខាង\u200bលិច", "HNT": "ម៉ោង\u200b\u200bស្តង់ដារ\u200b\u200bនៅ\u200bញូហ្វោនឡែន", "COST": "ម៉ោង\u200bរដូវ\u200bក្ដៅ\u200bនៅ\u200bកូឡុំប៊ី", "MDT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bនៅ\u200bតំបន់\u200bភ្នំ\u200bអាមេរិក\u200bភាគ\u200bខាង\u200bជើង", "GFT": "ម៉ោង\u200bនៅ\u200bឃ្វីយ៉ាន\u200bបារាំង", "CHAST": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bចាថាំ", "ACWST": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bភាគ\u200bខាង\u200bលិច\u200bនៃ\u200bអូស្ត្រាលី\u200bកណ្ដាល", "AWDT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bនៅ\u200bអូស្ត្រាលី\u200bខាង\u200bលិច", "BOT": "ម៉ោង\u200bនៅ\u200bបូលីវី", "MESZ": "ម៉ោង\u200bរដូវ\u200bក្ដៅ\u200bនៅ\u200bអឺរ៉ុប\u200bកណ្ដាល", "ChST": "ម៉ោង\u200bនៅ\u200bចាំម៉ូរ៉ូ", "WIT": "ម៉ោង\u200bនៅ\u200bឥណ្ឌូណេស៊ី\u200b\u200bខាង\u200bកើត", "MYT": "ម៉ោង\u200bនៅ\u200bម៉ាឡេស៊ី", "CLT": "ម៉ោងស្តង់ដារនៅឈីលី", "CST": "ម៉ោង\u200bស្តង់ដារ\u200bភាគ\u200bកណ្ដាល\u200bនៅ\u200bអាមេរិក\u200bខាង\u200bជើង", "WART": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bអាសង់ទីន\u200b\u200bខាង\u200bលិច", "VET": "ម៉ោង\u200bនៅ\u200bវ៉េណេស៊ុយអេឡា", "TMT": "ម៉ោង\u200bស្តង់ដារ\u200bនៅតួកម៉េនីស្ថាន", "HKST": "ម៉ោង\u200bរដូវ\u200bក្ដៅ\u200bនៅ\u200bហុងកុង", "TMST": "ម៉ោង\u200bរដូវ\u200bក្ដៅ\u200bនៅ\u200bតួកម៉េនីស្ថាន\u200b", "WESZ": "ម៉ោង\u200bរដូវ\u200bក្ដៅ\u200bនៅ\u200bអឺរ៉ុប\u200bខាង\u200bលិច", "SGT": "ម៉ោង\u200bនៅ\u200bសិង្ហបូរី", "GMT": "ម៉ោងនៅគ្រីនវិច", "CDT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bភាគ\u200bកណ្ដាល\u200bនៅ\u200bអាមេរិក\u200bខាង\u200bជើង", "ACST": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bអូស្ត្រាលី\u200bកណ្ដាល", "SRT": "ម៉ោង\u200bនៅ\u200bសូរីណាម", "AKST": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bអាឡាស្កា", "HAST": "ម៉ោង\u200bស្តង់ដារ\u200b\u200bនៅ\u200bហាវៃ-អាល់ដ្យូសិន", "LHST": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bឡត\u200bហៅ", "IST": "ម៉ោង\u200bនៅ\u200bឥណ្ឌា", "PDT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200b\u200bភាគ\u200bខាងលិច\u200bនៅ\u200bអាមេរិក\u200bភាគ\u200bខាង\u200bជើង"},
}
}
diff --git a/km/km_test.go b/km/km_test.go
new file mode 100644
index 00000000..8eea489a
--- /dev/null
+++ b/km/km_test.go
@@ -0,0 +1,1120 @@
+package km
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "km"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/km_KH/km_KH.go b/km_KH/km_KH.go
index 3270a115..e6bf142f 100644
--- a/km_KH/km_KH.go
+++ b/km_KH/km_KH.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"មុន គ.ស.", "គ.ស."},
erasNarrow: []string{"", ""},
erasWide: []string{"មុន\u200bគ្រិស្តសករាជ", "គ្រិស្តសករាជ"},
- timezones: map[string]string{"GFT": "ម៉ោង\u200bនៅ\u200bឃ្វីយ៉ាន\u200bបារាំង", "MST": "MST", "PST": "ម៉ោង\u200bស្តង់ដារ\u200bភាគ\u200bខាង\u200bលិច\u200bនៅ\u200bអាមេរិក\u200bខាង\u200bជើង", "AEST": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bអូស្ត្រាលី\u200bខាង\u200bកើត", "TMST": "ម៉ោង\u200bរដូវ\u200bក្ដៅ\u200bនៅ\u200bតួកម៉េនីស្ថាន\u200b", "CLT": "ម៉ោងស្តង់ដារនៅឈីលី", "HKST": "ម៉ោង\u200bរដូវ\u200bក្ដៅ\u200bនៅ\u200bហុងកុង", "GMT": "ម៉ោងនៅគ្រីនវិច", "WIT": "ម៉ោង\u200bនៅ\u200bឥណ្ឌូណេស៊ី\u200b\u200bខាង\u200bកើត", "∅∅∅": "ម៉ោង\u200bរដូវ\u200bក្ដៅ\u200bនៅ\u200bអាម៉ាសូន", "CDT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bភាគ\u200bកណ្ដាល\u200bនៅ\u200bអាមេរិក\u200bខាង\u200bជើង", "UYST": "ម៉ោង\u200b\u200bរដូវ\u200bក្ដៅ\u200bនៅ\u200bអ៊ុយរូហ្គាយ", "WAT": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bអាហ្វ្រិក\u200bខាង\u200bលិច", "UYT": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bអ៊ុយរូហ្គាយ", "WEZ": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bអឺរ៉ុប\u200bខាង\u200bលិច", "OESZ": "ម៉ោង\u200bរដូវ\u200bក្ដៅ\u200bនៅ\u200bអឺរ៉ុប\u200b\u200bខាង\u200bកើត\u200b", "MDT": "MDT", "ART": "ម៉ោង\u200b\u200bស្តង់ដារ\u200bនៅ\u200bអាសង់ទីន", "AWST": "ម៉ោង\u200b\u200bស្តង់ដារ\u200bនៅ\u200bអូស្ត្រាលី\u200bខាង\u200bលិច", "LHDT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bនៅ\u200bឡតហៅ", "IST": "ម៉ោង\u200bនៅ\u200bឥណ្ឌា", "HAT": "ម៉ោង\u200bពេលថ្ងៃ\u200bនៅ\u200bញូហ្វោនឡែន", "WIB": "ម៉ោង\u200bនៅ\u200bឥណ្ឌូណេស៊ី\u200b\u200bខាង\u200bលិច", "JST": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bជប៉ុន", "HADT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bនៅ\u200bហាវៃ-អាល់ដ្យូសិន", "WAST": "ម៉ោង\u200b\u200bរដូវ\u200bក្ដៅ\u200bនៅ\u200bអាហ្វ្រិក\u200b\u200b\u200bខាងលិច", "OEZ": "ម៉ោង\u200bស្តង់ដារ\u200b\u200bនៅ\u200bអឺរ៉ុប\u200b\u200bខាង\u200bកើត\u200b", "WITA": "ម៉ោង\u200bនៅ\u200bឥណ្ឌូណេស៊ី\u200b\u200b\u200bកណ្ដាល", "NZDT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bនៅ\u200bនូវែលសេឡង់", "WESZ": "ម៉ោង\u200bរដូវ\u200bក្ដៅ\u200bនៅ\u200bអឺរ៉ុប\u200bខាង\u200bលិច", "ChST": "ម៉ោង\u200bនៅ\u200bចាំម៉ូរ៉ូ", "AKDT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bនៅ\u200b\u200bអាឡាស្កា", "CHAST": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bចាថាំ", "HAST": "ម៉ោង\u200bស្តង់ដារ\u200b\u200bនៅ\u200bហាវៃ-អាល់ដ្យូសិន", "WART": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bអាសង់ទីន\u200b\u200bខាង\u200bលិច", "ECT": "ម៉ោង\u200bនៅ\u200bអេក្វាទ័រ", "EAT": "ម៉ោង\u200bនៅ\u200bអាហ្វ្រិក\u200bខាង\u200bកើត", "JDT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bនៅជប៉ុន", "EST": "ម៉ោង\u200bស្តង់ដារ\u200bភាគ\u200bខាង\u200bកើត\u200bនៅ\u200bអាមេរិក\u200bខាង\u200bជើង", "TMT": "ម៉ោង\u200bស្តង់ដារ\u200bនៅតួកម៉េនីស្ថាន", "AWDT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bនៅ\u200bអូស្ត្រាលី\u200bខាង\u200bលិច", "MYT": "ម៉ោង\u200bនៅ\u200bម៉ាឡេស៊ី", "MESZ": "ម៉ោង\u200bរដូវ\u200bក្ដៅ\u200bនៅ\u200bអឺរ៉ុប\u200bកណ្ដាល", "AST": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bអាត្លង់ទិក", "ACDT": "ម៉ោង\u200bពេលថ្ងៃ\u200b\u200b\u200b\u200bនៅ\u200bអូស្ត្រាលី\u200bកណ្ដាល", "PDT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200b\u200bភាគ\u200bខាងលិច\u200bនៅ\u200bអាមេរិក\u200bភាគ\u200bខាង\u200bជើង", "CST": "ម៉ោង\u200bស្តង់ដារ\u200bភាគ\u200bកណ្ដាល\u200bនៅ\u200bអាមេរិក\u200bខាង\u200bជើង", "ACWST": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bភាគ\u200bខាង\u200bលិច\u200bនៃ\u200bអូស្ត្រាលី\u200bកណ្ដាល", "ADT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bនៅ\u200bអាត្លង់ទិក", "SAST": "ម៉ោង\u200bនៅ\u200bអាហ្វ្រិក\u200bខាង\u200bត្បូង", "HNT": "ម៉ោង\u200b\u200bស្តង់ដារ\u200b\u200bនៅ\u200bញូហ្វោនឡែន", "ARST": "ម៉ោង\u200bរដូវ\u200bក្ដៅ\u200bនៅ\u200bអាសង់ទីន", "AKST": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bអាឡាស្កា", "NZST": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bនូវែលសេឡង់", "CHADT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bនៅ\u200bចាថាំ", "CLST": "ម៉ោងរដូវក្តៅនៅឈីលី", "CAT": "ម៉ោង\u200bនៅ\u200bអាហ្វ្រិក\u200bកណ្ដាល", "COT": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bកូឡុំប៊ី", "SGT": "ម៉ោង\u200bនៅ\u200bសិង្ហបូរី", "LHST": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bឡត\u200bហៅ", "GYT": "ម៉ោង\u200bនៅ\u200bឃ្វីយ៉ាន", "ACWDT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bនៅ\u200b\u200bភាគ\u200bខាង\u200bលិច\u200bនៃ\u200bអូស្ត្រាលី\u200bកណ្ដាល", "COST": "ម៉ោង\u200bរដូវ\u200bក្ដៅ\u200bនៅ\u200bកូឡុំប៊ី", "BT": "ម៉ោងនៅប៊ូតាន", "HKT": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bហុងកុង", "WARST": "ម៉ោង\u200bរដូវ\u200bក្ដៅ\u200bនៅ\u200bអាសង់ទីន\u200b\u200bខាង\u200bលិច", "ACST": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bអូស្ត្រាលី\u200bកណ្ដាល", "AEDT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bនៅ\u200bអូស្ត្រាលី\u200bខាង\u200bកើត", "VET": "ម៉ោង\u200bនៅ\u200bវ៉េណេស៊ុយអេឡា", "EDT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bភាគខាង\u200bកើតនៅ\u200bអាមេរិក\u200bខាង\u200bជើង", "SRT": "ម៉ោង\u200bនៅ\u200bសូរីណាម", "MEZ": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bអឺរ៉ុប\u200bកណ្ដាល", "BOT": "ម៉ោង\u200bនៅ\u200bបូលីវី"},
+ timezones: map[string]string{"ACST": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bអូស្ត្រាលី\u200bកណ្ដាល", "AKST": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bអាឡាស្កា", "NZST": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bនូវែលសេឡង់", "SAST": "ម៉ោង\u200bនៅ\u200bអាហ្វ្រិក\u200bខាង\u200bត្បូង", "HADT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bនៅ\u200bហាវៃ-អាល់ដ្យូសិន", "AEDT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bនៅ\u200bអូស្ត្រាលី\u200bខាង\u200bកើត", "CLT": "ម៉ោងស្តង់ដារនៅឈីលី", "AWST": "ម៉ោង\u200b\u200bស្តង់ដារ\u200bនៅ\u200bអូស្ត្រាលី\u200bខាង\u200bលិច", "AWDT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bនៅ\u200bអូស្ត្រាលី\u200bខាង\u200bលិច", "MEZ": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bអឺរ៉ុប\u200bកណ្ដាល", "HAT": "ម៉ោង\u200bពេលថ្ងៃ\u200bនៅ\u200bញូហ្វោនឡែន", "OEZ": "ម៉ោង\u200bស្តង់ដារ\u200b\u200bនៅ\u200bអឺរ៉ុប\u200b\u200bខាង\u200bកើត\u200b", "ADT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bនៅ\u200bអាត្លង់ទិក", "EST": "ម៉ោង\u200bស្តង់ដារ\u200bភាគ\u200bខាង\u200bកើត\u200bនៅ\u200bអាមេរិក\u200bខាង\u200bជើង", "SGT": "ម៉ោង\u200bនៅ\u200bសិង្ហបូរី", "MYT": "ម៉ោង\u200bនៅ\u200bម៉ាឡេស៊ី", "CST": "ម៉ោង\u200bស្តង់ដារ\u200bភាគ\u200bកណ្ដាល\u200bនៅ\u200bអាមេរិក\u200bខាង\u200bជើង", "GMT": "ម៉ោងនៅគ្រីនវិច", "ACDT": "ម៉ោង\u200bពេលថ្ងៃ\u200b\u200b\u200b\u200bនៅ\u200bអូស្ត្រាលី\u200bកណ្ដាល", "BOT": "ម៉ោង\u200bនៅ\u200bបូលីវី", "TMST": "ម៉ោង\u200bរដូវ\u200bក្ដៅ\u200bនៅ\u200bតួកម៉េនីស្ថាន\u200b", "OESZ": "ម៉ោង\u200bរដូវ\u200bក្ដៅ\u200bនៅ\u200bអឺរ៉ុប\u200b\u200bខាង\u200bកើត\u200b", "LHDT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bនៅ\u200bឡតហៅ", "WARST": "ម៉ោង\u200bរដូវ\u200bក្ដៅ\u200bនៅ\u200bអាសង់ទីន\u200b\u200bខាង\u200bលិច", "WITA": "ម៉ោង\u200bនៅ\u200bឥណ្ឌូណេស៊ី\u200b\u200b\u200bកណ្ដាល", "MDT": "MDT", "ACWST": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bភាគ\u200bខាង\u200bលិច\u200bនៃ\u200bអូស្ត្រាលី\u200bកណ្ដាល", "EDT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bភាគខាង\u200bកើតនៅ\u200bអាមេរិក\u200bខាង\u200bជើង", "WIT": "ម៉ោង\u200bនៅ\u200bឥណ្ឌូណេស៊ី\u200b\u200bខាង\u200bកើត", "CLST": "ម៉ោងរដូវក្តៅនៅឈីលី", "CDT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bភាគ\u200bកណ្ដាល\u200bនៅ\u200bអាមេរិក\u200bខាង\u200bជើង", "JDT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bនៅជប៉ុន", "ART": "ម៉ោង\u200b\u200bស្តង់ដារ\u200bនៅ\u200bអាសង់ទីន", "PST": "ម៉ោង\u200bស្តង់ដារ\u200bភាគ\u200bខាង\u200bលិច\u200bនៅ\u200bអាមេរិក\u200bខាង\u200bជើង", "PDT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200b\u200bភាគ\u200bខាងលិច\u200bនៅ\u200bអាមេរិក\u200bភាគ\u200bខាង\u200bជើង", "UYT": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bអ៊ុយរូហ្គាយ", "BT": "ម៉ោងនៅប៊ូតាន", "CHADT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bនៅ\u200bចាថាំ", "VET": "ម៉ោង\u200bនៅ\u200bវ៉េណេស៊ុយអេឡា", "IST": "ម៉ោង\u200bនៅ\u200bឥណ្ឌា", "COT": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bកូឡុំប៊ី", "AEST": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bអូស្ត្រាលី\u200bខាង\u200bកើត", "EAT": "ម៉ោង\u200bនៅ\u200bអាហ្វ្រិក\u200bខាង\u200bកើត", "GFT": "ម៉ោង\u200bនៅ\u200bឃ្វីយ៉ាន\u200bបារាំង", "ACWDT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bនៅ\u200b\u200bភាគ\u200bខាង\u200bលិច\u200bនៃ\u200bអូស្ត្រាលី\u200bកណ្ដាល", "WAT": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bអាហ្វ្រិក\u200bខាង\u200bលិច", "COST": "ម៉ោង\u200bរដូវ\u200bក្ដៅ\u200bនៅ\u200bកូឡុំប៊ី", "ChST": "ម៉ោង\u200bនៅ\u200bចាំម៉ូរ៉ូ", "GYT": "ម៉ោង\u200bនៅ\u200bឃ្វីយ៉ាន", "JST": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bជប៉ុន", "NZDT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bនៅ\u200bនូវែលសេឡង់", "HAST": "ម៉ោង\u200bស្តង់ដារ\u200b\u200bនៅ\u200bហាវៃ-អាល់ដ្យូសិន", "WAST": "ម៉ោង\u200b\u200bរដូវ\u200bក្ដៅ\u200bនៅ\u200bអាហ្វ្រិក\u200b\u200b\u200bខាងលិច", "WEZ": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bអឺរ៉ុប\u200bខាង\u200bលិច", "SRT": "ម៉ោង\u200bនៅ\u200bសូរីណាម", "MST": "MST", "HNT": "ម៉ោង\u200b\u200bស្តង់ដារ\u200b\u200bនៅ\u200bញូហ្វោនឡែន", "LHST": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bឡត\u200bហៅ", "∅∅∅": "ម៉ោង\u200bរដូវ\u200bក្ដៅ\u200bនៅ\u200bអេហ្សស", "CHAST": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bចាថាំ", "AST": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bអាត្លង់ទិក", "WESZ": "ម៉ោង\u200bរដូវ\u200bក្ដៅ\u200bនៅ\u200bអឺរ៉ុប\u200bខាង\u200bលិច", "AKDT": "ម៉ោង\u200bពេល\u200bថ្ងៃ\u200bនៅ\u200b\u200bអាឡាស្កា", "ARST": "ម៉ោង\u200bរដូវ\u200bក្ដៅ\u200bនៅ\u200bអាសង់ទីន", "TMT": "ម៉ោង\u200bស្តង់ដារ\u200bនៅតួកម៉េនីស្ថាន", "CAT": "ម៉ោង\u200bនៅ\u200bអាហ្វ្រិក\u200bកណ្ដាល", "WART": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bអាសង់ទីន\u200b\u200bខាង\u200bលិច", "HKT": "ម៉ោង\u200bស្តង់ដារ\u200bនៅ\u200bហុងកុង", "HKST": "ម៉ោង\u200bរដូវ\u200bក្ដៅ\u200bនៅ\u200bហុងកុង", "ECT": "ម៉ោង\u200bនៅ\u200bអេក្វាទ័រ", "MESZ": "ម៉ោង\u200bរដូវ\u200bក្ដៅ\u200bនៅ\u200bអឺរ៉ុប\u200bកណ្ដាល", "WIB": "ម៉ោង\u200bនៅ\u200bឥណ្ឌូណេស៊ី\u200b\u200bខាង\u200bលិច", "UYST": "ម៉ោង\u200b\u200bរដូវ\u200bក្ដៅ\u200bនៅ\u200bអ៊ុយរូហ្គាយ"},
}
}
diff --git a/km_KH/km_KH_test.go b/km_KH/km_KH_test.go
new file mode 100644
index 00000000..aca05e2d
--- /dev/null
+++ b/km_KH/km_KH_test.go
@@ -0,0 +1,1120 @@
+package km_KH
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "km_KH"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/kn/kn.go b/kn/kn.go
index bc8f6b84..128cff26 100644
--- a/kn/kn.go
+++ b/kn/kn.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ಕ್ರಿ.ಪೂ", "ಕ್ರಿ.ಶ"},
erasNarrow: []string{"", ""},
erasWide: []string{"ಕ್ರಿಸ್ತ ಪೂರ್ವ", "ಕ್ರಿಸ್ತ ಶಕ"},
- timezones: map[string]string{"NZST": "ನ್ಯೂಜಿಲ್ಯಾಂಡ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "UYST": "ಉರುಗ್ವೇ ಬೇಸಿಗೆ ಸಮಯ", "PST": "ಉತ್ತರ ಅಮೆರಿಕದ ಪೆಸಿಫಿಕ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "MEZ": "ಮಧ್ಯ ಯುರೋಪಿಯನ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "MST": "ಉತ್ತರ ಅಮೆರಿಕದ ಪರ್ವತ ಪ್ರಮಾಣಿತ ಸಮಯ", "CHAST": "ಚಥಾಮ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "ADT": "ಅಟ್ಲಾಂಟಿಕ್ ದಿನದ ಸಮಯ", "HAT": "ನ್ಯೂಫೌಂಡ್\u200cಲ್ಯಾಂಡ್ ದಿನದ ಸಮಯ", "WARST": "ಪಶ್ಚಿಮ ಅರ್ಜೆಂಟೀನಾ ಬೇಸಿಗೆ ಸಮಯ", "ART": "ಅರ್ಜೆಂಟೀನಾ ಪ್ರಮಾಣಿತ ಸಮಯ", "AWDT": "ಆಸ್ಟ್ರೇಲಿಯಾದ ಪಶ್ಚಿಮ ಹಗಲು ಸಮಯ", "GYT": "ಗಯಾನಾ ಸಮಯ", "CDT": "ಉತ್ತರ ಅಮೆರಿಕದ ಕೇಂದ್ರೀಯ ದಿನದ ಸಮಯ", "VET": "ವೆನಿಜುವೆಲಾ ಸಮಯ", "ECT": "ಈಕ್ವೆಡಾರ್ ಸಮಯ", "HAST": "ಹವಾಯಿ-ಅಲ್ಯುಟಿಯನ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "OESZ": "ಪೂರ್ವ ಯುರೋಪಿಯನ್ ಬೇಸಿಗೆ ಸಮಯ", "PDT": "ಉತ್ತರ ಅಮೆರಿಕದ ಪೆಸಿಫಿಕ್ ದಿನದ ಸಮಯ", "AWST": "ಆಸ್ಟ್ರೇಲಿಯಾದ ಪಶ್ಚಿಮ ಪ್ರಮಾಣಿತ ಸಮಯ", "WIT": "ಪೂರ್ವ ಇಂಡೋನೇಷಿಯಾ ಸಮಯ", "CST": "ಉತ್ತರ ಅಮೆರಿಕದ ಕೇಂದ್ರ ಪ್ರಮಾಣಿತ ಸಮಯ", "MESZ": "ಮಧ್ಯ ಯುರೋಪಿಯನ್ ಬೇಸಿಗೆ ಸಮಯ", "BOT": "ಬೊಲಿವಿಯಾ ಸಮಯ", "UYT": "ಉರುಗ್ವೇ ಪ್ರಮಾಣಿತ ಸಮಯ", "AEDT": "ಪೂರ್ವ ಆಸ್ಟ್ರೇಲಿಯಾದ ಹಗಲು ಸಮಯ", "COT": "ಕೊಲಂಬಿಯಾ ಪ್ರಮಾಣಿತ ಸಮಯ", "HKT": "ಹಾಂಗ್ ಕಾಂಗ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "TMT": "ತುರ್ಕ್\u200cಮೇನಿಸ್ತಾನ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "LHST": "ಲಾರ್ಡ್ ಹೋವ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "NZDT": "ನ್ಯೂಜಿಲ್ಯಾಂಡ್ ಹಗಲು ಸಮಯ", "WESZ": "ಪಶ್ಚಿಮ ಯುರೋಪಿಯನ್ ಬೇಸಿಗೆ ಸಮಯ", "ACWST": "ಆಸ್ಟ್ರೇಲಿಯಾದ ಕೇಂದ್ರ ಪಶ್ಚಿಮ ಪ್ರಮಾಣಿತ ಸಮಯ", "WITA": "ಮಧ್ಯ ಇಂಡೋನೇಷಿಯಾ ಸಮಯ", "CLT": "ಚಿಲಿ ಪ್ರಮಾಣಿತ ಸಮಯ", "∅∅∅": "ಬ್ರೆಸಿಲಿಯಾ ಬೇಸಿಗೆ ಸಮಯ", "AST": "ಅಟ್ಲಾಂಟಿಕ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "WAT": "ಪಶ್ಚಿಮ ಆಫ್ರಿಕಾ ಪ್ರಮಾಣಿತ ಸಮಯ", "GMT": "ಗ್ರೀನ್\u200cವಿಚ್ ಸರಾಸರಿ ಕಾಲಮಾನ", "AKST": "ಅಲಸ್ಕಾ ಪ್ರಮಾಣಿತ ಸಮಯ", "ACST": "ಆಸ್ಟ್ರೇಲಿಯಾದ ಕೇಂದ್ರ ಪ್ರಮಾಣಿತ ಸಮಯ", "WART": "ಪಶ್ಚಿಮ ಅರ್ಜೆಂಟೀನಾ ಪ್ರಮಾಣಿತ ಸಮಯ", "AEST": "ಆಸ್ಟ್ರೇಲಿಯಾದ ಪೂರ್ವ ಪ್ರಮಾಣಿತ ಸಮಯ", "ChST": "ಚಮೋರೋ ಪ್ರಮಾಣಿತ ಸಮಯ", "CLST": "ಚಿಲಿ ಬೇಸಿಗೆ ಸಮಯ", "CAT": "ಮಧ್ಯ ಆಫ್ರಿಕಾ ಸಮಯ", "SGT": "ಸಿಂಗಾಪುರ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "SAST": "ದಕ್ಷಿಣ ಆಫ್ರಿಕಾ ಪ್ರಮಾಣಿತ ಸಮಯ", "WAST": "ಪಶ್ಚಿಮ ಆಫ್ರಿಕಾ ಬೇಸಿಗೆ ಸಮಯ", "EDT": "ಉತ್ತರ ಅಮೆರಿಕದ ಪೂರ್ವದ ದಿನದ ಸಮಯ", "HNT": "ನ್ಯೂಫೌಂಡ್\u200cಲ್ಯಾಂಡ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "COST": "ಕೊಲಂಬಿಯಾ ಬೇಸಿಗೆ ಸಮಯ", "BT": "ಭೂತಾನ್ ಸಮಯ", "EAT": "ಪೂರ್ವ ಆಫ್ರಿಕಾ ಸಮಯ", "TMST": "ತುರ್ಕ್\u200cಮೇನಿಸ್ತಾನ್ ಬೇಸಿಗೆ ಸಮಯ", "MYT": "ಮಲೇಷಿಯಾ ಸಮಯ", "JST": "ಜಪಾನ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "WEZ": "ಪಶ್ಚಿಮ ಯುರೋಪಿಯನ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "CHADT": "ಚಥಾಮ್ ಹಗಲು ಸಮಯ", "HADT": "ಹವಾಯಿ-ಅಲ್ಯುಟಿಯನ್ ಹಗಲು ಸಮಯ", "ACWDT": "ಆಸ್ಟ್ರೇಲಿಯಾದ ಕೇಂದ್ರ ಪಶ್ಚಿಮ ಹಗಲು ಸಮಯ", "EST": "ಉತ್ತರ ಅಮೆರಿಕದ ಪೂರ್ವದ ಪ್ರಮಾಣಿತ ಸಮಯ", "ARST": "ಅರ್ಜೆಂಟಿನಾ ಬೇಸಿಗೆ ಸಮಯ", "AKDT": "\u200cಅಲಾಸ್ಕಾ ಹಗಲು ಸಮಯ", "GFT": "ಫ್ರೆಂಚ್ ಗಯಾನಾ ಸಮಯ", "LHDT": "ಲಾರ್ಡ್ ಹೋವ್ ಬೆಳಗಿನ ಸಮಯ", "IST": "ಭಾರತೀಯ ಪ್ರಮಾಣಿತ ಸಮಯ", "JDT": "ಜಪಾನ್ ಹಗಲು ಸಮಯ", "MDT": "ಉತ್ತರ ಅಮೆರಿಕದ ಪರ್ವತ ದಿನದ ಸಮಯ", "HKST": "ಹಾಂಗ್ ಕಾಂಗ್ ಬೇಸಿಗೆ ಸಮಯ", "WIB": "ಪಶ್ಚಿಮ ಇಂಡೋನೇಷಿಯ ಸಮಯ", "OEZ": "ಪೂರ್ವ ಯುರೋಪಿಯನ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "ACDT": "ಆಸ್ಟ್ರೇಲಿಯಾದ ಕೇಂದ್ರ ಹಗಲು ಸಮಯ", "SRT": "ಸುರಿನೇಮ್ ಸಮಯ"},
+ timezones: map[string]string{"WAT": "ಪಶ್ಚಿಮ ಆಫ್ರಿಕಾ ಪ್ರಮಾಣಿತ ಸಮಯ", "OESZ": "ಪೂರ್ವ ಯುರೋಪಿಯನ್ ಬೇಸಿಗೆ ಸಮಯ", "UYST": "ಉರುಗ್ವೇ ಬೇಸಿಗೆ ಸಮಯ", "JST": "ಜಪಾನ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "PST": "ಉತ್ತರ ಅಮೆರಿಕದ ಪೆಸಿಫಿಕ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "HAT": "ನ್ಯೂಫೌಂಡ್\u200cಲ್ಯಾಂಡ್ ದಿನದ ಸಮಯ", "CDT": "ಉತ್ತರ ಅಮೆರಿಕದ ಕೇಂದ್ರೀಯ ದಿನದ ಸಮಯ", "AKDT": "\u200cಅಲಾಸ್ಕಾ ಹಗಲು ಸಮಯ", "SAST": "ದಕ್ಷಿಣ ಆಫ್ರಿಕಾ ಪ್ರಮಾಣಿತ ಸಮಯ", "CLT": "ಚಿಲಿ ಪ್ರಮಾಣಿತ ಸಮಯ", "WAST": "ಪಶ್ಚಿಮ ಆಫ್ರಿಕಾ ಬೇಸಿಗೆ ಸಮಯ", "CLST": "ಚಿಲಿ ಬೇಸಿಗೆ ಸಮಯ", "MDT": "ಮಕಾವ್ ಬೇಸಿಗೆ ಸಮಯ", "NZST": "ನ್ಯೂಜಿಲ್ಯಾಂಡ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "COT": "ಕೊಲಂಬಿಯಾ ಪ್ರಮಾಣಿತ ಸಮಯ", "COST": "ಕೊಲಂಬಿಯಾ ಬೇಸಿಗೆ ಸಮಯ", "WESZ": "ಪಶ್ಚಿಮ ಯುರೋಪಿಯನ್ ಬೇಸಿಗೆ ಸಮಯ", "AEST": "ಆಸ್ಟ್ರೇಲಿಯಾದ ಪೂರ್ವ ಪ್ರಮಾಣಿತ ಸಮಯ", "CHAST": "ಚಥಾಮ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "JDT": "ಜಪಾನ್ ಹಗಲು ಸಮಯ", "HNT": "ನ್ಯೂಫೌಂಡ್\u200cಲ್ಯಾಂಡ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "NZDT": "ನ್ಯೂಜಿಲ್ಯಾಂಡ್ ಹಗಲು ಸಮಯ", "SGT": "ಸಿಂಗಾಪುರ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "TMST": "ತುರ್ಕ್\u200cಮೇನಿಸ್ತಾನ್ ಬೇಸಿಗೆ ಸಮಯ", "ACST": "ಆಸ್ಟ್ರೇಲಿಯಾದ ಕೇಂದ್ರ ಪ್ರಮಾಣಿತ ಸಮಯ", "GFT": "ಫ್ರೆಂಚ್ ಗಯಾನಾ ಸಮಯ", "CHADT": "ಚಥಾಮ್ ಹಗಲು ಸಮಯ", "AWST": "ಆಸ್ಟ್ರೇಲಿಯಾದ ಪಶ್ಚಿಮ ಪ್ರಮಾಣಿತ ಸಮಯ", "GMT": "ಗ್ರೀನ್\u200cವಿಚ್ ಸರಾಸರಿ ಕಾಲಮಾನ", "WITA": "ಮಧ್ಯ ಇಂಡೋನೇಷಿಯಾ ಸಮಯ", "MYT": "ಮಲೇಷಿಯಾ ಸಮಯ", "UYT": "ಉರುಗ್ವೇ ಪ್ರಮಾಣಿತ ಸಮಯ", "LHDT": "ಲಾರ್ಡ್ ಹೋವ್ ಬೆಳಗಿನ ಸಮಯ", "EDT": "ಉತ್ತರ ಅಮೆರಿಕದ ಪೂರ್ವದ ದಿನದ ಸಮಯ", "WIB": "ಪಶ್ಚಿಮ ಇಂಡೋನೇಷಿಯ ಸಮಯ", "EAT": "ಪೂರ್ವ ಆಫ್ರಿಕಾ ಸಮಯ", "PDT": "ಉತ್ತರ ಅಮೆರಿಕದ ಪೆಸಿಫಿಕ್ ದಿನದ ಸಮಯ", "CAT": "ಮಧ್ಯ ಆಫ್ರಿಕಾ ಸಮಯ", "AEDT": "ಪೂರ್ವ ಆಸ್ಟ್ರೇಲಿಯಾದ ಹಗಲು ಸಮಯ", "CST": "ಉತ್ತರ ಅಮೆರಿಕದ ಕೇಂದ್ರ ಪ್ರಮಾಣಿತ ಸಮಯ", "MST": "ಮಕಾವ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "AWDT": "ಆಸ್ಟ್ರೇಲಿಯಾದ ಪಶ್ಚಿಮ ಹಗಲು ಸಮಯ", "ADT": "ಅಟ್ಲಾಂಟಿಕ್ ದಿನದ ಸಮಯ", "VET": "ವೆನಿಜುವೆಲಾ ಸಮಯ", "MESZ": "ಮಧ್ಯ ಯುರೋಪಿಯನ್ ಬೇಸಿಗೆ ಸಮಯ", "WEZ": "ಪಶ್ಚಿಮ ಯುರೋಪಿಯನ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "WIT": "ಪೂರ್ವ ಇಂಡೋನೇಷಿಯಾ ಸಮಯ", "HKST": "ಹಾಂಗ್ ಕಾಂಗ್ ಬೇಸಿಗೆ ಸಮಯ", "ART": "ಅರ್ಜೆಂಟೀನಾ ಪ್ರಮಾಣಿತ ಸಮಯ", "ACWDT": "ಆಸ್ಟ್ರೇಲಿಯಾದ ಕೇಂದ್ರ ಪಶ್ಚಿಮ ಹಗಲು ಸಮಯ", "GYT": "ಗಯಾನಾ ಸಮಯ", "EST": "ಉತ್ತರ ಅಮೆರಿಕದ ಪೂರ್ವದ ಪ್ರಮಾಣಿತ ಸಮಯ", "∅∅∅": "ಅಮೆಜಾನ್ ಬೇಸಿಗೆ ಸಮಯ", "LHST": "ಲಾರ್ಡ್ ಹೋವ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "SRT": "ಸುರಿನೇಮ್ ಸಮಯ", "WART": "ಪಶ್ಚಿಮ ಅರ್ಜೆಂಟೀನಾ ಪ್ರಮಾಣಿತ ಸಮಯ", "ECT": "ಈಕ್ವೆಡಾರ್ ಸಮಯ", "HAST": "ಹವಾಯಿ-ಅಲ್ಯುಟಿಯನ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "BOT": "ಬೊಲಿವಿಯಾ ಸಮಯ", "WARST": "ಪಶ್ಚಿಮ ಅರ್ಜೆಂಟೀನಾ ಬೇಸಿಗೆ ಸಮಯ", "OEZ": "ಪೂರ್ವ ಯುರೋಪಿಯನ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "ARST": "ಅರ್ಜೆಂಟಿನಾ ಬೇಸಿಗೆ ಸಮಯ", "HADT": "ಹವಾಯಿ-ಅಲ್ಯುಟಿಯನ್ ಹಗಲು ಸಮಯ", "TMT": "ತುರ್ಕ್\u200cಮೇನಿಸ್ತಾನ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "ChST": "ಚಮೋರೋ ಪ್ರಮಾಣಿತ ಸಮಯ", "ACDT": "ಆಸ್ಟ್ರೇಲಿಯಾದ ಕೇಂದ್ರ ಹಗಲು ಸಮಯ", "HKT": "ಹಾಂಗ್ ಕಾಂಗ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "AST": "ಅಟ್ಲಾಂಟಿಕ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "IST": "ಭಾರತೀಯ ಪ್ರಮಾಣಿತ ಸಮಯ", "BT": "ಭೂತಾನ್ ಸಮಯ", "AKST": "ಅಲಸ್ಕಾ ಪ್ರಮಾಣಿತ ಸಮಯ", "ACWST": "ಆಸ್ಟ್ರೇಲಿಯಾದ ಕೇಂದ್ರ ಪಶ್ಚಿಮ ಪ್ರಮಾಣಿತ ಸಮಯ", "MEZ": "ಮಧ್ಯ ಯುರೋಪಿಯನ್ ಪ್ರಮಾಣಿತ ಸಮಯ"},
}
}
diff --git a/kn/kn_test.go b/kn/kn_test.go
new file mode 100644
index 00000000..6df80acb
--- /dev/null
+++ b/kn/kn_test.go
@@ -0,0 +1,1120 @@
+package kn
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "kn"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/kn_IN/kn_IN.go b/kn_IN/kn_IN.go
index 5ef33960..818a1196 100644
--- a/kn_IN/kn_IN.go
+++ b/kn_IN/kn_IN.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ಕ್ರಿ.ಪೂ", "ಕ್ರಿ.ಶ"},
erasNarrow: []string{"", ""},
erasWide: []string{"ಕ್ರಿಸ್ತ ಪೂರ್ವ", "ಕ್ರಿಸ್ತ ಶಕ"},
- timezones: map[string]string{"UYST": "ಉರುಗ್ವೇ ಬೇಸಿಗೆ ಸಮಯ", "CHADT": "ಚಥಾಮ್ ಹಗಲು ಸಮಯ", "WIB": "ಪಶ್ಚಿಮ ಇಂಡೋನೇಷಿಯ ಸಮಯ", "ACST": "ಆಸ್ಟ್ರೇಲಿಯಾದ ಕೇಂದ್ರ ಪ್ರಮಾಣಿತ ಸಮಯ", "ACDT": "ಆಸ್ಟ್ರೇಲಿಯಾದ ಕೇಂದ್ರ ಹಗಲು ಸಮಯ", "TMT": "ತುರ್ಕ್\u200cಮೇನಿಸ್ತಾನ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "TMST": "ತುರ್ಕ್\u200cಮೇನಿಸ್ತಾನ್ ಬೇಸಿಗೆ ಸಮಯ", "AWDT": "ಆಸ್ಟ್ರೇಲಿಯಾದ ಪಶ್ಚಿಮ ಹಗಲು ಸಮಯ", "MST": "ಉತ್ತರ ಅಮೆರಿಕದ ಪರ್ವತ ಪ್ರಮಾಣಿತ ಸಮಯ", "EDT": "ಉತ್ತರ ಅಮೆರಿಕದ ಪೂರ್ವದ ದಿನದ ಸಮಯ", "HAST": "ಹವಾಯಿ-ಅಲ್ಯುಟಿಯನ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "SGT": "ಸಿಂಗಾಪುರ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "WAT": "ಪಶ್ಚಿಮ ಆಫ್ರಿಕಾ ಪ್ರಮಾಣಿತ ಸಮಯ", "OESZ": "ಪೂರ್ವ ಯುರೋಪಿಯನ್ ಬೇಸಿಗೆ ಸಮಯ", "MYT": "ಮಲೇಷಿಯಾ ಸಮಯ", "AEDT": "ಪೂರ್ವ ಆಸ್ಟ್ರೇಲಿಯಾದ ಹಗಲು ಸಮಯ", "MDT": "ಉತ್ತರ ಅಮೆರಿಕದ ಪರ್ವತ ದಿನದ ಸಮಯ", "CAT": "ಮಧ್ಯ ಆಫ್ರಿಕಾ ಸಮಯ", "ADT": "ಅಟ್ಲಾಂಟಿಕ್ ದಿನದ ಸಮಯ", "WAST": "ಪಶ್ಚಿಮ ಆಫ್ರಿಕಾ ಬೇಸಿಗೆ ಸಮಯ", "WART": "ಪಶ್ಚಿಮ ಅರ್ಜೆಂಟೀನಾ ಪ್ರಮಾಣಿತ ಸಮಯ", "WARST": "ಪಶ್ಚಿಮ ಅರ್ಜೆಂಟೀನಾ ಬೇಸಿಗೆ ಸಮಯ", "PDT": "ಉತ್ತರ ಅಮೆರಿಕದ ಪೆಸಿಫಿಕ್ ದಿನದ ಸಮಯ", "WEZ": "ಪಶ್ಚಿಮ ಯುರೋಪಿಯನ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "WESZ": "ಪಶ್ಚಿಮ ಯುರೋಪಿಯನ್ ಬೇಸಿಗೆ ಸಮಯ", "ChST": "ಚಮೋರೋ ಪ್ರಮಾಣಿತ ಸಮಯ", "SAST": "ದಕ್ಷಿಣ ಆಫ್ರಿಕಾ ಪ್ರಮಾಣಿತ ಸಮಯ", "OEZ": "ಪೂರ್ವ ಯುರೋಪಿಯನ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "WITA": "ಮಧ್ಯ ಇಂಡೋನೇಷಿಯಾ ಸಮಯ", "MEZ": "ಮಧ್ಯ ಯುರೋಪಿಯನ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "NZDT": "ನ್ಯೂಜಿಲ್ಯಾಂಡ್ ಹಗಲು ಸಮಯ", "ACWDT": "ಆಸ್ಟ್ರೇಲಿಯಾದ ಕೇಂದ್ರ ಪಶ್ಚಿಮ ಹಗಲು ಸಮಯ", "BT": "ಭೂತಾನ್ ಸಮಯ", "IST": "ಭಾರತೀಯ ಪ್ರಮಾಣಿತ ಸಮಯ", "AWST": "ಆಸ್ಟ್ರೇಲಿಯಾದ ಪಶ್ಚಿಮ ಪ್ರಮಾಣಿತ ಸಮಯ", "LHST": "ಲಾರ್ಡ್ ಹೋವ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "MESZ": "ಮಧ್ಯ ಯುರೋಪಿಯನ್ ಬೇಸಿಗೆ ಸಮಯ", "AST": "ಅಟ್ಲಾಂಟಿಕ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "WIT": "ಪೂರ್ವ ಇಂಡೋನೇಷಿಯಾ ಸಮಯ", "LHDT": "ಲಾರ್ಡ್ ಹೋವ್ ಬೆಳಗಿನ ಸಮಯ", "CST": "ಉತ್ತರ ಅಮೆರಿಕದ ಕೇಂದ್ರ ಪ್ರಮಾಣಿತ ಸಮಯ", "∅∅∅": "ಬ್ರೆಸಿಲಿಯಾ ಬೇಸಿಗೆ ಸಮಯ", "ART": "ಅರ್ಜೆಂಟೀನಾ ಪ್ರಮಾಣಿತ ಸಮಯ", "CLST": "ಚಿಲಿ ಬೇಸಿಗೆ ಸಮಯ", "VET": "ವೆನಿಜುವೆಲಾ ಸಮಯ", "COT": "ಕೊಲಂಬಿಯಾ ಪ್ರಮಾಣಿತ ಸಮಯ", "HAT": "ನ್ಯೂಫೌಂಡ್\u200cಲ್ಯಾಂಡ್ ದಿನದ ಸಮಯ", "EAT": "ಪೂರ್ವ ಆಫ್ರಿಕಾ ಸಮಯ", "JDT": "ಜಪಾನ್ ಹಗಲು ಸಮಯ", "BOT": "ಬೊಲಿವಿಯಾ ಸಮಯ", "HADT": "ಹವಾಯಿ-ಅಲ್ಯುಟಿಯನ್ ಹಗಲು ಸಮಯ", "HNT": "ನ್ಯೂಫೌಂಡ್\u200cಲ್ಯಾಂಡ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "GFT": "ಫ್ರೆಂಚ್ ಗಯಾನಾ ಸಮಯ", "JST": "ಜಪಾನ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "GYT": "ಗಯಾನಾ ಸಮಯ", "NZST": "ನ್ಯೂಜಿಲ್ಯಾಂಡ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "HKT": "ಹಾಂಗ್ ಕಾಂಗ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "SRT": "ಸುರಿನೇಮ್ ಸಮಯ", "CLT": "ಚಿಲಿ ಪ್ರಮಾಣಿತ ಸಮಯ", "AEST": "ಆಸ್ಟ್ರೇಲಿಯಾದ ಪೂರ್ವ ಪ್ರಮಾಣಿತ ಸಮಯ", "COST": "ಕೊಲಂಬಿಯಾ ಬೇಸಿಗೆ ಸಮಯ", "HKST": "ಹಾಂಗ್ ಕಾಂಗ್ ಬೇಸಿಗೆ ಸಮಯ", "GMT": "ಗ್ರೀನ್\u200cವಿಚ್ ಸರಾಸರಿ ಕಾಲಮಾನ", "ARST": "ಅರ್ಜೆಂಟಿನಾ ಬೇಸಿಗೆ ಸಮಯ", "AKST": "ಅಲಸ್ಕಾ ಪ್ರಮಾಣಿತ ಸಮಯ", "ACWST": "ಆಸ್ಟ್ರೇಲಿಯಾದ ಕೇಂದ್ರ ಪಶ್ಚಿಮ ಪ್ರಮಾಣಿತ ಸಮಯ", "EST": "ಉತ್ತರ ಅಮೆರಿಕದ ಪೂರ್ವದ ಪ್ರಮಾಣಿತ ಸಮಯ", "PST": "ಉತ್ತರ ಅಮೆರಿಕದ ಪೆಸಿಫಿಕ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "CDT": "ಉತ್ತರ ಅಮೆರಿಕದ ಕೇಂದ್ರೀಯ ದಿನದ ಸಮಯ", "UYT": "ಉರುಗ್ವೇ ಪ್ರಮಾಣಿತ ಸಮಯ", "CHAST": "ಚಥಾಮ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "ECT": "ಈಕ್ವೆಡಾರ್ ಸಮಯ", "AKDT": "\u200cಅಲಾಸ್ಕಾ ಹಗಲು ಸಮಯ"},
+ timezones: map[string]string{"OEZ": "ಪೂರ್ವ ಯುರೋಪಿಯನ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "UYST": "ಉರುಗ್ವೇ ಬೇಸಿಗೆ ಸಮಯ", "WIB": "ಪಶ್ಚಿಮ ಇಂಡೋನೇಷಿಯ ಸಮಯ", "AEST": "ಆಸ್ಟ್ರೇಲಿಯಾದ ಪೂರ್ವ ಪ್ರಮಾಣಿತ ಸಮಯ", "OESZ": "ಪೂರ್ವ ಯುರೋಪಿಯನ್ ಬೇಸಿಗೆ ಸಮಯ", "LHST": "ಲಾರ್ಡ್ ಹೋವ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "MYT": "ಮಲೇಷಿಯಾ ಸಮಯ", "SRT": "ಸುರಿನೇಮ್ ಸಮಯ", "BOT": "ಬೊಲಿವಿಯಾ ಸಮಯ", "SGT": "ಸಿಂಗಾಪುರ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "VET": "ವೆನಿಜುವೆಲಾ ಸಮಯ", "JST": "ಜಪಾನ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "CDT": "ಉತ್ತರ ಅಮೆರಿಕದ ಕೇಂದ್ರೀಯ ದಿನದ ಸಮಯ", "ACDT": "ಆಸ್ಟ್ರೇಲಿಯಾದ ಕೇಂದ್ರ ಹಗಲು ಸಮಯ", "GMT": "ಗ್ರೀನ್\u200cವಿಚ್ ಸರಾಸರಿ ಕಾಲಮಾನ", "MST": "ಉತ್ತರ ಅಮೆರಿಕದ ಪರ್ವತ ಪ್ರಮಾಣಿತ ಸಮಯ", "AWST": "ಆಸ್ಟ್ರೇಲಿಯಾದ ಪಶ್ಚಿಮ ಪ್ರಮಾಣಿತ ಸಮಯ", "WAT": "ಪಶ್ಚಿಮ ಆಫ್ರಿಕಾ ಪ್ರಮಾಣಿತ ಸಮಯ", "AEDT": "ಪೂರ್ವ ಆಸ್ಟ್ರೇಲಿಯಾದ ಹಗಲು ಸಮಯ", "CST": "ಉತ್ತರ ಅಮೆರಿಕದ ಕೇಂದ್ರ ಪ್ರಮಾಣಿತ ಸಮಯ", "JDT": "ಜಪಾನ್ ಹಗಲು ಸಮಯ", "NZST": "ನ್ಯೂಜಿಲ್ಯಾಂಡ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "LHDT": "ಲಾರ್ಡ್ ಹೋವ್ ಬೆಳಗಿನ ಸಮಯ", "HKST": "ಹಾಂಗ್ ಕಾಂಗ್ ಬೇಸಿಗೆ ಸಮಯ", "ACWDT": "ಆಸ್ಟ್ರೇಲಿಯಾದ ಕೇಂದ್ರ ಪಶ್ಚಿಮ ಹಗಲು ಸಮಯ", "HAST": "ಹವಾಯಿ-ಅಲ್ಯುಟಿಯನ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "SAST": "ದಕ್ಷಿಣ ಆಫ್ರಿಕಾ ಪ್ರಮಾಣಿತ ಸಮಯ", "WESZ": "ಪಶ್ಚಿಮ ಯುರೋಪಿಯನ್ ಬೇಸಿಗೆ ಸಮಯ", "EST": "ಉತ್ತರ ಅಮೆರಿಕದ ಪೂರ್ವದ ಪ್ರಮಾಣಿತ ಸಮಯ", "PDT": "ಉತ್ತರ ಅಮೆರಿಕದ ಪೆಸಿಫಿಕ್ ದಿನದ ಸಮಯ", "CLT": "ಚಿಲಿ ಪ್ರಮಾಣಿತ ಸಮಯ", "ACST": "ಆಸ್ಟ್ರೇಲಿಯಾದ ಕೇಂದ್ರ ಪ್ರಮಾಣಿತ ಸಮಯ", "MESZ": "ಮಧ್ಯ ಯುರೋಪಿಯನ್ ಬೇಸಿಗೆ ಸಮಯ", "HNT": "ನ್ಯೂಫೌಂಡ್\u200cಲ್ಯಾಂಡ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "ECT": "ಈಕ್ವೆಡಾರ್ ಸಮಯ", "HKT": "ಹಾಂಗ್ ಕಾಂಗ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "ARST": "ಅರ್ಜೆಂಟಿನಾ ಬೇಸಿಗೆ ಸಮಯ", "HADT": "ಹವಾಯಿ-ಅಲ್ಯುಟಿಯನ್ ಹಗಲು ಸಮಯ", "COST": "ಕೊಲಂಬಿಯಾ ಬೇಸಿಗೆ ಸಮಯ", "AST": "ಅಟ್ಲಾಂಟಿಕ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "EDT": "ಉತ್ತರ ಅಮೆರಿಕದ ಪೂರ್ವದ ದಿನದ ಸಮಯ", "ChST": "ಚಮೋರೋ ಪ್ರಮಾಣಿತ ಸಮಯ", "WARST": "ಪಶ್ಚಿಮ ಅರ್ಜೆಂಟೀನಾ ಬೇಸಿಗೆ ಸಮಯ", "TMT": "ತುರ್ಕ್\u200cಮೇನಿಸ್ತಾನ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "WART": "ಪಶ್ಚಿಮ ಅರ್ಜೆಂಟೀನಾ ಪ್ರಮಾಣಿತ ಸಮಯ", "CHAST": "ಚಥಾಮ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "CAT": "ಮಧ್ಯ ಆಫ್ರಿಕಾ ಸಮಯ", "UYT": "ಉರುಗ್ವೇ ಪ್ರಮಾಣಿತ ಸಮಯ", "EAT": "ಪೂರ್ವ ಆಫ್ರಿಕಾ ಸಮಯ", "WITA": "ಮಧ್ಯ ಇಂಡೋನೇಷಿಯಾ ಸಮಯ", "AKDT": "\u200cಅಲಾಸ್ಕಾ ಹಗಲು ಸಮಯ", "HAT": "ನ್ಯೂಫೌಂಡ್\u200cಲ್ಯಾಂಡ್ ದಿನದ ಸಮಯ", "TMST": "ತುರ್ಕ್\u200cಮೇನಿಸ್ತಾನ್ ಬೇಸಿಗೆ ಸಮಯ", "NZDT": "ನ್ಯೂಜಿಲ್ಯಾಂಡ್ ಹಗಲು ಸಮಯ", "IST": "ಭಾರತೀಯ ಪ್ರಮಾಣಿತ ಸಮಯ", "WAST": "ಪಶ್ಚಿಮ ಆಫ್ರಿಕಾ ಬೇಸಿಗೆ ಸಮಯ", "MDT": "ಉತ್ತರ ಅಮೆರಿಕದ ಪರ್ವತ ದಿನದ ಸಮಯ", "WIT": "ಪೂರ್ವ ಇಂಡೋನೇಷಿಯಾ ಸಮಯ", "GFT": "ಫ್ರೆಂಚ್ ಗಯಾನಾ ಸಮಯ", "PST": "ಉತ್ತರ ಅಮೆರಿಕದ ಪೆಸಿಫಿಕ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "MEZ": "ಮಧ್ಯ ಯುರೋಪಿಯನ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "ART": "ಅರ್ಜೆಂಟೀನಾ ಪ್ರಮಾಣಿತ ಸಮಯ", "ADT": "ಅಟ್ಲಾಂಟಿಕ್ ದಿನದ ಸಮಯ", "BT": "ಭೂತಾನ್ ಸಮಯ", "CHADT": "ಚಥಾಮ್ ಹಗಲು ಸಮಯ", "ACWST": "ಆಸ್ಟ್ರೇಲಿಯಾದ ಕೇಂದ್ರ ಪಶ್ಚಿಮ ಪ್ರಮಾಣಿತ ಸಮಯ", "AWDT": "ಆಸ್ಟ್ರೇಲಿಯಾದ ಪಶ್ಚಿಮ ಹಗಲು ಸಮಯ", "AKST": "ಅಲಸ್ಕಾ ಪ್ರಮಾಣಿತ ಸಮಯ", "WEZ": "ಪಶ್ಚಿಮ ಯುರೋಪಿಯನ್ ಪ್ರಮಾಣಿತ ಸಮಯ", "CLST": "ಚಿಲಿ ಬೇಸಿಗೆ ಸಮಯ", "GYT": "ಗಯಾನಾ ಸಮಯ", "∅∅∅": "ಏಕರ್ ಬೇಸಿಗೆ ಸಮಯ", "COT": "ಕೊಲಂಬಿಯಾ ಪ್ರಮಾಣಿತ ಸಮಯ"},
}
}
diff --git a/kn_IN/kn_IN_test.go b/kn_IN/kn_IN_test.go
new file mode 100644
index 00000000..a070438e
--- /dev/null
+++ b/kn_IN/kn_IN_test.go
@@ -0,0 +1,1120 @@
+package kn_IN
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "kn_IN"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ko/ko.go b/ko/ko.go
index 1cd04d3a..5614d70c 100644
--- a/ko/ko.go
+++ b/ko/ko.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"", ""},
erasWide: []string{"기원전", "서기"},
- timezones: map[string]string{"HAT": "뉴펀들랜드 하계 표준시", "MST": "마카오 표준 시간", "ACST": "오스트레일리아 중부 표준시", "MYT": "말레이시아 시간", "WEZ": "서유럽 표준시", "HAST": "하와이 알류샨 표준시", "SAST": "남아프리카 시간", "WITA": "중부 인도네시아 시간", "GYT": "가이아나 시간", "UYT": "우루과이 표준시", "CLT": "칠레 표준시", "EST": "미 동부 표준시", "COST": "콜롬비아 하계 표준시", "ADT": "미 대서양 하계 표준시", "WART": "아르헨티나 서부 표준시", "GFT": "프랑스령 가이아나 시간", "AKDT": "알래스카 하계 표준시", "JDT": "일본 하계 표준시", "NZDT": "뉴질랜드 하계 표준시", "CAT": "중앙아프리카 시간", "EDT": "미 동부 하계 표준시", "HNT": "뉴펀들랜드 표준시", "WIT": "동부 인도네시아 시간", "AWDT": "오스트레일리아 서부 하계 표준시", "BOT": "볼리비아 시간", "ACWST": "오스트레일리아 중서부 표준시", "IST": "인도 표준시", "ART": "아르헨티나 표준시", "ARST": "아르헨티나 하계 표준시", "ECT": "에콰도르 시간", "ACDT": "오스트레일리아 중부 하계 표준시", "NZST": "뉴질랜드 표준시", "ACWDT": "오스트레일리아 중서부 하계 표준시", "∅∅∅": "아크레 하계 표준시", "BT": "부탄 시간", "HKST": "홍콩 하계 표준시", "JST": "일본 표준시", "HADT": "하와이 알류샨 하계 표준시", "UYST": "우루과이 하계 표준시", "AEST": "오스트레일리아 동부 표준시", "PST": "미 태평양 표준시", "ChST": "차모로 시간", "CHAST": "채텀 표준시", "COT": "콜롬비아 표준시", "MDT": "마카오 하계 표준시", "TMST": "투르크메니스탄 하계 표준시", "AEDT": "오스트레일리아 동부 하계 표준시", "VET": "베네수엘라 시간", "HKT": "홍콩 표준시", "WARST": "아르헨티나 서부 하계 표준시", "OEZ": "동유럽 표준시", "PDT": "미 태평양 하계 표준시", "MEZ": "중부 유럽 표준시", "CHADT": "채텀 하계 표준시", "OESZ": "동유럽 하계 표준시", "TMT": "투르크메니스탄 표준시", "LHST": "로드 하우 표준시", "SRT": "수리남 시간", "CLST": "칠레 하계 표준시", "CDT": "미 중부 하계 표준시", "GMT": "그리니치 표준시", "WIB": "서부 인도네시아 시간", "AKST": "알래스카 표준시", "AWST": "오스트레일리아 서부 표준시", "AST": "대서양 표준시", "SGT": "싱가포르 표준시", "WAT": "서아프리카 표준시", "WAST": "서아프리카 하계 표준시", "EAT": "동아프리카 시간", "LHDT": "로드 하우 하계 표준시", "CST": "미 중부 표준시", "MESZ": "중부 유럽 하계 표준시", "WESZ": "서유럽 하계 표준시"},
+ timezones: map[string]string{"CLT": "칠레 표준시", "ACDT": "오스트레일리아 중부 하계 표준시", "ARST": "아르헨티나 하계 표준시", "EDT": "미 동부 하계 표준시", "∅∅∅": "아크레 하계 표준시", "GMT": "그리니치 표준시", "WAT": "서아프리카 표준시", "CHADT": "채텀 하계 표준시", "HADT": "하와이 알류샨 하계 표준시", "SAST": "남아프리카 시간", "IST": "인도 표준시", "UYT": "우루과이 표준시", "UYST": "우루과이 하계 표준시", "WART": "아르헨티나 서부 표준시", "GFT": "프랑스령 가이아나 시간", "CHAST": "채텀 표준시", "AKST": "알래스카 표준시", "WEZ": "서유럽 표준시", "TMST": "투르크메니스탄 하계 표준시", "EAT": "동아프리카 시간", "BT": "부탄 시간", "WARST": "아르헨티나 서부 하계 표준시", "EST": "미 동부 표준시", "TMT": "투르크메니스탄 표준시", "CAT": "중앙아프리카 시간", "ChST": "차모로 시간", "MDT": "마카오 하계 표준시", "ACWDT": "오스트레일리아 중서부 하계 표준시", "HNT": "뉴펀들랜드 표준시", "AWST": "오스트레일리아 서부 표준시", "WAST": "서아프리카 하계 표준시", "OESZ": "동유럽 하계 표준시", "VET": "베네수엘라 시간", "HAST": "하와이 알류샨 표준시", "ACWST": "오스트레일리아 중서부 표준시", "ART": "아르헨티나 표준시", "COST": "콜롬비아 하계 표준시", "CLST": "칠레 하계 표준시", "MEZ": "중부 유럽 표준시", "NZDT": "뉴질랜드 하계 표준시", "WESZ": "서유럽 하계 표준시", "HAT": "뉴펀들랜드 하계 표준시", "ECT": "에콰도르 시간", "MST": "마카오 표준 시간", "JST": "일본 표준시", "JDT": "일본 하계 표준시", "HKT": "홍콩 표준시", "WIT": "동부 인도네시아 시간", "CST": "미 중부 표준시", "LHST": "로드 하우 표준시", "MYT": "말레이시아 시간", "ACST": "오스트레일리아 중부 표준시", "WITA": "중부 인도네시아 시간", "SGT": "싱가포르 표준시", "COT": "콜롬비아 표준시", "AEST": "오스트레일리아 동부 표준시", "OEZ": "동유럽 표준시", "LHDT": "로드 하우 하계 표준시", "SRT": "수리남 시간", "CDT": "미 중부 하계 표준시", "PST": "미 태평양 표준시", "NZST": "뉴질랜드 표준시", "BOT": "볼리비아 시간", "GYT": "가이아나 시간", "PDT": "미 태평양 하계 표준시", "MESZ": "중부 유럽 하계 표준시", "AWDT": "오스트레일리아 서부 하계 표준시", "AKDT": "알래스카 하계 표준시", "AST": "대서양 표준시", "ADT": "미 대서양 하계 표준시", "HKST": "홍콩 하계 표준시", "WIB": "서부 인도네시아 시간", "AEDT": "오스트레일리아 동부 하계 표준시"},
}
}
diff --git a/ko/ko_test.go b/ko/ko_test.go
new file mode 100644
index 00000000..2b29b38c
--- /dev/null
+++ b/ko/ko_test.go
@@ -0,0 +1,1120 @@
+package ko
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ko"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ko_KP/ko_KP.go b/ko_KP/ko_KP.go
index 45ba6bd4..e59a7d3a 100644
--- a/ko_KP/ko_KP.go
+++ b/ko_KP/ko_KP.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"", ""},
erasWide: []string{"기원전", "서기"},
- timezones: map[string]string{"∅∅∅": "아마존 하계 표준시", "PDT": "미 태평양 하계 표준시", "HKST": "홍콩 하계 표준시", "WITA": "중부 인도네시아 시간", "GFT": "프랑스령 가이아나 시간", "OESZ": "동유럽 하계 표준시", "ACDT": "오스트레일리아 중부 하계 표준시", "LHDT": "로드 하우 하계 표준시", "BOT": "볼리비아 시간", "AST": "대서양 표준시", "WARST": "아르헨티나 서부 하계 표준시", "HNT": "뉴펀들랜드 표준시", "ART": "아르헨티나 표준시", "ChST": "차모로 시간", "HADT": "하와이 알류샨 하계 표준시", "WIT": "동부 인도네시아 시간", "OEZ": "동유럽 표준시", "WIB": "서부 인도네시아 시간", "TMST": "투르크메니스탄 하계 표준시", "MDT": "마카오 하계 표준시", "CST": "미 중부 표준시", "WEZ": "서유럽 표준시", "ACWDT": "오스트레일리아 중서부 하계 표준시", "ACST": "오스트레일리아 중부 표준시", "VET": "베네수엘라 시간", "SGT": "싱가포르 표준시", "WAST": "서아프리카 하계 표준시", "GMT": "그리니치 표준시", "AEST": "오스트레일리아 동부 표준시", "CHADT": "채텀 하계 표준시", "CDT": "미 중부 하계 표준시", "TMT": "투르크메니스탄 표준시", "MST": "마카오 표준 시간", "WESZ": "서유럽 하계 표준시", "CAT": "중앙아프리카 시간", "IST": "인도 표준시", "ACWST": "오스트레일리아 중서부 표준시", "COST": "콜롬비아 하계 표준시", "UYST": "우루과이 하계 표준시", "MYT": "말레이시아 시간", "WART": "아르헨티나 서부 표준시", "GYT": "가이아나 시간", "WAT": "서아프리카 표준시", "EST": "미 동부 표준시", "EDT": "미 동부 하계 표준시", "MESZ": "중부 유럽 하계 표준시", "LHST": "로드 하우 표준시", "MEZ": "중부 유럽 표준시", "COT": "콜롬비아 표준시", "ADT": "미 대서양 하계 표준시", "BT": "부탄 시간", "HKT": "홍콩 표준시", "AWST": "오스트레일리아 서부 표준시", "ARST": "아르헨티나 하계 표준시", "AWDT": "오스트레일리아 서부 하계 표준시", "SRT": "수리남 시간", "PST": "미 태평양 표준시", "NZDT": "뉴질랜드 하계 표준시", "HAST": "하와이 알류샨 표준시", "SAST": "남아프리카 시간", "HAT": "뉴펀들랜드 하계 표준시", "AKST": "알래스카 표준시", "NZST": "뉴질랜드 표준시", "UYT": "우루과이 표준시", "CLT": "칠레 표준시", "JST": "일본 표준시", "JDT": "일본 하계 표준시", "AKDT": "알래스카 하계 표준시", "AEDT": "오스트레일리아 동부 하계 표준시", "CHAST": "채텀 표준시", "CLST": "칠레 하계 표준시", "ECT": "에콰도르 시간", "EAT": "동아프리카 시간"},
+ timezones: map[string]string{"WARST": "아르헨티나 서부 하계 표준시", "WAT": "서아프리카 표준시", "LHST": "로드 하우 표준시", "MYT": "말레이시아 시간", "WART": "아르헨티나 서부 표준시", "ADT": "미 대서양 하계 표준시", "GMT": "그리니치 표준시", "ACDT": "오스트레일리아 중부 하계 표준시", "EDT": "미 동부 하계 표준시", "NZDT": "뉴질랜드 하계 표준시", "CAT": "중앙아프리카 시간", "WAST": "서아프리카 하계 표준시", "CHADT": "채텀 하계 표준시", "MST": "마카오 표준 시간", "AKDT": "알래스카 하계 표준시", "NZST": "뉴질랜드 표준시", "CLST": "칠레 하계 표준시", "EAT": "동아프리카 시간", "CDT": "미 중부 하계 표준시", "AST": "대서양 표준시", "TMT": "투르크메니스탄 표준시", "AEST": "오스트레일리아 동부 표준시", "CLT": "칠레 표준시", "IST": "인도 표준시", "COST": "콜롬비아 하계 표준시", "MDT": "마카오 하계 표준시", "HKT": "홍콩 표준시", "JST": "일본 표준시", "SAST": "남아프리카 시간", "HAST": "하와이 알류샨 표준시", "SRT": "수리남 시간", "MESZ": "중부 유럽 하계 표준시", "HAT": "뉴펀들랜드 하계 표준시", "AEDT": "오스트레일리아 동부 하계 표준시", "OESZ": "동유럽 하계 표준시", "ACWST": "오스트레일리아 중서부 표준시", "HADT": "하와이 알류샨 하계 표준시", "WIB": "서부 인도네시아 시간", "TMST": "투르크메니스탄 하계 표준시", "ART": "아르헨티나 표준시", "MEZ": "중부 유럽 표준시", "HNT": "뉴펀들랜드 표준시", "WIT": "동부 인도네시아 시간", "CHAST": "채텀 표준시", "WEZ": "서유럽 표준시", "COT": "콜롬비아 표준시", "ChST": "차모로 시간", "ACWDT": "오스트레일리아 중서부 하계 표준시", "BOT": "볼리비아 시간", "CST": "미 중부 표준시", "WESZ": "서유럽 하계 표준시", "GYT": "가이아나 시간", "LHDT": "로드 하우 하계 표준시", "∅∅∅": "아조레스 하계 표준시", "AWDT": "오스트레일리아 서부 하계 표준시", "EST": "미 동부 표준시", "PDT": "미 태평양 하계 표준시", "UYST": "우루과이 하계 표준시", "JDT": "일본 하계 표준시", "PST": "미 태평양 표준시", "OEZ": "동유럽 표준시", "UYT": "우루과이 표준시", "ACST": "오스트레일리아 중부 표준시", "GFT": "프랑스령 가이아나 시간", "VET": "베네수엘라 시간", "AWST": "오스트레일리아 서부 표준시", "ARST": "아르헨티나 하계 표준시", "SGT": "싱가포르 표준시", "BT": "부탄 시간", "ECT": "에콰도르 시간", "HKST": "홍콩 하계 표준시", "WITA": "중부 인도네시아 시간", "AKST": "알래스카 표준시"},
}
}
diff --git a/ko_KP/ko_KP_test.go b/ko_KP/ko_KP_test.go
new file mode 100644
index 00000000..5e2da590
--- /dev/null
+++ b/ko_KP/ko_KP_test.go
@@ -0,0 +1,1120 @@
+package ko_KP
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ko_KP"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ko_KR/ko_KR.go b/ko_KR/ko_KR.go
index 60721da3..0824ee9a 100644
--- a/ko_KR/ko_KR.go
+++ b/ko_KR/ko_KR.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"", ""},
erasWide: []string{"기원전", "서기"},
- timezones: map[string]string{"GYT": "가이아나 시간", "PDT": "미 태평양 하계 표준시", "WEZ": "서유럽 표준시", "∅∅∅": "아크레 하계 표준시", "HADT": "하와이 알류샨 하계 표준시", "MDT": "마카오 하계 표준시", "AWST": "오스트레일리아 서부 표준시", "EST": "미 동부 표준시", "WARST": "아르헨티나 서부 하계 표준시", "ACDT": "오스트레일리아 중부 하계 표준시", "TMST": "투르크메니스탄 하계 표준시", "CHAST": "채텀 표준시", "PST": "미 태평양 표준시", "CST": "미 중부 표준시", "MEZ": "중부 유럽 표준시", "AEST": "오스트레일리아 동부 표준시", "HAST": "하와이 알류샨 표준시", "IST": "인도 표준시", "TMT": "투르크메니스탄 표준시", "SRT": "수리남 시간", "ART": "아르헨티나 표준시", "ARST": "아르헨티나 하계 표준시", "NZDT": "뉴질랜드 하계 표준시", "CLST": "칠레 하계 표준시", "UYST": "우루과이 하계 표준시", "CDT": "미 중부 하계 표준시", "AEDT": "오스트레일리아 동부 하계 표준시", "CLT": "칠레 표준시", "HKST": "홍콩 하계 표준시", "WITA": "중부 인도네시아 시간", "JDT": "일본 하계 표준시", "AKDT": "알래스카 하계 표준시", "WAT": "서아프리카 표준시", "WIT": "동부 인도네시아 시간", "AST": "대서양 표준시", "HAT": "뉴펀들랜드 하계 표준시", "LHDT": "로드 하우 하계 표준시", "ChST": "차모로 시간", "ADT": "미 대서양 하계 표준시", "OESZ": "동유럽 하계 표준시", "ACWST": "오스트레일리아 중서부 표준시", "HKT": "홍콩 표준시", "GFT": "프랑스령 가이아나 시간", "EAT": "동아프리카 시간", "WESZ": "서유럽 하계 표준시", "JST": "일본 표준시", "BOT": "볼리비아 시간", "WART": "아르헨티나 서부 표준시", "SAST": "남아프리카 시간", "GMT": "그리니치 표준시", "LHST": "로드 하우 표준시", "BT": "부탄 시간", "HNT": "뉴펀들랜드 표준시", "ECT": "에콰도르 시간", "MST": "마카오 표준 시간", "AKST": "알래스카 표준시", "MYT": "말레이시아 시간", "MESZ": "중부 유럽 하계 표준시", "CHADT": "채텀 하계 표준시", "ACWDT": "오스트레일리아 중서부 하계 표준시", "CAT": "중앙아프리카 시간", "SGT": "싱가포르 표준시", "WAST": "서아프리카 하계 표준시", "ACST": "오스트레일리아 중부 표준시", "COST": "콜롬비아 하계 표준시", "EDT": "미 동부 하계 표준시", "AWDT": "오스트레일리아 서부 하계 표준시", "NZST": "뉴질랜드 표준시", "UYT": "우루과이 표준시", "VET": "베네수엘라 시간", "WIB": "서부 인도네시아 시간", "OEZ": "동유럽 표준시", "COT": "콜롬비아 표준시"},
+ timezones: map[string]string{"NZDT": "뉴질랜드 하계 표준시", "PST": "미 태평양 표준시", "OEZ": "동유럽 표준시", "LHDT": "로드 하우 하계 표준시", "CST": "미 중부 표준시", "HKST": "홍콩 하계 표준시", "CHAST": "채텀 표준시", "AWDT": "오스트레일리아 서부 하계 표준시", "SAST": "남아프리카 시간", "ACWST": "오스트레일리아 중서부 표준시", "AWST": "오스트레일리아 서부 표준시", "WITA": "중부 인도네시아 시간", "AKST": "알래스카 표준시", "ACWDT": "오스트레일리아 중서부 하계 표준시", "OESZ": "동유럽 하계 표준시", "LHST": "로드 하우 표준시", "WART": "아르헨티나 서부 표준시", "GFT": "프랑스령 가이아나 시간", "ARST": "아르헨티나 하계 표준시", "AST": "대서양 표준시", "HAST": "하와이 알류샨 표준시", "COST": "콜롬비아 하계 표준시", "BT": "부탄 시간", "∅∅∅": "아조레스 하계 표준시", "CHADT": "채텀 하계 표준시", "HAT": "뉴펀들랜드 하계 표준시", "ECT": "에콰도르 시간", "WIB": "서부 인도네시아 시간", "ACDT": "오스트레일리아 중부 하계 표준시", "MDT": "마카오 하계 표준시", "GYT": "가이아나 시간", "BOT": "볼리비아 시간", "TMT": "투르크메니스탄 표준시", "VET": "베네수엘라 시간", "AKDT": "알래스카 하계 표준시", "AEDT": "오스트레일리아 동부 하계 표준시", "WIT": "동부 인도네시아 시간", "EAT": "동아프리카 시간", "PDT": "미 태평양 하계 표준시", "HNT": "뉴펀들랜드 표준시", "ADT": "미 대서양 하계 표준시", "COT": "콜롬비아 표준시", "SGT": "싱가포르 표준시", "CAT": "중앙아프리카 시간", "MST": "마카오 표준 시간", "EDT": "미 동부 하계 표준시", "IST": "인도 표준시", "EST": "미 동부 표준시", "WEZ": "서유럽 표준시", "ChST": "차모로 시간", "CDT": "미 중부 하계 표준시", "JST": "일본 표준시", "MESZ": "중부 유럽 하계 표준시", "WESZ": "서유럽 하계 표준시", "MYT": "말레이시아 시간", "SRT": "수리남 시간", "ART": "아르헨티나 표준시", "TMST": "투르크메니스탄 하계 표준시", "AEST": "오스트레일리아 동부 표준시", "CLST": "칠레 하계 표준시", "NZST": "뉴질랜드 표준시", "WAST": "서아프리카 하계 표준시", "CLT": "칠레 표준시", "UYT": "우루과이 표준시", "UYST": "우루과이 하계 표준시", "ACST": "오스트레일리아 중부 표준시", "JDT": "일본 하계 표준시", "GMT": "그리니치 표준시", "WAT": "서아프리카 표준시", "HKT": "홍콩 표준시", "HADT": "하와이 알류샨 하계 표준시", "MEZ": "중부 유럽 표준시", "WARST": "아르헨티나 서부 하계 표준시"},
}
}
diff --git a/ko_KR/ko_KR_test.go b/ko_KR/ko_KR_test.go
new file mode 100644
index 00000000..1a9ff91d
--- /dev/null
+++ b/ko_KR/ko_KR_test.go
@@ -0,0 +1,1120 @@
+package ko_KR
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ko_KR"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/kok/kok.go b/kok/kok.go
index 131dc72d..afd025c7 100644
--- a/kok/kok.go
+++ b/kok/kok.go
@@ -60,7 +60,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"क्रिस्तपूर्व", "क्रिस्तशखा"},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"TMST": "TMST", "ACWDT": "ACWDT", "EDT": "EDT", "HKST": "HKST", "GFT": "GFT", "AWST": "AWST", "AWDT": "AWDT", "GYT": "GYT", "WART": "WART", "WIB": "WIB", "JST": "JST", "MESZ": "MESZ", "BOT": "BOT", "OEZ": "OEZ", "PDT": "PDT", "HAST": "HAST", "WARST": "WARST", "ART": "ART", "ARST": "ARST", "WEZ": "WEZ", "HNT": "HNT", "LHDT": "LHDT", "SRT": "SRT", "CLT": "CLT", "BT": "BT", "COST": "COST", "OESZ": "OESZ", "UYST": "UYST", "WESZ": "WESZ", "CAT": "CAT", "UYT": "UYT", "EAT": "EAT", "CHAST": "CHAST", "ECT": "ECT", "SGT": "SGT", "WAT": "WAT", "NZST": "NZST", "AEST": "AEST", "MDT": "MDT", "ACST": "ACST", "∅∅∅": "∅∅∅", "TMT": "TMT", "MYT": "MYT", "CDT": "CDT", "COT": "COT", "HKT": "HKT", "AKST": "AKST", "LHST": "LHST", "JDT": "JDT", "EST": "EST", "WAST": "WAST", "AEDT": "AEDT", "AST": "AST", "GMT": "GMT", "HAT": "HAT", "MST": "MST", "AKDT": "AKDT", "ChST": "ChST", "CHADT": "CHADT", "CLST": "CLST", "WIT": "WIT", "ACDT": "ACDT", "PST": "PST", "ACWST": "ACWST", "ADT": "ADT", "HADT": "HADT", "IST": "भारतीय समय", "CST": "CST", "MEZ": "MEZ", "NZDT": "NZDT", "VET": "VET", "SAST": "SAST", "WITA": "WITA"},
+ timezones: map[string]string{"AWST": "AWST", "BOT": "BOT", "WAT": "WAT", "CLT": "CLT", "CLST": "CLST", "GFT": "GFT", "CHAST": "CHAST", "PST": "PST", "∅∅∅": "∅∅∅", "ECT": "ECT", "ACWDT": "ACWDT", "EDT": "EDT", "COT": "COT", "OEZ": "OEZ", "AWDT": "AWDT", "ARST": "ARST", "AEST": "AEST", "AEDT": "AEDT", "AKDT": "AKDT", "WAST": "WAST", "AKST": "AKST", "BT": "BT", "JST": "JST", "HNT": "HNT", "HAT": "HAT", "SAST": "SAST", "WIB": "WIB", "WIT": "WIT", "HKT": "HKT", "ACWST": "ACWST", "JDT": "JDT", "MESZ": "MESZ", "NZDT": "NZDT", "AST": "AST", "HKST": "HKST", "CDT": "CDT", "VET": "VET", "SGT": "SGT", "ChST": "ChST", "ACDT": "ACDT", "PDT": "PDT", "HAST": "HAST", "CST": "CST", "CHADT": "CHADT", "WITA": "WITA", "ADT": "ADT", "LHDT": "LHDT", "MST": "MST", "GYT": "GYT", "MEZ": "MEZ", "WESZ": "WESZ", "MDT": "MDT", "MYT": "MYT", "TMT": "TMT", "GMT": "GMT", "LHST": "LHST", "UYT": "UYT", "ACST": "ACST", "HADT": "HADT", "COST": "COST", "OESZ": "OESZ", "WART": "WART", "SRT": "SRT", "NZST": "NZST", "IST": "भारतीय समय", "UYST": "UYST", "EAT": "EAT", "EST": "EST", "CAT": "CAT", "WARST": "WARST", "ART": "ART", "WEZ": "WEZ", "TMST": "TMST"},
}
}
@@ -106,7 +106,7 @@ func (kok *kok) MonthAbbreviated(month time.Month) string {
// MonthsAbbreviated returns the locales abbreviated months
func (kok *kok) MonthsAbbreviated() []string {
- return kok.monthsAbbreviated[1:]
+ return nil
}
// MonthNarrow returns the locales narrow month given the 'month' provided
@@ -116,7 +116,7 @@ func (kok *kok) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (kok *kok) MonthsNarrow() []string {
- return kok.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/kok/kok_test.go b/kok/kok_test.go
new file mode 100644
index 00000000..7188e5cc
--- /dev/null
+++ b/kok/kok_test.go
@@ -0,0 +1,1120 @@
+package kok
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "kok"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/kok_IN/kok_IN.go b/kok_IN/kok_IN.go
index 42e624d8..6f42422c 100644
--- a/kok_IN/kok_IN.go
+++ b/kok_IN/kok_IN.go
@@ -60,7 +60,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"क्रिस्तपूर्व", "क्रिस्तशखा"},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"ACST": "ACST", "CST": "CST", "MEZ": "MEZ", "CLT": "CLT", "ECT": "ECT", "ADT": "ADT", "GFT": "GFT", "BT": "BT", "ARST": "ARST", "∅∅∅": "∅∅∅", "AKDT": "AKDT", "CDT": "CDT", "CAT": "CAT", "WAT": "WAT", "MST": "MST", "LHST": "LHST", "NZST": "NZST", "NZDT": "NZDT", "UYT": "UYT", "HAT": "HAT", "IST": "भारतीय समय", "OEZ": "OEZ", "SAST": "SAST", "OESZ": "OESZ", "MDT": "MDT", "SRT": "SRT", "PDT": "PDT", "MYT": "MYT", "BOT": "BOT", "HNT": "HNT", "HKST": "HKST", "EAT": "EAT", "TMST": "TMST", "AKST": "AKST", "PST": "PST", "WESZ": "WESZ", "CLST": "CLST", "HKT": "HKT", "MESZ": "MESZ", "VET": "VET", "TMT": "TMT", "WARST": "WARST", "ART": "ART", "LHDT": "LHDT", "ACWDT": "ACWDT", "SGT": "SGT", "WAST": "WAST", "CHAST": "CHAST", "COT": "COT", "AWDT": "AWDT", "WIT": "WIT", "AEST": "AEST", "AEDT": "AEDT", "ChST": "ChST", "EDT": "EDT", "WART": "WART", "ACDT": "ACDT", "JDT": "JDT", "EST": "EST", "COST": "COST", "GMT": "GMT", "AWST": "AWST", "UYST": "UYST", "WIB": "WIB", "JST": "JST", "WEZ": "WEZ", "ACWST": "ACWST", "HADT": "HADT", "WITA": "WITA", "CHADT": "CHADT", "AST": "AST", "HAST": "HAST", "GYT": "GYT"},
+ timezones: map[string]string{"UYT": "UYT", "CHAST": "CHAST", "AST": "AST", "PST": "PST", "HADT": "HADT", "NZST": "NZST", "COST": "COST", "AEST": "AEST", "GFT": "GFT", "HKST": "HKST", "BOT": "BOT", "IST": "भारतीय समय", "PDT": "PDT", "HNT": "HNT", "COT": "COT", "EAT": "EAT", "LHST": "LHST", "CST": "CST", "ACWST": "ACWST", "WITA": "WITA", "TMST": "TMST", "ChST": "ChST", "HKT": "HKT", "AKST": "AKST", "ART": "ART", "GMT": "GMT", "MYT": "MYT", "VET": "VET", "AKDT": "AKDT", "OESZ": "OESZ", "UYST": "UYST", "∅∅∅": "∅∅∅", "CDT": "CDT", "ACDT": "ACDT", "WARST": "WARST", "CLST": "CLST", "WESZ": "WESZ", "WART": "WART", "BT": "BT", "MST": "MST", "ADT": "ADT", "TMT": "TMT", "GYT": "GYT", "CLT": "CLT", "ACST": "ACST", "ARST": "ARST", "JST": "JST", "WAT": "WAT", "MDT": "MDT", "HAST": "HAST", "CHADT": "CHADT", "JDT": "JDT", "EST": "EST", "MEZ": "MEZ", "MESZ": "MESZ", "WAST": "WAST", "LHDT": "LHDT", "AWST": "AWST", "EDT": "EDT", "SRT": "SRT", "ECT": "ECT", "ACWDT": "ACWDT", "SAST": "SAST", "WEZ": "WEZ", "HAT": "HAT", "WIT": "WIT", "AWDT": "AWDT", "NZDT": "NZDT", "WIB": "WIB", "OEZ": "OEZ", "SGT": "SGT", "AEDT": "AEDT", "CAT": "CAT"},
}
}
@@ -106,7 +106,7 @@ func (kok *kok_IN) MonthAbbreviated(month time.Month) string {
// MonthsAbbreviated returns the locales abbreviated months
func (kok *kok_IN) MonthsAbbreviated() []string {
- return kok.monthsAbbreviated[1:]
+ return nil
}
// MonthNarrow returns the locales narrow month given the 'month' provided
@@ -116,7 +116,7 @@ func (kok *kok_IN) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (kok *kok_IN) MonthsNarrow() []string {
- return kok.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/kok_IN/kok_IN_test.go b/kok_IN/kok_IN_test.go
new file mode 100644
index 00000000..0dc3b577
--- /dev/null
+++ b/kok_IN/kok_IN_test.go
@@ -0,0 +1,1120 @@
+package kok_IN
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "kok_IN"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ks/ks.go b/ks/ks.go
index e43535b8..be18623a 100644
--- a/ks/ks.go
+++ b/ks/ks.go
@@ -66,7 +66,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"بی سی", "اے ڈی"},
erasNarrow: []string{"", ""},
erasWide: []string{"قبٕل مسیٖح", "عیٖسوی سنہٕ"},
- timezones: map[string]string{"AKST": "اٮ۪لاسکا سٹینڑاڑ ٹایِم", "COST": "کولومبِیا سَمَر ٹایِم", "ADT": "اٮ۪ٹلانٹِک ڈےلایِٔٹ ٹایِم", "IST": "ہِنٛدوستان", "PST": "پیسِفِک سٹینڑاڑ ٹایِم", "MEZ": "مرکزی یوٗرپی سٹینڑاڑ ٹایِم", "CLST": "چِلی سَمَر ٹایِم", "WAT": "مغربی افریٖقا سٹینڑاڑ ٹایِم", "JDT": "جاپٲنۍ ڑےلایِٔٹ ٹایِم", "JST": "جاپٲنۍ سٹینڑاڑ ٹایِم", "ACWDT": "آسٹریلِیَن مرکزی مغربی ڈےلایِٔٹ ٹایِم", "ChST": "کٮ۪مورو سٹینڑاڑ ٹایِم", "HKST": "حانٛگ کانٛگ سَمَر ٹایِم", "COT": "کولومبِیا سٹینڑاڑ ٹایِم", "GMT": "گرٛیٖن وِچ میٖن ٹایِم", "GFT": "فرٛٮ۪نٛچ گیوٗٮ۪نا ٹایِم", "ACDT": "آسٹریلِیَن مرکزی ڈےلایِٔٹ ٹایِم", "PDT": "پیسِفِک ڈےلایِٔٹ ٹایِم", "CHADT": "چٮ۪تھَم سَمَر ٹایِم", "AEST": "آسٹریلِیَن مشرقی سٹینڑاڑ ٹایِم", "EST": "مشرقی سٹینڑاڑ ٹایِم", "LHST": "لعاڑ حووے سٹینڑاڑ ٹایِم", "MESZ": "مرکزی یوٗرپی سَمَر ٹایِم", "NZDT": "نِوزِلینڑ ڑےلایٔٹ ٹایِم", "BOT": "بولِوِیا ٹایِم", "WIT": "مشرِقی اِنڑونیشِیا ٹایِم", "ARST": "ارجٮ۪نٹیٖنا سَمَر ٹایِم", "GYT": "گُیَنا ٹایِم", "HADT": "حَواے اٮ۪لیوٗٹِیَن سَمَر ٹایِم", "WARST": "مغربی ارجٮ۪نٹیٖنا سَمَر ٹایِم", "OEZ": "مشرقی یوٗرپی سٹینڑاڑ ٹایِم", "HNT": "نیوٗ فاونڑلینڑ سٹینڑاڑ ٹایِم", "TMST": "تُرکمٮ۪نِستان سَمَر ٹایِم", "ACST": "آسٹریلِیَن مرکزی سٹینڑاڑ ٹایِم", "WESZ": "مغرِبی یوٗرِپی سَمَر ٹایِم", "BT": "بوٗٹان ٹایِم", "HKT": "حانگ کانٛگ سٹینڑاڑ ٹایِم", "CDT": "مرکزی ڈےلایِٔٹ ٹایِم", "∅∅∅": "برٮ۪سِلِیا سَمَر ٹایِم", "EAT": "مشرقی افریٖقا ٹایِم", "LHDT": "لعاڑ ڑےلایٔٹ ٹایِم", "TMT": "تُرکمٮ۪نِستان سٹینڑاڑ ٹایِم", "SRT": "سُرِنام ٹایِم", "AWST": "آسٹریلِیَن مغرِبی سٹینڑاڑ ٹایِم", "MDT": "ماونٹین ڈےلایِٔٹ ٹایِم", "CAT": "مرکزی افریٖقا ٹایِم", "SGT": "سِنٛگاپوٗر ٹایِم", "WITA": "مرکزی اِنڑونیشِیا ٹایِم", "OESZ": "مشرقی یوٗرپی سَمَر ٹایِم", "ART": "ارجٮ۪نٹیٖنا سٹینڑاڑ ٹایِم", "CST": "مرکزی سٹینڑاڑ ٹایِم", "WEZ": "مغرِبی یوٗرپی سٹینڑاڑ ٹایِم", "ACWST": "آسٹریلِیَن مرکزی مغربی سٹینڑاڑ ٹایِم", "SAST": "جنوٗبی افریقا ٹایِم", "UYT": "یوٗرٮ۪گوَے سٹینڑاڑ ٹایِم", "CHAST": "کٮ۪تھَم سٹینڑاڑ ٹایِم", "VET": "وٮ۪نٮ۪زیوٗلا ٹایِم", "AEDT": "آسٹریلِیَن مشرقی ڈےلایِٔٹ ٹایِم", "WART": "مغربی ارجٮ۪نٹیٖنا سٹینڑاڑ ٹایِم", "WIB": "مغرِبی اِنڑونیشِیا ٹایِم", "HAT": "نیوٗ فاونڑ لینڑ ڑےلایِٔٹ ٹایِم", "MYT": "مَلیشِیا ٹایِم", "CLT": "چِلی سٹینڑاڑ ٹایِم", "ECT": "اِکویڑَر ٹایِم", "AST": "اٮ۪ٹلانٹِک سٹینڑاڑ ٹایِم", "EDT": "مشرقی ڈےلایِٔٹ ٹایِم", "UYST": "یوٗرٮ۪گوَے سَمَر ٹایِم", "MST": "ماونٹین سٹینڑاڑ ٹایِم", "AWDT": "آسٹریلِیَن مغرِبیٖ ڈےلایٔٹ ٹایِم", "WAST": "مغربی افریٖقا سَمَر ٹایِم", "AKDT": "اٮ۪لاسکا ڈےلایِٔٹ ٹایِم", "NZST": "نِوزِلینڑ سٹینڑاڑ ٹایِم", "HAST": "حَواے اٮ۪لیوٗٹِیَن سٹینڑاڑ ٹایِم"},
+ timezones: map[string]string{"MYT": "مَلیشِیا ٹایِم", "CDT": "مرکزی ڈےلایِٔٹ ٹایِم", "SRT": "سُرِنام ٹایِم", "ARST": "ارجٮ۪نٹیٖنا سَمَر ٹایِم", "HADT": "حَواے اٮ۪لیوٗٹِیَن سَمَر ٹایِم", "ChST": "کٮ۪مورو سٹینڑاڑ ٹایِم", "UYST": "یوٗرٮ۪گوَے سَمَر ٹایِم", "ACDT": "آسٹریلِیَن مرکزی ڈےلایِٔٹ ٹایِم", "HKST": "حانٛگ کانٛگ سَمَر ٹایِم", "MESZ": "مرکزی یوٗرپی سَمَر ٹایِم", "WAT": "مغربی افریٖقا سٹینڑاڑ ٹایِم", "MDT": "مَکَعوٗ سَمَر ٹایِم", "JST": "جاپٲنۍ سٹینڑاڑ ٹایِم", "OEZ": "مشرقی یوٗرپی سٹینڑاڑ ٹایِم", "CLST": "چِلی سَمَر ٹایِم", "GYT": "گُیَنا ٹایِم", "LHDT": "لعاڑ ڑےلایٔٹ ٹایِم", "ART": "ارجٮ۪نٹیٖنا سٹینڑاڑ ٹایِم", "JDT": "جاپٲنۍ ڑےلایِٔٹ ٹایِم", "CAT": "مرکزی افریٖقا ٹایِم", "HAT": "نیوٗ فاونڑ لینڑ ڑےلایِٔٹ ٹایِم", "∅∅∅": "اٮ۪زورٕس سَمَر ٹ", "CHAST": "کٮ۪تھَم سٹینڑاڑ ٹایِم", "MEZ": "مرکزی یوٗرپی سٹینڑاڑ ٹایِم", "NZST": "نِوزِلینڑ سٹینڑاڑ ٹایِم", "WEZ": "مغرِبی یوٗرپی سٹینڑاڑ ٹایِم", "AEST": "آسٹریلِیَن مشرقی سٹینڑاڑ ٹایِم", "CHADT": "چٮ۪تھَم سَمَر ٹایِم", "WITA": "مرکزی اِنڑونیشِیا ٹایِم", "AKDT": "اٮ۪لاسکا ڈےلایِٔٹ ٹایِم", "AWDT": "آسٹریلِیَن مغرِبیٖ ڈےلایٔٹ ٹایِم", "WIT": "مشرِقی اِنڑونیشِیا ٹایِم", "LHST": "لعاڑ حووے سٹینڑاڑ ٹایِم", "CST": "مرکزی سٹینڑاڑ ٹایِم", "WART": "مغربی ارجٮ۪نٹیٖنا سٹینڑاڑ ٹایِم", "IST": "ہِنٛدوستان", "EDT": "مشرقی ڈےلایِٔٹ ٹایِم", "SGT": "سِنٛگاپوٗر ٹایِم", "WIB": "مغرِبی اِنڑونیشِیا ٹایِم", "TMST": "تُرکمٮ۪نِستان سَمَر ٹایِم", "BT": "بوٗٹان ٹایِم", "VET": "وٮ۪نٮ۪زیوٗلا ٹایِم", "HAST": "حَواے اٮ۪لیوٗٹِیَن سٹینڑاڑ ٹایِم", "SAST": "جنوٗبی افریقا ٹایِم", "PST": "پیسِفِک سٹینڑاڑ ٹایِم", "UYT": "یوٗرٮ۪گوَے سٹینڑاڑ ٹایِم", "ADT": "اٮ۪ٹلانٹِک ڈےلایِٔٹ ٹایِم", "NZDT": "نِوزِلینڑ ڑےلایٔٹ ٹایِم", "TMT": "تُرکمٮ۪نِستان سٹینڑاڑ ٹایِم", "WESZ": "مغرِبی یوٗرِپی سَمَر ٹایِم", "AKST": "اٮ۪لاسکا سٹینڑاڑ ٹایِم", "ACWDT": "آسٹریلِیَن مرکزی مغربی ڈےلایِٔٹ ٹایِم", "HNT": "نیوٗ فاونڑلینڑ سٹینڑاڑ ٹایِم", "CLT": "چِلی سٹینڑاڑ ٹایِم", "HKT": "حانگ کانٛگ سٹینڑاڑ ٹایِم", "COST": "کولومبِیا سَمَر ٹایِم", "OESZ": "مشرقی یوٗرپی سَمَر ٹایِم", "AST": "اٮ۪ٹلانٹِک سٹینڑاڑ ٹایِم", "ACST": "آسٹریلِیَن مرکزی سٹینڑاڑ ٹایِم", "AWST": "آسٹریلِیَن مغرِبی سٹینڑاڑ ٹایِم", "BOT": "بولِوِیا ٹایِم", "WAST": "مغربی افریٖقا سَمَر ٹایِم", "EAT": "مشرقی افریٖقا ٹایِم", "WARST": "مغربی ارجٮ۪نٹیٖنا سَمَر ٹایِم", "GFT": "فرٛٮ۪نٛچ گیوٗٮ۪نا ٹایِم", "ACWST": "آسٹریلِیَن مرکزی مغربی سٹینڑاڑ ٹایِم", "EST": "مشرقی سٹینڑاڑ ٹایِم", "GMT": "گرٛیٖن وِچ میٖن ٹایِم", "AEDT": "آسٹریلِیَن مشرقی ڈےلایِٔٹ ٹایِم", "MST": "مَکَعوٗ سٹینڑاڑ ٹایِم", "ECT": "اِکویڑَر ٹایِم", "PDT": "پیسِفِک ڈےلایِٔٹ ٹایِم", "COT": "کولومبِیا سٹینڑاڑ ٹایِم"},
}
}
@@ -119,7 +119,7 @@ func (ks *ks) MonthAbbreviated(month time.Month) string {
// MonthsAbbreviated returns the locales abbreviated months
func (ks *ks) MonthsAbbreviated() []string {
- return ks.monthsAbbreviated[1:]
+ return nil
}
// MonthNarrow returns the locales narrow month given the 'month' provided
diff --git a/ks/ks_test.go b/ks/ks_test.go
new file mode 100644
index 00000000..42b6119a
--- /dev/null
+++ b/ks/ks_test.go
@@ -0,0 +1,1120 @@
+package ks
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ks"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ks_IN/ks_IN.go b/ks_IN/ks_IN.go
index 22243ef5..d1f8fbb8 100644
--- a/ks_IN/ks_IN.go
+++ b/ks_IN/ks_IN.go
@@ -66,7 +66,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"بی سی", "اے ڈی"},
erasNarrow: []string{"", ""},
erasWide: []string{"قبٕل مسیٖح", "عیٖسوی سنہٕ"},
- timezones: map[string]string{"GYT": "گُیَنا ٹایِم", "AEST": "آسٹریلِیَن مشرقی سٹینڑاڑ ٹایِم", "AWST": "آسٹریلِیَن مغرِبی سٹینڑاڑ ٹایِم", "EST": "مشرقی سٹینڑاڑ ٹایِم", "IST": "ہِنٛدوستان", "MST": "مَکَعوٗ سٹینڑاڑ ٹایِم", "JST": "جاپٲنۍ سٹینڑاڑ ٹایِم", "LHDT": "لعاڑ ڑےلایٔٹ ٹایِم", "WAT": "مغربی افریٖقا سٹینڑاڑ ٹایِم", "ACDT": "آسٹریلِیَن مرکزی ڈےلایِٔٹ ٹایِم", "ART": "ارجٮ۪نٹیٖنا سٹینڑاڑ ٹایِم", "ACWDT": "آسٹریلِیَن مرکزی مغربی ڈےلایِٔٹ ٹایِم", "GMT": "گرٛیٖن وِچ میٖن ٹایِم", "LHST": "لعاڑ حووے سٹینڑاڑ ٹایِم", "CHAST": "کٮ۪تھَم سٹینڑاڑ ٹایِم", "UYT": "یوٗرٮ۪گوَے سٹینڑاڑ ٹایِم", "ECT": "اِکویڑَر ٹایِم", "GFT": "فرٛٮ۪نٛچ گیوٗٮ۪نا ٹایِم", "MDT": "مَکَعوٗ سَمَر ٹایِم", "ARST": "ارجٮ۪نٹیٖنا سَمَر ٹایِم", "PST": "پیسِفِک سٹینڑاڑ ٹایِم", "ACWST": "آسٹریلِیَن مرکزی مغربی سٹینڑاڑ ٹایِم", "WARST": "مغربی ارجٮ۪نٹیٖنا سَمَر ٹایِم", "EAT": "مشرقی افریٖقا ٹایِم", "ACST": "آسٹریلِیَن مرکزی سٹینڑاڑ ٹایِم", "HADT": "حَواے اٮ۪لیوٗٹِیَن سَمَر ٹایِم", "JDT": "جاپٲنۍ ڑےلایِٔٹ ٹایِم", "CLT": "چِلی سٹینڑاڑ ٹایِم", "AST": "اٮ۪ٹلانٹِک سٹینڑاڑ ٹایِم", "ADT": "اٮ۪ٹلانٹِک ڈےلایِٔٹ ٹایِم", "PDT": "پیسِفِک ڈےلایِٔٹ ٹایِم", "CDT": "مرکزی ڈےلایِٔٹ ٹایِم", "AEDT": "آسٹریلِیَن مشرقی ڈےلایِٔٹ ٹایِم", "ChST": "کٮ۪مورو سٹینڑاڑ ٹایِم", "WART": "مغربی ارجٮ۪نٹیٖنا سٹینڑاڑ ٹایِم", "SAST": "جنوٗبی افریقا ٹایِم", "HKST": "حانٛگ کانٛگ سَمَر ٹایِم", "HAT": "نیوٗ فاونڑ لینڑ ڑےلایِٔٹ ٹایِم", "AKST": "اٮ۪لاسکا سٹینڑاڑ ٹایِم", "MEZ": "مرکزی یوٗرپی سٹینڑاڑ ٹایِم", "HAST": "حَواے اٮ۪لیوٗٹِیَن سٹینڑاڑ ٹایِم", "HNT": "نیوٗ فاونڑلینڑ سٹینڑاڑ ٹایِم", "∅∅∅": "اٮ۪مَزَن سَمَر ٹایِم", "EDT": "مشرقی ڈےلایِٔٹ ٹایِم", "WAST": "مغربی افریٖقا سَمَر ٹایِم", "OEZ": "مشرقی یوٗرپی سٹینڑاڑ ٹایِم", "CHADT": "چٮ۪تھَم سَمَر ٹایِم", "WESZ": "مغرِبی یوٗرِپی سَمَر ٹایِم", "UYST": "یوٗرٮ۪گوَے سَمَر ٹایِم", "NZDT": "نِوزِلینڑ ڑےلایٔٹ ٹایِم", "CLST": "چِلی سَمَر ٹایِم", "TMST": "تُرکمٮ۪نِستان سَمَر ٹایِم", "AWDT": "آسٹریلِیَن مغرِبیٖ ڈےلایٔٹ ٹایِم", "BOT": "بولِوِیا ٹایِم", "CAT": "مرکزی افریٖقا ٹایِم", "SGT": "سِنٛگاپوٗر ٹایِم", "TMT": "تُرکمٮ۪نِستان سٹینڑاڑ ٹایِم", "CST": "مرکزی سٹینڑاڑ ٹایِم", "HKT": "حانگ کانٛگ سٹینڑاڑ ٹایِم", "WIB": "مغرِبی اِنڑونیشِیا ٹایِم", "OESZ": "مشرقی یوٗرپی سَمَر ٹایِم", "NZST": "نِوزِلینڑ سٹینڑاڑ ٹایِم", "WEZ": "مغرِبی یوٗرپی سٹینڑاڑ ٹایِم", "AKDT": "اٮ۪لاسکا ڈےلایِٔٹ ٹایِم", "VET": "وٮ۪نٮ۪زیوٗلا ٹایِم", "COST": "کولومبِیا سَمَر ٹایِم", "BT": "بوٗٹان ٹایِم", "WIT": "مشرِقی اِنڑونیشِیا ٹایِم", "MYT": "مَلیشِیا ٹایِم", "SRT": "سُرِنام ٹایِم", "WITA": "مرکزی اِنڑونیشِیا ٹایِم", "MESZ": "مرکزی یوٗرپی سَمَر ٹایِم", "COT": "کولومبِیا سٹینڑاڑ ٹایِم"},
+ timezones: map[string]string{"AST": "اٮ۪ٹلانٹِک سٹینڑاڑ ٹایِم", "NZDT": "نِوزِلینڑ ڑےلایٔٹ ٹایِم", "EST": "مشرقی سٹینڑاڑ ٹایِم", "AEDT": "آسٹریلِیَن مشرقی ڈےلایِٔٹ ٹایِم", "∅∅∅": "اٮ۪زورٕس سَمَر ٹ", "JST": "جاپٲنۍ سٹینڑاڑ ٹایِم", "ADT": "اٮ۪ٹلانٹِک ڈےلایِٔٹ ٹایِم", "MEZ": "مرکزی یوٗرپی سٹینڑاڑ ٹایِم", "HADT": "حَواے اٮ۪لیوٗٹِیَن سَمَر ٹایِم", "CAT": "مرکزی افریٖقا ٹایِم", "WEZ": "مغرِبی یوٗرپی سٹینڑاڑ ٹایِم", "UYST": "یوٗرٮ۪گوَے سَمَر ٹایِم", "WITA": "مرکزی اِنڑونیشِیا ٹایِم", "MESZ": "مرکزی یوٗرپی سَمَر ٹایِم", "WAT": "مغربی افریٖقا سٹینڑاڑ ٹایِم", "OEZ": "مشرقی یوٗرپی سٹینڑاڑ ٹایِم", "AEST": "آسٹریلِیَن مشرقی سٹینڑاڑ ٹایِم", "LHST": "لعاڑ حووے سٹینڑاڑ ٹایِم", "SRT": "سُرِنام ٹایِم", "WART": "مغربی ارجٮ۪نٹیٖنا سٹینڑاڑ ٹایِم", "VET": "وٮ۪نٮ۪زیوٗلا ٹایِم", "MDT": "مَکَعوٗ سَمَر ٹایِم", "PST": "پیسِفِک سٹینڑاڑ ٹایِم", "BOT": "بولِوِیا ٹایِم", "SGT": "سِنٛگاپوٗر ٹایِم", "AWST": "آسٹریلِیَن مغرِبی سٹینڑاڑ ٹایِم", "ART": "ارجٮ۪نٹیٖنا سٹینڑاڑ ٹایِم", "UYT": "یوٗرٮ۪گوَے سٹینڑاڑ ٹایِم", "WIT": "مشرِقی اِنڑونیشِیا ٹایِم", "IST": "ہِنٛدوستان", "CLST": "چِلی سَمَر ٹایِم", "WARST": "مغربی ارجٮ۪نٹیٖنا سَمَر ٹایِم", "JDT": "جاپٲنۍ ڑےلایِٔٹ ٹایِم", "ACWST": "آسٹریلِیَن مرکزی مغربی سٹینڑاڑ ٹایِم", "NZST": "نِوزِلینڑ سٹینڑاڑ ٹایِم", "ACST": "آسٹریلِیَن مرکزی سٹینڑاڑ ٹایِم", "AWDT": "آسٹریلِیَن مغرِبیٖ ڈےلایٔٹ ٹایِم", "WAST": "مغربی افریٖقا سَمَر ٹایِم", "CLT": "چِلی سٹینڑاڑ ٹایِم", "EAT": "مشرقی افریٖقا ٹایِم", "AKDT": "اٮ۪لاسکا ڈےلایِٔٹ ٹایِم", "ACWDT": "آسٹریلِیَن مرکزی مغربی ڈےلایِٔٹ ٹایِم", "TMT": "تُرکمٮ۪نِستان سٹینڑاڑ ٹایِم", "GYT": "گُیَنا ٹایِم", "OESZ": "مشرقی یوٗرپی سَمَر ٹایِم", "CHADT": "چٮ۪تھَم سَمَر ٹایِم", "HAST": "حَواے اٮ۪لیوٗٹِیَن سٹینڑاڑ ٹایِم", "MYT": "مَلیشِیا ٹایِم", "MST": "مَکَعوٗ سٹینڑاڑ ٹایِم", "HNT": "نیوٗ فاونڑلینڑ سٹینڑاڑ ٹایِم", "TMST": "تُرکمٮ۪نِستان سَمَر ٹایِم", "HKST": "حانٛگ کانٛگ سَمَر ٹایِم", "EDT": "مشرقی ڈےلایِٔٹ ٹایِم", "HAT": "نیوٗ فاونڑ لینڑ ڑےلایِٔٹ ٹایِم", "CST": "مرکزی سٹینڑاڑ ٹایِم", "AKST": "اٮ۪لاسکا سٹینڑاڑ ٹایِم", "PDT": "پیسِفِک ڈےلایِٔٹ ٹایِم", "SAST": "جنوٗبی افریقا ٹایِم", "COT": "کولومبِیا سٹینڑاڑ ٹایِم", "CDT": "مرکزی ڈےلایِٔٹ ٹایِم", "ChST": "کٮ۪مورو سٹینڑاڑ ٹایِم", "LHDT": "لعاڑ ڑےلایٔٹ ٹایِم", "GFT": "فرٛٮ۪نٛچ گیوٗٮ۪نا ٹایِم", "ECT": "اِکویڑَر ٹایِم", "HKT": "حانگ کانٛگ سٹینڑاڑ ٹایِم", "ARST": "ارجٮ۪نٹیٖنا سَمَر ٹایِم", "COST": "کولومبِیا سَمَر ٹایِم", "ACDT": "آسٹریلِیَن مرکزی ڈےلایِٔٹ ٹایِم", "CHAST": "کٮ۪تھَم سٹینڑاڑ ٹایِم", "WIB": "مغرِبی اِنڑونیشِیا ٹایِم", "WESZ": "مغرِبی یوٗرِپی سَمَر ٹایِم", "GMT": "گرٛیٖن وِچ میٖن ٹایِم", "BT": "بوٗٹان ٹایِم"},
}
}
@@ -119,7 +119,7 @@ func (ks *ks_IN) MonthAbbreviated(month time.Month) string {
// MonthsAbbreviated returns the locales abbreviated months
func (ks *ks_IN) MonthsAbbreviated() []string {
- return ks.monthsAbbreviated[1:]
+ return nil
}
// MonthNarrow returns the locales narrow month given the 'month' provided
diff --git a/ks_IN/ks_IN_test.go b/ks_IN/ks_IN_test.go
new file mode 100644
index 00000000..a02bf47c
--- /dev/null
+++ b/ks_IN/ks_IN_test.go
@@ -0,0 +1,1120 @@
+package ks_IN
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ks_IN"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ksb/ksb.go b/ksb/ksb.go
index 060ed9f5..9f89c57b 100644
--- a/ksb/ksb.go
+++ b/ksb/ksb.go
@@ -59,7 +59,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"KK", "BK"},
erasNarrow: []string{"", ""},
erasWide: []string{"Kabla ya Klisto", "Baada ya Klisto"},
- timezones: map[string]string{"ARST": "ARST", "AKST": "AKST", "LHDT": "LHDT", "BOT": "BOT", "∅∅∅": "∅∅∅", "ART": "ART", "JST": "JST", "PST": "PST", "AWDT": "AWDT", "MESZ": "MESZ", "ACWDT": "ACWDT", "COST": "COST", "WARST": "WARST", "HNT": "HNT", "CST": "CST", "VET": "VET", "WESZ": "WESZ", "HKT": "HKT", "UYT": "UYT", "SGT": "SGT", "EDT": "EDT", "SRT": "SRT", "WITA": "WITA", "MYT": "MYT", "BT": "BT", "HKST": "HKST", "GFT": "GFT", "MDT": "MDT", "CLT": "CLT", "ADT": "ADT", "HAST": "HAST", "AKDT": "AKDT", "CHAST": "CHAST", "WEZ": "WEZ", "AEDT": "AEDT", "WAT": "WAT", "TMST": "TMST", "ACST": "ACST", "CDT": "CDT", "WAST": "WAST", "MST": "MST", "HADT": "HADT", "GYT": "GYT", "JDT": "JDT", "AWST": "AWST", "UYST": "UYST", "MEZ": "MEZ", "CHADT": "CHADT", "OESZ": "OESZ", "GMT": "GMT", "TMT": "TMT", "LHST": "LHST", "NZST": "NZST", "ChST": "ChST", "CAT": "CAT", "AST": "AST", "WIB": "WIB", "ACWST": "ACWST", "COT": "COT", "WART": "WART", "SAST": "SAST", "WIT": "WIT", "EAT": "EAT", "ECT": "ECT", "HAT": "HAT", "NZDT": "NZDT", "OEZ": "OEZ", "PDT": "PDT", "CLST": "CLST", "AEST": "AEST", "EST": "EST", "IST": "IST", "ACDT": "ACDT"},
+ timezones: map[string]string{"OEZ": "OEZ", "WART": "WART", "HKT": "HKT", "ACWDT": "ACWDT", "MEZ": "MEZ", "WIB": "WIB", "ACDT": "ACDT", "SRT": "SRT", "MST": "MST", "BOT": "BOT", "IST": "IST", "MESZ": "MESZ", "CDT": "CDT", "GFT": "GFT", "SAST": "SAST", "WAST": "WAST", "WEZ": "WEZ", "AEDT": "AEDT", "EDT": "EDT", "CLST": "CLST", "AKDT": "AKDT", "PDT": "PDT", "HAST": "HAST", "CLT": "CLT", "ACWST": "ACWST", "AWST": "AWST", "PST": "PST", "ACST": "ACST", "VET": "VET", "ARST": "ARST", "HADT": "HADT", "LHST": "LHST", "WARST": "WARST", "ART": "ART", "EST": "EST", "NZST": "NZST", "EAT": "EAT", "HNT": "HNT", "ChST": "ChST", "CHADT": "CHADT", "ADT": "ADT", "∅∅∅": "∅∅∅", "TMST": "TMST", "COT": "COT", "COST": "COST", "GMT": "GMT", "MYT": "MYT", "HKST": "HKST", "WITA": "WITA", "WAT": "WAT", "WESZ": "WESZ", "MDT": "MDT", "NZDT": "NZDT", "AWDT": "AWDT", "JST": "JST", "HAT": "HAT", "CST": "CST", "UYT": "UYT", "JDT": "JDT", "TMT": "TMT", "OESZ": "OESZ", "GYT": "GYT", "UYST": "UYST", "CHAST": "CHAST", "ECT": "ECT", "SGT": "SGT", "WIT": "WIT", "LHDT": "LHDT", "AKST": "AKST", "CAT": "CAT", "AEST": "AEST", "BT": "BT", "AST": "AST"},
}
}
diff --git a/ksb/ksb_test.go b/ksb/ksb_test.go
new file mode 100644
index 00000000..7f8bff7b
--- /dev/null
+++ b/ksb/ksb_test.go
@@ -0,0 +1,1120 @@
+package ksb
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ksb"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ksb_TZ/ksb_TZ.go b/ksb_TZ/ksb_TZ.go
index aaf4fb2a..e64ee8bd 100644
--- a/ksb_TZ/ksb_TZ.go
+++ b/ksb_TZ/ksb_TZ.go
@@ -59,7 +59,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"KK", "BK"},
erasNarrow: []string{"", ""},
erasWide: []string{"Kabla ya Klisto", "Baada ya Klisto"},
- timezones: map[string]string{"AEST": "AEST", "EDT": "EDT", "SAST": "SAST", "UYT": "UYT", "SGT": "SGT", "HKST": "HKST", "PST": "PST", "AEDT": "AEDT", "ChST": "ChST", "LHST": "LHST", "COT": "COT", "WIB": "WIB", "IST": "IST", "ACDT": "ACDT", "JST": "JST", "CLST": "CLST", "MDT": "MDT", "CAT": "CAT", "OESZ": "OESZ", "GMT": "GMT", "ACST": "ACST", "WAST": "WAST", "HAT": "HAT", "TMST": "TMST", "WEZ": "WEZ", "ECT": "ECT", "WAT": "WAT", "SRT": "SRT", "CHADT": "CHADT", "HKT": "HKT", "WART": "WART", "EST": "EST", "EAT": "EAT", "TMT": "TMT", "AKST": "AKST", "PDT": "PDT", "AWST": "AWST", "WITA": "WITA", "ART": "ART", "CST": "CST", "ACWST": "ACWST", "MST": "MST", "∅∅∅": "∅∅∅", "HADT": "HADT", "GFT": "GFT", "GYT": "GYT", "MYT": "MYT", "NZDT": "NZDT", "VET": "VET", "WESZ": "WESZ", "AST": "AST", "BT": "BT", "LHDT": "LHDT", "CDT": "CDT", "MEZ": "MEZ", "MESZ": "MESZ", "ACWDT": "ACWDT", "HAST": "HAST", "AKDT": "AKDT", "ADT": "ADT", "ARST": "ARST", "BOT": "BOT", "CLT": "CLT", "COST": "COST", "HNT": "HNT", "AWDT": "AWDT", "NZST": "NZST", "OEZ": "OEZ", "UYST": "UYST", "CHAST": "CHAST", "WARST": "WARST", "WIT": "WIT", "JDT": "JDT"},
+ timezones: map[string]string{"VET": "VET", "JDT": "JDT", "SAST": "SAST", "ChST": "ChST", "BT": "BT", "CLST": "CLST", "PDT": "PDT", "HAST": "HAST", "HADT": "HADT", "UYST": "UYST", "MYT": "MYT", "ADT": "ADT", "TMT": "TMT", "WAT": "WAT", "WESZ": "WESZ", "AEDT": "AEDT", "CST": "CST", "OESZ": "OESZ", "WIT": "WIT", "ECT": "ECT", "AWDT": "AWDT", "∅∅∅": "∅∅∅", "WIB": "WIB", "HAT": "HAT", "COST": "COST", "SRT": "SRT", "WARST": "WARST", "GFT": "GFT", "AKST": "AKST", "MEZ": "MEZ", "WAST": "WAST", "GMT": "GMT", "ACDT": "ACDT", "WART": "WART", "CLT": "CLT", "MDT": "MDT", "AST": "AST", "AWST": "AWST", "NZST": "NZST", "OEZ": "OEZ", "AEST": "AEST", "ARST": "ARST", "WITA": "WITA", "COT": "COT", "UYT": "UYT", "HKT": "HKT", "EST": "EST", "EAT": "EAT", "CDT": "CDT", "CHADT": "CHADT", "AKDT": "AKDT", "ACWDT": "ACWDT", "TMST": "TMST", "HNT": "HNT", "EDT": "EDT", "SGT": "SGT", "NZDT": "NZDT", "PST": "PST", "LHST": "LHST", "LHDT": "LHDT", "MST": "MST", "CHAST": "CHAST", "IST": "IST", "HKST": "HKST", "ACWST": "ACWST", "BOT": "BOT", "GYT": "GYT", "JST": "JST", "ART": "ART", "MESZ": "MESZ", "WEZ": "WEZ", "ACST": "ACST", "CAT": "CAT"},
}
}
diff --git a/ksb_TZ/ksb_TZ_test.go b/ksb_TZ/ksb_TZ_test.go
new file mode 100644
index 00000000..748c939f
--- /dev/null
+++ b/ksb_TZ/ksb_TZ_test.go
@@ -0,0 +1,1120 @@
+package ksb_TZ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ksb_TZ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ksf/ksf.go b/ksf/ksf.go
index af6f8267..aa80c6b7 100644
--- a/ksf/ksf.go
+++ b/ksf/ksf.go
@@ -64,7 +64,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"d.Y.", "k.Y."},
erasNarrow: []string{"", ""},
erasWide: []string{"di Yɛ́sus aká yálɛ", "cámɛɛn kǝ kǝbɔpka Y"},
- timezones: map[string]string{"WART": "WART", "IST": "IST", "LHST": "LHST", "CST": "CST", "HAST": "HAST", "JDT": "JDT", "AKST": "AKST", "CLT": "CLT", "WESZ": "WESZ", "HKST": "HKST", "MESZ": "MESZ", "NZST": "NZST", "WEZ": "WEZ", "OEZ": "OEZ", "LHDT": "LHDT", "NZDT": "NZDT", "VET": "VET", "WAT": "WAT", "HNT": "HNT", "WIT": "WIT", "AWST": "AWST", "MST": "MST", "EST": "EST", "GMT": "GMT", "TMT": "TMT", "ACDT": "ACDT", "JST": "JST", "ChST": "ChST", "WIB": "WIB", "AEDT": "AEDT", "EDT": "EDT", "COT": "COT", "HKT": "HKT", "SAST": "SAST", "GYT": "GYT", "UYST": "UYST", "ACWST": "ACWST", "WITA": "WITA", "ACST": "ACST", "WARST": "WARST", "GFT": "GFT", "TMST": "TMST", "MYT": "MYT", "AWDT": "AWDT", "ADT": "ADT", "COST": "COST", "∅∅∅": "∅∅∅", "CDT": "CDT", "ACWDT": "ACWDT", "CLST": "CLST", "HADT": "HADT", "ARST": "ARST", "MDT": "MDT", "EAT": "EAT", "ECT": "ECT", "ART": "ART", "AKDT": "AKDT", "MEZ": "MEZ", "CHADT": "CHADT", "OESZ": "OESZ", "AST": "AST", "SGT": "SGT", "BT": "BT", "PST": "PST", "CHAST": "CHAST", "AEST": "AEST", "UYT": "UYT", "CAT": "CAT", "WAST": "WAST", "HAT": "HAT", "SRT": "SRT", "PDT": "PDT", "BOT": "BOT"},
+ timezones: map[string]string{"MESZ": "MESZ", "OEZ": "OEZ", "UYT": "UYT", "WART": "WART", "GFT": "GFT", "VET": "VET", "ARST": "ARST", "EDT": "EDT", "UYST": "UYST", "TMST": "TMST", "HAT": "HAT", "CLST": "CLST", "WIT": "WIT", "HKT": "HKT", "ADT": "ADT", "WESZ": "WESZ", "NZST": "NZST", "CAT": "CAT", "ART": "ART", "HAST": "HAST", "WAST": "WAST", "OESZ": "OESZ", "LHDT": "LHDT", "∅∅∅": "∅∅∅", "ACDT": "ACDT", "WAT": "WAT", "HNT": "HNT", "GMT": "GMT", "BT": "BT", "AWDT": "AWDT", "JST": "JST", "AKDT": "AKDT", "PST": "PST", "AEST": "AEST", "SRT": "SRT", "EST": "EST", "COST": "COST", "CLT": "CLT", "HADT": "HADT", "AEDT": "AEDT", "ChST": "ChST", "MYT": "MYT", "ECT": "ECT", "WITA": "WITA", "IST": "IST", "GYT": "GYT", "WIB": "WIB", "WARST": "WARST", "CST": "CST", "CDT": "CDT", "SGT": "SGT", "NZDT": "NZDT", "SAST": "SAST", "WEZ": "WEZ", "LHST": "LHST", "MEZ": "MEZ", "AST": "AST", "JDT": "JDT", "MDT": "MDT", "COT": "COT", "CHAST": "CHAST", "CHADT": "CHADT", "AKST": "AKST", "BOT": "BOT", "TMT": "TMT", "MST": "MST", "EAT": "EAT", "ACST": "ACST", "HKST": "HKST", "ACWST": "ACWST", "ACWDT": "ACWDT", "PDT": "PDT", "AWST": "AWST"},
}
}
@@ -120,7 +120,7 @@ func (ksf *ksf) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (ksf *ksf) MonthsNarrow() []string {
- return ksf.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/ksf/ksf_test.go b/ksf/ksf_test.go
new file mode 100644
index 00000000..73f743cf
--- /dev/null
+++ b/ksf/ksf_test.go
@@ -0,0 +1,1120 @@
+package ksf
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ksf"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ksf_CM/ksf_CM.go b/ksf_CM/ksf_CM.go
index 15f20956..6d00a20d 100644
--- a/ksf_CM/ksf_CM.go
+++ b/ksf_CM/ksf_CM.go
@@ -64,7 +64,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"d.Y.", "k.Y."},
erasNarrow: []string{"", ""},
erasWide: []string{"di Yɛ́sus aká yálɛ", "cámɛɛn kǝ kǝbɔpka Y"},
- timezones: map[string]string{"AKDT": "AKDT", "LHST": "LHST", "CST": "CST", "ChST": "ChST", "CHAST": "CHAST", "SAST": "SAST", "AWST": "AWST", "LHDT": "LHDT", "WAT": "WAT", "WARST": "WARST", "ART": "ART", "CDT": "CDT", "CHADT": "CHADT", "AST": "AST", "BT": "BT", "GMT": "GMT", "HNT": "HNT", "ACST": "ACST", "MYT": "MYT", "BOT": "BOT", "COST": "COST", "HADT": "HADT", "HAT": "HAT", "AEST": "AEST", "ADT": "ADT", "HKT": "HKT", "OEZ": "OEZ", "∅∅∅": "∅∅∅", "EDT": "EDT", "AKST": "AKST", "MESZ": "MESZ", "UYST": "UYST", "ACWST": "ACWST", "HKST": "HKST", "WART": "WART", "EAT": "EAT", "CLT": "CLT", "COT": "COT", "HAST": "HAST", "WIB": "WIB", "MST": "MST", "JDT": "JDT", "WAST": "WAST", "OESZ": "OESZ", "PDT": "PDT", "AWDT": "AWDT", "JST": "JST", "NZST": "NZST", "NZDT": "NZDT", "SGT": "SGT", "PST": "PST", "SRT": "SRT", "MEZ": "MEZ", "TMT": "TMT", "WEZ": "WEZ", "CLST": "CLST", "ECT": "ECT", "MDT": "MDT", "AEDT": "AEDT", "VET": "VET", "EST": "EST", "ACDT": "ACDT", "TMST": "TMST", "ACWDT": "ACWDT", "CAT": "CAT", "IST": "IST", "GFT": "GFT", "WITA": "WITA", "GYT": "GYT", "UYT": "UYT", "WESZ": "WESZ", "ARST": "ARST", "WIT": "WIT"},
+ timezones: map[string]string{"∅∅∅": "∅∅∅", "AST": "AST", "MESZ": "MESZ", "WESZ": "WESZ", "HNT": "HNT", "WIB": "WIB", "AEST": "AEST", "AEDT": "AEDT", "BT": "BT", "CLST": "CLST", "ACDT": "ACDT", "MDT": "MDT", "ECT": "ECT", "CHAST": "CHAST", "AKDT": "AKDT", "ACWST": "ACWST", "ART": "ART", "COST": "COST", "OEZ": "OEZ", "HAT": "HAT", "GYT": "GYT", "MYT": "MYT", "GMT": "GMT", "GFT": "GFT", "VET": "VET", "EST": "EST", "HAST": "HAST", "WART": "WART", "ARST": "ARST", "SGT": "SGT", "UYT": "UYT", "WIT": "WIT", "ACST": "ACST", "ACWDT": "ACWDT", "JST": "JST", "WAST": "WAST", "WITA": "WITA", "JDT": "JDT", "CAT": "CAT", "WEZ": "WEZ", "ChST": "ChST", "MST": "MST", "PST": "PST", "EAT": "EAT", "UYST": "UYST", "WARST": "WARST", "AKST": "AKST", "TMST": "TMST", "LHST": "LHST", "CLT": "CLT", "CST": "CST", "HKT": "HKT", "ADT": "ADT", "SAST": "SAST", "MEZ": "MEZ", "BOT": "BOT", "HKST": "HKST", "CHADT": "CHADT", "IST": "IST", "NZDT": "NZDT", "EDT": "EDT", "PDT": "PDT", "NZST": "NZST", "SRT": "SRT", "AWST": "AWST", "AWDT": "AWDT", "HADT": "HADT", "OESZ": "OESZ", "CDT": "CDT", "WAT": "WAT", "COT": "COT", "TMT": "TMT", "LHDT": "LHDT"},
}
}
@@ -120,7 +120,7 @@ func (ksf *ksf_CM) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (ksf *ksf_CM) MonthsNarrow() []string {
- return ksf.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/ksf_CM/ksf_CM_test.go b/ksf_CM/ksf_CM_test.go
new file mode 100644
index 00000000..147b772e
--- /dev/null
+++ b/ksf_CM/ksf_CM_test.go
@@ -0,0 +1,1120 @@
+package ksf_CM
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ksf_CM"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ksh/ksh.go b/ksh/ksh.go
index 29e54eba..40965a7c 100644
--- a/ksh/ksh.go
+++ b/ksh/ksh.go
@@ -72,7 +72,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"v. Chr.", "n. Chr."},
erasNarrow: []string{"vC", "nC"},
erasWide: []string{"vür Chrestus", "noh Chrestus"},
- timezones: map[string]string{"ACWST": "ACWST", "HAT": "HAT", "SRT": "SRT", "AKDT": "AKDT", "CDT": "CDT", "CLT": "CLT", "GFT": "GFT", "WITA": "WITA", "LHDT": "LHDT", "CAT": "Zentraal-Affrekaanesche Zigg", "EST": "EST", "ACST": "ACST", "NZST": "NZST", "AEST": "AEST", "HAST": "HAST", "WART": "WART", "HNT": "HNT", "LHST": "LHST", "EDT": "EDT", "WIT": "WIT", "MESZ": "Meddel-Europpa sing Summerzick", "AST": "AST", "COT": "COT", "HADT": "HADT", "SAST": "Söd-Affrekaanesche Zigg", "WAT": "Jewöhnlijje Wäß-Affrekaanesche Zigg", "GYT": "GYT", "PDT": "PDT", "NZDT": "NZDT", "AEDT": "AEDT", "SGT": "SGT", "HKST": "HKST", "∅∅∅": "∅∅∅", "JDT": "JDT", "WESZ": "Weß-Europpa sing Summerzick", "MST": "MST", "VET": "VET", "COST": "COST", "BOT": "BOT", "HKT": "HKT", "TMT": "TMT", "PST": "PST", "AWDT": "AWDT", "CHAST": "CHAST", "WAST": "Wäß-Affrekaanesche Sommerzigg", "ACDT": "ACDT", "JST": "JST", "AWST": "AWST", "ARST": "ARST", "CHADT": "CHADT", "WIB": "WIB", "GMT": "Greenwich sing Standat-Zick", "ART": "ART", "MYT": "MYT", "CLST": "CLST", "UYST": "UYST", "ECT": "ECT", "WARST": "WARST", "TMST": "TMST", "EAT": "Oß-Affrekaanesche Zigg", "MDT": "MDT", "WEZ": "Weß-Europpa sing jewöhnlijje Zick", "ADT": "ADT", "BT": "BT", "IST": "IST", "OESZ": "Oß-Europpa sing Summerzick", "MEZ": "Meddel-Europpa sing jewöhnlijje Zick", "CST": "CST", "ChST": "ChST", "ACWDT": "ACWDT", "OEZ": "Oß-Europpa sing jewöhnlijje Zick", "AKST": "AKST", "UYT": "UYT"},
+ timezones: map[string]string{"NZDT": "NZDT", "MESZ": "Meddel-Europpa sing Summerzick", "GMT": "Greenwich sing Standat-Zick", "CLST": "CLST", "WIT": "WIT", "ACST": "ACST", "JST": "JST", "NZST": "NZST", "MYT": "MYT", "GFT": "GFT", "MST": "MST", "AKDT": "AKDT", "ACWST": "ACWST", "SAST": "Söd-Affrekaanesche Zigg", "AEDT": "AEDT", "EAT": "Oß-Affrekaanesche Zigg", "SRT": "SRT", "COT": "COT", "CAT": "Zentraal-Affrekaanesche Zigg", "HNT": "HNT", "HAT": "HAT", "LHST": "LHST", "∅∅∅": "de Azore ier Summerzick", "AWST": "AWST", "WAST": "Wäß-Affrekaanesche Sommerzigg", "AST": "AST", "IST": "IST", "WEZ": "Weß-Europpa sing jewöhnlijje Zick", "LHDT": "LHDT", "CST": "CST", "HKST": "HKST", "WITA": "WITA", "CLT": "CLT", "HKT": "HKT", "WIB": "WIB", "TMST": "TMST", "ADT": "ADT", "COST": "COST", "OESZ": "Oß-Europpa sing Summerzick", "UYT": "UYT", "ACDT": "ACDT", "JDT": "JDT", "AKST": "AKST", "WESZ": "Weß-Europpa sing Summerzick", "OEZ": "Oß-Europpa sing jewöhnlijje Zick", "CHAST": "CHAST", "ACWDT": "ACWDT", "EST": "EST", "UYST": "UYST", "WART": "WART", "WAT": "Jewöhnlijje Wäß-Affrekaanesche Zigg", "SGT": "SGT", "AEST": "AEST", "GYT": "GYT", "MDT": "MDT", "HAST": "HAST", "HADT": "HADT", "PST": "PST", "BT": "BT", "CDT": "CDT", "WARST": "WARST", "ECT": "ECT", "ChST": "ChST", "AWDT": "AWDT", "BOT": "BOT", "EDT": "EDT", "CHADT": "CHADT", "VET": "VET", "TMT": "TMT", "MEZ": "Meddel-Europpa sing jewöhnlijje Zick", "ART": "ART", "ARST": "ARST", "PDT": "PDT"},
}
}
diff --git a/ksh/ksh_test.go b/ksh/ksh_test.go
new file mode 100644
index 00000000..611d1655
--- /dev/null
+++ b/ksh/ksh_test.go
@@ -0,0 +1,1120 @@
+package ksh
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ksh"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ksh_DE/ksh_DE.go b/ksh_DE/ksh_DE.go
index 4373b28c..3910c58a 100644
--- a/ksh_DE/ksh_DE.go
+++ b/ksh_DE/ksh_DE.go
@@ -72,7 +72,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"v. Chr.", "n. Chr."},
erasNarrow: []string{"vC", "nC"},
erasWide: []string{"vür Chrestus", "noh Chrestus"},
- timezones: map[string]string{"WESZ": "Weß-Europpa sing Summerzick", "EDT": "EDT", "WART": "WART", "ACST": "ACST", "SRT": "SRT", "CST": "CST", "CDT": "CDT", "COT": "COT", "ADT": "ADT", "OESZ": "Oß-Europpa sing Summerzick", "WIT": "WIT", "JDT": "JDT", "UYST": "UYST", "WEZ": "Weß-Europpa sing jewöhnlijje Zick", "∅∅∅": "∅∅∅", "HAST": "HAST", "IST": "IST", "EAT": "Oß-Affrekaanesche Zigg", "AST": "AST", "TMT": "TMT", "PDT": "PDT", "ART": "ART", "AKST": "AKST", "AWST": "AWST", "MESZ": "Meddel-Europpa sing Summerzick", "ACWDT": "ACWDT", "CAT": "Zentraal-Affrekaanesche Zigg", "PST": "PST", "ACWST": "ACWST", "BT": "BT", "HNT": "HNT", "UYT": "UYT", "ChST": "ChST", "MST": "MST", "CLST": "CLST", "WAST": "Wäß-Affrekaanesche Sommerzigg", "HAT": "HAT", "GYT": "GYT", "CHAST": "CHAST", "GFT": "GFT", "MEZ": "Meddel-Europpa sing jewöhnlijje Zick", "BOT": "BOT", "WAT": "Jewöhnlijje Wäß-Affrekaanesche Zigg", "WARST": "WARST", "AKDT": "AKDT", "AEST": "AEST", "MDT": "MDT", "SGT": "SGT", "HKT": "HKT", "HKST": "HKST", "GMT": "Greenwich sing Standat-Zick", "AWDT": "AWDT", "NZDT": "NZDT", "CHADT": "CHADT", "EST": "EST", "ECT": "ECT", "WITA": "WITA", "TMST": "TMST", "NZST": "NZST", "AEDT": "AEDT", "VET": "VET", "SAST": "Söd-Affrekaanesche Zigg", "ACDT": "ACDT", "ARST": "ARST", "MYT": "MYT", "JST": "JST", "CLT": "CLT", "HADT": "HADT", "OEZ": "Oß-Europpa sing jewöhnlijje Zick", "LHST": "LHST", "LHDT": "LHDT", "COST": "COST", "WIB": "WIB"},
+ timezones: map[string]string{"WIB": "WIB", "AEDT": "AEDT", "∅∅∅": "∅∅∅", "ACDT": "ACDT", "SAST": "Söd-Affrekaanesche Zigg", "CLST": "CLST", "UYST": "UYST", "CHADT": "CHADT", "AWDT": "AWDT", "MEZ": "Meddel-Europpa sing jewöhnlijje Zick", "EDT": "EDT", "GYT": "GYT", "OEZ": "Oß-Europpa sing jewöhnlijje Zick", "BT": "BT", "ACST": "ACST", "ART": "ART", "AKDT": "AKDT", "LHST": "LHST", "LHDT": "LHDT", "NZDT": "NZDT", "AEST": "AEST", "CDT": "CDT", "ACWDT": "ACWDT", "PST": "PST", "CAT": "Zentraal-Affrekaanesche Zigg", "MST": "MST", "HAST": "HAST", "BOT": "BOT", "WEZ": "Weß-Europpa sing jewöhnlijje Zick", "WARST": "WARST", "SRT": "SRT", "MDT": "MDT", "WART": "WART", "AKST": "AKST", "OESZ": "Oß-Europpa sing Summerzick", "GMT": "Greenwich sing Standat-Zick", "MYT": "MYT", "UYT": "UYT", "CLT": "CLT", "IST": "IST", "WESZ": "Weß-Europpa sing Summerzick", "HNT": "HNT", "HADT": "HADT", "TMT": "TMT", "HKST": "HKST", "CHAST": "CHAST", "ECT": "ECT", "JST": "JST", "WIT": "WIT", "CST": "CST", "WAST": "Wäß-Affrekaanesche Sommerzigg", "ChST": "ChST", "GFT": "GFT", "TMST": "TMST", "MESZ": "Meddel-Europpa sing Summerzick", "WAT": "Jewöhnlijje Wäß-Affrekaanesche Zigg", "ADT": "ADT", "AWST": "AWST", "EST": "EST", "PDT": "PDT", "WITA": "WITA", "AST": "AST", "ARST": "ARST", "JDT": "JDT", "ACWST": "ACWST", "SGT": "SGT", "HAT": "HAT", "EAT": "Oß-Affrekaanesche Zigg", "VET": "VET", "COT": "COT", "COST": "COST", "HKT": "HKT", "NZST": "NZST"},
}
}
diff --git a/ksh_DE/ksh_DE_test.go b/ksh_DE/ksh_DE_test.go
new file mode 100644
index 00000000..3ccccd76
--- /dev/null
+++ b/ksh_DE/ksh_DE_test.go
@@ -0,0 +1,1120 @@
+package ksh_DE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ksh_DE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/kw/kw.go b/kw/kw.go
index 6fae1afe..088affd6 100644
--- a/kw/kw.go
+++ b/kw/kw.go
@@ -57,7 +57,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"RC", "AD"},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"SGT": "SGT", "AKDT": "AKDT", "WEZ": "WEZ", "ACWST": "ACWST", "ChST": "ChST", "CLT": "CLT", "ECT": "ECT", "HAT": "HAT", "LHST": "LHST", "CDT": "CDT", "AEDT": "AEDT", "WART": "WART", "WIT": "WIT", "AWDT": "AWDT", "WESZ": "WESZ", "CLST": "CLST", "COT": "COT", "HNT": "HNT", "PST": "PST", "VET": "VET", "TMT": "TMT", "LHDT": "LHDT", "CST": "CST", "ACWDT": "ACWDT", "COST": "COST", "WARST": "WARST", "BOT": "BOT", "AST": "AST", "WIB": "WIB", "ARST": "ARST", "AWST": "AWST", "GYT": "GYT", "JST": "JST", "MEZ": "MEZ", "WAST": "WAST", "OEZ": "OEZ", "GFT": "GFT", "MYT": "MYT", "BT": "BT", "CAT": "CAT", "EAT": "EAT", "WITA": "WITA", "ACST": "ACST", "ACDT": "ACDT", "∅∅∅": "∅∅∅", "CHAST": "CHAST", "EST": "EST", "AKST": "AKST", "PDT": "PDT", "CHADT": "CHADT", "MDT": "MDT", "EDT": "EDT", "WAT": "WAT", "HKT": "HKT", "TMST": "TMST", "ADT": "ADT", "SAST": "SAST", "MST": "MST", "JDT": "JDT", "SRT": "SRT", "NZDT": "NZDT", "HAST": "HAST", "OESZ": "OESZ", "ART": "ART", "MESZ": "MESZ", "UYT": "UYT", "HKST": "HKST", "IST": "IST", "GMT": "GMT", "NZST": "NZST", "UYST": "UYST", "AEST": "AEST", "HADT": "HADT"},
+ timezones: map[string]string{"HKST": "HKST", "HAST": "HAST", "WAST": "WAST", "AEST": "AEST", "CHADT": "CHADT", "ECT": "ECT", "PDT": "PDT", "OEZ": "OEZ", "UYST": "UYST", "WITA": "WITA", "HAT": "HAT", "SGT": "SGT", "OESZ": "OESZ", "LHST": "LHST", "LHDT": "LHDT", "HKT": "HKT", "HADT": "HADT", "SAST": "SAST", "GMT": "GMT", "MYT": "MYT", "CDT": "CDT", "JST": "JST", "JDT": "JDT", "ACWST": "ACWST", "NZST": "NZST", "IST": "IST", "WEZ": "WEZ", "UYT": "UYT", "CST": "CST", "ACDT": "ACDT", "SRT": "SRT", "∅∅∅": "∅∅∅", "AST": "AST", "ChST": "ChST", "CHAST": "CHAST", "AKDT": "AKDT", "BOT": "BOT", "EDT": "EDT", "CLST": "CLST", "WART": "WART", "WARST": "WARST", "ARST": "ARST", "WAT": "WAT", "EAT": "EAT", "AKST": "AKST", "AWST": "AWST", "COST": "COST", "ACST": "ACST", "ADT": "ADT", "COT": "COT", "MST": "MST", "AEDT": "AEDT", "TMST": "TMST", "VET": "VET", "ACWDT": "ACWDT", "MEZ": "MEZ", "CAT": "CAT", "WESZ": "WESZ", "CLT": "CLT", "WIT": "WIT", "BT": "BT", "GFT": "GFT", "PST": "PST", "WIB": "WIB", "GYT": "GYT", "ART": "ART", "NZDT": "NZDT", "TMT": "TMT", "MESZ": "MESZ", "HNT": "HNT", "MDT": "MDT", "AWDT": "AWDT", "EST": "EST"},
}
}
@@ -122,7 +122,7 @@ func (kw *kw) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (kw *kw) MonthsNarrow() []string {
- return kw.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/kw/kw_test.go b/kw/kw_test.go
new file mode 100644
index 00000000..f941244c
--- /dev/null
+++ b/kw/kw_test.go
@@ -0,0 +1,1120 @@
+package kw
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "kw"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/kw_GB/kw_GB.go b/kw_GB/kw_GB.go
index d50d9463..7c0ebe03 100644
--- a/kw_GB/kw_GB.go
+++ b/kw_GB/kw_GB.go
@@ -57,7 +57,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"RC", "AD"},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"MST": "MST", "OEZ": "OEZ", "AEST": "AEST", "OESZ": "OESZ", "ACST": "ACST", "LHDT": "LHDT", "MDT": "MDT", "HKST": "HKST", "LHST": "LHST", "GYT": "GYT", "MEZ": "MEZ", "CST": "CST", "ChST": "ChST", "BT": "BT", "NZDT": "NZDT", "UYT": "UYT", "CHAST": "CHAST", "EDT": "EDT", "∅∅∅": "∅∅∅", "CAT": "CAT", "HAST": "HAST", "SGT": "SGT", "WARST": "WARST", "MYT": "MYT", "ACWST": "ACWST", "WIB": "WIB", "PDT": "PDT", "SRT": "SRT", "VET": "VET", "TMT": "TMT", "WART": "WART", "WAST": "WAST", "HKT": "HKT", "GMT": "GMT", "TMST": "TMST", "AWST": "AWST", "AKDT": "AKDT", "NZST": "NZST", "WEZ": "WEZ", "WESZ": "WESZ", "ADT": "ADT", "WIT": "WIT", "IST": "IST", "CLT": "CLT", "HAT": "HAT", "ART": "ART", "AWDT": "AWDT", "JST": "JST", "CLST": "CLST", "AKST": "AKST", "MESZ": "MESZ", "CHADT": "CHADT", "COT": "COT", "HADT": "HADT", "WAT": "WAT", "ACDT": "ACDT", "UYST": "UYST", "CDT": "CDT", "AEDT": "AEDT", "EST": "EST", "BOT": "BOT", "ACWDT": "ACWDT", "ARST": "ARST", "WITA": "WITA", "ECT": "ECT", "AST": "AST", "SAST": "SAST", "EAT": "EAT", "COST": "COST", "GFT": "GFT", "PST": "PST", "JDT": "JDT", "HNT": "HNT"},
+ timezones: map[string]string{"EDT": "EDT", "MEZ": "MEZ", "CST": "CST", "WITA": "WITA", "COT": "COT", "WIB": "WIB", "LHST": "LHST", "CLT": "CLT", "ACDT": "ACDT", "WESZ": "WESZ", "AEST": "AEST", "MST": "MST", "MDT": "MDT", "CDT": "CDT", "AEDT": "AEDT", "ADT": "ADT", "COST": "COST", "WAST": "WAST", "GFT": "GFT", "ACWST": "ACWST", "HADT": "HADT", "ACWDT": "ACWDT", "AKDT": "AKDT", "JDT": "JDT", "AKST": "AKST", "SGT": "SGT", "CHADT": "CHADT", "HKST": "HKST", "PST": "PST", "HAT": "HAT", "TMT": "TMT", "∅∅∅": "∅∅∅", "HKT": "HKT", "AWST": "AWST", "ART": "ART", "JST": "JST", "LHDT": "LHDT", "UYT": "UYT", "ACST": "ACST", "AWDT": "AWDT", "EST": "EST", "IST": "IST", "WAT": "WAT", "WIT": "WIT", "SRT": "SRT", "ECT": "ECT", "GYT": "GYT", "GMT": "GMT", "CLST": "CLST", "EAT": "EAT", "OESZ": "OESZ", "BT": "BT", "ARST": "ARST", "HNT": "HNT", "CAT": "CAT", "UYST": "UYST", "WEZ": "WEZ", "ChST": "ChST", "NZST": "NZST", "BOT": "BOT", "PDT": "PDT", "MESZ": "MESZ", "HAST": "HAST", "SAST": "SAST", "MYT": "MYT", "WARST": "WARST", "VET": "VET", "AST": "AST", "NZDT": "NZDT", "TMST": "TMST", "OEZ": "OEZ", "WART": "WART", "CHAST": "CHAST"},
}
}
@@ -122,7 +122,7 @@ func (kw *kw_GB) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (kw *kw_GB) MonthsNarrow() []string {
- return kw.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/kw_GB/kw_GB_test.go b/kw_GB/kw_GB_test.go
new file mode 100644
index 00000000..d95f1648
--- /dev/null
+++ b/kw_GB/kw_GB_test.go
@@ -0,0 +1,1120 @@
+package kw_GB
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "kw_GB"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ky/ky.go b/ky/ky.go
index c13a861f..9ac9eb08 100644
--- a/ky/ky.go
+++ b/ky/ky.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"б.з.ч.", "б.з."},
erasNarrow: []string{"б.з.ч.", "б.з."},
erasWide: []string{"биздин заманга чейин", "биздин заман"},
- timezones: map[string]string{"WIT": "Чыгыш Индонезия убактысы", "IST": "Индия убактысы", "AKST": "Аляска стандарт убактысы", "ACWDT": "Австралия борбордук чыгыш күндүзгү убактысы", "HNT": "Нюфаундлэнд стандарт убактысы", "GFT": "Француз Гвиана убактысы", "MDT": "MDT", "COT": "Колумбия стандарт убактысы", "SGT": "Сингапур убактысы", "MEZ": "Борбордук Европа стандарт убактысы", "NZDT": "Жаңы Зеландия күндүзгү убактысы", "WAST": "Батыш Африка жайкы убактысы", "WART": "Батыш Аргентина стандарт убактысы", "CAT": "Борбордук Африка убактысы", "AST": "Атлантика стандарт убактысы", "HADT": "Гавайи-Алеут жайкы убактысы", "ACST": "Австралия борбордук стандарт убактысы", "LHDT": "Лорд Хау күндүзгү убактысы", "VET": "Венесуэла убактысы", "ACWST": "Австралия борбордук батыш стандарт убактысы", "ChST": "Чаморро убактысы", "WIB": "Батыш Индонезия убактысы", "ACDT": "Австралия борбордук күндүзгү убактысы", "AWDT": "Австралия батыш күндүзгү убактысы", "TMT": "Түркмөнстан стандарт убактысы", "MYT": "Малайзия убактысы", "JST": "Жапан стандарт убактысы", "UYST": "Уругвай жайкы убактысы", "COST": "Колумбия жайкы убактысы", "MST": "MST", "MESZ": "Борбордук Европа жайкы убактысы", "CHADT": "Чатам күндүзгү убактысы", "WARST": "Батыш Аргентина жайкы убактысы", "EST": "Түндүк Америка, чыгыш стандарт убактысы", "HKT": "Гонконг стандарт убактысы", "OEZ": "Чыгыш Европа стандарт убактысы", "EAT": "Чыгыш Африка убактысы", "ART": "Аргентина стандарт убактысы", "AWST": "Австралия батыш стандарт убактысы", "CLST": "Чили жайкы убактысы", "TMST": "Түркмөнстан жайкы убактысы", "CLT": "Чили стандарт убактысы", "WAT": "Батыш Африка стандарт убактысы", "JDT": "Жапан күндүзгү убактысы", "ADT": "Атлантика жайкы убактысы", "∅∅∅": "Амазон жайкы убактысы", "PDT": "Түндүк Америка, Тынч океан жайкы убактысы", "WESZ": "Батыш Европа жайкы убактысы", "AEDT": "Австралия чыгыш күндүзгү убактысы", "GYT": "Гвиана убактысы", "CDT": "Түндүк Америка, борбордук жайкы убактысы", "CHAST": "Чатам стандарт убактысы", "ECT": "Экуадор убактысы", "BT": "Бутан убактысы", "EDT": "Түндүк Америка, чыгыш жайкы убактысы", "WITA": "Борбордук Индонезия убактысы", "OESZ": "Чыгыш Европа жайкы убактысы", "CST": "Түндүк Америка, борбордук стандарт убактысы", "NZST": "Жаӊы Зеландия стандарт убактысы", "UYT": "Уругвай стандарт убактысы", "PST": "Түндүк Америка, Тынч океан стандарт убактысы", "SAST": "Түштүк Африка убактысы", "AKDT": "Аляска жайкы убактысы", "BOT": "Боливия убактысы", "WEZ": "Батыш Европа стандарт убактысы", "HKST": "Гонконг жайкы убактысы", "AEST": "Австралия чыгыш стандарт убактысы", "HAST": "Гавайи-Алеут стандарт убактысы", "GMT": "Гринвич универсалдуу убактысы", "HAT": "Нюфаундлэнд жайкы убактысы", "ARST": "Аргентина жайкы убактысы", "SRT": "Суринаме убактысы", "LHST": "Лорд Хау стандарт убактысы"},
+ timezones: map[string]string{"OESZ": "Чыгыш Европа жайкы убактысы", "AEST": "Австралия чыгыш стандарт убактысы", "UYT": "Уругвай стандарт убактысы", "AKST": "Аляска стандарт убактысы", "∅∅∅": "Амазон жайкы убактысы", "SRT": "Суринаме убактысы", "AKDT": "Аляска жайкы убактысы", "ART": "Аргентина стандарт убактысы", "HADT": "Гавайи-Алеут жайкы убактысы", "TMST": "Түркмөнстан жайкы убактысы", "MDT": "Түндүк Америка, тоо жайкы убактысы", "CHADT": "Чатам күндүзгү убактысы", "JDT": "Жапан күндүзгү убактысы", "PDT": "Түндүк Америка, Тынч океан жайкы убактысы", "AEDT": "Австралия чыгыш күндүзгү убактысы", "SAST": "Түштүк Африка убактысы", "NZDT": "Жаңы Зеландия күндүзгү убактысы", "WAST": "Батыш Африка жайкы убактысы", "MEZ": "Борбордук Европа стандарт убактысы", "NZST": "Жаӊы Зеландия стандарт убактысы", "BOT": "Боливия убактысы", "WIB": "Батыш Индонезия убактысы", "OEZ": "Чыгыш Европа стандарт убактысы", "EAT": "Чыгыш Африка убактысы", "UYST": "Уругвай жайкы убактысы", "WIT": "Чыгыш Индонезия убактысы", "GFT": "Француз Гвиана убактысы", "IST": "Индия убактысы", "GMT": "Гринвич универсалдуу убактысы", "HKT": "Гонконг стандарт убактысы", "VET": "Венесуэла убактысы", "ACWST": "Австралия борбордук батыш стандарт убактысы", "ACWDT": "Австралия борбордук чыгыш күндүзгү убактысы", "PST": "Түндүк Америка, Тынч океан стандарт убактысы", "HAST": "Гавайи-Алеут стандарт убактысы", "CLST": "Чили жайкы убактысы", "HKST": "Гонконг жайкы убактысы", "AWST": "Австралия батыш стандарт убактысы", "WITA": "Борбордук Индонезия убактысы", "AWDT": "Австралия батыш күндүзгү убактысы", "JST": "Жапан стандарт убактысы", "WESZ": "Батыш Европа жайкы убактысы", "HAT": "Нюфаундлэнд жайкы убактысы", "COST": "Колумбия жайкы убактысы", "TMT": "Түркмөнстан стандарт убактысы", "CLT": "Чили стандарт убактысы", "ACDT": "Австралия борбордук күндүзгү убактысы", "ECT": "Экуадор убактысы", "AST": "Атлантика стандарт убактысы", "ADT": "Атлантика жайкы убактысы", "EDT": "Түндүк Америка, чыгыш жайкы убактысы", "MESZ": "Борбордук Европа жайкы убактысы", "SGT": "Сингапур убактысы", "COT": "Колумбия стандарт убактысы", "BT": "Бутан убактысы", "LHDT": "Лорд Хау күндүзгү убактысы", "MST": "Түндүк Америка, тоо стандарт убактысы", "WAT": "Батыш Африка стандарт убактысы", "HNT": "Нюфаундлэнд стандарт убактысы", "ChST": "Чаморро убактысы", "LHST": "Лорд Хау стандарт убактысы", "MYT": "Малайзия убактысы", "ACST": "Австралия борбордук стандарт убактысы", "WART": "Батыш Аргентина стандарт убактысы", "EST": "Түндүк Америка, чыгыш стандарт убактысы", "CAT": "Борбордук Африка убактысы", "WEZ": "Батыш Европа стандарт убактысы", "CST": "Түндүк Америка, борбордук стандарт убактысы", "CDT": "Түндүк Америка, борбордук жайкы убактысы", "GYT": "Гвиана убактысы", "WARST": "Батыш Аргентина жайкы убактысы", "CHAST": "Чатам стандарт убактысы", "ARST": "Аргентина жайкы убактысы"},
}
}
diff --git a/ky/ky_test.go b/ky/ky_test.go
new file mode 100644
index 00000000..53aa700c
--- /dev/null
+++ b/ky/ky_test.go
@@ -0,0 +1,1120 @@
+package ky
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ky"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ky_KG/ky_KG.go b/ky_KG/ky_KG.go
index bf532cff..aa185a4d 100644
--- a/ky_KG/ky_KG.go
+++ b/ky_KG/ky_KG.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"б.з.ч.", "б.з."},
erasNarrow: []string{"б.з.ч.", "б.з."},
erasWide: []string{"биздин заманга чейин", "биздин заман"},
- timezones: map[string]string{"LHST": "Лорд Хау стандарт убактысы", "HAST": "Гавайи-Алеут стандарт убактысы", "PST": "Түндүк Америка, Тынч океан стандарт убактысы", "CDT": "Түндүк Америка, борбордук жайкы убактысы", "SGT": "Сингапур убактысы", "WART": "Батыш Аргентина стандарт убактысы", "GMT": "Гринвич универсалдуу убактысы", "WITA": "Борбордук Индонезия убактысы", "MDT": "MDT", "TMST": "Түркмөнстан жайкы убактысы", "GYT": "Гвиана убактысы", "JDT": "Жапан күндүзгү убактысы", "WESZ": "Батыш Европа жайкы убактысы", "AST": "Атлантика стандарт убактысы", "WAT": "Батыш Африка стандарт убактысы", "NZST": "Жаӊы Зеландия стандарт убактысы", "UYT": "Уругвай стандарт убактысы", "CAT": "Борбордук Африка убактысы", "EST": "Түндүк Америка, чыгыш стандарт убактысы", "SAST": "Түштүк Африка убактысы", "HNT": "Нюфаундлэнд стандарт убактысы", "MST": "MST", "ART": "Аргентина стандарт убактысы", "ECT": "Экуадор убактысы", "ACST": "Австралия борбордук стандарт убактысы", "∅∅∅": "Амазон жайкы убактысы", "AWST": "Австралия батыш стандарт убактысы", "CHAST": "Чатам стандарт убактысы", "BT": "Бутан убактысы", "OESZ": "Чыгыш Европа жайкы убактысы", "AKST": "Аляска стандарт убактысы", "CST": "Түндүк Америка, борбордук стандарт убактысы", "ADT": "Атлантика жайкы убактысы", "WAST": "Батыш Африка жайкы убактысы", "EAT": "Чыгыш Африка убактысы", "LHDT": "Лорд Хау күндүзгү убактысы", "NZDT": "Жаңы Зеландия күндүзгү убактысы", "AEDT": "Австралия чыгыш күндүзгү убактысы", "ACDT": "Австралия борбордук күндүзгү убактысы", "SRT": "Суринаме убактысы", "BOT": "Боливия убактысы", "UYST": "Уругвай жайкы убактысы", "AEST": "Австралия чыгыш стандарт убактысы", "OEZ": "Чыгыш Европа стандарт убактысы", "AKDT": "Аляска жайкы убактысы", "AWDT": "Австралия батыш күндүзгү убактысы", "JST": "Жапан стандарт убактысы", "ACWDT": "Австралия борбордук чыгыш күндүзгү убактысы", "CLST": "Чили жайкы убактысы", "HADT": "Гавайи-Алеут жайкы убактысы", "HKST": "Гонконг жайкы убактысы", "IST": "Индия убактысы", "HAT": "Нюфаундлэнд жайкы убактысы", "WIB": "Батыш Индонезия убактысы", "WEZ": "Батыш Европа стандарт убактысы", "ChST": "Чаморро убактысы", "CHADT": "Чатам күндүзгү убактысы", "GFT": "Француз Гвиана убактысы", "ARST": "Аргентина жайкы убактысы", "PDT": "Түндүк Америка, Тынч океан жайкы убактысы", "MEZ": "Борбордук Европа стандарт убактысы", "MESZ": "Борбордук Европа жайкы убактысы", "ACWST": "Австралия борбордук батыш стандарт убактысы", "VET": "Венесуэла убактысы", "EDT": "Түндүк Америка, чыгыш жайкы убактысы", "COST": "Колумбия жайкы убактысы", "HKT": "Гонконг стандарт убактысы", "WARST": "Батыш Аргентина жайкы убактысы", "TMT": "Түркмөнстан стандарт убактысы", "CLT": "Чили стандарт убактысы", "COT": "Колумбия стандарт убактысы", "WIT": "Чыгыш Индонезия убактысы", "MYT": "Малайзия убактысы"},
+ timezones: map[string]string{"WARST": "Батыш Аргентина жайкы убактысы", "HKT": "Гонконг стандарт убактысы", "WIT": "Чыгыш Индонезия убактысы", "∅∅∅": "Бразилия жайкы убактысы", "GFT": "Француз Гвиана убактысы", "HKST": "Гонконг жайкы убактысы", "ADT": "Атлантика жайкы убактысы", "MST": "Түндүк Америка, тоо стандарт убактысы", "WITA": "Борбордук Индонезия убактысы", "COT": "Колумбия стандарт убактысы", "WIB": "Батыш Индонезия убактысы", "TMST": "Түркмөнстан жайкы убактысы", "EST": "Түндүк Америка, чыгыш стандарт убактысы", "CDT": "Түндүк Америка, борбордук жайкы убактысы", "WART": "Батыш Аргентина стандарт убактысы", "WAST": "Батыш Африка жайкы убактысы", "WESZ": "Батыш Европа жайкы убактысы", "HAT": "Нюфаундлэнд жайкы убактысы", "JDT": "Жапан күндүзгү убактысы", "HADT": "Гавайи-Алеут жайкы убактысы", "BOT": "Боливия убактысы", "OEZ": "Чыгыш Европа стандарт убактысы", "GMT": "Гринвич универсалдуу убактысы", "UYT": "Уругвай стандарт убактысы", "ACDT": "Австралия борбордук күндүзгү убактысы", "VET": "Венесуэла убактысы", "SAST": "Түштүк Африка убактысы", "CST": "Түндүк Америка, борбордук стандарт убактысы", "SRT": "Суринаме убактысы", "MEZ": "Борбордук Европа стандарт убактысы", "COST": "Колумбия жайкы убактысы", "TMT": "Түркмөнстан стандарт убактысы", "CAT": "Борбордук Африка убактысы", "ACST": "Австралия борбордук стандарт убактысы", "CHADT": "Чатам күндүзгү убактысы", "AST": "Атлантика стандарт убактысы", "HAST": "Гавайи-Алеут стандарт убактысы", "MESZ": "Борбордук Европа жайкы убактысы", "WAT": "Батыш Африка стандарт убактысы", "ChST": "Чаморро убактысы", "ECT": "Экуадор убактысы", "ACWST": "Австралия борбордук батыш стандарт убактысы", "ART": "Аргентина стандарт убактысы", "PDT": "Түндүк Америка, Тынч океан жайкы убактысы", "AEDT": "Австралия чыгыш күндүзгү убактысы", "UYST": "Уругвай жайкы убактысы", "AKDT": "Аляска жайкы убактысы", "NZDT": "Жаңы Зеландия күндүзгү убактысы", "PST": "Түндүк Америка, Тынч океан стандарт убактысы", "BT": "Бутан убактысы", "MDT": "Түндүк Америка, тоо жайкы убактысы", "JST": "Жапан стандарт убактысы", "AWDT": "Австралия батыш күндүзгү убактысы", "WEZ": "Батыш Европа стандарт убактысы", "EAT": "Чыгыш Африка убактысы", "ACWDT": "Австралия борбордук чыгыш күндүзгү убактысы", "AWST": "Австралия батыш стандарт убактысы", "ARST": "Аргентина жайкы убактысы", "IST": "Индия убактысы", "LHST": "Лорд Хау стандарт убактысы", "LHDT": "Лорд Хау күндүзгү убактысы", "MYT": "Малайзия убактысы", "CLST": "Чили жайкы убактысы", "SGT": "Сингапур убактысы", "AEST": "Австралия чыгыш стандарт убактысы", "CHAST": "Чатам стандарт убактысы", "AKST": "Аляска стандарт убактысы", "NZST": "Жаӊы Зеландия стандарт убактысы", "HNT": "Нюфаундлэнд стандарт убактысы", "OESZ": "Чыгыш Европа жайкы убактысы", "GYT": "Гвиана убактысы", "CLT": "Чили стандарт убактысы", "EDT": "Түндүк Америка, чыгыш жайкы убактысы"},
}
}
diff --git a/ky_KG/ky_KG_test.go b/ky_KG/ky_KG_test.go
new file mode 100644
index 00000000..a63a107c
--- /dev/null
+++ b/ky_KG/ky_KG_test.go
@@ -0,0 +1,1120 @@
+package ky_KG
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ky_KG"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/lag/lag.go b/lag/lag.go
index 2647a5b9..87cbf2cc 100644
--- a/lag/lag.go
+++ b/lag/lag.go
@@ -67,7 +67,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"KSA", "KA"},
erasNarrow: []string{"", ""},
erasWide: []string{"Kɨrɨsitʉ sɨ anavyaal", "Kɨrɨsitʉ akavyaalwe"},
- timezones: map[string]string{"TMT": "TMT", "EAT": "EAT", "MST": "MST", "SAST": "SAST", "HAT": "HAT", "ChST": "ChST", "MEZ": "MEZ", "PDT": "PDT", "BOT": "BOT", "SGT": "SGT", "AKST": "AKST", "AWST": "AWST", "MYT": "MYT", "AEDT": "AEDT", "CAT": "CAT", "HKT": "HKT", "WIB": "WIB", "IST": "IST", "NZST": "NZST", "WAT": "WAT", "WITA": "WITA", "CLT": "CLT", "VET": "VET", "NZDT": "NZDT", "CDT": "CDT", "AWDT": "AWDT", "LHST": "LHST", "ECT": "ECT", "WART": "WART", "JST": "JST", "AKDT": "AKDT", "WARST": "WARST", "MDT": "MDT", "HAST": "HAST", "HADT": "HADT", "BT": "BT", "HNT": "HNT", "TMST": "TMST", "SRT": "SRT", "∅∅∅": "∅∅∅", "ADT": "ADT", "PST": "PST", "MESZ": "MESZ", "CHAST": "CHAST", "EST": "EST", "ARST": "ARST", "WEZ": "WEZ", "ACWDT": "ACWDT", "GMT": "GMT", "CST": "CST", "ART": "ART", "CHADT": "CHADT", "CLST": "CLST", "ACWST": "ACWST", "ACST": "ACST", "ACDT": "ACDT", "WAST": "WAST", "OESZ": "OESZ", "LHDT": "LHDT", "GYT": "GYT", "JDT": "JDT", "AEST": "AEST", "COT": "COT", "COST": "COST", "OEZ": "OEZ", "AST": "AST", "GFT": "GFT", "WIT": "WIT", "UYT": "UYT", "UYST": "UYST", "WESZ": "WESZ", "EDT": "EDT", "HKST": "HKST"},
+ timezones: map[string]string{"GFT": "GFT", "HKST": "HKST", "GYT": "GYT", "TMST": "TMST", "WIB": "WIB", "OESZ": "OESZ", "BT": "BT", "CLT": "CLT", "ACDT": "ACDT", "ACWDT": "ACWDT", "IST": "IST", "AEST": "AEST", "LHDT": "LHDT", "CLST": "CLST", "ACST": "ACST", "JDT": "JDT", "BOT": "BOT", "SAST": "SAST", "AEDT": "AEDT", "CHADT": "CHADT", "ARST": "ARST", "PST": "PST", "WAT": "WAT", "HAT": "HAT", "SRT": "SRT", "AWDT": "AWDT", "MESZ": "MESZ", "HNT": "HNT", "NZDT": "NZDT", "UYT": "UYT", "WARST": "WARST", "HKT": "HKT", "VET": "VET", "AKDT": "AKDT", "JST": "JST", "HAST": "HAST", "MDT": "MDT", "ECT": "ECT", "AST": "AST", "ART": "ART", "EST": "EST", "AKST": "AKST", "PDT": "PDT", "EAT": "EAT", "CST": "CST", "TMT": "TMT", "SGT": "SGT", "MYT": "MYT", "CHAST": "CHAST", "COST": "COST", "CDT": "CDT", "ACWST": "ACWST", "GMT": "GMT", "LHST": "LHST", "WEZ": "WEZ", "MST": "MST", "ADT": "ADT", "WITA": "WITA", "MEZ": "MEZ", "CAT": "CAT", "HADT": "HADT", "NZST": "NZST", "WIT": "WIT", "UYST": "UYST", "WART": "WART", "AWST": "AWST", "EDT": "EDT", "WESZ": "WESZ", "∅∅∅": "∅∅∅", "WAST": "WAST", "COT": "COT", "OEZ": "OEZ", "ChST": "ChST"},
}
}
diff --git a/lag/lag_test.go b/lag/lag_test.go
new file mode 100644
index 00000000..5c1e38ba
--- /dev/null
+++ b/lag/lag_test.go
@@ -0,0 +1,1120 @@
+package lag
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "lag"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/lag_TZ/lag_TZ.go b/lag_TZ/lag_TZ.go
index d72186d3..fc0af307 100644
--- a/lag_TZ/lag_TZ.go
+++ b/lag_TZ/lag_TZ.go
@@ -67,7 +67,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"KSA", "KA"},
erasNarrow: []string{"", ""},
erasWide: []string{"Kɨrɨsitʉ sɨ anavyaal", "Kɨrɨsitʉ akavyaalwe"},
- timezones: map[string]string{"AEST": "AEST", "ChST": "ChST", "WIT": "WIT", "TMT": "TMT", "AKST": "AKST", "PST": "PST", "SGT": "SGT", "JST": "JST", "CLST": "CLST", "AEDT": "AEDT", "ACWDT": "ACWDT", "WART": "WART", "GYT": "GYT", "SRT": "SRT", "CHAST": "CHAST", "ADT": "ADT", "UYST": "UYST", "EDT": "EDT", "WAST": "WAST", "BT": "BT", "LHDT": "LHDT", "HAST": "HAST", "GFT": "GFT", "MST": "MST", "MDT": "MDT", "CST": "CST", "CLT": "CLT", "VET": "VET", "WESZ": "WESZ", "CAT": "CAT", "SAST": "SAST", "WAT": "WAT", "AWST": "AWST", "∅∅∅": "∅∅∅", "MEZ": "MEZ", "ARST": "ARST", "AKDT": "AKDT", "PDT": "PDT", "CDT": "CDT", "WITA": "WITA", "HNT": "HNT", "TMST": "TMST", "EAT": "EAT", "NZDT": "NZDT", "CHADT": "CHADT", "WARST": "WARST", "UYT": "UYT", "ACWST": "ACWST", "COST": "COST", "HKT": "HKT", "HAT": "HAT", "COT": "COT", "ECT": "ECT", "AST": "AST", "HADT": "HADT", "WIB": "WIB", "ART": "ART", "NZST": "NZST", "BOT": "BOT", "HKST": "HKST", "OEZ": "OEZ", "ACDT": "ACDT", "LHST": "LHST", "JDT": "JDT", "AWDT": "AWDT", "WEZ": "WEZ", "EST": "EST", "IST": "IST", "GMT": "GMT", "MYT": "MYT", "OESZ": "OESZ", "ACST": "ACST", "MESZ": "MESZ"},
+ timezones: map[string]string{"SAST": "SAST", "TMT": "TMT", "CAT": "CAT", "BT": "BT", "AWDT": "AWDT", "NZDT": "NZDT", "EST": "EST", "MYT": "MYT", "WARST": "WARST", "JDT": "JDT", "WEZ": "WEZ", "WIT": "WIT", "AKST": "AKST", "WART": "WART", "VET": "VET", "CHAST": "CHAST", "CHADT": "CHADT", "JST": "JST", "WESZ": "WESZ", "CLT": "CLT", "GYT": "GYT", "CST": "CST", "SRT": "SRT", "GFT": "GFT", "ECT": "ECT", "ADT": "ADT", "AWST": "AWST", "NZST": "NZST", "GMT": "GMT", "AEST": "AEST", "HKST": "HKST", "TMST": "TMST", "HNT": "HNT", "OEZ": "OEZ", "SGT": "SGT", "EAT": "EAT", "MDT": "MDT", "WAST": "WAST", "HAT": "HAT", "AEDT": "AEDT", "ART": "ART", "∅∅∅": "∅∅∅", "COST": "COST", "LHDT": "LHDT", "ACST": "ACST", "AST": "AST", "ACWST": "ACWST", "LHST": "LHST", "WIB": "WIB", "AKDT": "AKDT", "ARST": "ARST", "EDT": "EDT", "PDT": "PDT", "MEZ": "MEZ", "COT": "COT", "UYT": "UYT", "CDT": "CDT", "WITA": "WITA", "HAST": "HAST", "HADT": "HADT", "ACDT": "ACDT", "PST": "PST", "WAT": "WAT", "UYST": "UYST", "OESZ": "OESZ", "ChST": "ChST", "CLST": "CLST", "MESZ": "MESZ", "MST": "MST", "HKT": "HKT", "ACWDT": "ACWDT", "BOT": "BOT", "IST": "IST"},
}
}
diff --git a/lag_TZ/lag_TZ_test.go b/lag_TZ/lag_TZ_test.go
new file mode 100644
index 00000000..df20ccc5
--- /dev/null
+++ b/lag_TZ/lag_TZ_test.go
@@ -0,0 +1,1120 @@
+package lag_TZ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "lag_TZ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/lb/lb.go b/lb/lb.go
index e04c85fc..6f43caca 100644
--- a/lb/lb.go
+++ b/lb/lb.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"v. Chr.", "n. Chr."},
erasNarrow: []string{"", ""},
erasWide: []string{"v. Chr.", "n. Chr."},
- timezones: map[string]string{"WIB": "Westindonesesch Zäit", "EAT": "Ostafrikanesch Zäit", "∅∅∅": "Amazonas-Summerzäit", "JDT": "Japanesch Summerzäit", "WARST": "Westargentinesch Summerzäit", "WESZ": "Westeuropäesch Summerzäit", "HKT": "Hong-Kong-Normalzäit", "EST": "Nordamerikanesch Ostküsten-Normalzäit", "EDT": "Nordamerikanesch Ostküsten-Summerzäit", "HAST": "Hawaii-Aleuten-Normalzäit", "AKST": "Alaska-Normalzäit", "AWDT": "Westaustralesch Summerzäit", "CST": "Nordamerikanesch Inland-Normalzäit", "BOT": "Bolivianesch Zäit", "CAT": "Zentralafrikanesch Zäit", "AST": "Atlantik-Normalzäit", "IST": "Indesch Zäit", "GMT": "Mëttler Greenwich-Zäit", "PDT": "Nordamerikanesch Westküsten-Summerzäit", "GYT": "Guyana-Zäit", "ACWST": "Zentral-/Westaustralesch Normalzäit", "AWST": "Westaustralesch Normalzäit", "MEZ": "Mëtteleuropäesch Normalzäit", "NZST": "Neiséiland-Normalzäit", "HNT": "Neifundland-Normalzäit", "GFT": "Franséisch-Guayane-Zäit", "TMT": "Turkmenistan-Normalzäit", "TMST": "Turkmenistan-Summerzäit", "ACDT": "Zentralaustralesch Summerzäit", "CLT": "Chilenesch Normalzäit", "ACWDT": "Zentral-/Westaustralesch Summerzäit", "COT": "Kolumbianesch Normalzäit", "WAT": "Westafrikanesch Normalzäit", "ARST": "Argentinesch Summerzäit", "JST": "Japanesch Normalzäit", "CHAST": "Chatham-Normalzäit", "MYT": "Malaysesch Zäit", "UYT": "Uruguyanesch Normalzäit", "ChST": "Chamorro-Zäit", "WAST": "Westafrikanesch Summerzäit", "ACST": "Zentralaustralesch Normalzäit", "LHST": "Lord-Howe-Normalzäit", "NZDT": "Neiséiland-Summerzäit", "AEDT": "Ostaustralesch Summerzäit", "ADT": "Atlantik-Summerzäit", "UYST": "Uruguayanesch Summerzäit", "VET": "Venezuela-Zäit", "HADT": "Hawaii-Aleuten-Summerzäit", "HAT": "Neifundland-Summerzäit", "SRT": "Suriname-Zäit", "CHADT": "Chatham-Summerzäit", "AEST": "Ostaustralesch Normalzäit", "ECT": "Ecuadorianesch Zäit", "WIT": "Ostindonesesch Zäit", "ART": "Argentinesch Normalzäit", "WEZ": "Westeuropäesch Normalzäit", "SAST": "Südafrikanesch Zäit", "WART": "Westargentinesch Normalzäit", "OESZ": "Osteuropäesch Summerzäit", "MDT": "MDT", "MESZ": "Mëtteleuropäesch Summerzäit", "CLST": "Chilenesch Summerzäit", "COST": "Kolumbianesch Summerzäit", "HKST": "Hong-Kong-Summerzäit", "OEZ": "Osteuropäesch Normalzäit", "MST": "MST", "BT": "Bhutan-Zäit", "SGT": "Singapur-Standardzäit", "WITA": "Zentralindonesesch Zäit", "AKDT": "Alaska-Summerzäit", "PST": "Nordamerikanesch Westküsten-Normalzäit", "LHDT": "Lord-Howe-Summerzäit", "CDT": "Nordamerikanesch Inland-Summerzäit"},
+ timezones: map[string]string{"GFT": "Franséisch-Guayane-Zäit", "WAT": "Westafrikanesch Normalzäit", "WEZ": "Westeuropäesch Normalzäit", "WESZ": "Westeuropäesch Summerzäit", "SGT": "Singapur-Standardzäit", "GMT": "Mëttler Greenwich-Zäit", "AEDT": "Ostaustralesch Summerzäit", "ChST": "Chamorro-Zäit", "AWDT": "Westaustralesch Summerzäit", "PDT": "Nordamerikanesch Westküsten-Summerzäit", "HNT": "Neifundland-Normalzäit", "MYT": "Malaysesch Zäit", "AKST": "Alaska-Normalzäit", "ART": "Argentinesch Normalzäit", "HADT": "Hawaii-Aleuten-Summerzäit", "NZST": "Neiséiland-Normalzäit", "HAT": "Neifundland-Summerzäit", "UYT": "Uruguyanesch Normalzäit", "ACWST": "Zentral-/Westaustralesch Normalzäit", "MESZ": "Mëtteleuropäesch Summerzäit", "COST": "Kolumbianesch Summerzäit", "AST": "Atlantik-Normalzäit", "JST": "Japanesch Normalzäit", "BOT": "Bolivianesch Zäit", "EST": "Nordamerikanesch Ostküsten-Normalzäit", "MEZ": "Mëtteleuropäesch Normalzäit", "WIB": "Westindonesesch Zäit", "AEST": "Ostaustralesch Normalzäit", "CLST": "Chilenesch Summerzäit", "WART": "Westargentinesch Normalzäit", "ADT": "Atlantik-Summerzäit", "PST": "Nordamerikanesch Westküsten-Normalzäit", "COT": "Kolumbianesch Normalzäit", "∅∅∅": "Brasília-Summerzäit", "SRT": "Suriname-Zäit", "IST": "Indesch Zäit", "LHDT": "Lord-Howe-Summerzäit", "WARST": "Westargentinesch Summerzäit", "ACWDT": "Zentral-/Westaustralesch Summerzäit", "NZDT": "Neiséiland-Summerzäit", "CAT": "Zentralafrikanesch Zäit", "BT": "Bhutan-Zäit", "MST": "Rocky-Mountain-Normalzäit", "ARST": "Argentinesch Summerzäit", "LHST": "Lord-Howe-Normalzäit", "CLT": "Chilenesch Normalzäit", "ACDT": "Zentralaustralesch Summerzäit", "HKT": "Hong-Kong-Normalzäit", "CHADT": "Chatham-Summerzäit", "TMT": "Turkmenistan-Normalzäit", "TMST": "Turkmenistan-Summerzäit", "CHAST": "Chatham-Normalzäit", "SAST": "Südafrikanesch Zäit", "GYT": "Guyana-Zäit", "UYST": "Uruguayanesch Summerzäit", "VET": "Venezuela-Zäit", "AKDT": "Alaska-Summerzäit", "WITA": "Zentralindonesesch Zäit", "JDT": "Japanesch Summerzäit", "WIT": "Ostindonesesch Zäit", "ECT": "Ecuadorianesch Zäit", "HAST": "Hawaii-Aleuten-Normalzäit", "WAST": "Westafrikanesch Summerzäit", "OESZ": "Osteuropäesch Summerzäit", "MDT": "Rocky-Mountain-Summerzäit", "EDT": "Nordamerikanesch Ostküsten-Summerzäit", "CST": "Nordamerikanesch Inland-Normalzäit", "CDT": "Nordamerikanesch Inland-Summerzäit", "ACST": "Zentralaustralesch Normalzäit", "OEZ": "Osteuropäesch Normalzäit", "EAT": "Ostafrikanesch Zäit", "HKST": "Hong-Kong-Summerzäit", "AWST": "Westaustralesch Normalzäit"},
}
}
diff --git a/lb/lb_test.go b/lb/lb_test.go
new file mode 100644
index 00000000..a51b75f9
--- /dev/null
+++ b/lb/lb_test.go
@@ -0,0 +1,1120 @@
+package lb
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "lb"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/lb_LU/lb_LU.go b/lb_LU/lb_LU.go
index 3d89653c..c1e8bf40 100644
--- a/lb_LU/lb_LU.go
+++ b/lb_LU/lb_LU.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"v. Chr.", "n. Chr."},
erasNarrow: []string{"", ""},
erasWide: []string{"v. Chr.", "n. Chr."},
- timezones: map[string]string{"NZDT": "Neiséiland-Summerzäit", "GFT": "Franséisch-Guayane-Zäit", "TMST": "Turkmenistan-Summerzäit", "AKST": "Alaska-Normalzäit", "JST": "Japanesch Normalzäit", "CST": "Nordamerikanesch Inland-Normalzäit", "HNT": "Neifundland-Normalzäit", "WIB": "Westindonesesch Zäit", "BOT": "Bolivianesch Zäit", "WEZ": "Westeuropäesch Normalzäit", "WIT": "Ostindonesesch Zäit", "ECT": "Ecuadorianesch Zäit", "NZST": "Neiséiland-Normalzäit", "CHADT": "Chatham-Summerzäit", "CAT": "Zentralafrikanesch Zäit", "ARST": "Argentinesch Summerzäit", "MYT": "Malaysesch Zäit", "AEDT": "Ostaustralesch Summerzäit", "MST": "Rocky-Mountain-Normalzäit", "OEZ": "Osteuropäesch Normalzäit", "LHDT": "Lord-Howe-Summerzäit", "SRT": "Suriname-Zäit", "ACWST": "Zentral-/Westaustralesch Normalzäit", "ChST": "Chamorro-Zäit", "MDT": "Rocky-Mountain-Summerzäit", "HKST": "Hong-Kong-Summerzäit", "PDT": "Nordamerikanesch Westküsten-Summerzäit", "EDT": "Nordamerikanesch Ostküsten-Summerzäit", "WAT": "Westafrikanesch Normalzäit", "WAST": "Westafrikanesch Summerzäit", "AST": "Atlantik-Normalzäit", "SAST": "Südafrikanesch Zäit", "BT": "Bhutan-Zäit", "GMT": "Mëttler Greenwich-Zäit", "ACST": "Zentralaustralesch Normalzäit", "UYST": "Uruguayanesch Summerzäit", "AEST": "Ostaustralesch Normalzäit", "COST": "Kolumbianesch Summerzäit", "GYT": "Guyana-Zäit", "SGT": "Singapur-Standardzäit", "HAT": "Neifundland-Summerzäit", "MESZ": "Mëtteleuropäesch Summerzäit", "CHAST": "Chatham-Normalzäit", "CLT": "Chilenesch Normalzäit", "WITA": "Zentralindonesesch Zäit", "JDT": "Japanesch Summerzäit", "WESZ": "Westeuropäesch Summerzäit", "EST": "Nordamerikanesch Ostküsten-Normalzäit", "ADT": "Atlantik-Summerzäit", "COT": "Kolumbianesch Normalzäit", "HKT": "Hong-Kong-Normalzäit", "IST": "Indesch Zäit", "EAT": "Ostafrikanesch Zäit", "UYT": "Uruguyanesch Normalzäit", "CLST": "Chilenesch Summerzäit", "OESZ": "Osteuropäesch Summerzäit", "ACDT": "Zentralaustralesch Summerzäit", "AKDT": "Alaska-Summerzäit", "AWDT": "Westaustralesch Summerzäit", "MEZ": "Mëtteleuropäesch Normalzäit", "HADT": "Hawaii-Aleuten-Summerzäit", "WARST": "Westargentinesch Summerzäit", "PST": "Nordamerikanesch Westküsten-Normalzäit", "∅∅∅": "Brasília-Summerzäit", "WART": "Westargentinesch Normalzäit", "ART": "Argentinesch Normalzäit", "HAST": "Hawaii-Aleuten-Normalzäit", "TMT": "Turkmenistan-Normalzäit", "AWST": "Westaustralesch Normalzäit", "LHST": "Lord-Howe-Normalzäit", "CDT": "Nordamerikanesch Inland-Summerzäit", "ACWDT": "Zentral-/Westaustralesch Summerzäit", "VET": "Venezuela-Zäit"},
+ timezones: map[string]string{"LHST": "Lord-Howe-Normalzäit", "HKT": "Hong-Kong-Normalzäit", "JDT": "Japanesch Summerzäit", "ACWDT": "Zentral-/Westaustralesch Summerzäit", "HADT": "Hawaii-Aleuten-Summerzäit", "EST": "Nordamerikanesch Ostküsten-Normalzäit", "CLT": "Chilenesch Normalzäit", "BT": "Bhutan-Zäit", "AEDT": "Ostaustralesch Summerzäit", "MESZ": "Mëtteleuropäesch Summerzäit", "PDT": "Nordamerikanesch Westküsten-Summerzäit", "TMT": "Turkmenistan-Normalzäit", "HNT": "Neifundland-Normalzäit", "OESZ": "Osteuropäesch Summerzäit", "SRT": "Suriname-Zäit", "AST": "Atlantik-Normalzäit", "BOT": "Bolivianesch Zäit", "SGT": "Singapur-Standardzäit", "GYT": "Guyana-Zäit", "GMT": "Mëttler Greenwich-Zäit", "CDT": "Nordamerikanesch Inland-Summerzäit", "ADT": "Atlantik-Summerzäit", "TMST": "Turkmenistan-Summerzäit", "OEZ": "Osteuropäesch Normalzäit", "MST": "Rocky-Mountain-Normalzäit", "WITA": "Zentralindonesesch Zäit", "ARST": "Argentinesch Summerzäit", "WIT": "Ostindonesesch Zäit", "WARST": "Westargentinesch Summerzäit", "AKST": "Alaska-Normalzäit", "AKDT": "Alaska-Summerzäit", "UYT": "Uruguyanesch Normalzäit", "ACDT": "Zentralaustralesch Summerzäit", "COST": "Kolumbianesch Summerzäit", "CHAST": "Chatham-Normalzäit", "EDT": "Nordamerikanesch Ostküsten-Summerzäit", "CST": "Nordamerikanesch Inland-Normalzäit", "HKST": "Hong-Kong-Summerzäit", "AEST": "Ostaustralesch Normalzäit", "ChST": "Chamorro-Zäit", "SAST": "Südafrikanesch Zäit", "CAT": "Zentralafrikanesch Zäit", "CHADT": "Chatham-Summerzäit", "PST": "Nordamerikanesch Westküsten-Normalzäit", "COT": "Kolumbianesch Normalzäit", "WESZ": "Westeuropäesch Summerzäit", "HAT": "Neifundland-Summerzäit", "CLST": "Chilenesch Summerzäit", "UYST": "Uruguayanesch Summerzäit", "ECT": "Ecuadorianesch Zäit", "ACWST": "Zentral-/Westaustralesch Normalzäit", "NZDT": "Neiséiland-Summerzäit", "WART": "Westargentinesch Normalzäit", "VET": "Venezuela-Zäit", "EAT": "Ostafrikanesch Zäit", "HAST": "Hawaii-Aleuten-Normalzäit", "MEZ": "Mëtteleuropäesch Normalzäit", "WIB": "Westindonesesch Zäit", "WAST": "Westafrikanesch Summerzäit", "WEZ": "Westeuropäesch Normalzäit", "MDT": "Rocky-Mountain-Summerzäit", "ACST": "Zentralaustralesch Normalzäit", "AWDT": "Westaustralesch Summerzäit", "∅∅∅": "Brasília-Summerzäit", "ART": "Argentinesch Normalzäit", "GFT": "Franséisch-Guayane-Zäit", "AWST": "Westaustralesch Normalzäit", "MYT": "Malaysesch Zäit", "LHDT": "Lord-Howe-Summerzäit", "IST": "Indesch Zäit", "WAT": "Westafrikanesch Normalzäit", "JST": "Japanesch Normalzäit", "NZST": "Neiséiland-Normalzäit"},
}
}
diff --git a/lb_LU/lb_LU_test.go b/lb_LU/lb_LU_test.go
new file mode 100644
index 00000000..ff94ec31
--- /dev/null
+++ b/lb_LU/lb_LU_test.go
@@ -0,0 +1,1120 @@
+package lb_LU
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "lb_LU"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/lg/lg.go b/lg/lg.go
index 696d99fd..eb5301cc 100644
--- a/lg/lg.go
+++ b/lg/lg.go
@@ -57,7 +57,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"", ""},
erasWide: []string{"Kulisito nga tannaza", "Bukya Kulisito Azaal"},
- timezones: map[string]string{"CLST": "CLST", "PST": "PST", "CHADT": "CHADT", "MYT": "MYT", "SRT": "SRT", "LHDT": "LHDT", "ADT": "ADT", "GFT": "GFT", "MST": "MST", "JST": "JST", "PDT": "PDT", "MEZ": "MEZ", "WESZ": "WESZ", "ChST": "ChST", "COT": "COT", "HKT": "HKT", "MDT": "MDT", "ECT": "ECT", "JDT": "JDT", "NZST": "NZST", "∅∅∅": "∅∅∅", "AEST": "AEST", "WARST": "WARST", "GMT": "GMT", "HNT": "HNT", "UYST": "UYST", "CHAST": "CHAST", "AST": "AST", "HADT": "HADT", "SAST": "SAST", "OEZ": "OEZ", "UYT": "UYT", "BOT": "BOT", "ACWST": "ACWST", "ACWDT": "ACWDT", "ARST": "ARST", "AWST": "AWST", "ART": "ART", "HAST": "HAST", "IST": "IST", "ACDT": "ACDT", "EDT": "EDT", "TMT": "TMT", "AKDT": "AKDT", "MESZ": "MESZ", "VET": "VET", "CAT": "CAT", "EST": "EST", "SGT": "SGT", "WAST": "WAST", "TMST": "TMST", "AWDT": "AWDT", "ACST": "ACST", "NZDT": "NZDT", "WIB": "WIB", "COST": "COST", "HKST": "HKST", "WITA": "WITA", "WIT": "WIT", "GYT": "GYT", "AKST": "AKST", "LHST": "LHST", "AEDT": "AEDT", "WART": "WART", "WAT": "WAT", "HAT": "HAT", "WEZ": "WEZ", "EAT": "EAT", "CST": "CST", "CDT": "CDT", "CLT": "CLT", "BT": "BT", "OESZ": "OESZ"},
+ timezones: map[string]string{"MDT": "MDT", "VET": "VET", "COST": "COST", "CHAST": "CHAST", "ACWDT": "ACWDT", "GMT": "GMT", "SRT": "SRT", "NZDT": "NZDT", "HAT": "HAT", "WITA": "WITA", "PST": "PST", "SGT": "SGT", "CAT": "CAT", "MST": "MST", "CST": "CST", "ACST": "ACST", "ACWST": "ACWST", "PDT": "PDT", "HADT": "HADT", "WIB": "WIB", "WAT": "WAT", "AEST": "AEST", "MYT": "MYT", "CHADT": "CHADT", "ADT": "ADT", "GFT": "GFT", "ECT": "ECT", "ARST": "ARST", "WESZ": "WESZ", "AEDT": "AEDT", "UYT": "UYT", "UYST": "UYST", "WARST": "WARST", "HNT": "HNT", "COT": "COT", "TMT": "TMT", "JST": "JST", "JDT": "JDT", "EST": "EST", "NZST": "NZST", "BT": "BT", "HKT": "HKT", "AWST": "AWST", "HAST": "HAST", "AWDT": "AWDT", "ART": "ART", "AKST": "AKST", "WEZ": "WEZ", "OEZ": "OEZ", "OESZ": "OESZ", "LHDT": "LHDT", "WIT": "WIT", "CDT": "CDT", "GYT": "GYT", "CLST": "CLST", "EAT": "EAT", "∅∅∅": "∅∅∅", "ChST": "ChST", "IST": "IST", "MEZ": "MEZ", "MESZ": "MESZ", "SAST": "SAST", "WAST": "WAST", "LHST": "LHST", "WART": "WART", "HKST": "HKST", "AKDT": "AKDT", "CLT": "CLT", "AST": "AST", "EDT": "EDT", "ACDT": "ACDT", "BOT": "BOT", "TMST": "TMST"},
}
}
diff --git a/lg/lg_test.go b/lg/lg_test.go
new file mode 100644
index 00000000..553c1cf8
--- /dev/null
+++ b/lg/lg_test.go
@@ -0,0 +1,1120 @@
+package lg
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "lg"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/lg_UG/lg_UG.go b/lg_UG/lg_UG.go
index 42e7b930..696b0753 100644
--- a/lg_UG/lg_UG.go
+++ b/lg_UG/lg_UG.go
@@ -57,7 +57,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"", ""},
erasWide: []string{"Kulisito nga tannaza", "Bukya Kulisito Azaal"},
- timezones: map[string]string{"SRT": "SRT", "MEZ": "MEZ", "WAT": "WAT", "WAST": "WAST", "OEZ": "OEZ", "MST": "MST", "MYT": "MYT", "EDT": "EDT", "COT": "COT", "COST": "COST", "HAST": "HAST", "HKST": "HKST", "TMST": "TMST", "EAT": "EAT", "AEST": "AEST", "WARST": "WARST", "OESZ": "OESZ", "GMT": "GMT", "AKDT": "AKDT", "NZDT": "NZDT", "CHADT": "CHADT", "WEZ": "WEZ", "ACWDT": "ACWDT", "HAT": "HAT", "GFT": "GFT", "LHDT": "LHDT", "MESZ": "MESZ", "NZST": "NZST", "SAST": "SAST", "HKT": "HKT", "MDT": "MDT", "PDT": "PDT", "AST": "AST", "TMT": "TMT", "ACDT": "ACDT", "ART": "ART", "JDT": "JDT", "UYST": "UYST", "CST": "CST", "CHAST": "CHAST", "ACWST": "ACWST", "BT": "BT", "WART": "WART", "∅∅∅": "∅∅∅", "JST": "JST", "AWST": "AWST", "ADT": "ADT", "WIT": "WIT", "UYT": "UYT", "VET": "VET", "EST": "EST", "SGT": "SGT", "CLT": "CLT", "WESZ": "WESZ", "HADT": "HADT", "HNT": "HNT", "PST": "PST", "GYT": "GYT", "CDT": "CDT", "BOT": "BOT", "CLST": "CLST", "CAT": "CAT", "ChST": "ChST", "WITA": "WITA", "IST": "IST", "AWDT": "AWDT", "LHST": "LHST", "AEDT": "AEDT", "WIB": "WIB", "ACST": "ACST", "ARST": "ARST", "AKST": "AKST", "ECT": "ECT"},
+ timezones: map[string]string{"ECT": "ECT", "CHAST": "CHAST", "CHADT": "CHADT", "GYT": "GYT", "SRT": "SRT", "ACWST": "ACWST", "MYT": "MYT", "CLT": "CLT", "PDT": "PDT", "WIB": "WIB", "WAST": "WAST", "∅∅∅": "∅∅∅", "VET": "VET", "MDT": "MDT", "AKST": "AKST", "ADT": "ADT", "CLST": "CLST", "WART": "WART", "JDT": "JDT", "NZST": "NZST", "IST": "IST", "HAT": "HAT", "GMT": "GMT", "TMT": "TMT", "AEDT": "AEDT", "ACST": "ACST", "ARST": "ARST", "HAST": "HAST", "ACDT": "ACDT", "WAT": "WAT", "WEZ": "WEZ", "LHST": "LHST", "JST": "JST", "ACWDT": "ACWDT", "BOT": "BOT", "HNT": "HNT", "TMST": "TMST", "SAST": "SAST", "EDT": "EDT", "GFT": "GFT", "MST": "MST", "HKT": "HKT", "AST": "AST", "MEZ": "MEZ", "HKST": "HKST", "AWST": "AWST", "WITA": "WITA", "SGT": "SGT", "ART": "ART", "HADT": "HADT", "EST": "EST", "COST": "COST", "WIT": "WIT", "WESZ": "WESZ", "OESZ": "OESZ", "CST": "CST", "EAT": "EAT", "LHDT": "LHDT", "ChST": "ChST", "UYT": "UYT", "UYST": "UYST", "AEST": "AEST", "BT": "BT", "WARST": "WARST", "CAT": "CAT", "CDT": "CDT", "AWDT": "AWDT", "PST": "PST", "MESZ": "MESZ", "NZDT": "NZDT", "COT": "COT", "AKDT": "AKDT", "OEZ": "OEZ"},
}
}
diff --git a/lg_UG/lg_UG_test.go b/lg_UG/lg_UG_test.go
new file mode 100644
index 00000000..e9458eef
--- /dev/null
+++ b/lg_UG/lg_UG_test.go
@@ -0,0 +1,1120 @@
+package lg_UG
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "lg_UG"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/lkt/lkt.go b/lkt/lkt.go
index 00881c60..706765a2 100644
--- a/lkt/lkt.go
+++ b/lkt/lkt.go
@@ -65,7 +65,7 @@ func New() locales.Translator {
monthsWide: []string{"", "Wiótheȟika Wí", "Thiyóȟeyuŋka Wí", "Ištáwičhayazaŋ Wí", "Pȟežítȟo Wí", "Čhaŋwápetȟo Wí", "Wípazukȟa-wašté Wí", "Čhaŋpȟásapa Wí", "Wasútȟuŋ Wí", "Čhaŋwápeǧi Wí", "Čhaŋwápe-kasná Wí", "Waníyetu Wí", "Tȟahékapšuŋ Wí"},
daysNarrow: []string{"A", "W", "N", "Y", "T", "Z", "O"},
daysWide: []string{"Aŋpétuwakȟaŋ", "Aŋpétuwaŋži", "Aŋpétunuŋpa", "Aŋpétuyamni", "Aŋpétutopa", "Aŋpétuzaptaŋ", "Owáŋgyužažapi"},
- timezones: map[string]string{"SRT": "SRT", "VET": "VET", "AWDT": "AWDT", "ACDT": "ACDT", "UYST": "UYST", "CST": "CST", "CHADT": "CHADT", "OEZ": "OEZ", "WIB": "WIB", "AKDT": "AKDT", "ACWDT": "ACWDT", "CLT": "CLT", "EDT": "EDT", "WARST": "WARST", "ARST": "ARST", "PDT": "PDT", "JST": "JST", "UYT": "UYT", "AEST": "AEST", "ChST": "ChST", "CAT": "CAT", "COST": "COST", "GMT": "GMT", "MDT": "MDT", "PST": "PST", "ACWST": "ACWST", "CLST": "CLST", "EST": "EST", "JDT": "JDT", "CHAST": "CHAST", "ART": "ART", "LHDT": "LHDT", "EAT": "EAT", "HKST": "HKST", "WART": "WART", "MST": "MST", "NZST": "NZST", "BOT": "BOT", "CDT": "CDT", "AST": "AST", "LHST": "LHST", "GYT": "GYT", "AEDT": "AEDT", "HKT": "HKT", "OESZ": "OESZ", "WITA": "WITA", "TMT": "TMT", "AWST": "AWST", "WEZ": "WEZ", "ADT": "ADT", "SGT": "SGT", "SAST": "SAST", "TMST": "TMST", "MEZ": "MEZ", "NZDT": "NZDT", "HAST": "HAST", "WAT": "WAT", "ACST": "ACST", "AKST": "AKST", "MESZ": "MESZ", "WESZ": "WESZ", "ECT": "ECT", "GFT": "GFT", "IST": "IST", "BT": "BT", "∅∅∅": "∅∅∅", "WAST": "WAST", "HNT": "HNT", "HAT": "HAT", "WIT": "WIT", "COT": "COT", "MYT": "MYT", "HADT": "HADT"},
+ timezones: map[string]string{"MEZ": "MEZ", "SGT": "SGT", "TMT": "TMT", "MST": "MST", "AWST": "AWST", "EAT": "EAT", "COST": "COST", "GMT": "GMT", "AEDT": "AEDT", "CLST": "CLST", "ACST": "ACST", "NZDT": "NZDT", "SAST": "SAST", "EST": "EST", "WAT": "WAT", "VET": "VET", "JST": "JST", "LHDT": "LHDT", "HADT": "HADT", "WESZ": "WESZ", "PST": "PST", "ARST": "ARST", "ACWDT": "ACWDT", "MESZ": "MESZ", "HAT": "HAT", "ChST": "ChST", "CLT": "CLT", "BT": "BT", "CHADT": "CHADT", "AWDT": "AWDT", "HKT": "HKT", "JDT": "JDT", "COT": "COT", "WIB": "WIB", "GYT": "GYT", "OEZ": "OEZ", "SRT": "SRT", "MDT": "MDT", "UYT": "UYT", "LHST": "LHST", "TMST": "TMST", "WAST": "WAST", "WEZ": "WEZ", "AEST": "AEST", "WIT": "WIT", "ECT": "ECT", "ACWST": "ACWST", "HKST": "HKST", "AKDT": "AKDT", "CDT": "CDT", "∅∅∅": "∅∅∅", "OESZ": "OESZ", "CHAST": "CHAST", "AKST": "AKST", "PDT": "PDT", "WARST": "WARST", "ART": "ART", "HNT": "HNT", "ADT": "ADT", "EDT": "EDT", "CAT": "CAT", "WART": "WART", "AST": "AST", "GFT": "GFT", "WITA": "WITA", "BOT": "BOT", "IST": "IST", "MYT": "MYT", "UYST": "UYST", "CST": "CST", "ACDT": "ACDT", "HAST": "HAST", "NZST": "NZST"},
}
}
@@ -111,7 +111,7 @@ func (lkt *lkt) MonthAbbreviated(month time.Month) string {
// MonthsAbbreviated returns the locales abbreviated months
func (lkt *lkt) MonthsAbbreviated() []string {
- return lkt.monthsAbbreviated[1:]
+ return nil
}
// MonthNarrow returns the locales narrow month given the 'month' provided
@@ -121,7 +121,7 @@ func (lkt *lkt) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (lkt *lkt) MonthsNarrow() []string {
- return lkt.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/lkt/lkt_test.go b/lkt/lkt_test.go
new file mode 100644
index 00000000..d33a3584
--- /dev/null
+++ b/lkt/lkt_test.go
@@ -0,0 +1,1120 @@
+package lkt
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "lkt"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/lkt_US/lkt_US.go b/lkt_US/lkt_US.go
index c1233682..cc45db04 100644
--- a/lkt_US/lkt_US.go
+++ b/lkt_US/lkt_US.go
@@ -65,7 +65,7 @@ func New() locales.Translator {
monthsWide: []string{"", "Wiótheȟika Wí", "Thiyóȟeyuŋka Wí", "Ištáwičhayazaŋ Wí", "Pȟežítȟo Wí", "Čhaŋwápetȟo Wí", "Wípazukȟa-wašté Wí", "Čhaŋpȟásapa Wí", "Wasútȟuŋ Wí", "Čhaŋwápeǧi Wí", "Čhaŋwápe-kasná Wí", "Waníyetu Wí", "Tȟahékapšuŋ Wí"},
daysNarrow: []string{"A", "W", "N", "Y", "T", "Z", "O"},
daysWide: []string{"Aŋpétuwakȟaŋ", "Aŋpétuwaŋži", "Aŋpétunuŋpa", "Aŋpétuyamni", "Aŋpétutopa", "Aŋpétuzaptaŋ", "Owáŋgyužažapi"},
- timezones: map[string]string{"CDT": "CDT", "HKT": "HKT", "TMST": "TMST", "WAT": "WAT", "HAT": "HAT", "CLST": "CLST", "ACWST": "ACWST", "COT": "COT", "ADT": "ADT", "MST": "MST", "PST": "PST", "NZST": "NZST", "WESZ": "WESZ", "ECT": "ECT", "SAST": "SAST", "GMT": "GMT", "AEST": "AEST", "LHDT": "LHDT", "AKDT": "AKDT", "∅∅∅": "∅∅∅", "BT": "BT", "HKST": "HKST", "JST": "JST", "WEZ": "WEZ", "ACWDT": "ACWDT", "EDT": "EDT", "HAST": "HAST", "PDT": "PDT", "CAT": "CAT", "OEZ": "OEZ", "WIT": "WIT", "IST": "IST", "AEDT": "AEDT", "HADT": "HADT", "HNT": "HNT", "LHST": "LHST", "BOT": "BOT", "CHAST": "CHAST", "VET": "VET", "EST": "EST", "AST": "AST", "UYT": "UYT", "MEZ": "MEZ", "CLT": "CLT", "WITA": "WITA", "ACDT": "ACDT", "SGT": "SGT", "CHADT": "CHADT", "WAST": "WAST", "WIB": "WIB", "TMT": "TMT", "GFT": "GFT", "ACST": "ACST", "OESZ": "OESZ", "GYT": "GYT", "MYT": "MYT", "AKST": "AKST", "NZDT": "NZDT", "CST": "CST", "COST": "COST", "WART": "WART", "MESZ": "MESZ", "ChST": "ChST", "JDT": "JDT", "SRT": "SRT", "UYST": "UYST", "WARST": "WARST", "MDT": "MDT", "EAT": "EAT", "AWST": "AWST", "AWDT": "AWDT", "ART": "ART", "ARST": "ARST"},
+ timezones: map[string]string{"AWDT": "AWDT", "HADT": "HADT", "PST": "PST", "ACST": "ACST", "PDT": "PDT", "OEZ": "OEZ", "OESZ": "OESZ", "CHADT": "CHADT", "EDT": "EDT", "HNT": "HNT", "CLT": "CLT", "GFT": "GFT", "WAST": "WAST", "MYT": "MYT", "CDT": "CDT", "JDT": "JDT", "HAST": "HAST", "BOT": "BOT", "MEZ": "MEZ", "∅∅∅": "∅∅∅", "ACDT": "ACDT", "CAT": "CAT", "AST": "AST", "AWST": "AWST", "CST": "CST", "ECT": "ECT", "AKST": "AKST", "NZDT": "NZDT", "LHDT": "LHDT", "HKST": "HKST", "ACWST": "ACWST", "UYT": "UYT", "HKT": "HKT", "CHAST": "CHAST", "ARST": "ARST", "GYT": "GYT", "LHST": "LHST", "MDT": "MDT", "UYST": "UYST", "WITA": "WITA", "COST": "COST", "TMST": "TMST", "GMT": "GMT", "CLST": "CLST", "ADT": "ADT", "IST": "IST", "WESZ": "WESZ", "EAT": "EAT", "VET": "VET", "ACWDT": "ACWDT", "ART": "ART", "HAT": "HAT", "BT": "BT", "MESZ": "MESZ", "SGT": "SGT", "AEST": "AEST", "AEDT": "AEDT", "WIT": "WIT", "NZST": "NZST", "WIB": "WIB", "WAT": "WAT", "ChST": "ChST", "WART": "WART", "AKDT": "AKDT", "SAST": "SAST", "COT": "COT", "WEZ": "WEZ", "MST": "MST", "JST": "JST", "EST": "EST", "TMT": "TMT", "WARST": "WARST", "SRT": "SRT"},
}
}
@@ -111,7 +111,7 @@ func (lkt *lkt_US) MonthAbbreviated(month time.Month) string {
// MonthsAbbreviated returns the locales abbreviated months
func (lkt *lkt_US) MonthsAbbreviated() []string {
- return lkt.monthsAbbreviated[1:]
+ return nil
}
// MonthNarrow returns the locales narrow month given the 'month' provided
@@ -121,7 +121,7 @@ func (lkt *lkt_US) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (lkt *lkt_US) MonthsNarrow() []string {
- return lkt.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/lkt_US/lkt_US_test.go b/lkt_US/lkt_US_test.go
new file mode 100644
index 00000000..06696751
--- /dev/null
+++ b/lkt_US/lkt_US_test.go
@@ -0,0 +1,1120 @@
+package lkt_US
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "lkt_US"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ln/ln.go b/ln/ln.go
index 52ca46c4..c1814b32 100644
--- a/ln/ln.go
+++ b/ln/ln.go
@@ -69,7 +69,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"libóso ya", "nsima ya Y"},
erasNarrow: []string{"", ""},
erasWide: []string{"Yambo ya Yézu Krís", "Nsima ya Yézu Krís"},
- timezones: map[string]string{"GFT": "GFT", "TMT": "TMT", "AST": "AST", "EAT": "Ntángo ya Afríka ya Ɛ́sita", "PDT": "PDT", "AWDT": "AWDT", "CHADT": "CHADT", "ECT": "ECT", "OESZ": "OESZ", "HNT": "HNT", "AWST": "AWST", "JDT": "JDT", "AEDT": "AEDT", "EST": "EST", "CLST": "CLST", "OEZ": "OEZ", "TMST": "TMST", "AKST": "AKST", "JST": "JST", "ACWDT": "ACWDT", "ChST": "ChST", "SRT": "SRT", "WESZ": "WESZ", "WAT": "WAT", "IST": "IST", "MESZ": "MESZ", "EDT": "EDT", "SGT": "SGT", "SAST": "Ntángo ya Afríka ya Sidi", "LHST": "LHST", "COT": "COT", "HAST": "HAST", "WARST": "WARST", "CST": "CST", "ADT": "ADT", "GMT": "Ntángo ya Londoni", "HAT": "HAT", "WIB": "WIB", "CLT": "CLT", "WAST": "WAST", "COST": "COST", "MDT": "MDT", "ACST": "ACST", "ART": "ART", "∅∅∅": "∅∅∅", "LHDT": "LHDT", "CHAST": "CHAST", "BOT": "BOT", "WEZ": "WEZ", "WITA": "WITA", "AKDT": "AKDT", "PST": "PST", "GYT": "GYT", "MYT": "MYT", "MEZ": "MEZ", "ACDT": "ACDT", "ARST": "ARST", "UYT": "UYT", "AEST": "AEST", "WART": "WART", "WIT": "WIT", "CDT": "CDT", "NZST": "NZST", "NZDT": "NZDT", "ACWST": "ACWST", "CAT": "Ntángo ya Lubumbashi", "HADT": "HADT", "MST": "MST", "VET": "VET", "BT": "BT", "HKST": "HKST", "UYST": "UYST", "HKT": "HKT"},
+ timezones: map[string]string{"JST": "JST", "AKDT": "AKDT", "OESZ": "OESZ", "LHST": "LHST", "LHDT": "LHDT", "HKST": "HKST", "ACWST": "ACWST", "EST": "EST", "WAT": "WAT", "CST": "CST", "GFT": "GFT", "CHADT": "CHADT", "AWST": "AWST", "∅∅∅": "∅∅∅", "WIB": "WIB", "COT": "COT", "MYT": "MYT", "SGT": "SGT", "MST": "MST", "ADT": "ADT", "ARST": "ARST", "MEZ": "MEZ", "WESZ": "WESZ", "NZST": "NZST", "PST": "PST", "MESZ": "MESZ", "TMT": "TMT", "AEST": "AEST", "WIT": "WIT", "CLST": "CLST", "CDT": "CDT", "BOT": "BOT", "SAST": "Ntángo ya Afríka ya Sidi", "IST": "IST", "CAT": "Ntángo ya Lubumbashi", "ACST": "ACST", "JDT": "JDT", "AST": "AST", "AWDT": "AWDT", "HNT": "HNT", "OEZ": "OEZ", "CLT": "CLT", "HKT": "HKT", "AKST": "AKST", "AEDT": "AEDT", "ACDT": "ACDT", "NZDT": "NZDT", "HAT": "HAT", "ChST": "ChST", "WART": "WART", "VET": "VET", "ART": "ART", "SRT": "SRT", "EDT": "EDT", "HAST": "HAST", "HADT": "HADT", "COST": "COST", "GMT": "Ntángo ya Londoni", "GYT": "GYT", "ACWDT": "ACWDT", "TMST": "TMST", "WEZ": "WEZ", "MDT": "MDT", "WARST": "WARST", "UYT": "UYT", "UYST": "UYST", "BT": "BT", "CHAST": "CHAST", "ECT": "ECT", "WITA": "WITA", "PDT": "PDT", "WAST": "WAST", "EAT": "Ntángo ya Afríka ya Ɛ́sita"},
}
}
diff --git a/ln/ln_test.go b/ln/ln_test.go
new file mode 100644
index 00000000..29916194
--- /dev/null
+++ b/ln/ln_test.go
@@ -0,0 +1,1120 @@
+package ln
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ln"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ln_AO/ln_AO.go b/ln_AO/ln_AO.go
index 4c586462..8dc07eb4 100644
--- a/ln_AO/ln_AO.go
+++ b/ln_AO/ln_AO.go
@@ -69,7 +69,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"libóso ya", "nsima ya Y"},
erasNarrow: []string{"", ""},
erasWide: []string{"Yambo ya Yézu Krís", "Nsima ya Yézu Krís"},
- timezones: map[string]string{"GFT": "GFT", "MESZ": "MESZ", "HKT": "HKT", "WITA": "WITA", "CHAST": "CHAST", "COT": "COT", "AWDT": "AWDT", "GYT": "GYT", "AKST": "AKST", "PST": "PST", "WARST": "WARST", "WAST": "WAST", "IST": "IST", "OESZ": "OESZ", "ECT": "ECT", "AEDT": "AEDT", "ChST": "ChST", "∅∅∅": "∅∅∅", "AWST": "AWST", "LHDT": "LHDT", "BOT": "BOT", "EDT": "EDT", "AEST": "AEST", "COST": "COST", "OEZ": "OEZ", "TMST": "TMST", "NZST": "NZST", "NZDT": "NZDT", "MDT": "MDT", "CST": "CST", "AST": "AST", "HNT": "HNT", "ACDT": "ACDT", "ARST": "ARST", "CLST": "CLST", "WEZ": "WEZ", "ADT": "ADT", "EAT": "Ntángo ya Afríka ya Ɛ́sita", "JDT": "JDT", "CDT": "CDT", "SAST": "Ntángo ya Afríka ya Sidi", "WESZ": "WESZ", "MEZ": "MEZ", "EST": "EST", "ART": "ART", "CHADT": "CHADT", "HAST": "HAST", "HADT": "HADT", "WAT": "WAT", "HAT": "HAT", "BT": "BT", "WIT": "WIT", "TMT": "TMT", "AKDT": "AKDT", "ACWST": "ACWST", "SGT": "SGT", "SRT": "SRT", "UYT": "UYT", "VET": "VET", "JST": "JST", "PDT": "PDT", "UYST": "UYST", "CLT": "CLT", "GMT": "Ntángo ya Londoni", "MST": "MST", "LHST": "LHST", "MYT": "MYT", "CAT": "Ntángo ya Lubumbashi", "ACWDT": "ACWDT", "HKST": "HKST", "WART": "WART", "WIB": "WIB", "ACST": "ACST"},
+ timezones: map[string]string{"UYST": "UYST", "MDT": "MDT", "WARST": "WARST", "∅∅∅": "∅∅∅", "WEZ": "WEZ", "WESZ": "WESZ", "CLT": "CLT", "JDT": "JDT", "HADT": "HADT", "ECT": "ECT", "ACWST": "ACWST", "WIB": "WIB", "HAT": "HAT", "EAT": "Ntángo ya Afríka ya Ɛ́sita", "LHST": "LHST", "ART": "ART", "AWST": "AWST", "PST": "PST", "OEZ": "OEZ", "BT": "BT", "GFT": "GFT", "CHAST": "CHAST", "JST": "JST", "AWDT": "AWDT", "PDT": "PDT", "GYT": "GYT", "ChST": "ChST", "CLST": "CLST", "ACDT": "ACDT", "ARST": "ARST", "NZST": "NZST", "TMST": "TMST", "ACST": "ACST", "SRT": "SRT", "BOT": "BOT", "SGT": "SGT", "COT": "COT", "MYT": "MYT", "MESZ": "MESZ", "COST": "COST", "OESZ": "OESZ", "AEST": "AEST", "CST": "CST", "ACWDT": "ACWDT", "MEZ": "MEZ", "SAST": "Ntángo ya Afríka ya Sidi", "HNT": "HNT", "MST": "MST", "HKST": "HKST", "HAST": "HAST", "IST": "IST", "EDT": "EDT", "WAST": "WAST", "TMT": "TMT", "CAT": "Ntángo ya Lubumbashi", "WIT": "WIT", "LHDT": "LHDT", "WART": "WART", "CHADT": "CHADT", "NZDT": "NZDT", "EST": "EST", "WAT": "WAT", "AEDT": "AEDT", "AKDT": "AKDT", "UYT": "UYT", "VET": "VET", "HKT": "HKT", "GMT": "Ntángo ya Londoni", "CDT": "CDT", "WITA": "WITA", "AKST": "AKST", "AST": "AST", "ADT": "ADT"},
}
}
diff --git a/ln_AO/ln_AO_test.go b/ln_AO/ln_AO_test.go
new file mode 100644
index 00000000..c7eb4f22
--- /dev/null
+++ b/ln_AO/ln_AO_test.go
@@ -0,0 +1,1120 @@
+package ln_AO
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ln_AO"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ln_CD/ln_CD.go b/ln_CD/ln_CD.go
index e34ad905..ac85c3df 100644
--- a/ln_CD/ln_CD.go
+++ b/ln_CD/ln_CD.go
@@ -69,7 +69,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"libóso ya", "nsima ya Y"},
erasNarrow: []string{"", ""},
erasWide: []string{"Yambo ya Yézu Krís", "Nsima ya Yézu Krís"},
- timezones: map[string]string{"AST": "AST", "MDT": "MDT", "ACDT": "ACDT", "ART": "ART", "AWST": "AWST", "SRT": "SRT", "HADT": "HADT", "SGT": "SGT", "IST": "IST", "MST": "MST", "NZDT": "NZDT", "CDT": "CDT", "WAST": "WAST", "HNT": "HNT", "UYST": "UYST", "CLST": "CLST", "COST": "COST", "CAT": "Ntángo ya Lubumbashi", "HAST": "HAST", "MEZ": "MEZ", "ACWST": "ACWST", "ACWDT": "ACWDT", "EDT": "EDT", "COT": "COT", "∅∅∅": "∅∅∅", "GMT": "Ntángo ya Londoni", "HKST": "HKST", "WIT": "WIT", "TMT": "TMT", "JST": "JST", "CHADT": "CHADT", "VET": "VET", "TMST": "TMST", "EAT": "Ntángo ya Afríka ya Ɛ́sita", "PDT": "PDT", "AWDT": "AWDT", "AKST": "AKST", "AKDT": "AKDT", "CHAST": "CHAST", "ADT": "ADT", "WITA": "WITA", "GYT": "GYT", "AEST": "AEST", "BT": "BT", "GFT": "GFT", "ARST": "ARST", "JDT": "JDT", "WART": "WART", "WARST": "WARST", "SAST": "Ntángo ya Afríka ya Sidi", "WIB": "WIB", "PST": "PST", "LHST": "LHST", "LHDT": "LHDT", "CST": "CST", "AEDT": "AEDT", "WESZ": "WESZ", "OEZ": "OEZ", "ACST": "ACST", "NZST": "NZST", "EST": "EST", "HKT": "HKT", "OESZ": "OESZ", "WEZ": "WEZ", "ECT": "ECT", "WAT": "WAT", "MESZ": "MESZ", "ChST": "ChST", "CLT": "CLT", "HAT": "HAT", "UYT": "UYT", "MYT": "MYT", "BOT": "BOT"},
+ timezones: map[string]string{"EAT": "Ntángo ya Afríka ya Ɛ́sita", "HKST": "HKST", "AST": "AST", "COT": "COT", "COST": "COST", "WIB": "WIB", "UYST": "UYST", "∅∅∅": "∅∅∅", "AWST": "AWST", "EDT": "EDT", "UYT": "UYT", "ARST": "ARST", "NZST": "NZST", "PST": "PST", "CST": "CST", "EST": "EST", "PDT": "PDT", "AEST": "AEST", "CHADT": "CHADT", "WAST": "WAST", "JST": "JST", "MYT": "MYT", "SRT": "SRT", "MESZ": "MESZ", "TMT": "TMT", "WAT": "WAT", "ACWDT": "ACWDT", "ART": "ART", "IST": "IST", "CAT": "Ntángo ya Lubumbashi", "WEZ": "WEZ", "ECT": "ECT", "SAST": "Ntángo ya Afríka ya Sidi", "MEZ": "MEZ", "AEDT": "AEDT", "TMST": "TMST", "WESZ": "WESZ", "HNT": "HNT", "OEZ": "OEZ", "ChST": "ChST", "MST": "MST", "AKDT": "AKDT", "ADT": "ADT", "CLST": "CLST", "HAST": "HAST", "LHDT": "LHDT", "GYT": "GYT", "WIT": "WIT", "LHST": "LHST", "ACWST": "ACWST", "HADT": "HADT", "HAT": "HAT", "JDT": "JDT", "GMT": "Ntángo ya Londoni", "BT": "BT", "HKT": "HKT", "VET": "VET", "WITA": "WITA", "SGT": "SGT", "ACDT": "ACDT", "WART": "WART", "WARST": "WARST", "GFT": "GFT", "MDT": "MDT", "AWDT": "AWDT", "BOT": "BOT", "OESZ": "OESZ", "CLT": "CLT", "CDT": "CDT", "ACST": "ACST", "CHAST": "CHAST", "AKST": "AKST", "NZDT": "NZDT"},
}
}
diff --git a/ln_CD/ln_CD_test.go b/ln_CD/ln_CD_test.go
new file mode 100644
index 00000000..42fc0ca7
--- /dev/null
+++ b/ln_CD/ln_CD_test.go
@@ -0,0 +1,1120 @@
+package ln_CD
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ln_CD"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ln_CF/ln_CF.go b/ln_CF/ln_CF.go
index 1372e0cd..cb9dba60 100644
--- a/ln_CF/ln_CF.go
+++ b/ln_CF/ln_CF.go
@@ -69,7 +69,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"libóso ya", "nsima ya Y"},
erasNarrow: []string{"", ""},
erasWide: []string{"Yambo ya Yézu Krís", "Nsima ya Yézu Krís"},
- timezones: map[string]string{"AWST": "AWST", "CHADT": "CHADT", "CAT": "Ntángo ya Lubumbashi", "ART": "ART", "JDT": "JDT", "WESZ": "WESZ", "OESZ": "OESZ", "TMT": "TMT", "AKDT": "AKDT", "UYST": "UYST", "CLST": "CLST", "HADT": "HADT", "WIT": "WIT", "ARST": "ARST", "SRT": "SRT", "ACWST": "ACWST", "HKT": "HKT", "SAST": "Ntángo ya Afríka ya Sidi", "MST": "MST", "VET": "VET", "ECT": "ECT", "WIB": "WIB", "CLT": "CLT", "NZDT": "NZDT", "WEZ": "WEZ", "SGT": "SGT", "MDT": "MDT", "HAST": "HAST", "COST": "COST", "MYT": "MYT", "AKST": "AKST", "ADT": "ADT", "LHST": "LHST", "EAT": "Ntángo ya Afríka ya Ɛ́sita", "MEZ": "MEZ", "BOT": "BOT", "CST": "CST", "CDT": "CDT", "AST": "AST", "ACST": "ACST", "CHAST": "CHAST", "COT": "COT", "WAST": "WAST", "BT": "BT", "GYT": "GYT", "EST": "EST", "OEZ": "OEZ", "LHDT": "LHDT", "MESZ": "MESZ", "NZST": "NZST", "AEDT": "AEDT", "HKST": "HKST", "GMT": "Ntángo ya Londoni", "GFT": "GFT", "IST": "IST", "PDT": "PDT", "PST": "PST", "EDT": "EDT", "HAT": "HAT", "∅∅∅": "∅∅∅", "AEST": "AEST", "WAT": "WAT", "WARST": "WARST", "TMST": "TMST", "ACWDT": "ACWDT", "ChST": "ChST", "WART": "WART", "HNT": "HNT", "AWDT": "AWDT", "JST": "JST", "UYT": "UYT", "WITA": "WITA", "ACDT": "ACDT"},
+ timezones: map[string]string{"MST": "MST", "EAT": "Ntángo ya Afríka ya Ɛ́sita", "WARST": "WARST", "ECT": "ECT", "AWST": "AWST", "ADT": "ADT", "EST": "EST", "BOT": "BOT", "VET": "VET", "WEZ": "WEZ", "TMT": "TMT", "OEZ": "OEZ", "LHST": "LHST", "WITA": "WITA", "AST": "AST", "PDT": "PDT", "MESZ": "MESZ", "LHDT": "LHDT", "BT": "BT", "CHAST": "CHAST", "CAT": "Ntángo ya Lubumbashi", "ChST": "ChST", "GMT": "Ntángo ya Londoni", "GFT": "GFT", "MDT": "MDT", "HKT": "HKT", "ART": "ART", "MEZ": "MEZ", "SAST": "Ntángo ya Afríka ya Sidi", "TMST": "TMST", "WAST": "WAST", "HKST": "HKST", "GYT": "GYT", "WIT": "WIT", "EDT": "EDT", "HAST": "HAST", "NZDT": "NZDT", "COT": "COT", "AEST": "AEST", "ACDT": "ACDT", "ACWST": "ACWST", "AWDT": "AWDT", "PST": "PST", "WESZ": "WESZ", "ACWDT": "ACWDT", "HADT": "HADT", "AEDT": "AEDT", "ACST": "ACST", "ARST": "ARST", "NZST": "NZST", "UYST": "UYST", "CST": "CST", "SGT": "SGT", "WIB": "WIB", "AKST": "AKST", "AKDT": "AKDT", "IST": "IST", "HAT": "HAT", "CDT": "CDT", "JST": "JST", "∅∅∅": "∅∅∅", "UYT": "UYT", "SRT": "SRT", "COST": "COST", "WAT": "WAT", "OESZ": "OESZ", "CHADT": "CHADT", "CLST": "CLST", "WART": "WART", "JDT": "JDT", "HNT": "HNT", "MYT": "MYT", "CLT": "CLT"},
}
}
diff --git a/ln_CF/ln_CF_test.go b/ln_CF/ln_CF_test.go
new file mode 100644
index 00000000..ffedd862
--- /dev/null
+++ b/ln_CF/ln_CF_test.go
@@ -0,0 +1,1120 @@
+package ln_CF
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ln_CF"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ln_CG/ln_CG.go b/ln_CG/ln_CG.go
index a252339d..b1f13895 100644
--- a/ln_CG/ln_CG.go
+++ b/ln_CG/ln_CG.go
@@ -69,7 +69,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"libóso ya", "nsima ya Y"},
erasNarrow: []string{"", ""},
erasWide: []string{"Yambo ya Yézu Krís", "Nsima ya Yézu Krís"},
- timezones: map[string]string{"CLST": "CLST", "COST": "COST", "OESZ": "OESZ", "ACDT": "ACDT", "∅∅∅": "∅∅∅", "AEDT": "AEDT", "MDT": "MDT", "CHADT": "CHADT", "ARST": "ARST", "WIT": "WIT", "AKST": "AKST", "VET": "VET", "WEZ": "WEZ", "GFT": "GFT", "ChST": "ChST", "WAT": "WAT", "EAT": "Ntángo ya Afríka ya Ɛ́sita", "CDT": "CDT", "EDT": "EDT", "AST": "AST", "GMT": "Ntángo ya Londoni", "HNT": "HNT", "TMST": "TMST", "UYST": "UYST", "MESZ": "MESZ", "COT": "COT", "WART": "WART", "HAST": "HAST", "WIB": "WIB", "TMT": "TMT", "JST": "JST", "PST": "PST", "MST": "MST", "ACWST": "ACWST", "AKDT": "AKDT", "HAT": "HAT", "OEZ": "OEZ", "MYT": "MYT", "MEZ": "MEZ", "CLT": "CLT", "SAST": "Ntángo ya Afríka ya Sidi", "IST": "IST", "ACWDT": "ACWDT", "ADT": "ADT", "BT": "BT", "HKST": "HKST", "SRT": "SRT", "EST": "EST", "WARST": "WARST", "SGT": "SGT", "HKT": "HKT", "JDT": "JDT", "CST": "CST", "WESZ": "WESZ", "CAT": "Ntángo ya Lubumbashi", "PDT": "PDT", "AEST": "AEST", "WITA": "WITA", "AWDT": "AWDT", "NZDT": "NZDT", "HADT": "HADT", "WAST": "WAST", "AWST": "AWST", "LHST": "LHST", "ECT": "ECT", "ART": "ART", "LHDT": "LHDT", "BOT": "BOT", "ACST": "ACST", "GYT": "GYT", "NZST": "NZST", "UYT": "UYT", "CHAST": "CHAST"},
+ timezones: map[string]string{"SRT": "SRT", "CHAST": "CHAST", "WITA": "WITA", "LHDT": "LHDT", "EAT": "Ntángo ya Afríka ya Ɛ́sita", "LHST": "LHST", "ACST": "ACST", "GFT": "GFT", "AKDT": "AKDT", "ADT": "ADT", "PST": "PST", "TMST": "TMST", "HKST": "HKST", "VET": "VET", "ARST": "ARST", "GMT": "Ntángo ya Londoni", "OEZ": "OEZ", "OESZ": "OESZ", "BT": "BT", "MESZ": "MESZ", "WAST": "WAST", "ChST": "ChST", "ACDT": "ACDT", "IST": "IST", "MEZ": "MEZ", "HADT": "HADT", "AEDT": "AEDT", "UYT": "UYT", "WARST": "WARST", "JDT": "JDT", "AST": "AST", "CAT": "Ntángo ya Lubumbashi", "WEZ": "WEZ", "WESZ": "WESZ", "MDT": "MDT", "HKT": "HKT", "AKST": "AKST", "AWST": "AWST", "PDT": "PDT", "∅∅∅": "∅∅∅", "ACWDT": "ACWDT", "COT": "COT", "UYST": "UYST", "CLT": "CLT", "CLST": "CLST", "CDT": "CDT", "ACWST": "ACWST", "BOT": "BOT", "CHADT": "CHADT", "NZDT": "NZDT", "HAST": "HAST", "AEST": "AEST", "COST": "COST", "WART": "WART", "ECT": "ECT", "AWDT": "AWDT", "EST": "EST", "TMT": "TMT", "HAT": "HAT", "CST": "CST", "NZST": "NZST", "EDT": "EDT", "WAT": "WAT", "HNT": "HNT", "JST": "JST", "SAST": "Ntángo ya Afríka ya Sidi", "SGT": "SGT", "WIT": "WIT", "MST": "MST", "ART": "ART", "WIB": "WIB", "GYT": "GYT", "MYT": "MYT"},
}
}
diff --git a/ln_CG/ln_CG_test.go b/ln_CG/ln_CG_test.go
new file mode 100644
index 00000000..b47cafc3
--- /dev/null
+++ b/ln_CG/ln_CG_test.go
@@ -0,0 +1,1120 @@
+package ln_CG
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ln_CG"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/lo/lo.go b/lo/lo.go
index 535d70ad..a564d6ba 100644
--- a/lo/lo.go
+++ b/lo/lo.go
@@ -69,7 +69,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ກ່ອນ ຄ.ສ.", "ຄ.ສ."},
erasNarrow: []string{"", ""},
erasWide: []string{"ກ່ອນຄຣິດສັກກະລາດ", "ຄຣິດສັກກະລາດ"},
- timezones: map[string]string{"WARST": "ເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນເວ\u200bສ\u200bເທິນອາ\u200bເຈນ\u200bທິ\u200bນາ", "HNT": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານ\u200bນິວ\u200bຟາວ\u200bແລນ", "ACDT": "ເວ\u200bລາ\u200bຕອນ\u200bທ່ຽງ\u200bອອສ\u200bເຕຣ\u200bເລຍ\u200bກາງ", "AST": "ເວລາມາດຕະຖານຂອງອາແລນຕິກ", "TMST": "ເວລາລະດູຮ້ອນຕວກເມນິສຖານ", "JDT": "ເວ\u200bລາ\u200bຕອນ\u200bທ່ຽງ\u200bຍີ່\u200bປຸ່ນ", "LHDT": "\u200bເວ\u200bລ\u200bສາ\u200bຕອນ\u200b\u200bທ່ຽງ\u200bລອດ\u200bເຮົາ\u200b", "ECT": "ເວ\u200bລາ\u200bເອ\u200bກົວ\u200bດໍ", "SGT": "ເວ\u200bລາ\u200bສິງ\u200bກະ\u200bໂປ", "BT": "ເວ\u200bລາ\u200bພູ\u200bຖານ", "WEZ": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານຢູ\u200bໂຣບ\u200bຕາ\u200bເວັນ\u200bຕົກ", "WIT": "ເວ\u200bລາ\u200bອິນ\u200bໂດ\u200bເນ\u200bເຊຍ\u200bຕາ\u200bເວັນ\u200bອອກ", "MDT": "ເວລາລະດູຮ້ອນມາເກົາ", "AWDT": "ເວ\u200bລາ\u200bຕອນ\u200bທ່ຽງ\u200bອອສ\u200bເຕຣ\u200bລຽນ\u200bຕາ\u200bເວັນ\u200bຕົກ", "EAT": "ເວ\u200bລາ\u200bອາ\u200bຟຣິ\u200bກາ\u200bຕາ\u200bເວັນ\u200bອອກ", "JST": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານ\u200bຍີ່\u200bປຸ່ນ", "AKST": "ເວລາມາດຕະຖານອະແລສກາ", "PST": "ເວລາມາດຕະຖານຂອງປາຊີຟິກ", "WESZ": "ເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນຢູ\u200bໂຣບ\u200bຕາ\u200bເວັນ\u200bຕົກ", "WART": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານເວ\u200bສ\u200bເທິນອາ\u200bເຈນ\u200bທິ\u200bນາ", "WIB": "ເວ\u200bລາ\u200bອິນ\u200bໂດ\u200bເນ\u200bເຊຍ\u200bຕາ\u200bເວັນ\u200bຕົກ", "IST": "ເວລາ ອິນເດຍ", "WITA": "ເວ\u200bລາ\u200bອິນ\u200bໂດ\u200bເນ\u200bເຊຍ\u200bກາງ", "UYST": "ເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນ\u200bອູ\u200bຣູ\u200bກວຍ", "VET": "ເວ\u200bລາ\u200bເວ\u200bເນ\u200bຊູ\u200bເອ\u200bລາ", "ChST": "ເວ\u200bລາ\u200bຈາ\u200bໂມ\u200bໂຣ", "COT": "ເວລາມາດຕະຖານໂຄລຳເບຍ", "ADT": "ເວລາກາງເວັນຂອງອາແລນຕິກ", "HAST": "ເວລາມາດຕະຖານຮາວາຍ-ເອລູທຽນ", "HKST": "\u200bເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນ\u200bຮອງ\u200bກົງ", "OEZ": "ເວ\u200bລາ\u200bມາ\u200bດ\u200bຕະ\u200bຖານ\u200bຢູ\u200bໂຣບ\u200bຕາ\u200bເວັນ\u200bອອກ", "ACWST": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານອອສ\u200bເຕຣ\u200bລຽນ\u200bກາງ\u200bຕາ\u200bເວັນ\u200bຕົກ", "EST": "ເວລາມາດຕະຖານຕາເວັນອອກ", "HAT": "\u200bເວ\u200bລາ\u200bຕອນ\u200bທ່ຽງ\u200bນິວ\u200bຟາວ\u200bແລນ", "MST": "ເວລາມາດຕະຖານມາເກົາ", "ARST": "\u200bເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນ\u200bອາ\u200bເຈນ\u200bທິ\u200bນາ", "∅∅∅": "ເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນອາ\u200bເມ\u200bຊອນ", "ACWDT": "ເວ\u200bລາ\u200bຕອນ\u200bທ່ຽງ\u200bອອສ\u200bເຕຣ\u200bລຽນ\u200bກາງ\u200bຕາ\u200bເວັນ\u200bຕົກ", "GMT": "ເວ\u200bລາກຣີນ\u200bວິ\u200bຊ", "TMT": "ເວລາມາດຕະຖານຕວກເມນິສຖານ", "CDT": "ເວລາກາງເວັນກາງ", "OESZ": "ເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນຢູ\u200bໂຣບ\u200bຕາ\u200bເວັນ\u200bອອກ", "MESZ": "\u200bເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນ\u200bຢູ\u200bໂຣບ\u200bກາງ", "BOT": "ເວ\u200bລາ\u200bໂບ\u200bລິ\u200bເວຍ", "CLST": "ເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນຊິ\u200bລີ", "AEDT": "ເວ\u200bລາ\u200bຕອນ\u200bທ່ຽງ\u200bອອສ\u200bເຕຣ\u200bລຽນ\u200bຕາ\u200bເວັນ\u200bອອກ", "WAST": "ເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນ\u200bອາ\u200bຟຣິ\u200bກາ\u200bຕາ\u200bເວັນ\u200bຕົກ", "ART": "\u200bເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານອາ\u200bເຈນ\u200bທິ\u200bນາ", "GYT": "ເວລາກາຍອານາ", "CST": "ເວລາມາດຕະຖານກາງ", "NZDT": "ເວ\u200bລາ\u200bຕອນ\u200bທ່ຽງ\u200bນິວ\u200bຊີ\u200bແລນ", "WAT": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານ\u200bອາ\u200bຟຣິ\u200bກາ\u200bຕາ\u200bເວັນ\u200bຕົກ", "HKT": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານ\u200bຮອງ\u200bກົງ", "MEZ": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານ\u200bຢູ\u200bໂຣບກາງ", "CHAST": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານ\u200bຊາ\u200bທາມ", "CHADT": "ເວ\u200bລາ\u200bຕອນ\u200bທ່ຽງ\u200bຊາ\u200bທາມ", "SRT": "ເວ\u200bລາ\u200bຊຸ\u200bຣິ\u200bນາມ", "LHST": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານ\u200bລອດ\u200bເຮົາ", "MYT": "ເວ\u200bລາ\u200bມາ\u200bເລ\u200bເຊຍ", "UYT": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານ\u200bອູ\u200bຣູ\u200bກວຍ", "AEST": "ເວ\u200bລາ\u200bມາດຕະຖານ\u200b\u200b\u200bອອສ\u200bເຕຣ\u200bລຽນ\u200bຕາ\u200bເວັນ\u200bອອກ", "CAT": "ເວ\u200bລາ\u200bອາ\u200bຟຣິ\u200bກາ\u200bກາງ", "HADT": "ເວລາຕອນທ່ຽງຮາວາຍ-ເອລູທຽນ", "GFT": "ເວ\u200bລາ\u200bເຟ\u200bຣນ\u200bຊ໌\u200bເກຍ\u200bນາ", "PDT": "ເວລາກາງເວັນຂອງປາຊີຟິກ", "EDT": "ເວລາຕອນທ່ຽງທາງຕາເວັນອອກ", "COST": "ເວລາລະດູຮ້ອນໂຄລໍາເບຍ", "SAST": "ເວ\u200bລາ\u200bອາ\u200bຟຣິ\u200bກາ\u200bໃຕ້", "ACST": "ເວ\u200bລາມາດ\u200bຕະ\u200bຖານອອ\u200bສ\u200bເຕຣ\u200bເລຍ\u200bກ\u200bາງ", "AWST": "ເວ\u200bລາ\u200bມາ\u200bດ\u200bຕະ\u200bຖານອອສ\u200bເຕຣ\u200bລຽນ\u200bຕາ\u200bເວັນ\u200bຕົກ", "NZST": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານນິວ\u200bຊີ\u200bແລນ", "CLT": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານຊິ\u200bລີ", "AKDT": "ເວລາກາງເວັນອະແລສກາ"},
+ timezones: map[string]string{"CST": "ເວລາມາດຕະຖານກາງ", "ARST": "\u200bເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນ\u200bອາ\u200bເຈນ\u200bທິ\u200bນາ", "HAST": "ເວລາມາດຕະຖານຮາວາຍ-ເອລູທຽນ", "NZDT": "ເວ\u200bລາ\u200bຕອນ\u200bທ່ຽງ\u200bນິວ\u200bຊີ\u200bແລນ", "WAT": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານ\u200bອາ\u200bຟຣິ\u200bກາ\u200bຕາ\u200bເວັນ\u200bຕົກ", "MYT": "ເວ\u200bລາ\u200bມາ\u200bເລ\u200bເຊຍ", "ACST": "ເວ\u200bລາມາດ\u200bຕະ\u200bຖານອອ\u200bສ\u200bເຕຣ\u200bເລຍ\u200bກ\u200bາງ", "AWST": "ເວ\u200bລາ\u200bມາ\u200bດ\u200bຕະ\u200bຖານອອສ\u200bເຕຣ\u200bລຽນ\u200bຕາ\u200bເວັນ\u200bຕົກ", "WIT": "ເວ\u200bລາ\u200bອິນ\u200bໂດ\u200bເນ\u200bເຊຍ\u200bຕາ\u200bເວັນ\u200bອອກ", "GMT": "ເວ\u200bລາກຣີນ\u200bວິ\u200bຊ", "EAT": "ເວ\u200bລາ\u200bອາ\u200bຟຣິ\u200bກາ\u200bຕາ\u200bເວັນ\u200bອອກ", "HKT": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານ\u200bຮອງ\u200bກົງ", "WITA": "ເວ\u200bລາ\u200bອິນ\u200bໂດ\u200bເນ\u200bເຊຍ\u200bກາງ", "HADT": "ເວລາຕອນທ່ຽງຮາວາຍ-ເອລູທຽນ", "SGT": "ເວ\u200bລາ\u200bສິງ\u200bກະ\u200bໂປ", "OESZ": "ເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນຢູ\u200bໂຣບ\u200bຕາ\u200bເວັນ\u200bອອກ", "CHAST": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານ\u200bຊາ\u200bທາມ", "WAST": "ເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນ\u200bອາ\u200bຟຣິ\u200bກາ\u200bຕາ\u200bເວັນ\u200bຕົກ", "OEZ": "ເວ\u200bລາ\u200bມາ\u200bດ\u200bຕະ\u200bຖານ\u200bຢູ\u200bໂຣບ\u200bຕາ\u200bເວັນ\u200bອອກ", "ACWDT": "ເວ\u200bລາ\u200bຕອນ\u200bທ່ຽງ\u200bອອສ\u200bເຕຣ\u200bລຽນ\u200bກາງ\u200bຕາ\u200bເວັນ\u200bຕົກ", "SAST": "ເວ\u200bລາ\u200bອາ\u200bຟຣິ\u200bກາ\u200bໃຕ້", "AEST": "ເວ\u200bລາ\u200bມາດຕະຖານ\u200b\u200b\u200bອອສ\u200bເຕຣ\u200bລຽນ\u200bຕາ\u200bເວັນ\u200bອອກ", "WESZ": "ເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນຢູ\u200bໂຣບ\u200bຕາ\u200bເວັນ\u200bຕົກ", "LHST": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານ\u200bລອດ\u200bເຮົາ", "BOT": "ເວ\u200bລາ\u200bໂບ\u200bລິ\u200bເວຍ", "PST": "ເວລາມາດຕະຖານຂອງປາຊີຟິກ", "ART": "\u200bເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານອາ\u200bເຈນ\u200bທິ\u200bນາ", "GFT": "ເວ\u200bລາ\u200bເຟ\u200bຣນ\u200bຊ໌\u200bເກຍ\u200bນາ", "HKST": "\u200bເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນ\u200bຮອງ\u200bກົງ", "ACWST": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານອອສ\u200bເຕຣ\u200bລຽນ\u200bກາງ\u200bຕາ\u200bເວັນ\u200bຕົກ", "JST": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານ\u200bຍີ່\u200bປຸ່ນ", "JDT": "ເວ\u200bລາ\u200bຕອນ\u200bທ່ຽງ\u200bຍີ່\u200bປຸ່ນ", "NZST": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານນິວ\u200bຊີ\u200bແລນ", "UYST": "ເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນ\u200bອູ\u200bຣູ\u200bກວຍ", "UYT": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານ\u200bອູ\u200bຣູ\u200bກວຍ", "CHADT": "ເວ\u200bລາ\u200bຕອນ\u200bທ່ຽງ\u200bຊາ\u200bທາມ", "AKDT": "ເວລາກາງເວັນອະແລສກາ", "MESZ": "\u200bເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນ\u200bຢູ\u200bໂຣບ\u200bກາງ", "MST": "ເວລາມາດຕະຖານແຖບພູເຂົາ", "LHDT": "\u200bເວ\u200bລ\u200bສາ\u200bຕອນ\u200b\u200bທ່ຽງ\u200bລອດ\u200bເຮົາ\u200b", "SRT": "ເວ\u200bລາ\u200bຊຸ\u200bຣິ\u200bນາມ", "AKST": "ເວລາມາດຕະຖານອະແລສກາ", "EDT": "ເວລາຕອນທ່ຽງທາງຕາເວັນອອກ", "WEZ": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານຢູ\u200bໂຣບ\u200bຕາ\u200bເວັນ\u200bຕົກ", "HNT": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານ\u200bນິວ\u200bຟາວ\u200bແລນ", "AEDT": "ເວ\u200bລາ\u200bຕອນ\u200bທ່ຽງ\u200bອອສ\u200bເຕຣ\u200bລຽນ\u200bຕາ\u200bເວັນ\u200bອອກ", "WARST": "ເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນເວ\u200bສ\u200bເທິນອາ\u200bເຈນ\u200bທິ\u200bນາ", "IST": "ເວລາ ອິນເດຍ", "EST": "ເວລາມາດຕະຖານຕາເວັນອອກ", "PDT": "ເວລາກາງເວັນຂອງປາຊີຟິກ", "GYT": "ເວລາກາຍອານາ", "ECT": "ເວ\u200bລາ\u200bເອ\u200bກົວ\u200bດໍ", "COT": "ເວລາມາດຕະຖານໂຄລຳເບຍ", "∅∅∅": "ເວລາຕາມເຂດລະດູຮ້ອນຕາມເຂດບຣາຊີເລຍ", "CLT": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານຊິ\u200bລີ", "CDT": "ເວລາກາງເວັນກາງ", "WART": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານເວ\u200bສ\u200bເທິນອາ\u200bເຈນ\u200bທິ\u200bນາ", "AWDT": "ເວ\u200bລາ\u200bຕອນ\u200bທ່ຽງ\u200bອອສ\u200bເຕຣ\u200bລຽນ\u200bຕາ\u200bເວັນ\u200bຕົກ", "TMT": "ເວລາມາດຕະຖານຕວກເມນິສຖານ", "HAT": "\u200bເວ\u200bລາ\u200bຕອນ\u200bທ່ຽງ\u200bນິວ\u200bຟາວ\u200bແລນ", "ChST": "ເວ\u200bລາ\u200bຈາ\u200bໂມ\u200bໂຣ", "ACDT": "ເວ\u200bລາ\u200bຕອນ\u200bທ່ຽງ\u200bອອສ\u200bເຕຣ\u200bເລຍ\u200bກາງ", "VET": "ເວ\u200bລາ\u200bເວ\u200bເນ\u200bຊູ\u200bເອ\u200bລາ", "ADT": "ເວລາກາງເວັນຂອງອາແລນຕິກ", "WIB": "ເວ\u200bລາ\u200bອິນ\u200bໂດ\u200bເນ\u200bເຊຍ\u200bຕາ\u200bເວັນ\u200bຕົກ", "CLST": "ເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນຊິ\u200bລີ", "MDT": "ເວລາກາງເວັນແຖວພູເຂົາ", "AST": "ເວລາມາດຕະຖານຂອງອາແລນຕິກ", "MEZ": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານ\u200bຢູ\u200bໂຣບກາງ", "TMST": "ເວລາລະດູຮ້ອນຕວກເມນິສຖານ", "BT": "ເວ\u200bລາ\u200bພູ\u200bຖານ", "COST": "ເວລາລະດູຮ້ອນໂຄລໍາເບຍ", "CAT": "ເວ\u200bລາ\u200bອາ\u200bຟຣິ\u200bກາ\u200bກາງ"},
}
}
diff --git a/lo/lo_test.go b/lo/lo_test.go
new file mode 100644
index 00000000..d7e51fae
--- /dev/null
+++ b/lo/lo_test.go
@@ -0,0 +1,1120 @@
+package lo
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "lo"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/lo_LA/lo_LA.go b/lo_LA/lo_LA.go
index 0b834cdd..9eb9dd18 100644
--- a/lo_LA/lo_LA.go
+++ b/lo_LA/lo_LA.go
@@ -69,7 +69,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ກ່ອນ ຄ.ສ.", "ຄ.ສ."},
erasNarrow: []string{"", ""},
erasWide: []string{"ກ່ອນຄຣິດສັກກະລາດ", "ຄຣິດສັກກະລາດ"},
- timezones: map[string]string{"EST": "ເວລາມາດຕະຖານຕາເວັນອອກ", "WART": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານເວ\u200bສ\u200bເທິນອາ\u200bເຈນ\u200bທິ\u200bນາ", "IST": "ເວລາ ອິນເດຍ", "GFT": "ເວ\u200bລາ\u200bເຟ\u200bຣນ\u200bຊ໌\u200bເກຍ\u200bນາ", "JST": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານ\u200bຍີ່\u200bປຸ່ນ", "CST": "ເວລາມາດຕະຖານກາງ", "ACWST": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານອອສ\u200bເຕຣ\u200bລຽນ\u200bກາງ\u200bຕາ\u200bເວັນ\u200bຕົກ", "BT": "ເວ\u200bລາ\u200bພູ\u200bຖານ", "WIB": "ເວ\u200bລາ\u200bອິນ\u200bໂດ\u200bເນ\u200bເຊຍ\u200bຕາ\u200bເວັນ\u200bຕົກ", "TMT": "ເວລາມາດຕະຖານຕວກເມນິສຖານ", "TMST": "ເວລາລະດູຮ້ອນຕວກເມນິສຖານ", "SRT": "ເວ\u200bລາ\u200bຊຸ\u200bຣິ\u200bນາມ", "NZST": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານນິວ\u200bຊີ\u200bແລນ", "∅∅∅": "ເວລາຕາມເຂດລະດູຮ້ອນຕາມເຂດບຣາຊີເລຍ", "AST": "ເວລາມາດຕະຖານຂອງອາແລນຕິກ", "WARST": "ເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນເວ\u200bສ\u200bເທິນອາ\u200bເຈນ\u200bທິ\u200bນາ", "ACST": "ເວ\u200bລາມາດ\u200bຕະ\u200bຖານອອ\u200bສ\u200bເຕຣ\u200bເລຍ\u200bກ\u200bາງ", "JDT": "ເວ\u200bລາ\u200bຕອນ\u200bທ່ຽງ\u200bຍີ່\u200bປຸ່ນ", "AEST": "ເວ\u200bລາ\u200bມາດຕະຖານ\u200b\u200b\u200bອອສ\u200bເຕຣ\u200bລຽນ\u200bຕາ\u200bເວັນ\u200bອອກ", "ECT": "ເວ\u200bລາ\u200bເອ\u200bກົວ\u200bດໍ", "WESZ": "ເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນຢູ\u200bໂຣບ\u200bຕາ\u200bເວັນ\u200bຕົກ", "SAST": "ເວ\u200bລາ\u200bອາ\u200bຟຣິ\u200bກາ\u200bໃຕ້", "OEZ": "ເວ\u200bລາ\u200bມາ\u200bດ\u200bຕະ\u200bຖານ\u200bຢູ\u200bໂຣບ\u200bຕາ\u200bເວັນ\u200bອອກ", "ARST": "\u200bເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນ\u200bອາ\u200bເຈນ\u200bທິ\u200bນາ", "WEZ": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານຢູ\u200bໂຣບ\u200bຕາ\u200bເວັນ\u200bຕົກ", "ACWDT": "ເວ\u200bລາ\u200bຕອນ\u200bທ່ຽງ\u200bອອສ\u200bເຕຣ\u200bລຽນ\u200bກາງ\u200bຕາ\u200bເວັນ\u200bຕົກ", "AEDT": "ເວ\u200bລາ\u200bຕອນ\u200bທ່ຽງ\u200bອອສ\u200bເຕຣ\u200bລຽນ\u200bຕາ\u200bເວັນ\u200bອອກ", "MST": "ເວລາມາດຕະຖານແຖບພູເຂົາ", "CAT": "ເວ\u200bລາ\u200bອາ\u200bຟຣິ\u200bກາ\u200bກາງ", "WAT": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານ\u200bອາ\u200bຟຣິ\u200bກາ\u200bຕາ\u200bເວັນ\u200bຕົກ", "EAT": "ເວ\u200bລາ\u200bອາ\u200bຟຣິ\u200bກາ\u200bຕາ\u200bເວັນ\u200bອອກ", "CDT": "ເວລາກາງເວັນກາງ", "HNT": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານ\u200bນິວ\u200bຟາວ\u200bແລນ", "AKDT": "ເວລາກາງເວັນອະແລສກາ", "AWST": "ເວ\u200bລາ\u200bມາ\u200bດ\u200bຕະ\u200bຖານອອສ\u200bເຕຣ\u200bລຽນ\u200bຕາ\u200bເວັນ\u200bຕົກ", "COT": "ເວລາມາດຕະຖານໂຄລຳເບຍ", "HAST": "ເວລາມາດຕະຖານຮາວາຍ-ເອລູທຽນ", "AKST": "ເວລາມາດຕະຖານອະແລສກາ", "MESZ": "\u200bເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນ\u200bຢູ\u200bໂຣບ\u200bກາງ", "NZDT": "ເວ\u200bລາ\u200bຕອນ\u200bທ່ຽງ\u200bນິວ\u200bຊີ\u200bແລນ", "UYST": "ເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນ\u200bອູ\u200bຣູ\u200bກວຍ", "CLT": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານຊິ\u200bລີ", "VET": "ເວ\u200bລາ\u200bເວ\u200bເນ\u200bຊູ\u200bເອ\u200bລາ", "CHAST": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານ\u200bຊາ\u200bທາມ", "HADT": "ເວລາຕອນທ່ຽງຮາວາຍ-ເອລູທຽນ", "PST": "ເວລາມາດຕະຖານຂອງປາຊີຟິກ", "LHDT": "\u200bເວ\u200bລ\u200bສາ\u200bຕອນ\u200b\u200bທ່ຽງ\u200bລອດ\u200bເຮົາ\u200b", "OESZ": "ເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນຢູ\u200bໂຣບ\u200bຕາ\u200bເວັນ\u200bອອກ", "WITA": "ເວ\u200bລາ\u200bອິນ\u200bໂດ\u200bເນ\u200bເຊຍ\u200bກາງ", "ART": "\u200bເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານອາ\u200bເຈນ\u200bທິ\u200bນາ", "MDT": "ເວລາກາງເວັນແຖວພູເຂົາ", "EDT": "ເວລາຕອນທ່ຽງທາງຕາເວັນອອກ", "WIT": "ເວ\u200bລາ\u200bອິນ\u200bໂດ\u200bເນ\u200bເຊຍ\u200bຕາ\u200bເວັນ\u200bອອກ", "GMT": "ເວ\u200bລາກຣີນ\u200bວິ\u200bຊ", "ACDT": "ເວ\u200bລາ\u200bຕອນ\u200bທ່ຽງ\u200bອອສ\u200bເຕຣ\u200bເລຍ\u200bກາງ", "PDT": "ເວລາກາງເວັນຂອງປາຊີຟິກ", "GYT": "ເວລາກາຍອານາ", "UYT": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານ\u200bອູ\u200bຣູ\u200bກວຍ", "SGT": "ເວ\u200bລາ\u200bສິງ\u200bກະ\u200bໂປ", "WAST": "ເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນ\u200bອາ\u200bຟຣິ\u200bກາ\u200bຕາ\u200bເວັນ\u200bຕົກ", "HKT": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານ\u200bຮອງ\u200bກົງ", "HAT": "\u200bເວ\u200bລາ\u200bຕອນ\u200bທ່ຽງ\u200bນິວ\u200bຟາວ\u200bແລນ", "LHST": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານ\u200bລອດ\u200bເຮົາ", "MEZ": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານ\u200bຢູ\u200bໂຣບກາງ", "BOT": "ເວ\u200bລາ\u200bໂບ\u200bລິ\u200bເວຍ", "CLST": "ເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນຊິ\u200bລີ", "ChST": "ເວ\u200bລາ\u200bຈາ\u200bໂມ\u200bໂຣ", "CHADT": "ເວ\u200bລາ\u200bຕອນ\u200bທ່ຽງ\u200bຊາ\u200bທາມ", "ADT": "ເວລາກາງເວັນຂອງອາແລນຕິກ", "HKST": "\u200bເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນ\u200bຮອງ\u200bກົງ", "MYT": "ເວ\u200bລາ\u200bມາ\u200bເລ\u200bເຊຍ", "COST": "ເວລາລະດູຮ້ອນໂຄລໍາເບຍ", "AWDT": "ເວ\u200bລາ\u200bຕອນ\u200bທ່ຽງ\u200bອອສ\u200bເຕຣ\u200bລຽນ\u200bຕາ\u200bເວັນ\u200bຕົກ"},
+ timezones: map[string]string{"ECT": "ເວ\u200bລາ\u200bເອ\u200bກົວ\u200bດໍ", "AKST": "ເວລາມາດຕະຖານອະແລສກາ", "WITA": "ເວ\u200bລາ\u200bອິນ\u200bໂດ\u200bເນ\u200bເຊຍ\u200bກາງ", "HNT": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານ\u200bນິວ\u200bຟາວ\u200bແລນ", "UYST": "ເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນ\u200bອູ\u200bຣູ\u200bກວຍ", "ACDT": "ເວ\u200bລາ\u200bຕອນ\u200bທ່ຽງ\u200bອອສ\u200bເຕຣ\u200bເລຍ\u200bກາງ", "∅∅∅": "ເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນອາ\u200bໂຊ\u200bເຣ\u200bສ", "NZDT": "ເວ\u200bລາ\u200bຕອນ\u200bທ່ຽງ\u200bນິວ\u200bຊີ\u200bແລນ", "SGT": "ເວ\u200bລາ\u200bສິງ\u200bກະ\u200bໂປ", "OEZ": "ເວ\u200bລາ\u200bມາ\u200bດ\u200bຕະ\u200bຖານ\u200bຢູ\u200bໂຣບ\u200bຕາ\u200bເວັນ\u200bອອກ", "BT": "ເວ\u200bລາ\u200bພູ\u200bຖານ", "LHST": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານ\u200bລອດ\u200bເຮົາ", "COT": "ເວລາມາດຕະຖານໂຄລຳເບຍ", "HKT": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານ\u200bຮອງ\u200bກົງ", "CHADT": "ເວ\u200bລາ\u200bຕອນ\u200bທ່ຽງ\u200bຊາ\u200bທາມ", "HADT": "ເວລາຕອນທ່ຽງຮາວາຍ-ເອລູທຽນ", "WARST": "ເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນເວ\u200bສ\u200bເທິນອາ\u200bເຈນ\u200bທິ\u200bນາ", "AWDT": "ເວ\u200bລາ\u200bຕອນ\u200bທ່ຽງ\u200bອອສ\u200bເຕຣ\u200bລຽນ\u200bຕາ\u200bເວັນ\u200bຕົກ", "SAST": "ເວ\u200bລາ\u200bອາ\u200bຟຣິ\u200bກາ\u200bໃຕ້", "WESZ": "ເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນຢູ\u200bໂຣບ\u200bຕາ\u200bເວັນ\u200bຕົກ", "AEDT": "ເວ\u200bລາ\u200bຕອນ\u200bທ່ຽງ\u200bອອສ\u200bເຕຣ\u200bລຽນ\u200bຕາ\u200bເວັນ\u200bອອກ", "JDT": "ເວ\u200bລາ\u200bຕອນ\u200bທ່ຽງ\u200bຍີ່\u200bປຸ່ນ", "AKDT": "ເວລາກາງເວັນອະແລສກາ", "MEZ": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານ\u200bຢູ\u200bໂຣບກາງ", "GMT": "ເວ\u200bລາກຣີນ\u200bວິ\u200bຊ", "MST": "ເວລາມາດຕະຖານມາເກົາ", "AST": "ເວລາມາດຕະຖານຂອງອາແລນຕິກ", "IST": "ເວລາ ອິນເດຍ", "TMST": "ເວລາລະດູຮ້ອນຕວກເມນິສຖານ", "CHAST": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານ\u200bຊາ\u200bທາມ", "ADT": "ເວລາກາງເວັນຂອງອາແລນຕິກ", "EST": "ເວລາມາດຕະຖານຕາເວັນອອກ", "PDT": "ເວລາກາງເວັນຂອງປາຊີຟິກ", "HAST": "ເວລາມາດຕະຖານຮາວາຍ-ເອລູທຽນ", "HAT": "\u200bເວ\u200bລາ\u200bຕອນ\u200bທ່ຽງ\u200bນິວ\u200bຟາວ\u200bແລນ", "CLT": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານຊິ\u200bລີ", "WIB": "ເວ\u200bລາ\u200bອິນ\u200bໂດ\u200bເນ\u200bເຊຍ\u200bຕາ\u200bເວັນ\u200bຕົກ", "WEZ": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານຢູ\u200bໂຣບ\u200bຕາ\u200bເວັນ\u200bຕົກ", "WAT": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານ\u200bອາ\u200bຟຣິ\u200bກາ\u200bຕາ\u200bເວັນ\u200bຕົກ", "OESZ": "ເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນຢູ\u200bໂຣບ\u200bຕາ\u200bເວັນ\u200bອອກ", "GFT": "ເວ\u200bລາ\u200bເຟ\u200bຣນ\u200bຊ໌\u200bເກຍ\u200bນາ", "VET": "ເວ\u200bລາ\u200bເວ\u200bເນ\u200bຊູ\u200bເອ\u200bລາ", "JST": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານ\u200bຍີ່\u200bປຸ່ນ", "ChST": "ເວ\u200bລາ\u200bຈາ\u200bໂມ\u200bໂຣ", "GYT": "ເວລາກາຍອານາ", "WIT": "ເວ\u200bລາ\u200bອິນ\u200bໂດ\u200bເນ\u200bເຊຍ\u200bຕາ\u200bເວັນ\u200bອອກ", "ACWST": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານອອສ\u200bເຕຣ\u200bລຽນ\u200bກາງ\u200bຕາ\u200bເວັນ\u200bຕົກ", "BOT": "ເວ\u200bລາ\u200bໂບ\u200bລິ\u200bເວຍ", "COST": "ເວລາລະດູຮ້ອນໂຄລໍາເບຍ", "UYT": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານ\u200bອູ\u200bຣູ\u200bກວຍ", "CLST": "ເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນຊິ\u200bລີ", "MDT": "ເວລາລະດູຮ້ອນມາເກົາ", "AEST": "ເວ\u200bລາ\u200bມາດຕະຖານ\u200b\u200b\u200bອອສ\u200bເຕຣ\u200bລຽນ\u200bຕາ\u200bເວັນ\u200bອອກ", "EAT": "ເວ\u200bລາ\u200bອາ\u200bຟຣິ\u200bກາ\u200bຕາ\u200bເວັນ\u200bອອກ", "ACST": "ເວ\u200bລາມາດ\u200bຕະ\u200bຖານອອ\u200bສ\u200bເຕຣ\u200bເລຍ\u200bກ\u200bາງ", "HKST": "\u200bເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນ\u200bຮອງ\u200bກົງ", "AWST": "ເວ\u200bລາ\u200bມາ\u200bດ\u200bຕະ\u200bຖານອອສ\u200bເຕຣ\u200bລຽນ\u200bຕາ\u200bເວັນ\u200bຕົກ", "ART": "\u200bເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານອາ\u200bເຈນ\u200bທິ\u200bນາ", "EDT": "ເວລາຕອນທ່ຽງທາງຕາເວັນອອກ", "MYT": "ເວ\u200bລາ\u200bມາ\u200bເລ\u200bເຊຍ", "CST": "ເວລາມາດຕະຖານກາງ", "CDT": "ເວລາກາງເວັນກາງ", "WART": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານເວ\u200bສ\u200bເທິນອາ\u200bເຈນ\u200bທິ\u200bນາ", "SRT": "ເວ\u200bລາ\u200bຊຸ\u200bຣິ\u200bນາມ", "ACWDT": "ເວ\u200bລາ\u200bຕອນ\u200bທ່ຽງ\u200bອອສ\u200bເຕຣ\u200bລຽນ\u200bກາງ\u200bຕາ\u200bເວັນ\u200bຕົກ", "ARST": "\u200bເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນ\u200bອາ\u200bເຈນ\u200bທິ\u200bນາ", "NZST": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານນິວ\u200bຊີ\u200bແລນ", "PST": "ເວລາມາດຕະຖານຂອງປາຊີຟິກ", "MESZ": "\u200bເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນ\u200bຢູ\u200bໂຣບ\u200bກາງ", "TMT": "ເວລາມາດຕະຖານຕວກເມນິສຖານ", "CAT": "ເວ\u200bລາ\u200bອາ\u200bຟຣິ\u200bກາ\u200bກາງ", "WAST": "ເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນ\u200bອາ\u200bຟຣິ\u200bກາ\u200bຕາ\u200bເວັນ\u200bຕົກ", "LHDT": "\u200bເວ\u200bລ\u200bສາ\u200bຕອນ\u200b\u200bທ່ຽງ\u200bລອດ\u200bເຮົາ\u200b"},
}
}
diff --git a/lo_LA/lo_LA_test.go b/lo_LA/lo_LA_test.go
new file mode 100644
index 00000000..7ed0e7fe
--- /dev/null
+++ b/lo_LA/lo_LA_test.go
@@ -0,0 +1,1120 @@
+package lo_LA
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "lo_LA"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/lrc/lrc.go b/lrc/lrc.go
index 410992fc..abff8361 100644
--- a/lrc/lrc.go
+++ b/lrc/lrc.go
@@ -64,7 +64,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BCE", "CE"},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"CHADT": "CHADT", "WITA": "WITA", "OESZ": "OESZ", "NZDT": "NZDT", "AEDT": "AEDT", "HKT": "HKT", "PST": "PST", "MESZ": "MESZ", "TMST": "TMST", "ARST": "ARST", "AWST": "AWST", "CHAST": "CHAST", "AEST": "AEST", "EDT": "EDT", "WAT": "WAT", "BOT": "BOT", "ADT": "ADT", "HADT": "HADT", "WIB": "WIB", "GMT": "GMT", "EAT": "EAT", "GYT": "GYT", "NZST": "NZST", "WESZ": "WESZ", "ACWDT": "ACWDT", "COT": "COT", "COST": "COST", "JDT": "JDT", "SRT": "SRT", "AKST": "AKST", "CST": "گاٛت مینجاٛیی ئستاٛنداٛرد", "ACWST": "ACWST", "ECT": "ECT", "HNT": "HNT", "ACDT": "ACDT", "MDT": "MDT", "HAST": "HAST", "JST": "JST", "MEZ": "MEZ", "EST": "EST", "WEZ": "WEZ", "AST": "AST", "SAST": "SAST", "HKST": "HKST", "ACST": "ACST", "LHST": "LHST", "∅∅∅": "∅∅∅", "SGT": "SGT", "WART": "WART", "WAST": "WAST", "IST": "IST", "UYT": "UYT", "UYST": "UYST", "CLT": "CLT", "CLST": "CLST", "BT": "BT", "GFT": "GFT", "VET": "VET", "LHDT": "LHDT", "WARST": "WARST", "MST": "MST", "ChST": "ChST", "HAT": "HAT", "PDT": "PDT", "AKDT": "AKDT", "WIT": "WIT", "TMT": "TMT", "ART": "ART", "MYT": "MYT", "CAT": "CAT", "OEZ": "OEZ", "AWDT": "AWDT", "CDT": "روٙشنایی نئهادار روٙز"},
+ timezones: map[string]string{"EST": "EST", "WAT": "WAT", "TMT": "TMT", "AEDT": "AEDT", "WIT": "WIT", "AWST": "AWST", "CLST": "CLST", "UYST": "UYST", "HADT": "HADT", "WARST": "WARST", "ACWST": "ACWST", "LHST": "LHST", "GFT": "GFT", "WITA": "WITA", "COST": "COST", "MST": "MST", "WART": "WART", "AKDT": "AKDT", "ART": "ART", "JDT": "JDT", "HAST": "HAST", "HNT": "HNT", "WIB": "WIB", "OESZ": "OESZ", "ACDT": "ACDT", "ACWDT": "ACWDT", "HKT": "HKT", "WESZ": "WESZ", "MEZ": "MEZ", "BOT": "BOT", "CDT": "روٙشنایی نئهادار روٙز", "HKST": "HKST", "ECT": "ECT", "PST": "PST", "NZDT": "NZDT", "HAT": "HAT", "BT": "BT", "AKST": "AKST", "COT": "COT", "TMST": "TMST", "GYT": "GYT", "OEZ": "OEZ", "NZST": "NZST", "JST": "JST", "WAST": "WAST", "AEST": "AEST", "CST": "گاٛت مینجاٛیی ئستاٛنداٛرد", "AWDT": "AWDT", "EDT": "EDT", "WEZ": "WEZ", "CAT": "CAT", "ACST": "ACST", "IST": "IST", "PDT": "PDT", "MESZ": "MESZ", "SGT": "SGT", "CLT": "CLT", "AST": "AST", "GMT": "GMT", "MDT": "MDT", "EAT": "EAT", "SRT": "SRT", "CHADT": "CHADT", "ADT": "ADT", "∅∅∅": "∅∅∅", "ChST": "ChST", "LHDT": "LHDT", "MYT": "MYT", "ARST": "ARST", "UYT": "UYT", "CHAST": "CHAST", "VET": "VET", "SAST": "SAST"},
}
}
diff --git a/lrc/lrc_test.go b/lrc/lrc_test.go
new file mode 100644
index 00000000..b4f9a6c4
--- /dev/null
+++ b/lrc/lrc_test.go
@@ -0,0 +1,1120 @@
+package lrc
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "lrc"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/lrc_IQ/lrc_IQ.go b/lrc_IQ/lrc_IQ.go
index 5d6f6efc..b2445697 100644
--- a/lrc_IQ/lrc_IQ.go
+++ b/lrc_IQ/lrc_IQ.go
@@ -64,7 +64,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BCE", "CE"},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"WESZ": "WESZ", "CLST": "CLST", "ECT": "ECT", "AST": "AST", "UYT": "UYT", "SGT": "SGT", "GFT": "GFT", "ART": "ART", "HAST": "HAST", "JDT": "JDT", "AEST": "AEST", "TMST": "TMST", "MYT": "MYT", "HADT": "HADT", "MEZ": "MEZ", "HKST": "HKST", "OESZ": "OESZ", "ACDT": "ACDT", "WEZ": "WEZ", "CDT": "روٙشنایی نئهادار روٙز", "UYST": "UYST", "VET": "VET", "ACWST": "ACWST", "ChST": "ChST", "WAT": "WAT", "WIT": "WIT", "LHST": "LHST", "WARST": "WARST", "IST": "IST", "HNT": "HNT", "CHADT": "CHADT", "MESZ": "MESZ", "CHAST": "CHAST", "SAST": "SAST", "OEZ": "OEZ", "HAT": "HAT", "LHDT": "LHDT", "CST": "گاٛت مینجاٛیی ئستاٛنداٛرد", "BOT": "BOT", "MST": "MST", "CLT": "CLT", "WAST": "WAST", "AKDT": "AKDT", "PDT": "PDT", "GYT": "GYT", "ADT": "ADT", "BT": "BT", "GMT": "GMT", "TMT": "TMT", "SRT": "SRT", "∅∅∅": "∅∅∅", "NZDT": "NZDT", "AEDT": "AEDT", "MDT": "MDT", "EST": "EST", "COT": "COT", "EAT": "EAT", "AKST": "AKST", "EDT": "EDT", "ARST": "ARST", "NZST": "NZST", "AWST": "AWST", "WIB": "WIB", "ACST": "ACST", "PST": "PST", "JST": "JST", "CAT": "CAT", "COST": "COST", "WART": "WART", "AWDT": "AWDT", "HKT": "HKT", "WITA": "WITA", "ACWDT": "ACWDT"},
+ timezones: map[string]string{"WEZ": "WEZ", "OESZ": "OESZ", "CDT": "روٙشنایی نئهادار روٙز", "VET": "VET", "CHADT": "CHADT", "AST": "AST", "ACWST": "ACWST", "EST": "EST", "CAT": "CAT", "UYST": "UYST", "WAST": "WAST", "WART": "WART", "AKST": "AKST", "AEST": "AEST", "CLST": "CLST", "WIT": "WIT", "ChST": "ChST", "MESZ": "MESZ", "NZDT": "NZDT", "COT": "COT", "TMST": "TMST", "ACST": "ACST", "PST": "PST", "∅∅∅": "∅∅∅", "SGT": "SGT", "UYT": "UYT", "HKT": "HKT", "ART": "ART", "EAT": "EAT", "BT": "BT", "LHST": "LHST", "COST": "COST", "TMT": "TMT", "WAT": "WAT", "OEZ": "OEZ", "ARST": "ARST", "WITA": "WITA", "MEZ": "MEZ", "IST": "IST", "WIB": "WIB", "SRT": "SRT", "WARST": "WARST", "ECT": "ECT", "AKDT": "AKDT", "NZST": "NZST", "MST": "MST", "MDT": "MDT", "AWST": "AWST", "ADT": "ADT", "BOT": "BOT", "SAST": "SAST", "AEDT": "AEDT", "HKST": "HKST", "ACWDT": "ACWDT", "EDT": "EDT", "HNT": "HNT", "GFT": "GFT", "CST": "گاٛت مینجاٛیی ئستاٛنداٛرد", "ACDT": "ACDT", "CHAST": "CHAST", "AWDT": "AWDT", "PDT": "PDT", "HAST": "HAST", "GMT": "GMT", "HADT": "HADT", "CLT": "CLT", "JDT": "JDT", "MYT": "MYT", "LHDT": "LHDT", "JST": "JST", "HAT": "HAT", "WESZ": "WESZ", "GYT": "GYT"},
}
}
diff --git a/lrc_IQ/lrc_IQ_test.go b/lrc_IQ/lrc_IQ_test.go
new file mode 100644
index 00000000..e8528e00
--- /dev/null
+++ b/lrc_IQ/lrc_IQ_test.go
@@ -0,0 +1,1120 @@
+package lrc_IQ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "lrc_IQ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/lrc_IR/lrc_IR.go b/lrc_IR/lrc_IR.go
index fc11a470..eabdeb5d 100644
--- a/lrc_IR/lrc_IR.go
+++ b/lrc_IR/lrc_IR.go
@@ -64,7 +64,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BCE", "CE"},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"COST": "COST", "GFT": "GFT", "ACDT": "ACDT", "PST": "PST", "UYST": "UYST", "AEDT": "AEDT", "HKT": "HKT", "CST": "گاٛت مینجاٛیی ئستاٛنداٛرد", "UYT": "UYT", "AEST": "AEST", "SGT": "SGT", "WART": "WART", "ACST": "ACST", "JST": "JST", "MEZ": "MEZ", "BOT": "BOT", "ChST": "ChST", "CLST": "CLST", "COT": "COT", "EAT": "EAT", "AWST": "AWST", "MYT": "MYT", "CHAST": "CHAST", "ARST": "ARST", "NZDT": "NZDT", "OEZ": "OEZ", "GMT": "GMT", "WITA": "WITA", "∅∅∅": "∅∅∅", "ACWST": "ACWST", "CLT": "CLT", "ADT": "ADT", "AWDT": "AWDT", "JDT": "JDT", "CDT": "روٙشنایی نئهادار روٙز", "HADT": "HADT", "BT": "BT", "IST": "IST", "HAT": "HAT", "PDT": "PDT", "GYT": "GYT", "WIT": "WIT", "NZST": "NZST", "CHADT": "CHADT", "WARST": "WARST", "OESZ": "OESZ", "HNT": "HNT", "MST": "MST", "ART": "ART", "AKDT": "AKDT", "LHDT": "LHDT", "EST": "EST", "EDT": "EDT", "SRT": "SRT", "WESZ": "WESZ", "CAT": "CAT", "HAST": "HAST", "WAST": "WAST", "MDT": "MDT", "TMST": "TMST", "AKST": "AKST", "ACWDT": "ACWDT", "VET": "VET", "ECT": "ECT", "AST": "AST", "HKST": "HKST", "WIB": "WIB", "TMT": "TMT", "LHST": "LHST", "MESZ": "MESZ", "WEZ": "WEZ", "SAST": "SAST", "WAT": "WAT"},
+ timezones: map[string]string{"NZDT": "NZDT", "WIB": "WIB", "SRT": "SRT", "ARST": "ARST", "AWDT": "AWDT", "ACWDT": "ACWDT", "SAST": "SAST", "BT": "BT", "ACDT": "ACDT", "ACWST": "ACWST", "CAT": "CAT", "WART": "WART", "WEZ": "WEZ", "∅∅∅": "∅∅∅", "WAT": "WAT", "SGT": "SGT", "EAT": "EAT", "GFT": "GFT", "PST": "PST", "CLT": "CLT", "HAT": "HAT", "WESZ": "WESZ", "ChST": "ChST", "OEZ": "OEZ", "UYT": "UYT", "ADT": "ADT", "IST": "IST", "EDT": "EDT", "BOT": "BOT", "COST": "COST", "TMT": "TMT", "AEDT": "AEDT", "CLST": "CLST", "JDT": "JDT", "ECT": "ECT", "ART": "ART", "EST": "EST", "HAST": "HAST", "HADT": "HADT", "COT": "COT", "UYST": "UYST", "WIT": "WIT", "AST": "AST", "CHADT": "CHADT", "TMST": "TMST", "LHST": "LHST", "WARST": "WARST", "CDT": "روٙشنایی نئهادار روٙز", "HKT": "HKT", "VET": "VET", "AKST": "AKST", "NZST": "NZST", "MST": "MST", "HKST": "HKST", "MEZ": "MEZ", "GMT": "GMT", "GYT": "GYT", "CHAST": "CHAST", "AKDT": "AKDT", "MESZ": "MESZ", "ACST": "ACST", "PDT": "PDT", "WITA": "WITA", "AEST": "AEST", "MDT": "MDT", "AWST": "AWST", "MYT": "MYT", "CST": "گاٛت مینجاٛیی ئستاٛنداٛرد", "LHDT": "LHDT", "WAST": "WAST", "HNT": "HNT", "OESZ": "OESZ", "JST": "JST"},
}
}
diff --git a/lrc_IR/lrc_IR_test.go b/lrc_IR/lrc_IR_test.go
new file mode 100644
index 00000000..92e4c28f
--- /dev/null
+++ b/lrc_IR/lrc_IR_test.go
@@ -0,0 +1,1120 @@
+package lrc_IR
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "lrc_IR"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/lt/lt.go b/lt/lt.go
index 2b42268e..f4d90142 100644
--- a/lt/lt.go
+++ b/lt/lt.go
@@ -48,7 +48,7 @@ func New() locales.Translator {
locale: "lt",
pluralsCardinal: []locales.PluralRule{2, 4, 5, 6},
pluralsOrdinal: []locales.PluralRule{6},
- pluralsRange: []locales.PluralRule{2, 4, 5, 6},
+ pluralsRange: []locales.PluralRule{5, 6, 2, 4},
decimal: ",",
group: " ",
minus: "−",
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"pr. Kr.", "po Kr."},
erasNarrow: []string{"pr. Kr.", "po Kr."},
erasWide: []string{"prieš Kristų", "po Kristaus"},
- timezones: map[string]string{"AEDT": "Rytų Australijos vasaros laikas", "MST": "Makau žiemos laikas", "HADT": "Havajų–Aleutų vasaros laikas", "WART": "Vakarų Argentinos žiemos laikas", "ACDT": "Centrinės Australijos vasaros laikas", "ChST": "Čamoro laikas", "WAST": "Vakarų Afrikos vasaros laikas", "AST": "Atlanto žiemos laikas", "GFT": "Prancūzijos Gvianos laikas", "TMST": "Turkmėnistano vasaros laikas", "AKST": "Aliaskos žiemos laikas", "CDT": "Šiaurės Amerikos centro vasaros laikas", "VET": "Venesuelos laikas", "WEZ": "Vakarų Europos žiemos laikas", "HKT": "Honkongo žiemos laikas", "HKST": "Honkongo vasaros laikas", "HNT": "Niufaundlendo žiemos laikas", "WIB": "Vakarų Indonezijos laikas", "AWST": "Vakarų Australijos žiemos laikas", "AKDT": "Aliaskos vasaros laikas", "WESZ": "Vakarų Europos vasaros laikas", "SGT": "Singapūro laikas", "OEZ": "Rytų Europos žiemos laikas", "WIT": "Rytų Indonezijos laikas", "LHST": "Lordo Hau žiemos laikas", "GYT": "Gajanos laikas", "NZDT": "Naujosios Zelandijos vasaros laikas", "UYST": "Urugvajaus vasaros laikas", "MEZ": "Vidurio Europos žiemos laikas", "CST": "Šiaurės Amerikos centro žiemos laikas", "CHAST": "Čatamo žiemos laikas", "HAT": "Niufaundlendo vasaros laikas", "IST": "Indijos laikas", "ACST": "Centrinės Australijos žiemos laikas", "EAT": "Rytų Afrikos laikas", "COST": "Kolumbijos vasaros laikas", "HAST": "Havajų–Aleutų žiemos laikas", "CAT": "Centrinės Afrikos laikas", "SAST": "Pietų Afrikos laikas", "NZST": "Naujosios Zelandijos žiemos laikas", "EDT": "Šiaurės Amerikos rytų vasaros laikas", "MDT": "Makau vasaros laikas", "TMT": "Turkmėnistano žiemos laikas", "LHDT": "Lordo Hau vasaros laikas", "JDT": "Japonijos vasaros laikas", "SRT": "Surinamo laikas", "MESZ": "Vidurio Europos vasaros laikas", "BT": "Butano laikas", "WARST": "Vakarų Argentinos vasaros laikas", "GMT": "Grinvičo laikas", "ART": "Argentinos žiemos laikas", "CLT": "Čilės žiemos laikas", "CLST": "Čilės vasaros laikas", "∅∅∅": "Amazonės vasaros laikas", "ACWDT": "Centrinės vakarų Australijos vasaros laikas", "OESZ": "Rytų Europos vasaros laikas", "PST": "Šiaurės Amerikos Ramiojo vandenyno žiemos laikas", "COT": "Kolumbijos žiemos laikas", "WITA": "Centrinės Indonezijos laikas", "ARST": "Argentinos vasaros laikas", "AWDT": "Vakarų Australijos vasaros laikas", "MYT": "Malaizijos laikas", "EST": "Šiaurės Amerikos rytų žiemos laikas", "PDT": "Šiaurės Amerikos Ramiojo vandenyno vasaros laikas", "UYT": "Urugvajaus žiemos laikas", "AEST": "Rytų Australijos žiemos laikas", "CHADT": "Čatamo vasaros laikas", "ECT": "Ekvadoro laikas", "JST": "Japonijos žiemos laikas", "BOT": "Bolivijos laikas", "ACWST": "Centrinės vakarų Australijos žiemos laikas", "ADT": "Atlanto vasaros laikas", "WAT": "Vakarų Afrikos žiemos laikas"},
+ timezones: map[string]string{"WIB": "Vakarų Indonezijos laikas", "LHST": "Lordo Hau žiemos laikas", "ACST": "Centrinės Australijos žiemos laikas", "SRT": "Surinamo laikas", "GFT": "Prancūzijos Gvianos laikas", "AKST": "Aliaskos žiemos laikas", "ACWDT": "Centrinės vakarų Australijos vasaros laikas", "SAST": "Pietų Afrikos laikas", "ChST": "Čamoro laikas", "JST": "Japonijos žiemos laikas", "PDT": "Šiaurės Amerikos Ramiojo vandenyno vasaros laikas", "HADT": "Havajų–Aleutų vasaros laikas", "WAST": "Vakarų Afrikos vasaros laikas", "CST": "Šiaurės Amerikos centro žiemos laikas", "IST": "Indijos laikas", "AEST": "Rytų Australijos žiemos laikas", "WIT": "Rytų Indonezijos laikas", "CHAST": "Čatamo žiemos laikas", "AST": "Atlanto žiemos laikas", "MEZ": "Vidurio Europos žiemos laikas", "NZST": "Naujosios Zelandijos žiemos laikas", "MYT": "Malaizijos laikas", "UYT": "Urugvajaus žiemos laikas", "CHADT": "Čatamo vasaros laikas", "ARST": "Argentinos vasaros laikas", "COST": "Kolumbijos vasaros laikas", "OESZ": "Rytų Europos vasaros laikas", "EST": "Šiaurės Amerikos rytų žiemos laikas", "HNT": "Niufaundlendo žiemos laikas", "TMT": "Turkmėnistano žiemos laikas", "GYT": "Gajanos laikas", "UYST": "Urugvajaus vasaros laikas", "MDT": "Makau vasaros laikas", "ACWST": "Centrinės vakarų Australijos žiemos laikas", "AWDT": "Vakarų Australijos vasaros laikas", "JDT": "Japonijos vasaros laikas", "BOT": "Bolivijos laikas", "HAT": "Niufaundlendo vasaros laikas", "AWST": "Vakarų Australijos žiemos laikas", "ART": "Argentinos žiemos laikas", "WITA": "Centrinės Indonezijos laikas", "WESZ": "Vakarų Europos vasaros laikas", "AEDT": "Rytų Australijos vasaros laikas", "CDT": "Šiaurės Amerikos centro vasaros laikas", "MST": "Makau žiemos laikas", "HKT": "Honkongo žiemos laikas", "WAT": "Vakarų Afrikos žiemos laikas", "WEZ": "Vakarų Europos žiemos laikas", "SGT": "Singapūro laikas", "LHDT": "Lordo Hau vasaros laikas", "ECT": "Ekvadoro laikas", "PST": "Šiaurės Amerikos Ramiojo vandenyno žiemos laikas", "HKST": "Honkongo vasaros laikas", "AKDT": "Aliaskos vasaros laikas", "COT": "Kolumbijos žiemos laikas", "EAT": "Rytų Afrikos laikas", "WART": "Vakarų Argentinos žiemos laikas", "WARST": "Vakarų Argentinos vasaros laikas", "GMT": "Grinvičo laikas", "BT": "Butano laikas", "VET": "Venesuelos laikas", "EDT": "Šiaurės Amerikos rytų vasaros laikas", "MESZ": "Vidurio Europos vasaros laikas", "CAT": "Centrinės Afrikos laikas", "TMST": "Turkmėnistano vasaros laikas", "OEZ": "Rytų Europos žiemos laikas", "CLST": "Čilės vasaros laikas", "ADT": "Atlanto vasaros laikas", "HAST": "Havajų–Aleutų žiemos laikas", "ACDT": "Centrinės Australijos vasaros laikas", "∅∅∅": "Azorų Salų vasaros laikas", "NZDT": "Naujosios Zelandijos vasaros laikas", "CLT": "Čilės žiemos laikas"},
}
}
@@ -102,8 +102,8 @@ func (lt *lt) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
n := math.Abs(num)
f := locales.F(n, v)
- nMod100 := math.Mod(n, 100)
nMod10 := math.Mod(n, 10)
+ nMod100 := math.Mod(n, 100)
if nMod10 == 1 && nMod100 < 11 && nMod100 > 19 {
return locales.PluralRuleOne
diff --git a/lt/lt_test.go b/lt/lt_test.go
new file mode 100644
index 00000000..97823f94
--- /dev/null
+++ b/lt/lt_test.go
@@ -0,0 +1,1120 @@
+package lt
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "lt"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/lt_LT/lt_LT.go b/lt_LT/lt_LT.go
index 3faa91de..b3d8b5fa 100644
--- a/lt_LT/lt_LT.go
+++ b/lt_LT/lt_LT.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"pr. Kr.", "po Kr."},
erasNarrow: []string{"pr. Kr.", "po Kr."},
erasWide: []string{"prieš Kristų", "po Kristaus"},
- timezones: map[string]string{"EDT": "Šiaurės Amerikos rytų vasaros laikas", "WAST": "Vakarų Afrikos vasaros laikas", "MYT": "Malaizijos laikas", "JST": "Japonijos žiemos laikas", "AEST": "Rytų Australijos žiemos laikas", "LHST": "Lordo Hau žiemos laikas", "NZST": "Naujosios Zelandijos žiemos laikas", "HKT": "Honkongo žiemos laikas", "OESZ": "Rytų Europos vasaros laikas", "WEZ": "Vakarų Europos žiemos laikas", "CHAST": "Čatamo žiemos laikas", "VET": "Venesuelos laikas", "COT": "Kolumbijos žiemos laikas", "COST": "Kolumbijos vasaros laikas", "ADT": "Atlanto vasaros laikas", "TMST": "Turkmėnistano vasaros laikas", "GYT": "Gajanos laikas", "UYT": "Urugvajaus žiemos laikas", "CHADT": "Čatamo vasaros laikas", "SAST": "Pietų Afrikos laikas", "IST": "Indijos laikas", "ARST": "Argentinos vasaros laikas", "AKST": "Aliaskos žiemos laikas", "PDT": "Šiaurės Amerikos Ramiojo vandenyno vasaros laikas", "AEDT": "Rytų Australijos vasaros laikas", "EST": "Šiaurės Amerikos rytų žiemos laikas", "GFT": "Prancūzijos Gvianos laikas", "CDT": "Šiaurės Amerikos centro vasaros laikas", "HNT": "Niufaundlendo žiemos laikas", "HAT": "Niufaundlendo vasaros laikas", "HKST": "Honkongo vasaros laikas", "AWDT": "Vakarų Australijos vasaros laikas", "MST": "Šiaurės Amerikos kalnų žiemos laikas", "HADT": "Havajų–Aleutų vasaros laikas", "WIT": "Rytų Indonezijos laikas", "JDT": "Japonijos vasaros laikas", "∅∅∅": "Brazilijos vasaros laikas", "SGT": "Singapūro laikas", "ART": "Argentinos žiemos laikas", "CST": "Šiaurės Amerikos centro žiemos laikas", "TMT": "Turkmėnistano žiemos laikas", "WAT": "Vakarų Afrikos žiemos laikas", "ACDT": "Centrinės Australijos vasaros laikas", "PST": "Šiaurės Amerikos Ramiojo vandenyno žiemos laikas", "UYST": "Urugvajaus vasaros laikas", "WESZ": "Vakarų Europos vasaros laikas", "CAT": "Centrinės Afrikos laikas", "WARST": "Vakarų Argentinos vasaros laikas", "AWST": "Vakarų Australijos žiemos laikas", "LHDT": "Lordo Hau vasaros laikas", "ACST": "Centrinės Australijos žiemos laikas", "ACWST": "Centrinės vakarų Australijos žiemos laikas", "ChST": "Čamoro laikas", "MDT": "Šiaurės Amerikos kalnų vasaros laikas", "HAST": "Havajų–Aleutų žiemos laikas", "BT": "Butano laikas", "WIB": "Vakarų Indonezijos laikas", "ACWDT": "Centrinės vakarų Australijos vasaros laikas", "CLT": "Čilės žiemos laikas", "WART": "Vakarų Argentinos žiemos laikas", "AKDT": "Aliaskos vasaros laikas", "CLST": "Čilės vasaros laikas", "WITA": "Centrinės Indonezijos laikas", "SRT": "Surinamo laikas", "MEZ": "Vidurio Europos žiemos laikas", "MESZ": "Vidurio Europos vasaros laikas", "BOT": "Bolivijos laikas", "ECT": "Ekvadoro laikas", "AST": "Atlanto žiemos laikas", "OEZ": "Rytų Europos žiemos laikas", "GMT": "Grinvičo laikas", "EAT": "Rytų Afrikos laikas", "NZDT": "Naujosios Zelandijos vasaros laikas"},
+ timezones: map[string]string{"SGT": "Singapūro laikas", "COT": "Kolumbijos žiemos laikas", "GMT": "Grinvičo laikas", "UYT": "Urugvajaus žiemos laikas", "CHAST": "Čatamo žiemos laikas", "PST": "Šiaurės Amerikos Ramiojo vandenyno žiemos laikas", "NZST": "Naujosios Zelandijos žiemos laikas", "IST": "Indijos laikas", "UYST": "Urugvajaus vasaros laikas", "LHST": "Lordo Hau žiemos laikas", "CST": "Šiaurės Amerikos centro žiemos laikas", "EDT": "Šiaurės Amerikos rytų vasaros laikas", "TMST": "Turkmėnistano vasaros laikas", "CAT": "Centrinės Afrikos laikas", "AEDT": "Rytų Australijos vasaros laikas", "CLT": "Čilės žiemos laikas", "MDT": "Šiaurės Amerikos kalnų vasaros laikas", "VET": "Venesuelos laikas", "ACWST": "Centrinės vakarų Australijos žiemos laikas", "WAT": "Vakarų Afrikos žiemos laikas", "WAST": "Vakarų Afrikos vasaros laikas", "AST": "Atlanto žiemos laikas", "HNT": "Niufaundlendo žiemos laikas", "MST": "Šiaurės Amerikos kalnų žiemos laikas", "CLST": "Čilės vasaros laikas", "∅∅∅": "Brazilijos vasaros laikas", "WARST": "Vakarų Argentinos vasaros laikas", "CHADT": "Čatamo vasaros laikas", "JST": "Japonijos žiemos laikas", "HAT": "Niufaundlendo vasaros laikas", "COST": "Kolumbijos vasaros laikas", "ChST": "Čamoro laikas", "OESZ": "Rytų Europos vasaros laikas", "HKT": "Honkongo žiemos laikas", "ADT": "Atlanto vasaros laikas", "NZDT": "Naujosios Zelandijos vasaros laikas", "WESZ": "Vakarų Europos vasaros laikas", "AKDT": "Aliaskos vasaros laikas", "TMT": "Turkmėnistano žiemos laikas", "OEZ": "Rytų Europos žiemos laikas", "AKST": "Aliaskos žiemos laikas", "PDT": "Šiaurės Amerikos Ramiojo vandenyno vasaros laikas", "MYT": "Malaizijos laikas", "CDT": "Šiaurės Amerikos centro vasaros laikas", "ACDT": "Centrinės Australijos vasaros laikas", "HKST": "Honkongo vasaros laikas", "ART": "Argentinos žiemos laikas", "WART": "Vakarų Argentinos žiemos laikas", "WITA": "Centrinės Indonezijos laikas", "HADT": "Havajų–Aleutų vasaros laikas", "BOT": "Bolivijos laikas", "AEST": "Rytų Australijos žiemos laikas", "GFT": "Prancūzijos Gvianos laikas", "ECT": "Ekvadoro laikas", "AWST": "Vakarų Australijos žiemos laikas", "SAST": "Pietų Afrikos laikas", "WIT": "Rytų Indonezijos laikas", "BT": "Butano laikas", "LHDT": "Lordo Hau vasaros laikas", "SRT": "Surinamo laikas", "ACWDT": "Centrinės vakarų Australijos vasaros laikas", "EAT": "Rytų Afrikos laikas", "AWDT": "Vakarų Australijos vasaros laikas", "ARST": "Argentinos vasaros laikas", "HAST": "Havajų–Aleutų žiemos laikas", "EST": "Šiaurės Amerikos rytų žiemos laikas", "MEZ": "Vidurio Europos žiemos laikas", "WEZ": "Vakarų Europos žiemos laikas", "ACST": "Centrinės Australijos žiemos laikas", "JDT": "Japonijos vasaros laikas", "MESZ": "Vidurio Europos vasaros laikas", "WIB": "Vakarų Indonezijos laikas", "GYT": "Gajanos laikas"},
}
}
diff --git a/lt_LT/lt_LT_test.go b/lt_LT/lt_LT_test.go
new file mode 100644
index 00000000..20d56847
--- /dev/null
+++ b/lt_LT/lt_LT_test.go
@@ -0,0 +1,1120 @@
+package lt_LT
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "lt_LT"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/lu/lu.go b/lu/lu.go
index a18cfe79..d7626032 100644
--- a/lu/lu.go
+++ b/lu/lu.go
@@ -61,7 +61,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"kmp. Y.K.", "kny. Y. K."},
erasNarrow: []string{"", ""},
erasWide: []string{"Kumpala kwa Yezu Kli", "Kunyima kwa Yezu Kli"},
- timezones: map[string]string{"MDT": "MDT", "LHDT": "LHDT", "GYT": "GYT", "ChST": "ChST", "ACWST": "ACWST", "∅∅∅": "∅∅∅", "HKT": "HKT", "WIT": "WIT", "WESZ": "WESZ", "AKST": "AKST", "CST": "CST", "CHADT": "CHADT", "AWST": "AWST", "EST": "EST", "SAST": "SAST", "TMT": "TMT", "CLT": "CLT", "EDT": "EDT", "AWDT": "AWDT", "NZST": "NZST", "UYST": "UYST", "AEDT": "AEDT", "WITA": "WITA", "JDT": "JDT", "UYT": "UYT", "ART": "ART", "WART": "WART", "WAST": "WAST", "OESZ": "OESZ", "HAT": "HAT", "MYT": "MYT", "LHST": "LHST", "CLST": "CLST", "AEST": "AEST", "HADT": "HADT", "HKST": "HKST", "ACST": "ACST", "HNT": "HNT", "WIB": "WIB", "GMT": "GMT", "TMST": "TMST", "MST": "MST", "ECT": "ECT", "CAT": "CAT", "BT": "BT", "BOT": "BOT", "CHAST": "CHAST", "GFT": "GFT", "PDT": "PDT", "WEZ": "WEZ", "WAT": "WAT", "CDT": "CDT", "MEZ": "MEZ", "AST": "AST", "ADT": "ADT", "HAST": "HAST", "COT": "COT", "SGT": "SGT", "PST": "PST", "SRT": "SRT", "ACWDT": "ACWDT", "COST": "COST", "IST": "IST", "EAT": "EAT", "VET": "VET", "WARST": "WARST", "ACDT": "ACDT", "AKDT": "AKDT", "OEZ": "OEZ", "MESZ": "MESZ", "ARST": "ARST", "JST": "JST", "NZDT": "NZDT"},
+ timezones: map[string]string{"AWDT": "AWDT", "BOT": "BOT", "WAST": "WAST", "HNT": "HNT", "WARST": "WARST", "AST": "AST", "AEST": "AEST", "MST": "MST", "CHAST": "CHAST", "WITA": "WITA", "EDT": "EDT", "UYST": "UYST", "ACDT": "ACDT", "MDT": "MDT", "PST": "PST", "PDT": "PDT", "MEZ": "MEZ", "NZDT": "NZDT", "TMT": "TMT", "TMST": "TMST", "CAT": "CAT", "AWST": "AWST", "EAT": "EAT", "GYT": "GYT", "IST": "IST", "WAT": "WAT", "WIB": "WIB", "HKST": "HKST", "ACWDT": "ACWDT", "WEZ": "WEZ", "CLT": "CLT", "ACST": "ACST", "ECT": "ECT", "CDT": "CDT", "SRT": "SRT", "ChST": "ChST", "HKT": "HKT", "ACWST": "ACWST", "ART": "ART", "HAST": "HAST", "HADT": "HADT", "NZST": "NZST", "OESZ": "OESZ", "GFT": "GFT", "BT": "BT", "COST": "COST", "GMT": "GMT", "WIT": "WIT", "LHDT": "LHDT", "JDT": "JDT", "UYT": "UYT", "WART": "WART", "OEZ": "OEZ", "SAST": "SAST", "CLST": "CLST", "CST": "CST", "JST": "JST", "MESZ": "MESZ", "HAT": "HAT", "ADT": "ADT", "VET": "VET", "AKST": "AKST", "AKDT": "AKDT", "COT": "COT", "∅∅∅": "∅∅∅", "ARST": "ARST", "EST": "EST", "WESZ": "WESZ", "SGT": "SGT", "CHADT": "CHADT", "LHST": "LHST", "MYT": "MYT", "AEDT": "AEDT"},
}
}
diff --git a/lu/lu_test.go b/lu/lu_test.go
new file mode 100644
index 00000000..3507bf39
--- /dev/null
+++ b/lu/lu_test.go
@@ -0,0 +1,1120 @@
+package lu
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "lu"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/lu_CD/lu_CD.go b/lu_CD/lu_CD.go
index 9fde5ae6..3e54cb3e 100644
--- a/lu_CD/lu_CD.go
+++ b/lu_CD/lu_CD.go
@@ -61,7 +61,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"kmp. Y.K.", "kny. Y. K."},
erasNarrow: []string{"", ""},
erasWide: []string{"Kumpala kwa Yezu Kli", "Kunyima kwa Yezu Kli"},
- timezones: map[string]string{"WAT": "WAT", "MYT": "MYT", "AEST": "AEST", "HAST": "HAST", "SGT": "SGT", "PDT": "PDT", "JDT": "JDT", "SRT": "SRT", "ACWDT": "ACWDT", "AEDT": "AEDT", "VET": "VET", "WART": "WART", "WARST": "WARST", "MDT": "MDT", "JST": "JST", "CHAST": "CHAST", "NZST": "NZST", "CAT": "CAT", "LHDT": "LHDT", "WESZ": "WESZ", "ECT": "ECT", "MEZ": "MEZ", "CDT": "CDT", "CLST": "CLST", "EDT": "EDT", "WAST": "WAST", "OESZ": "OESZ", "HNT": "HNT", "WIT": "WIT", "LHST": "LHST", "MESZ": "MESZ", "BOT": "BOT", "HKST": "HKST", "ARST": "ARST", "NZDT": "NZDT", "ACST": "ACST", "TMT": "TMT", "EAT": "EAT", "UYST": "UYST", "CST": "CST", "GMT": "GMT", "AWDT": "AWDT", "AKDT": "AKDT", "WEZ": "WEZ", "∅∅∅": "∅∅∅", "HKT": "HKT", "SAST": "SAST", "HAT": "HAT", "ART": "ART", "TMST": "TMST", "AWST": "AWST", "AST": "AST", "BT": "BT", "OEZ": "OEZ", "GFT": "GFT", "PST": "PST", "GYT": "GYT", "ACDT": "ACDT", "CLT": "CLT", "ADT": "ADT", "WITA": "WITA", "AKST": "AKST", "CHADT": "CHADT", "HADT": "HADT", "WIB": "WIB", "IST": "IST", "MST": "MST", "UYT": "UYT", "ACWST": "ACWST", "ChST": "ChST", "EST": "EST", "COT": "COT", "COST": "COST"},
+ timezones: map[string]string{"MEZ": "MEZ", "CLT": "CLT", "HKST": "HKST", "ECT": "ECT", "WEZ": "WEZ", "MDT": "MDT", "ACST": "ACST", "VET": "VET", "WART": "WART", "GFT": "GFT", "ACWST": "ACWST", "EDT": "EDT", "TMT": "TMT", "WAST": "WAST", "BT": "BT", "JDT": "JDT", "AWDT": "AWDT", "PDT": "PDT", "ChST": "ChST", "CDT": "CDT", "CHADT": "CHADT", "MYT": "MYT", "CHAST": "CHAST", "ARST": "ARST", "ACWDT": "ACWDT", "HAT": "HAT", "EAT": "EAT", "COT": "COT", "CAT": "CAT", "WAT": "WAT", "HNT": "HNT", "HAST": "HAST", "ACDT": "ACDT", "SRT": "SRT", "WIB": "WIB", "WARST": "WARST", "AWST": "AWST", "JST": "JST", "AST": "AST", "MST": "MST", "NZDT": "NZDT", "COST": "COST", "OEZ": "OEZ", "WIT": "WIT", "HADT": "HADT", "GYT": "GYT", "AEST": "AEST", "WITA": "WITA", "∅∅∅": "∅∅∅", "SGT": "SGT", "HKT": "HKT", "ART": "ART", "BOT": "BOT", "WESZ": "WESZ", "CLST": "CLST", "ADT": "ADT", "IST": "IST", "EST": "EST", "LHST": "LHST", "LHDT": "LHDT", "CST": "CST", "PST": "PST", "TMST": "TMST", "AEDT": "AEDT", "UYST": "UYST", "GMT": "GMT", "UYT": "UYT", "AKST": "AKST", "AKDT": "AKDT", "MESZ": "MESZ", "NZST": "NZST", "SAST": "SAST", "OESZ": "OESZ"},
}
}
diff --git a/lu_CD/lu_CD_test.go b/lu_CD/lu_CD_test.go
new file mode 100644
index 00000000..cbc4fadb
--- /dev/null
+++ b/lu_CD/lu_CD_test.go
@@ -0,0 +1,1120 @@
+package lu_CD
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "lu_CD"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/luo/luo.go b/luo/luo.go
index c5f05410..06368682 100644
--- a/luo/luo.go
+++ b/luo/luo.go
@@ -59,7 +59,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"", ""},
erasWide: []string{"Kapok Kristo obiro", "Ka Kristo osebiro"},
- timezones: map[string]string{"ARST": "ARST", "MEZ": "MEZ", "EST": "EST", "ADT": "ADT", "WIB": "WIB", "ACDT": "ACDT", "JDT": "JDT", "HAST": "HAST", "WART": "WART", "OESZ": "OESZ", "HNT": "HNT", "MST": "MST", "AWDT": "AWDT", "AEST": "AEST", "AEDT": "AEDT", "MDT": "MDT", "∅∅∅": "∅∅∅", "CST": "CST", "CLT": "CLT", "GMT": "GMT", "WITA": "WITA", "AKST": "AKST", "PDT": "PDT", "CAT": "CAT", "SAST": "SAST", "PST": "PST", "EDT": "EDT", "AST": "AST", "HKT": "HKT", "CLST": "CLST", "HADT": "HADT", "WAT": "WAT", "EAT": "EAT", "AWST": "AWST", "CHAST": "CHAST", "CHADT": "CHADT", "WAST": "WAST", "ART": "ART", "AKDT": "AKDT", "LHDT": "LHDT", "MESZ": "MESZ", "NZST": "NZST", "COST": "COST", "ECT": "ECT", "WARST": "WARST", "HAT": "HAT", "OEZ": "OEZ", "ACST": "ACST", "TMT": "TMT", "SRT": "SRT", "JST": "JST", "BOT": "BOT", "UYT": "UYT", "HKST": "HKST", "GYT": "GYT", "WESZ": "WESZ", "ACWST": "ACWST", "SGT": "SGT", "IST": "IST", "CDT": "CDT", "ACWDT": "ACWDT", "BT": "BT", "WIT": "WIT", "TMST": "TMST", "MYT": "MYT", "UYST": "UYST", "VET": "VET", "WEZ": "WEZ", "COT": "COT", "LHST": "LHST", "NZDT": "NZDT", "ChST": "ChST", "GFT": "GFT"},
+ timezones: map[string]string{"AST": "AST", "UYT": "UYT", "CHADT": "CHADT", "AWDT": "AWDT", "WIB": "WIB", "CLT": "CLT", "CST": "CST", "HKST": "HKST", "PDT": "PDT", "WIT": "WIT", "EAT": "EAT", "CHAST": "CHAST", "WITA": "WITA", "TMST": "TMST", "AEDT": "AEDT", "LHST": "LHST", "ACST": "ACST", "WARST": "WARST", "HNT": "HNT", "AKST": "AKST", "SAST": "SAST", "IST": "IST", "OEZ": "OEZ", "GFT": "GFT", "HKT": "HKT", "NZST": "NZST", "NZDT": "NZDT", "HAST": "HAST", "WAT": "WAT", "WEZ": "WEZ", "SGT": "SGT", "GYT": "GYT", "JST": "JST", "BOT": "BOT", "PST": "PST", "VET": "VET", "JDT": "JDT", "ART": "ART", "TMT": "TMT", "HAT": "HAT", "AEST": "AEST", "CDT": "CDT", "ADT": "ADT", "MESZ": "MESZ", "CAT": "CAT", "ChST": "ChST", "WART": "WART", "WAST": "WAST", "LHDT": "LHDT", "MDT": "MDT", "CLST": "CLST", "∅∅∅": "∅∅∅", "GMT": "GMT", "MST": "MST", "AKDT": "AKDT", "ACWST": "ACWST", "ACWDT": "ACWDT", "ARST": "ARST", "MEZ": "MEZ", "MYT": "MYT", "AWST": "AWST", "EDT": "EDT", "ECT": "ECT", "OESZ": "OESZ", "UYST": "UYST", "ACDT": "ACDT", "SRT": "SRT", "EST": "EST", "HADT": "HADT", "WESZ": "WESZ", "COT": "COT", "COST": "COST", "BT": "BT"},
}
}
diff --git a/luo/luo_test.go b/luo/luo_test.go
new file mode 100644
index 00000000..795303de
--- /dev/null
+++ b/luo/luo_test.go
@@ -0,0 +1,1120 @@
+package luo
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "luo"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/luo_KE/luo_KE.go b/luo_KE/luo_KE.go
index 1fa1122b..0dffc800 100644
--- a/luo_KE/luo_KE.go
+++ b/luo_KE/luo_KE.go
@@ -59,7 +59,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"", ""},
erasWide: []string{"Kapok Kristo obiro", "Ka Kristo osebiro"},
- timezones: map[string]string{"HADT": "HADT", "WARST": "WARST", "WIT": "WIT", "AKST": "AKST", "JST": "JST", "CHADT": "CHADT", "BT": "BT", "HNT": "HNT", "ACST": "ACST", "NZST": "NZST", "NZDT": "NZDT", "MST": "MST", "WIB": "WIB", "ARST": "ARST", "LHST": "LHST", "ECT": "ECT", "WESZ": "WESZ", "MDT": "MDT", "WAST": "WAST", "MEZ": "MEZ", "WEZ": "WEZ", "CLT": "CLT", "ADT": "ADT", "ACDT": "ACDT", "MYT": "MYT", "ACWDT": "ACWDT", "IST": "IST", "AKDT": "AKDT", "PST": "PST", "AWST": "AWST", "AST": "AST", "ART": "ART", "CST": "CST", "∅∅∅": "∅∅∅", "GFT": "GFT", "OEZ": "OEZ", "VET": "VET", "BOT": "BOT", "AEDT": "AEDT", "EST": "EST", "GMT": "GMT", "CHAST": "CHAST", "CLST": "CLST", "CAT": "CAT", "SAST": "SAST", "HAT": "HAT", "TMT": "TMT", "LHDT": "LHDT", "CDT": "CDT", "ChST": "ChST", "SGT": "SGT", "SRT": "SRT", "AWDT": "AWDT", "HAST": "HAST", "COT": "COT", "COST": "COST", "HKT": "HKT", "OESZ": "OESZ", "EAT": "EAT", "TMST": "TMST", "JDT": "JDT", "ACWST": "ACWST", "UYT": "UYT", "MESZ": "MESZ", "EDT": "EDT", "WAT": "WAT", "WART": "WART", "PDT": "PDT", "AEST": "AEST", "WITA": "WITA", "GYT": "GYT", "UYST": "UYST", "HKST": "HKST"},
+ timezones: map[string]string{"MST": "MST", "ART": "ART", "WARST": "WARST", "ECT": "ECT", "ARST": "ARST", "JST": "JST", "PDT": "PDT", "HAT": "HAT", "ChST": "ChST", "CDT": "CDT", "AWST": "AWST", "PST": "PST", "SAST": "SAST", "COT": "COT", "JDT": "JDT", "EST": "EST", "WAT": "WAT", "WAST": "WAST", "AEDT": "AEDT", "UYT": "UYT", "BT": "BT", "ACST": "ACST", "HKST": "HKST", "IST": "IST", "SGT": "SGT", "OESZ": "OESZ", "LHDT": "LHDT", "CLT": "CLT", "MEZ": "MEZ", "HADT": "HADT", "HNT": "HNT", "CAT": "CAT", "LHST": "LHST", "GFT": "GFT", "NZDT": "NZDT", "CLST": "CLST", "MDT": "MDT", "TMT": "TMT", "AST": "AST", "WIB": "WIB", "WIT": "WIT", "CST": "CST", "WITA": "WITA", "CHAST": "CHAST", "VET": "VET", "WESZ": "WESZ", "AEST": "AEST", "WART": "WART", "∅∅∅": "∅∅∅", "CHADT": "CHADT", "GYT": "GYT", "EDT": "EDT", "UYST": "UYST", "EAT": "EAT", "HKT": "HKT", "ACWST": "ACWST", "AWDT": "AWDT", "HAST": "HAST", "BOT": "BOT", "TMST": "TMST", "OEZ": "OEZ", "SRT": "SRT", "ACWDT": "ACWDT", "WEZ": "WEZ", "MYT": "MYT", "ADT": "ADT", "MESZ": "MESZ", "COST": "COST", "AKDT": "AKDT", "NZST": "NZST", "GMT": "GMT", "ACDT": "ACDT", "AKST": "AKST"},
}
}
diff --git a/luo_KE/luo_KE_test.go b/luo_KE/luo_KE_test.go
new file mode 100644
index 00000000..5d46321d
--- /dev/null
+++ b/luo_KE/luo_KE_test.go
@@ -0,0 +1,1120 @@
+package luo_KE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "luo_KE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/luy/luy.go b/luy/luy.go
index 352e0f96..85d298dd 100644
--- a/luy/luy.go
+++ b/luy/luy.go
@@ -59,7 +59,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"", ""},
erasWide: []string{"Imberi ya Kuuza Kwa", "Muhiga Kuvita Kuuza"},
- timezones: map[string]string{"SRT": "SRT", "PDT": "PDT", "CHAST": "CHAST", "EST": "EST", "SGT": "SGT", "WEZ": "WEZ", "COST": "COST", "HKST": "HKST", "AWDT": "AWDT", "MESZ": "MESZ", "UYST": "UYST", "WARST": "WARST", "CDT": "CDT", "ACWDT": "ACWDT", "ECT": "ECT", "HAST": "HAST", "WITA": "WITA", "JDT": "JDT", "PST": "PST", "UYT": "UYT", "SAST": "SAST", "GYT": "GYT", "ACWST": "ACWST", "ChST": "ChST", "CHADT": "CHADT", "EDT": "EDT", "HAT": "HAT", "ACDT": "ACDT", "AKST": "AKST", "MEZ": "MEZ", "AEST": "AEST", "MDT": "MDT", "VET": "VET", "AST": "AST", "∅∅∅": "∅∅∅", "JST": "JST", "CST": "CST", "CAT": "CAT", "WART": "WART", "LHST": "LHST", "LHDT": "LHDT", "WESZ": "WESZ", "COT": "COT", "WIT": "WIT", "OEZ": "OEZ", "GMT": "GMT", "HNT": "HNT", "MST": "MST", "ARST": "ARST", "TMST": "TMST", "WAT": "WAT", "HKT": "HKT", "IST": "IST", "ART": "ART", "AWST": "AWST", "CLST": "CLST", "HADT": "HADT", "OESZ": "OESZ", "BT": "BT", "GFT": "GFT", "ACST": "ACST", "TMT": "TMT", "AKDT": "AKDT", "NZST": "NZST", "CLT": "CLT", "AEDT": "AEDT", "WIB": "WIB", "EAT": "EAT", "MYT": "MYT", "NZDT": "NZDT", "BOT": "BOT", "ADT": "ADT", "WAST": "WAST"},
+ timezones: map[string]string{"ChST": "ChST", "NZDT": "NZDT", "WITA": "WITA", "BOT": "BOT", "TMST": "TMST", "ACWDT": "ACWDT", "CHAST": "CHAST", "JDT": "JDT", "EDT": "EDT", "SGT": "SGT", "OESZ": "OESZ", "WART": "WART", "AWST": "AWST", "NZST": "NZST", "WESZ": "WESZ", "GYT": "GYT", "MDT": "MDT", "∅∅∅": "∅∅∅", "AWDT": "AWDT", "AKST": "AKST", "SAST": "SAST", "COST": "COST", "MYT": "MYT", "UYST": "UYST", "WARST": "WARST", "HNT": "HNT", "CAT": "CAT", "AEST": "AEST", "CLST": "CLST", "SRT": "SRT", "PDT": "PDT", "HAST": "HAST", "LHDT": "LHDT", "CLT": "CLT", "GFT": "GFT", "ART": "ART", "EST": "EST", "WAT": "WAT", "OEZ": "OEZ", "WIT": "WIT", "HKST": "HKST", "IST": "IST", "PST": "PST", "AEDT": "AEDT", "AST": "AST", "ACWST": "ACWST", "ARST": "ARST", "COT": "COT", "EAT": "EAT", "VET": "VET", "BT": "BT", "HKT": "HKT", "JST": "JST", "HADT": "HADT", "GMT": "GMT", "LHST": "LHST", "CDT": "CDT", "CST": "CST", "CHADT": "CHADT", "ECT": "ECT", "MST": "MST", "ADT": "ADT", "WEZ": "WEZ", "TMT": "TMT", "ACST": "ACST", "WAST": "WAST", "AKDT": "AKDT", "MEZ": "MEZ", "MESZ": "MESZ", "HAT": "HAT", "WIB": "WIB", "UYT": "UYT", "ACDT": "ACDT"},
}
}
diff --git a/luy/luy_test.go b/luy/luy_test.go
new file mode 100644
index 00000000..703744af
--- /dev/null
+++ b/luy/luy_test.go
@@ -0,0 +1,1120 @@
+package luy
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "luy"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/luy_KE/luy_KE.go b/luy_KE/luy_KE.go
index 20ff0e2b..7b3a55f7 100644
--- a/luy_KE/luy_KE.go
+++ b/luy_KE/luy_KE.go
@@ -59,7 +59,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"", ""},
erasWide: []string{"Imberi ya Kuuza Kwa", "Muhiga Kuvita Kuuza"},
- timezones: map[string]string{"WESZ": "WESZ", "EDT": "EDT", "ACST": "ACST", "BOT": "BOT", "CLST": "CLST", "COT": "COT", "OEZ": "OEZ", "MYT": "MYT", "ACWST": "ACWST", "LHDT": "LHDT", "PST": "PST", "MESZ": "MESZ", "ACWDT": "ACWDT", "TMST": "TMST", "UYST": "UYST", "EAT": "EAT", "AKDT": "AKDT", "NZST": "NZST", "CDT": "CDT", "EST": "EST", "AST": "AST", "SAST": "SAST", "WIB": "WIB", "WAST": "WAST", "WITA": "WITA", "AWST": "AWST", "CHAST": "CHAST", "AKST": "AKST", "AEDT": "AEDT", "BT": "BT", "GFT": "GFT", "ARST": "ARST", "LHST": "LHST", "ECT": "ECT", "SGT": "SGT", "GMT": "GMT", "HNT": "HNT", "UYT": "UYT", "CHADT": "CHADT", "HKST": "HKST", "WIT": "WIT", "GYT": "GYT", "JST": "JST", "HKT": "HKT", "TMT": "TMT", "MEZ": "MEZ", "VET": "VET", "HAST": "HAST", "WARST": "WARST", "PDT": "PDT", "ChST": "ChST", "MST": "MST", "JDT": "JDT", "WEZ": "WEZ", "CAT": "CAT", "ADT": "ADT", "HADT": "HADT", "ART": "ART", "ACDT": "ACDT", "AWDT": "AWDT", "SRT": "SRT", "AEST": "AEST", "COST": "COST", "∅∅∅": "∅∅∅", "WART": "WART", "HAT": "HAT", "CLT": "CLT", "NZDT": "NZDT", "CST": "CST", "WAT": "WAT", "IST": "IST", "OESZ": "OESZ", "MDT": "MDT"},
+ timezones: map[string]string{"HAT": "HAT", "BT": "BT", "CST": "CST", "TMST": "TMST", "GMT": "GMT", "AWDT": "AWDT", "EDT": "EDT", "CLST": "CLST", "CDT": "CDT", "PDT": "PDT", "HNT": "HNT", "WART": "WART", "CHADT": "CHADT", "VET": "VET", "ACWST": "ACWST", "MESZ": "MESZ", "EAT": "EAT", "WIT": "WIT", "MDT": "MDT", "ACDT": "ACDT", "CHAST": "CHAST", "ADT": "ADT", "ARST": "ARST", "WITA": "WITA", "WAT": "WAT", "AEDT": "AEDT", "WESZ": "WESZ", "HKT": "HKT", "AWST": "AWST", "EST": "EST", "HAST": "HAST", "OEZ": "OEZ", "∅∅∅": "∅∅∅", "MYT": "MYT", "SRT": "SRT", "AKST": "AKST", "SAST": "SAST", "HADT": "HADT", "ChST": "ChST", "LHDT": "LHDT", "OESZ": "OESZ", "GYT": "GYT", "LHST": "LHST", "CLT": "CLT", "ACST": "ACST", "ACWDT": "ACWDT", "WEZ": "WEZ", "SGT": "SGT", "JST": "JST", "NZST": "NZST", "PST": "PST", "BOT": "BOT", "COST": "COST", "WARST": "WARST", "WIB": "WIB", "ECT": "ECT", "AKDT": "AKDT", "IST": "IST", "CAT": "CAT", "WAST": "WAST", "AST": "AST", "MST": "MST", "UYT": "UYT", "NZDT": "NZDT", "AEST": "AEST", "JDT": "JDT", "MEZ": "MEZ", "TMT": "TMT", "GFT": "GFT", "HKST": "HKST", "ART": "ART", "COT": "COT", "UYST": "UYST"},
}
}
diff --git a/luy_KE/luy_KE_test.go b/luy_KE/luy_KE_test.go
new file mode 100644
index 00000000..2746529e
--- /dev/null
+++ b/luy_KE/luy_KE_test.go
@@ -0,0 +1,1120 @@
+package luy_KE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "luy_KE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/lv/lv.go b/lv/lv.go
index 45df2312..a298914b 100644
--- a/lv/lv.go
+++ b/lv/lv.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"p.m.ē.", "m.ē."},
erasNarrow: []string{"p.m.ē.", "m.ē."},
erasWide: []string{"pirms mūsu ēras", "mūsu ērā"},
- timezones: map[string]string{"AWST": "Austrālijas rietumu ziemas laiks", "MEZ": "Centrāleiropas ziemas laiks", "ChST": "Čamoro standarta laiks", "SAST": "Dienvidāfrikas ziemas laiks", "OEZ": "Austrumeiropas ziemas laiks", "OESZ": "Austrumeiropas vasaras laiks", "LHDT": "Lorda Hava salas vasaras laiks", "COST": "Kolumbijas vasaras laiks", "AST": "Atlantijas ziemas laiks", "HKT": "Honkongas ziemas laiks", "WAST": "Rietumāfrikas vasaras laiks", "MESZ": "Centrāleiropas vasaras laiks", "NZDT": "Jaunzēlandes vasaras laiks", "ECT": "Ekvadoras laiks", "CDT": "Centrālais vasaras laiks", "CHADT": "Četemas vasaras laiks", "ACST": "Austrālijas centrālais ziemas laiks", "AKST": "Aļaskas ziemas laiks", "PST": "Klusā okeāna ziemas laiks", "CAT": "Centrālāfrikas laiks", "EDT": "Austrumu vasaras laiks", "HAST": "Havaju–Aleutu ziemas laiks", "IST": "Indijas ziemas laiks", "GYT": "Gajānas laiks", "MYT": "Malaizijas laiks", "CLT": "Čīles ziemas laiks", "CLST": "Čīles vasaras laiks", "UYT": "Urugvajas ziemas laiks", "UYST": "Urugvajas vasaras laiks", "CHAST": "Četemas ziemas laiks", "ACWDT": "Austrālijas centrālais rietumu vasaras laiks", "HNT": "Ņūfaundlendas ziemas laiks", "WIT": "Austrumindonēzijas laiks", "LHST": "Lorda Hava salas ziemas laiks", "CST": "Centrālais ziemas laiks", "NZST": "Jaunzēlandes ziemas laiks", "AEST": "Austrālijas austrumu ziemas laiks", "ADT": "Atlantijas vasaras laiks", "ARST": "Argentīnas vasaras laiks", "ACDT": "Austrālijas centrālais vasaras laiks", "JDT": "Japānas vasaras laiks", "AKDT": "Aļaskas vasaras laiks", "AWDT": "Austrālijas rietumu vasaras laiks", "WARST": "Rietumargentīnas vasaras laiks", "BT": "Butānas laiks", "GMT": "Griničas laiks", "TMST": "Turkmenistānas vasaras laiks", "JST": "Japānas ziemas laiks", "EAT": "Austrumāfrikas laiks", "MDT": "MDT", "HAT": "Ņūfaundlendas vasaras laiks", "GFT": "Franču Gviānas laiks", "WITA": "Centrālindonēzijas laiks", "ACWST": "Austrālijas centrālais rietumu ziemas laiks", "HADT": "Havaju–Aleutu vasaras laiks", "SGT": "Singapūras laiks", "COT": "Kolumbijas ziemas laiks", "HKST": "Honkongas vasaras laiks", "WIB": "Rietumindonēzijas laiks", "TMT": "Turkmenistānas ziemas laiks", "BOT": "Bolīvijas laiks", "∅∅∅": "Amazones vasaras laiks", "WART": "Rietumargentīnas ziemas laiks", "WAT": "Rietumāfrikas ziemas laiks", "ART": "Argentīnas ziemas laiks", "PDT": "Klusā okeāna vasaras laiks", "EST": "Austrumu ziemas laiks", "AEDT": "Austrālijas austrumu vasaras laiks", "MST": "MST", "WESZ": "Rietumeiropas vasaras laiks", "SRT": "Surinamas laiks", "VET": "Venecuēlas laiks", "WEZ": "Rietumeiropas ziemas laiks"},
+ timezones: map[string]string{"MEZ": "Centrāleiropas ziemas laiks", "∅∅∅": "Amazones vasaras laiks", "ChST": "Čamoro standarta laiks", "JST": "Japānas ziemas laiks", "EDT": "Austrumu vasaras laiks", "CLST": "Čīles vasaras laiks", "HKST": "Honkongas vasaras laiks", "ART": "Argentīnas ziemas laiks", "ACDT": "Austrālijas centrālais vasaras laiks", "IST": "Indijas ziemas laiks", "MESZ": "Centrāleiropas vasaras laiks", "WEZ": "Rietumeiropas ziemas laiks", "EAT": "Austrumāfrikas laiks", "ECT": "Ekvadoras laiks", "SGT": "Singapūras laiks", "MYT": "Malaizijas laiks", "ACWDT": "Austrālijas centrālais rietumu vasaras laiks", "COST": "Kolumbijas vasaras laiks", "AKDT": "Aļaskas vasaras laiks", "NZDT": "Jaunzēlandes vasaras laiks", "WESZ": "Rietumeiropas vasaras laiks", "OESZ": "Austrumeiropas vasaras laiks", "BT": "Butānas laiks", "LHDT": "Lorda Hava salas vasaras laiks", "CHAST": "Četemas ziemas laiks", "CHADT": "Četemas vasaras laiks", "ACWST": "Austrālijas centrālais rietumu ziemas laiks", "AWDT": "Austrālijas rietumu vasaras laiks", "ARST": "Argentīnas vasaras laiks", "SAST": "Dienvidāfrikas ziemas laiks", "BOT": "Bolīvijas laiks", "UYST": "Urugvajas vasaras laiks", "WARST": "Rietumargentīnas vasaras laiks", "WAST": "Rietumāfrikas vasaras laiks", "GMT": "Griničas laiks", "AEDT": "Austrālijas austrumu vasaras laiks", "LHST": "Lorda Hava salas ziemas laiks", "AKST": "Aļaskas ziemas laiks", "AWST": "Austrālijas rietumu ziemas laiks", "CLT": "Čīles ziemas laiks", "UYT": "Urugvajas ziemas laiks", "MDT": "MDT", "HKT": "Honkongas ziemas laiks", "AST": "Atlantijas ziemas laiks", "WITA": "Centrālindonēzijas laiks", "CAT": "Centrālāfrikas laiks", "TMST": "Turkmenistānas vasaras laiks", "CST": "Centrālais ziemas laiks", "JDT": "Japānas vasaras laiks", "EST": "Austrumu ziemas laiks", "PDT": "Klusā okeāna vasaras laiks", "HAST": "Havaju–Aleutu ziemas laiks", "HAT": "Ņūfaundlendas vasaras laiks", "CDT": "Centrālais vasaras laiks", "MST": "MST", "VET": "Venecuēlas laiks", "ADT": "Atlantijas vasaras laiks", "PST": "Klusā okeāna ziemas laiks", "HADT": "Havaju–Aleutu vasaras laiks", "WAT": "Rietumāfrikas ziemas laiks", "WIB": "Rietumindonēzijas laiks", "TMT": "Turkmenistānas ziemas laiks", "AEST": "Austrālijas austrumu ziemas laiks", "ACST": "Austrālijas centrālais ziemas laiks", "SRT": "Surinamas laiks", "OEZ": "Austrumeiropas ziemas laiks", "WART": "Rietumargentīnas ziemas laiks", "GFT": "Franču Gviānas laiks", "NZST": "Jaunzēlandes ziemas laiks", "HNT": "Ņūfaundlendas ziemas laiks", "COT": "Kolumbijas ziemas laiks", "GYT": "Gajānas laiks", "WIT": "Austrumindonēzijas laiks"},
}
}
diff --git a/lv/lv_test.go b/lv/lv_test.go
new file mode 100644
index 00000000..a4ee46a1
--- /dev/null
+++ b/lv/lv_test.go
@@ -0,0 +1,1120 @@
+package lv
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "lv"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/lv_LV/lv_LV.go b/lv_LV/lv_LV.go
index 2a7b4cef..6d9b0806 100644
--- a/lv_LV/lv_LV.go
+++ b/lv_LV/lv_LV.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"p.m.ē.", "m.ē."},
erasNarrow: []string{"p.m.ē.", "m.ē."},
erasWide: []string{"pirms mūsu ēras", "mūsu ērā"},
- timezones: map[string]string{"ACWST": "Austrālijas centrālais rietumu ziemas laiks", "CHADT": "Četemas vasaras laiks", "AST": "Atlantijas ziemas laiks", "SAST": "Dienvidāfrikas ziemas laiks", "GFT": "Franču Gviānas laiks", "PDT": "Klusā okeāna vasaras laiks", "JDT": "Japānas vasaras laiks", "AEST": "Austrālijas austrumu ziemas laiks", "ART": "Argentīnas ziemas laiks", "PST": "Klusā okeāna ziemas laiks", "WEZ": "Rietumeiropas ziemas laiks", "BT": "Butānas laiks", "HNT": "Ņūfaundlendas ziemas laiks", "AKDT": "Aļaskas vasaras laiks", "GMT": "Griničas laiks", "WITA": "Centrālindonēzijas laiks", "ACDT": "Austrālijas centrālais vasaras laiks", "AWST": "Austrālijas rietumu ziemas laiks", "CDT": "Centrālais vasaras laiks", "HADT": "Havaju–Aleutu vasaras laiks", "SGT": "Singapūras laiks", "IST": "Indijas ziemas laiks", "WIB": "Rietumindonēzijas laiks", "MYT": "Malaizijas laiks", "ACWDT": "Austrālijas centrālais rietumu vasaras laiks", "ChST": "Čamoro standarta laiks", "CAT": "Centrālāfrikas laiks", "HAST": "Havaju–Aleutu ziemas laiks", "WAT": "Rietumāfrikas ziemas laiks", "HKT": "Honkongas ziemas laiks", "HKST": "Honkongas vasaras laiks", "BOT": "Bolīvijas laiks", "AEDT": "Austrālijas austrumu vasaras laiks", "CHAST": "Četemas ziemas laiks", "OESZ": "Austrumeiropas vasaras laiks", "ACST": "Austrālijas centrālais ziemas laiks", "UYT": "Urugvajas ziemas laiks", "MDT": "Kalnu vasaras laiks", "HAT": "Ņūfaundlendas vasaras laiks", "AKST": "Aļaskas ziemas laiks", "AWDT": "Austrālijas rietumu vasaras laiks", "CST": "Centrālais ziemas laiks", "ADT": "Atlantijas vasaras laiks", "ARST": "Argentīnas vasaras laiks", "LHST": "Lorda Hava salas ziemas laiks", "MESZ": "Centrāleiropas vasaras laiks", "NZST": "Jaunzēlandes ziemas laiks", "MST": "Kalnu ziemas laiks", "WAST": "Rietumāfrikas vasaras laiks", "TMT": "Turkmenistānas ziemas laiks", "SRT": "Surinamas laiks", "CLT": "Čīles ziemas laiks", "COT": "Kolumbijas ziemas laiks", "∅∅∅": "Brazīlijas vasaras laiks", "WART": "Rietumargentīnas ziemas laiks", "OEZ": "Austrumeiropas ziemas laiks", "WIT": "Austrumindonēzijas laiks", "GYT": "Gajānas laiks", "NZDT": "Jaunzēlandes vasaras laiks", "WESZ": "Rietumeiropas vasaras laiks", "EST": "Austrumu ziemas laiks", "LHDT": "Lorda Hava salas vasaras laiks", "EDT": "Austrumu vasaras laiks", "EAT": "Austrumāfrikas laiks", "JST": "Japānas ziemas laiks", "COST": "Kolumbijas vasaras laiks", "MEZ": "Centrāleiropas ziemas laiks", "UYST": "Urugvajas vasaras laiks", "CLST": "Čīles vasaras laiks", "VET": "Venecuēlas laiks", "ECT": "Ekvadoras laiks", "WARST": "Rietumargentīnas vasaras laiks", "TMST": "Turkmenistānas vasaras laiks"},
+ timezones: map[string]string{"CLST": "Čīles vasaras laiks", "UYT": "Urugvajas ziemas laiks", "EAT": "Austrumāfrikas laiks", "LHST": "Lorda Hava salas ziemas laiks", "WITA": "Centrālindonēzijas laiks", "JST": "Japānas ziemas laiks", "SGT": "Singapūras laiks", "SAST": "Dienvidāfrikas ziemas laiks", "EDT": "Austrumu vasaras laiks", "WESZ": "Rietumeiropas vasaras laiks", "OEZ": "Austrumeiropas ziemas laiks", "UYST": "Urugvajas vasaras laiks", "MST": "MST", "CHAST": "Četemas ziemas laiks", "HAST": "Havaju–Aleutu ziemas laiks", "WART": "Rietumargentīnas ziemas laiks", "PDT": "Klusā okeāna vasaras laiks", "NZDT": "Jaunzēlandes vasaras laiks", "HNT": "Ņūfaundlendas ziemas laiks", "ChST": "Čamoro standarta laiks", "LHDT": "Lorda Hava salas vasaras laiks", "ARST": "Argentīnas vasaras laiks", "AKST": "Aļaskas ziemas laiks", "AST": "Atlantijas ziemas laiks", "CST": "Centrālais ziemas laiks", "TMST": "Turkmenistānas vasaras laiks", "BT": "Butānas laiks", "ACST": "Austrālijas centrālais ziemas laiks", "GFT": "Franču Gviānas laiks", "HKT": "Honkongas ziemas laiks", "COT": "Kolumbijas ziemas laiks", "TMT": "Turkmenistānas ziemas laiks", "ACWDT": "Austrālijas centrālais rietumu vasaras laiks", "MESZ": "Centrāleiropas vasaras laiks", "WIB": "Rietumindonēzijas laiks", "MDT": "MDT", "HKST": "Honkongas vasaras laiks", "ADT": "Atlantijas vasaras laiks", "AKDT": "Aļaskas vasaras laiks", "SRT": "Surinamas laiks", "HADT": "Havaju–Aleutu vasaras laiks", "IST": "Indijas ziemas laiks", "GYT": "Gajānas laiks", "CAT": "Centrālāfrikas laiks", "GMT": "Griničas laiks", "AEDT": "Austrālijas austrumu vasaras laiks", "AWDT": "Austrālijas rietumu vasaras laiks", "JDT": "Japānas vasaras laiks", "∅∅∅": "Amazones vasaras laiks", "BOT": "Bolīvijas laiks", "WARST": "Rietumargentīnas vasaras laiks", "VET": "Venecuēlas laiks", "WAT": "Rietumāfrikas ziemas laiks", "WIT": "Austrumindonēzijas laiks", "ACWST": "Austrālijas centrālais rietumu ziemas laiks", "EST": "Austrumu ziemas laiks", "MYT": "Malaizijas laiks", "ECT": "Ekvadoras laiks", "COST": "Kolumbijas vasaras laiks", "CLT": "Čīles ziemas laiks", "CDT": "Centrālais vasaras laiks", "WAST": "Rietumāfrikas vasaras laiks", "WEZ": "Rietumeiropas ziemas laiks", "AEST": "Austrālijas austrumu ziemas laiks", "NZST": "Jaunzēlandes ziemas laiks", "CHADT": "Četemas vasaras laiks", "AWST": "Austrālijas rietumu ziemas laiks", "ART": "Argentīnas ziemas laiks", "HAT": "Ņūfaundlendas vasaras laiks", "OESZ": "Austrumeiropas vasaras laiks", "ACDT": "Austrālijas centrālais vasaras laiks", "PST": "Klusā okeāna ziemas laiks", "MEZ": "Centrāleiropas ziemas laiks"},
}
}
@@ -100,10 +100,10 @@ func (lv *lv_LV) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
n := math.Abs(num)
f := locales.F(n, v)
- nMod100 := math.Mod(n, 100)
nMod10 := math.Mod(n, 10)
- fMod10 := f % 10
+ nMod100 := math.Mod(n, 100)
fMod100 := f % 100
+ fMod10 := f % 10
if (nMod10 == 0) || (nMod100 >= 11 && nMod100 <= 19) || (v == 2 && fMod100 >= 11 && fMod100 <= 19) {
return locales.PluralRuleZero
diff --git a/lv_LV/lv_LV_test.go b/lv_LV/lv_LV_test.go
new file mode 100644
index 00000000..ac35517d
--- /dev/null
+++ b/lv_LV/lv_LV_test.go
@@ -0,0 +1,1120 @@
+package lv_LV
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "lv_LV"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/mas/mas.go b/mas/mas.go
index a551fd5b..86e34bb3 100644
--- a/mas/mas.go
+++ b/mas/mas.go
@@ -62,7 +62,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"MY", "EY"},
erasNarrow: []string{"", ""},
erasWide: []string{"Meínō Yɛ́sʉ", "Eínō Yɛ́sʉ"},
- timezones: map[string]string{"ChST": "ChST", "ACST": "ACST", "NZST": "NZST", "AEST": "AEST", "BOT": "BOT", "VET": "VET", "WEZ": "WEZ", "AEDT": "AEDT", "MYT": "MYT", "PST": "PST", "AWST": "AWST", "WITA": "WITA", "WIT": "WIT", "ART": "ART", "UYST": "UYST", "CAT": "CAT", "CLT": "CLT", "WAST": "WAST", "HKST": "HKST", "WIB": "WIB", "∅∅∅": "∅∅∅", "MDT": "MDT", "CLST": "CLST", "HAST": "HAST", "AKST": "AKST", "MEZ": "MEZ", "CHADT": "CHADT", "EST": "EST", "COT": "COT", "UYT": "UYT", "CST": "CST", "BT": "BT", "OEZ": "OEZ", "WAT": "WAT", "HAT": "HAT", "ARST": "ARST", "SRT": "SRT", "ACWST": "ACWST", "AWDT": "AWDT", "LHDT": "LHDT", "MST": "MST", "AST": "AST", "SAST": "SAST", "OESZ": "OESZ", "JDT": "JDT", "PDT": "PDT", "GMT": "GMT", "COST": "COST", "TMT": "TMT", "ACWDT": "ACWDT", "ECT": "ECT", "CHAST": "CHAST", "WESZ": "WESZ", "LHST": "LHST", "CDT": "CDT", "MESZ": "MESZ", "ADT": "ADT", "HADT": "HADT", "SGT": "SGT", "GYT": "GYT", "AKDT": "AKDT", "WARST": "WARST", "HKT": "HKT", "WART": "WART", "GFT": "GFT", "JST": "JST", "NZDT": "NZDT", "ACDT": "ACDT", "EDT": "EDT", "IST": "IST", "EAT": "EAT", "HNT": "HNT", "TMST": "TMST"},
+ timezones: map[string]string{"PST": "PST", "COT": "COT", "GMT": "GMT", "EAT": "EAT", "ACDT": "ACDT", "VET": "VET", "AEST": "AEST", "ACST": "ACST", "LHDT": "LHDT", "CHAST": "CHAST", "JDT": "JDT", "SGT": "SGT", "CAT": "CAT", "GYT": "GYT", "CHADT": "CHADT", "ACWST": "ACWST", "AWST": "AWST", "WITA": "WITA", "PDT": "PDT", "HAST": "HAST", "NZST": "NZST", "MYT": "MYT", "ECT": "ECT", "BOT": "BOT", "HAT": "HAT", "CLST": "CLST", "HADT": "HADT", "EST": "EST", "OESZ": "OESZ", "LHST": "LHST", "ART": "ART", "ADT": "ADT", "IST": "IST", "∅∅∅": "∅∅∅", "AWDT": "AWDT", "EDT": "EDT", "HNT": "HNT", "CLT": "CLT", "AKST": "AKST", "MEZ": "MEZ", "OEZ": "OEZ", "ACWDT": "ACWDT", "CDT": "CDT", "COST": "COST", "MDT": "MDT", "WARST": "WARST", "ARST": "ARST", "AST": "AST", "NZDT": "NZDT", "UYST": "UYST", "WIT": "WIT", "CST": "CST", "GFT": "GFT", "AKDT": "AKDT", "MESZ": "MESZ", "WIB": "WIB", "BT": "BT", "SRT": "SRT", "TMST": "TMST", "JST": "JST", "TMT": "TMT", "SAST": "SAST", "WEZ": "WEZ", "WAT": "WAT", "WAST": "WAST", "AEDT": "AEDT", "HKST": "HKST", "UYT": "UYT", "WART": "WART", "HKT": "HKT", "WESZ": "WESZ", "ChST": "ChST", "MST": "MST"},
}
}
@@ -125,7 +125,7 @@ func (mas *mas) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (mas *mas) MonthsNarrow() []string {
- return mas.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/mas/mas_test.go b/mas/mas_test.go
new file mode 100644
index 00000000..a09bbf6d
--- /dev/null
+++ b/mas/mas_test.go
@@ -0,0 +1,1120 @@
+package mas
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "mas"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/mas_KE/mas_KE.go b/mas_KE/mas_KE.go
index d7835cb2..f7be46c7 100644
--- a/mas_KE/mas_KE.go
+++ b/mas_KE/mas_KE.go
@@ -62,7 +62,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"MY", "EY"},
erasNarrow: []string{"", ""},
erasWide: []string{"Meínō Yɛ́sʉ", "Eínō Yɛ́sʉ"},
- timezones: map[string]string{"AEDT": "AEDT", "CHADT": "CHADT", "SGT": "SGT", "BT": "BT", "OEZ": "OEZ", "TMT": "TMT", "AWST": "AWST", "UYT": "UYT", "COST": "COST", "WIB": "WIB", "PDT": "PDT", "LHST": "LHST", "UYST": "UYST", "CLST": "CLST", "HAST": "HAST", "WART": "WART", "MST": "MST", "ACDT": "ACDT", "GYT": "GYT", "EST": "EST", "HADT": "HADT", "ART": "ART", "TMST": "TMST", "MESZ": "MESZ", "COT": "COT", "NZDT": "NZDT", "VET": "VET", "WEZ": "WEZ", "BOT": "BOT", "CHAST": "CHAST", "JST": "JST", "JDT": "JDT", "∅∅∅": "∅∅∅", "AST": "AST", "HKT": "HKT", "WIT": "WIT", "HAT": "HAT", "ACST": "ACST", "NZST": "NZST", "AEST": "AEST", "AWDT": "AWDT", "MYT": "MYT", "ACWST": "ACWST", "ChST": "ChST", "OESZ": "OESZ", "GMT": "GMT", "LHDT": "LHDT", "CAT": "CAT", "SAST": "SAST", "WAT": "WAT", "IST": "IST", "HKST": "HKST", "SRT": "SRT", "PST": "PST", "EDT": "EDT", "ECT": "ECT", "EAT": "EAT", "ARST": "ARST", "MEZ": "MEZ", "WAST": "WAST", "HNT": "HNT", "GFT": "GFT", "WITA": "WITA", "MDT": "MDT", "AKDT": "AKDT", "WARST": "WARST", "CST": "CST", "ADT": "ADT", "AKST": "AKST", "CDT": "CDT", "CLT": "CLT", "WESZ": "WESZ", "ACWDT": "ACWDT"},
+ timezones: map[string]string{"ECT": "ECT", "MEZ": "MEZ", "IST": "IST", "TMST": "TMST", "AEST": "AEST", "WAT": "WAT", "MDT": "MDT", "CLT": "CLT", "GFT": "GFT", "AKST": "AKST", "ADT": "ADT", "ACDT": "ACDT", "MESZ": "MESZ", "WIB": "WIB", "ChST": "ChST", "OEZ": "OEZ", "LHDT": "LHDT", "CDT": "CDT", "CLST": "CLST", "PDT": "PDT", "NZDT": "NZDT", "HADT": "HADT", "SGT": "SGT", "AEDT": "AEDT", "UYT": "UYT", "BT": "BT", "LHST": "LHST", "AWDT": "AWDT", "HAST": "HAST", "EAT": "EAT", "CST": "CST", "ART": "ART", "WITA": "WITA", "SAST": "SAST", "JST": "JST", "AST": "AST", "ACWDT": "ACWDT", "∅∅∅": "∅∅∅", "ACWST": "ACWST", "CAT": "CAT", "GMT": "GMT", "MST": "MST", "VET": "VET", "HKST": "HKST", "HAT": "HAT", "MYT": "MYT", "BOT": "BOT", "GYT": "GYT", "AKDT": "AKDT", "PST": "PST", "COST": "COST", "WAST": "WAST", "HNT": "HNT", "OESZ": "OESZ", "SRT": "SRT", "WARST": "WARST", "CHADT": "CHADT", "NZST": "NZST", "EDT": "EDT", "UYST": "UYST", "WIT": "WIT", "WART": "WART", "COT": "COT", "TMT": "TMT", "ACST": "ACST", "HKT": "HKT", "AWST": "AWST", "JDT": "JDT", "EST": "EST", "CHAST": "CHAST", "ARST": "ARST", "WEZ": "WEZ", "WESZ": "WESZ"},
}
}
@@ -125,7 +125,7 @@ func (mas *mas_KE) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (mas *mas_KE) MonthsNarrow() []string {
- return mas.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/mas_KE/mas_KE_test.go b/mas_KE/mas_KE_test.go
new file mode 100644
index 00000000..9d0b24e5
--- /dev/null
+++ b/mas_KE/mas_KE_test.go
@@ -0,0 +1,1120 @@
+package mas_KE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "mas_KE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/mas_TZ/mas_TZ.go b/mas_TZ/mas_TZ.go
index 02eb7b1e..7d58954c 100644
--- a/mas_TZ/mas_TZ.go
+++ b/mas_TZ/mas_TZ.go
@@ -62,7 +62,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"MY", "EY"},
erasNarrow: []string{"", ""},
erasWide: []string{"Meínō Yɛ́sʉ", "Eínō Yɛ́sʉ"},
- timezones: map[string]string{"EST": "EST", "∅∅∅": "∅∅∅", "ACDT": "ACDT", "UYST": "UYST", "NZST": "NZST", "ACWDT": "ACWDT", "MST": "MST", "LHST": "LHST", "ChST": "ChST", "ECT": "ECT", "IST": "IST", "MDT": "MDT", "JST": "JST", "SRT": "SRT", "VET": "VET", "WESZ": "WESZ", "GYT": "GYT", "UYT": "UYT", "CAT": "CAT", "HADT": "HADT", "OESZ": "OESZ", "WIT": "WIT", "PST": "PST", "CHADT": "CHADT", "COST": "COST", "HAST": "HAST", "WITA": "WITA", "HKT": "HKT", "MYT": "MYT", "AKDT": "AKDT", "AWDT": "AWDT", "CST": "CST", "CLT": "CLT", "SAST": "SAST", "BT": "BT", "ARST": "ARST", "ACST": "ACST", "AKST": "AKST", "CHAST": "CHAST", "AEDT": "AEDT", "LHDT": "LHDT", "AWST": "AWST", "CDT": "CDT", "CLST": "CLST", "WART": "WART", "TMST": "TMST", "AEST": "AEST", "COT": "COT", "HKST": "HKST", "ADT": "ADT", "HAT": "HAT", "WIB": "WIB", "OEZ": "OEZ", "BOT": "BOT", "MESZ": "MESZ", "AST": "AST", "SGT": "SGT", "TMT": "TMT", "ACWST": "ACWST", "WAST": "WAST", "HNT": "HNT", "GMT": "GMT", "ART": "ART", "PDT": "PDT", "MEZ": "MEZ", "WARST": "WARST", "WAT": "WAT", "GFT": "GFT", "EAT": "EAT", "JDT": "JDT", "NZDT": "NZDT", "WEZ": "WEZ", "EDT": "EDT"},
+ timezones: map[string]string{"SGT": "SGT", "WARST": "WARST", "ACWST": "ACWST", "ACWDT": "ACWDT", "AEST": "AEST", "ARST": "ARST", "MESZ": "MESZ", "WEZ": "WEZ", "COST": "COST", "GMT": "GMT", "CST": "CST", "ACST": "ACST", "HADT": "HADT", "CAT": "CAT", "UYST": "UYST", "BT": "BT", "SAST": "SAST", "HKST": "HKST", "LHDT": "LHDT", "MST": "MST", "MYT": "MYT", "CHAST": "CHAST", "CHADT": "CHADT", "VET": "VET", "MEZ": "MEZ", "TMT": "TMT", "LHST": "LHST", "MDT": "MDT", "OEZ": "OEZ", "AKDT": "AKDT", "PDT": "PDT", "NZDT": "NZDT", "HAT": "HAT", "ACDT": "ACDT", "JDT": "JDT", "WESZ": "WESZ", "AEDT": "AEDT", "AWDT": "AWDT", "EST": "EST", "AST": "AST", "EDT": "EDT", "NZST": "NZST", "IST": "IST", "ChST": "ChST", "GYT": "GYT", "CLT": "CLT", "CLST": "CLST", "ART": "ART", "ADT": "ADT", "PST": "PST", "HAST": "HAST", "HNT": "HNT", "WAT": "WAT", "UYT": "UYT", "WART": "WART", "JST": "JST", "WAST": "WAST", "CDT": "CDT", "AWST": "AWST", "TMST": "TMST", "WIT": "WIT", "HKT": "HKT", "ECT": "ECT", "AKST": "AKST", "COT": "COT", "WIB": "WIB", "EAT": "EAT", "∅∅∅": "∅∅∅", "BOT": "BOT", "SRT": "SRT", "GFT": "GFT", "WITA": "WITA", "OESZ": "OESZ"},
}
}
@@ -125,7 +125,7 @@ func (mas *mas_TZ) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (mas *mas_TZ) MonthsNarrow() []string {
- return mas.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/mas_TZ/mas_TZ_test.go b/mas_TZ/mas_TZ_test.go
new file mode 100644
index 00000000..4a2d4e84
--- /dev/null
+++ b/mas_TZ/mas_TZ_test.go
@@ -0,0 +1,1120 @@
+package mas_TZ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "mas_TZ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/mer/mer.go b/mer/mer.go
index a224be48..35b28fad 100644
--- a/mer/mer.go
+++ b/mer/mer.go
@@ -63,7 +63,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"MK", "NK"},
erasNarrow: []string{"", ""},
erasWide: []string{"Mbere ya Kristũ", "Nyuma ya Kristũ"},
- timezones: map[string]string{"CST": "CST", "ARST": "ARST", "MYT": "MYT", "SRT": "SRT", "AKDT": "AKDT", "NZST": "NZST", "ChST": "ChST", "SAST": "SAST", "WAT": "WAT", "AKST": "AKST", "ECT": "ECT", "HKT": "HKT", "IST": "IST", "TMT": "TMT", "JST": "JST", "BOT": "BOT", "UYST": "UYST", "ACST": "ACST", "JDT": "JDT", "AWDT": "AWDT", "HKST": "HKST", "TMST": "TMST", "CAT": "CAT", "WARST": "WARST", "ACDT": "ACDT", "LHST": "LHST", "CHAST": "CHAST", "CLT": "CLT", "ACWST": "ACWST", "COST": "COST", "HADT": "HADT", "GYT": "GYT", "WIB": "WIB", "MEZ": "MEZ", "MESZ": "MESZ", "MDT": "MDT", "COT": "COT", "WIT": "WIT", "EDT": "EDT", "OESZ": "OESZ", "GMT": "GMT", "ART": "ART", "PDT": "PDT", "NZDT": "NZDT", "CLST": "CLST", "EST": "EST", "EAT": "EAT", "WITA": "WITA", "HNT": "HNT", "GFT": "GFT", "UYT": "UYT", "ACWDT": "ACWDT", "AEDT": "AEDT", "∅∅∅": "∅∅∅", "MST": "MST", "OEZ": "OEZ", "WEZ": "WEZ", "WESZ": "WESZ", "AEST": "AEST", "AWST": "AWST", "CDT": "CDT", "CHADT": "CHADT", "SGT": "SGT", "WART": "WART", "PST": "PST", "LHDT": "LHDT", "AST": "AST", "BT": "BT", "HAT": "HAT", "WAST": "WAST", "VET": "VET", "ADT": "ADT", "HAST": "HAST"},
+ timezones: map[string]string{"BOT": "BOT", "OEZ": "OEZ", "LHDT": "LHDT", "MYT": "MYT", "EAT": "EAT", "WARST": "WARST", "VET": "VET", "ARST": "ARST", "HNT": "HNT", "LHST": "LHST", "CLT": "CLT", "GFT": "GFT", "HKT": "HKT", "ACWST": "ACWST", "HADT": "HADT", "HAT": "HAT", "ChST": "ChST", "CHAST": "CHAST", "AST": "AST", "EDT": "EDT", "PDT": "PDT", "MEZ": "MEZ", "IST": "IST", "TMT": "TMT", "WAT": "WAT", "ART": "ART", "BT": "BT", "MDT": "MDT", "WITA": "WITA", "ADT": "ADT", "COST": "COST", "AEDT": "AEDT", "UYT": "UYT", "JDT": "JDT", "CLST": "CLST", "WIT": "WIT", "AKST": "AKST", "PST": "PST", "AEST": "AEST", "GMT": "GMT", "CHADT": "CHADT", "ACWDT": "ACWDT", "JST": "JST", "∅∅∅": "∅∅∅", "WESZ": "WESZ", "SRT": "SRT", "AWST": "AWST", "WART": "WART", "CDT": "CDT", "ECT": "ECT", "CAT": "CAT", "EST": "EST", "COT": "COT", "TMST": "TMST", "WAST": "WAST", "CST": "CST", "HKST": "HKST", "MST": "MST", "AKDT": "AKDT", "SAST": "SAST", "GYT": "GYT", "ACDT": "ACDT", "AWDT": "AWDT", "MESZ": "MESZ", "HAST": "HAST", "NZST": "NZST", "NZDT": "NZDT", "WEZ": "WEZ", "SGT": "SGT", "WIB": "WIB", "OESZ": "OESZ", "UYST": "UYST", "ACST": "ACST"},
}
}
diff --git a/mer/mer_test.go b/mer/mer_test.go
new file mode 100644
index 00000000..4d268b93
--- /dev/null
+++ b/mer/mer_test.go
@@ -0,0 +1,1120 @@
+package mer
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "mer"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/mer_KE/mer_KE.go b/mer_KE/mer_KE.go
index 5a065186..c26553b6 100644
--- a/mer_KE/mer_KE.go
+++ b/mer_KE/mer_KE.go
@@ -63,7 +63,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"MK", "NK"},
erasNarrow: []string{"", ""},
erasWide: []string{"Mbere ya Kristũ", "Nyuma ya Kristũ"},
- timezones: map[string]string{"WIT": "WIT", "HAT": "HAT", "EAT": "EAT", "ACWST": "ACWST", "COST": "COST", "AST": "AST", "WITA": "WITA", "GYT": "GYT", "WESZ": "WESZ", "CHAST": "CHAST", "MYT": "MYT", "NZDT": "NZDT", "CHADT": "CHADT", "SAST": "SAST", "HKST": "HKST", "OESZ": "OESZ", "SGT": "SGT", "HKT": "HKT", "WART": "WART", "WARST": "WARST", "MST": "MST", "LHDT": "LHDT", "ADT": "ADT", "BT": "BT", "OEZ": "OEZ", "COT": "COT", "GMT": "GMT", "GFT": "GFT", "PDT": "PDT", "LHST": "LHST", "CAT": "CAT", "WAT": "WAT", "HNT": "HNT", "ACDT": "ACDT", "AKST": "AKST", "AWST": "AWST", "CLST": "CLST", "WEZ": "WEZ", "ACST": "ACST", "UYT": "UYT", "HAST": "HAST", "TMST": "TMST", "CST": "CST", "AEDT": "AEDT", "HADT": "HADT", "MDT": "MDT", "ART": "ART", "SRT": "SRT", "ChST": "ChST", "EDT": "EDT", "WAST": "WAST", "JST": "JST", "AWDT": "AWDT", "CDT": "CDT", "NZST": "NZST", "BOT": "BOT", "JDT": "JDT", "AKDT": "AKDT", "PST": "PST", "AEST": "AEST", "ECT": "ECT", "WIB": "WIB", "IST": "IST", "ARST": "ARST", "∅∅∅": "∅∅∅", "MEZ": "MEZ", "VET": "VET", "TMT": "TMT", "MESZ": "MESZ", "UYST": "UYST", "CLT": "CLT", "ACWDT": "ACWDT", "EST": "EST"},
+ timezones: map[string]string{"CST": "CST", "AWDT": "AWDT", "ARST": "ARST", "WAST": "WAST", "GYT": "GYT", "CLT": "CLT", "BT": "BT", "MST": "MST", "CHADT": "CHADT", "ECT": "ECT", "AKST": "AKST", "WIB": "WIB", "CHAST": "CHAST", "AKDT": "AKDT", "MEZ": "MEZ", "AEDT": "AEDT", "UYT": "UYT", "JDT": "JDT", "SGT": "SGT", "TMT": "TMT", "MYT": "MYT", "GFT": "GFT", "WITA": "WITA", "JST": "JST", "EST": "EST", "HAST": "HAST", "NZST": "NZST", "COST": "COST", "GMT": "GMT", "ACDT": "ACDT", "ADT": "ADT", "MESZ": "MESZ", "BOT": "BOT", "ACWDT": "ACWDT", "TMST": "TMST", "EAT": "EAT", "HKT": "HKT", "WAT": "WAT", "WEZ": "WEZ", "WESZ": "WESZ", "∅∅∅": "∅∅∅", "HKST": "HKST", "IST": "IST", "VET": "VET", "LHST": "LHST", "WART": "WART", "WARST": "WARST", "ART": "ART", "NZDT": "NZDT", "LHDT": "LHDT", "WIT": "WIT", "SRT": "SRT", "AWST": "AWST", "PST": "PST", "HADT": "HADT", "HAT": "HAT", "OEZ": "OEZ", "PDT": "PDT", "HNT": "HNT", "COT": "COT", "AEST": "AEST", "ChST": "ChST", "CLST": "CLST", "UYST": "UYST", "AST": "AST", "SAST": "SAST", "MDT": "MDT", "CDT": "CDT", "ACST": "ACST", "ACWST": "ACWST", "EDT": "EDT", "CAT": "CAT", "OESZ": "OESZ"},
}
}
diff --git a/mer_KE/mer_KE_test.go b/mer_KE/mer_KE_test.go
new file mode 100644
index 00000000..80daebb7
--- /dev/null
+++ b/mer_KE/mer_KE_test.go
@@ -0,0 +1,1120 @@
+package mer_KE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "mer_KE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/mfe/mfe.go b/mfe/mfe.go
index 139e2e33..50fa1ef8 100644
--- a/mfe/mfe.go
+++ b/mfe/mfe.go
@@ -66,7 +66,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. Z-K", "ap. Z-K"},
erasNarrow: []string{"", ""},
erasWide: []string{"avan Zezi-Krist", "apre Zezi-Krist"},
- timezones: map[string]string{"HADT": "HADT", "GMT": "GMT", "GFT": "GFT", "WIB": "WIB", "MYT": "MYT", "CLT": "CLT", "CLST": "CLST", "SAST": "SAST", "WAT": "WAT", "EST": "EST", "ChST": "ChST", "CAT": "CAT", "WART": "WART", "OESZ": "OESZ", "AWDT": "AWDT", "JST": "JST", "WESZ": "WESZ", "AEDT": "AEDT", "HAT": "HAT", "MDT": "MDT", "ACWST": "ACWST", "HAST": "HAST", "MEZ": "MEZ", "UYT": "UYT", "ECT": "ECT", "UYST": "UYST", "HNT": "HNT", "WIT": "WIT", "EAT": "EAT", "AKST": "AKST", "LHST": "LHST", "MESZ": "MESZ", "PST": "PST", "LHDT": "LHDT", "SRT": "SRT", "NZDT": "NZDT", "COST": "COST", "NZST": "NZST", "AEST": "AEST", "HKT": "HKT", "TMT": "TMT", "CHAST": "CHAST", "SGT": "SGT", "WAST": "WAST", "IST": "IST", "TMST": "TMST", "WEZ": "WEZ", "COT": "COT", "WITA": "WITA", "CST": "CST", "CDT": "CDT", "VET": "VET", "JDT": "JDT", "ACWDT": "ACWDT", "EDT": "EDT", "WARST": "WARST", "MST": "MST", "ART": "ART", "AKDT": "AKDT", "BT": "BT", "HKST": "HKST", "PDT": "PDT", "BOT": "BOT", "AST": "AST", "ADT": "ADT", "AWST": "AWST", "CHADT": "CHADT", "OEZ": "OEZ", "ACST": "ACST", "ACDT": "ACDT", "ARST": "ARST", "∅∅∅": "∅∅∅", "GYT": "GYT"},
+ timezones: map[string]string{"EST": "EST", "NZDT": "NZDT", "SGT": "SGT", "GMT": "GMT", "LHST": "LHST", "ACDT": "ACDT", "ECT": "ECT", "AST": "AST", "COST": "COST", "AEST": "AEST", "HKST": "HKST", "AWST": "AWST", "OEZ": "OEZ", "LHDT": "LHDT", "AKDT": "AKDT", "CHAST": "CHAST", "AKST": "AKST", "PDT": "PDT", "HAST": "HAST", "WEZ": "WEZ", "OESZ": "OESZ", "AEDT": "AEDT", "WART": "WART", "HKT": "HKT", "ACWDT": "ACWDT", "WIB": "WIB", "EAT": "EAT", "∅∅∅": "∅∅∅", "SAST": "SAST", "BOT": "BOT", "WAT": "WAT", "HAT": "HAT", "MYT": "MYT", "CDT": "CDT", "AWDT": "AWDT", "EDT": "EDT", "ADT": "ADT", "CAT": "CAT", "UYT": "UYT", "SRT": "SRT", "GFT": "GFT", "GYT": "GYT", "WIT": "WIT", "CHADT": "CHADT", "MEZ": "MEZ", "WAST": "WAST", "CLT": "CLT", "VET": "VET", "ART": "ART", "ARST": "ARST", "TMT": "TMT", "TMST": "TMST", "CLST": "CLST", "ACST": "ACST", "WARST": "WARST", "JDT": "JDT", "BT": "BT", "UYST": "UYST", "IST": "IST", "MESZ": "MESZ", "PST": "PST", "NZST": "NZST", "HNT": "HNT", "COT": "COT", "ChST": "ChST", "MDT": "MDT", "CST": "CST", "ACWST": "ACWST", "WESZ": "WESZ", "MST": "MST", "WITA": "WITA", "JST": "JST", "HADT": "HADT"},
}
}
diff --git a/mfe/mfe_test.go b/mfe/mfe_test.go
new file mode 100644
index 00000000..62985206
--- /dev/null
+++ b/mfe/mfe_test.go
@@ -0,0 +1,1120 @@
+package mfe
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "mfe"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/mfe_MU/mfe_MU.go b/mfe_MU/mfe_MU.go
index 8bfed60b..50d30c8f 100644
--- a/mfe_MU/mfe_MU.go
+++ b/mfe_MU/mfe_MU.go
@@ -66,7 +66,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. Z-K", "ap. Z-K"},
erasNarrow: []string{"", ""},
erasWide: []string{"avan Zezi-Krist", "apre Zezi-Krist"},
- timezones: map[string]string{"CAT": "CAT", "ECT": "ECT", "OEZ": "OEZ", "WESZ": "WESZ", "WAT": "WAT", "GMT": "GMT", "ARST": "ARST", "LHDT": "LHDT", "UYST": "UYST", "HADT": "HADT", "MST": "MST", "AKST": "AKST", "AKDT": "AKDT", "∅∅∅": "∅∅∅", "ADT": "ADT", "MDT": "MDT", "TMST": "TMST", "CDT": "CDT", "UYT": "UYT", "BT": "BT", "HKST": "HKST", "ACWDT": "ACWDT", "OESZ": "OESZ", "NZST": "NZST", "CLST": "CLST", "AEST": "AEST", "EDT": "EDT", "COT": "COT", "WIB": "WIB", "HNT": "HNT", "WARST": "WARST", "WITA": "WITA", "ART": "ART", "JDT": "JDT", "BOT": "BOT", "AEDT": "AEDT", "SGT": "SGT", "HKT": "HKT", "IST": "IST", "PDT": "PDT", "AWST": "AWST", "MESZ": "MESZ", "JST": "JST", "AWDT": "AWDT", "EST": "EST", "AST": "AST", "HAST": "HAST", "SAST": "SAST", "WAST": "WAST", "ACST": "ACST", "LHST": "LHST", "ChST": "ChST", "WIT": "WIT", "EAT": "EAT", "PST": "PST", "GYT": "GYT", "CST": "CST", "MEZ": "MEZ", "HAT": "HAT", "MYT": "MYT", "NZDT": "NZDT", "COST": "COST", "ACWST": "ACWST", "GFT": "GFT", "ACDT": "ACDT", "TMT": "TMT", "VET": "VET", "WEZ": "WEZ", "WART": "WART", "SRT": "SRT", "CLT": "CLT", "CHAST": "CHAST", "CHADT": "CHADT"},
+ timezones: map[string]string{"BT": "BT", "WART": "WART", "SAST": "SAST", "PST": "PST", "IST": "IST", "SRT": "SRT", "ECT": "ECT", "AKST": "AKST", "MESZ": "MESZ", "AEDT": "AEDT", "AKDT": "AKDT", "TMT": "TMT", "WEZ": "WEZ", "WESZ": "WESZ", "LHDT": "LHDT", "WARST": "WARST", "VET": "VET", "COT": "COT", "UYST": "UYST", "WAT": "WAT", "∅∅∅": "∅∅∅", "ChST": "ChST", "NZST": "NZST", "TMST": "TMST", "OESZ": "OESZ", "EAT": "EAT", "CDT": "CDT", "HKST": "HKST", "ART": "ART", "EDT": "EDT", "GYT": "GYT", "MDT": "MDT", "ACDT": "ACDT", "GFT": "GFT", "JST": "JST", "MYT": "MYT", "AST": "AST", "MEZ": "MEZ", "GMT": "GMT", "BOT": "BOT", "SGT": "SGT", "COST": "COST", "CAT": "CAT", "UYT": "UYT", "NZDT": "NZDT", "EST": "EST", "HAT": "HAT", "AEST": "AEST", "LHST": "LHST", "JDT": "JDT", "ACWST": "ACWST", "ACWDT": "ACWDT", "HNT": "HNT", "CLT": "CLT", "WIT": "WIT", "HAST": "HAST", "HADT": "HADT", "WIB": "WIB", "HKT": "HKT", "CHAST": "CHAST", "ARST": "ARST", "PDT": "PDT", "AWST": "AWST", "AWDT": "AWDT", "MST": "MST", "ACST": "ACST", "CHADT": "CHADT", "WITA": "WITA", "OEZ": "OEZ", "CLST": "CLST", "CST": "CST", "ADT": "ADT", "WAST": "WAST"},
}
}
diff --git a/mfe_MU/mfe_MU_test.go b/mfe_MU/mfe_MU_test.go
new file mode 100644
index 00000000..1fa82376
--- /dev/null
+++ b/mfe_MU/mfe_MU_test.go
@@ -0,0 +1,1120 @@
+package mfe_MU
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "mfe_MU"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/mg/mg.go b/mg/mg.go
index 2fb457f9..cdd6506c 100644
--- a/mg/mg.go
+++ b/mg/mg.go
@@ -57,7 +57,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"", ""},
erasWide: []string{"Alohan’i JK", "Aorian’i JK"},
- timezones: map[string]string{"CDT": "CDT", "MDT": "MDT", "IST": "IST", "COST": "COST", "AST": "AST", "AKDT": "AKDT", "LHST": "LHST", "UYST": "UYST", "WESZ": "WESZ", "AEST": "AEST", "COT": "COT", "BOT": "BOT", "CAT": "CAT", "NZST": "NZST", "EST": "EST", "EDT": "EDT", "WAT": "WAT", "WAST": "WAST", "AKST": "AKST", "ECT": "ECT", "WART": "WART", "HKT": "HKT", "MYT": "MYT", "UYT": "UYT", "HAST": "HAST", "BT": "BT", "WIB": "WIB", "HAT": "HAT", "PST": "PST", "∅∅∅": "∅∅∅", "ADT": "ADT", "WIT": "WIT", "GMT": "GMT", "HNT": "HNT", "ACDT": "ACDT", "JDT": "JDT", "MEZ": "MEZ", "MST": "MST", "CHADT": "CHADT", "SAST": "SAST", "WITA": "WITA", "CLST": "CLST", "ACWDT": "ACWDT", "ChST": "ChST", "ARST": "ARST", "TMT": "TMT", "OESZ": "OESZ", "GFT": "GFT", "SRT": "SRT", "AWST": "AWST", "AEDT": "AEDT", "CHAST": "CHAST", "SGT": "SGT", "OEZ": "OEZ", "EAT": "EAT", "ART": "ART", "CST": "CST", "ACWST": "ACWST", "HKST": "HKST", "HADT": "HADT", "JST": "JST", "NZDT": "NZDT", "WEZ": "WEZ", "AWDT": "AWDT", "VET": "VET", "ACST": "ACST", "TMST": "TMST", "PDT": "PDT", "LHDT": "LHDT", "GYT": "GYT", "MESZ": "MESZ", "CLT": "CLT", "WARST": "WARST"},
+ timezones: map[string]string{"WIB": "WIB", "AEST": "AEST", "OEZ": "OEZ", "CST": "CST", "NZST": "NZST", "ACWST": "ACWST", "WESZ": "WESZ", "AEDT": "AEDT", "ADT": "ADT", "BOT": "BOT", "WAT": "WAT", "BT": "BT", "WIT": "WIT", "HAST": "HAST", "EDT": "EDT", "∅∅∅": "∅∅∅", "COT": "COT", "JDT": "JDT", "WAST": "WAST", "TMT": "TMT", "HKST": "HKST", "MEZ": "MEZ", "ACST": "ACST", "CHADT": "CHADT", "SGT": "SGT", "LHDT": "LHDT", "MYT": "MYT", "UYT": "UYT", "GFT": "GFT", "CHAST": "CHAST", "CAT": "CAT", "ACWDT": "ACWDT", "EST": "EST", "HNT": "HNT", "EAT": "EAT", "SRT": "SRT", "ECT": "ECT", "AST": "AST", "OESZ": "OESZ", "UYST": "UYST", "TMST": "TMST", "ART": "ART", "WEZ": "WEZ", "CLT": "CLT", "CLST": "CLST", "AWDT": "AWDT", "LHST": "LHST", "ACDT": "ACDT", "WARST": "WARST", "AKDT": "AKDT", "SAST": "SAST", "COST": "COST", "HKT": "HKT", "VET": "VET", "AWST": "AWST", "AKST": "AKST", "PST": "PST", "NZDT": "NZDT", "ChST": "ChST", "GYT": "GYT", "MST": "MST", "CDT": "CDT", "WITA": "WITA", "PDT": "PDT", "HADT": "HADT", "GMT": "GMT", "IST": "IST", "JST": "JST", "MESZ": "MESZ", "MDT": "MDT", "WART": "WART", "ARST": "ARST", "HAT": "HAT"},
}
}
diff --git a/mg/mg_test.go b/mg/mg_test.go
new file mode 100644
index 00000000..2cbc2164
--- /dev/null
+++ b/mg/mg_test.go
@@ -0,0 +1,1120 @@
+package mg
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "mg"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/mg_MG/mg_MG.go b/mg_MG/mg_MG.go
index 53cf4de6..21ec029a 100644
--- a/mg_MG/mg_MG.go
+++ b/mg_MG/mg_MG.go
@@ -57,7 +57,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"", ""},
erasWide: []string{"Alohan’i JK", "Aorian’i JK"},
- timezones: map[string]string{"GYT": "GYT", "CHADT": "CHADT", "BT": "BT", "HAT": "HAT", "∅∅∅": "∅∅∅", "TMT": "TMT", "JST": "JST", "ECT": "ECT", "SGT": "SGT", "IST": "IST", "PST": "PST", "PDT": "PDT", "COST": "COST", "HNT": "HNT", "WITA": "WITA", "EST": "EST", "WARST": "WARST", "WAST": "WAST", "EAT": "EAT", "ACST": "ACST", "AKST": "AKST", "AWDT": "AWDT", "WEZ": "WEZ", "OESZ": "OESZ", "ARST": "ARST", "JDT": "JDT", "CDT": "CDT", "NZDT": "NZDT", "GFT": "GFT", "EDT": "EDT", "GMT": "GMT", "NZST": "NZST", "CLST": "CLST", "TMST": "TMST", "ACWDT": "ACWDT", "HAST": "HAST", "HKST": "HKST", "AWST": "AWST", "MEZ": "MEZ", "WIT": "WIT", "AST": "AST", "ART": "ART", "MST": "MST", "ACDT": "ACDT", "ChST": "ChST", "COT": "COT", "AEST": "AEST", "HADT": "HADT", "WIB": "WIB", "OEZ": "OEZ", "AKDT": "AKDT", "BOT": "BOT", "CLT": "CLT", "AEDT": "AEDT", "CAT": "CAT", "HKT": "HKT", "MYT": "MYT", "UYT": "UYT", "UYST": "UYST", "CHAST": "CHAST", "WESZ": "WESZ", "LHST": "LHST", "LHDT": "LHDT", "MESZ": "MESZ", "ADT": "ADT", "SAST": "SAST", "MDT": "MDT", "CST": "CST", "VET": "VET", "ACWST": "ACWST", "WART": "WART", "SRT": "SRT", "WAT": "WAT"},
+ timezones: map[string]string{"JST": "JST", "AKST": "AKST", "WIT": "WIT", "BT": "BT", "WARST": "WARST", "ECT": "ECT", "MYT": "MYT", "CDT": "CDT", "ART": "ART", "JDT": "JDT", "WAST": "WAST", "WEZ": "WEZ", "OEZ": "OEZ", "AEST": "AEST", "WITA": "WITA", "ACWST": "ACWST", "AWDT": "AWDT", "NZDT": "NZDT", "EST": "EST", "HAT": "HAT", "CLST": "CLST", "PST": "PST", "WAT": "WAT", "GYT": "GYT", "LHDT": "LHDT", "ADT": "ADT", "MEZ": "MEZ", "CAT": "CAT", "OESZ": "OESZ", "ChST": "ChST", "HNT": "HNT", "LHST": "LHST", "CHAST": "CHAST", "WART": "WART", "VET": "VET", "ACWDT": "ACWDT", "EDT": "EDT", "∅∅∅": "∅∅∅", "COT": "COT", "WESZ": "WESZ", "MDT": "MDT", "ACST": "ACST", "ARST": "ARST", "IST": "IST", "PDT": "PDT", "TMST": "TMST", "EAT": "EAT", "TMT": "TMT", "UYT": "UYT", "AST": "AST", "MESZ": "MESZ", "HAST": "HAST", "NZST": "NZST", "COST": "COST", "BOT": "BOT", "WIB": "WIB", "MST": "MST", "AKDT": "AKDT", "ACDT": "ACDT", "SRT": "SRT", "SAST": "SAST", "SGT": "SGT", "GMT": "GMT", "AEDT": "AEDT", "CHADT": "CHADT", "AWST": "AWST", "CLT": "CLT", "CST": "CST", "HKT": "HKT", "HKST": "HKST", "HADT": "HADT", "UYST": "UYST", "GFT": "GFT"},
}
}
diff --git a/mg_MG/mg_MG_test.go b/mg_MG/mg_MG_test.go
new file mode 100644
index 00000000..04572823
--- /dev/null
+++ b/mg_MG/mg_MG_test.go
@@ -0,0 +1,1120 @@
+package mg_MG
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "mg_MG"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/mgh/mgh.go b/mgh/mgh.go
index b627f20b..3cbdf3f6 100644
--- a/mgh/mgh.go
+++ b/mgh/mgh.go
@@ -69,7 +69,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"HY", "YY"},
erasNarrow: []string{"", ""},
erasWide: []string{"Hinapiya yesu", "Yopia yesu"},
- timezones: map[string]string{"CLT": "CLT", "OEZ": "OEZ", "LHST": "LHST", "LHDT": "LHDT", "HAST": "HAST", "SRT": "SRT", "CDT": "CDT", "CLST": "CLST", "AEDT": "AEDT", "ACST": "ACST", "AWDT": "AWDT", "NZDT": "NZDT", "WESZ": "WESZ", "CHAST": "CHAST", "EST": "EST", "ECT": "ECT", "WAST": "WAST", "ART": "ART", "VET": "VET", "ACWDT": "ACWDT", "TMST": "TMST", "JDT": "JDT", "AKST": "AKST", "SGT": "SGT", "MYT": "MYT", "MST": "MST", "TMT": "TMT", "EDT": "EDT", "WART": "WART", "WARST": "WARST", "GYT": "GYT", "HADT": "HADT", "BT": "BT", "OESZ": "OESZ", "WITA": "WITA", "WEZ": "WEZ", "ADT": "ADT", "HAT": "HAT", "CST": "CST", "MESZ": "MESZ", "UYT": "UYT", "NZST": "NZST", "CAT": "CAT", "COT": "COT", "∅∅∅": "∅∅∅", "HKST": "HKST", "GMT": "GMT", "PST": "PST", "COST": "COST", "WAT": "WAT", "WIT": "WIT", "GFT": "GFT", "ARST": "ARST", "AEST": "AEST", "MDT": "MDT", "CHADT": "CHADT", "EAT": "EAT", "JST": "JST", "BOT": "BOT", "ACWST": "ACWST", "ChST": "ChST", "WIB": "WIB", "ACDT": "ACDT", "PDT": "PDT", "UYST": "UYST", "SAST": "SAST", "HKT": "HKT", "IST": "IST", "AKDT": "AKDT", "AWST": "AWST", "MEZ": "MEZ", "AST": "AST", "HNT": "HNT"},
+ timezones: map[string]string{"TMST": "TMST", "MST": "MST", "MDT": "MDT", "CDT": "CDT", "WARST": "WARST", "ACWST": "ACWST", "NZST": "NZST", "OESZ": "OESZ", "AEDT": "AEDT", "BT": "BT", "PST": "PST", "HADT": "HADT", "SGT": "SGT", "GYT": "GYT", "ACST": "ACST", "GFT": "GFT", "BOT": "BOT", "PDT": "PDT", "WESZ": "WESZ", "ACDT": "ACDT", "WAT": "WAT", "JDT": "JDT", "ARST": "ARST", "UYT": "UYT", "WIT": "WIT", "LHST": "LHST", "CLT": "CLT", "CST": "CST", "JST": "JST", "NZDT": "NZDT", "MESZ": "MESZ", "COT": "COT", "ART": "ART", "WIB": "WIB", "AEST": "AEST", "∅∅∅": "∅∅∅", "HKT": "HKT", "AKDT": "AKDT", "HAT": "HAT", "AWST": "AWST", "AWDT": "AWDT", "COST": "COST", "ChST": "ChST", "CHAST": "CHAST", "CHADT": "CHADT", "WITA": "WITA", "SRT": "SRT", "ECT": "ECT", "EST": "EST", "CAT": "CAT", "CLST": "CLST", "WAST": "WAST", "GMT": "GMT", "WART": "WART", "MEZ": "MEZ", "HKST": "HKST", "IST": "IST", "EAT": "EAT", "LHDT": "LHDT", "MYT": "MYT", "VET": "VET", "SAST": "SAST", "EDT": "EDT", "OEZ": "OEZ", "UYST": "UYST", "ACWDT": "ACWDT", "HAST": "HAST", "TMT": "TMT", "HNT": "HNT", "AKST": "AKST", "AST": "AST", "ADT": "ADT", "WEZ": "WEZ"},
}
}
diff --git a/mgh/mgh_test.go b/mgh/mgh_test.go
new file mode 100644
index 00000000..eeb29c8b
--- /dev/null
+++ b/mgh/mgh_test.go
@@ -0,0 +1,1120 @@
+package mgh
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "mgh"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/mgh_MZ/mgh_MZ.go b/mgh_MZ/mgh_MZ.go
index 3b51a994..4cb59c46 100644
--- a/mgh_MZ/mgh_MZ.go
+++ b/mgh_MZ/mgh_MZ.go
@@ -69,7 +69,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"HY", "YY"},
erasNarrow: []string{"", ""},
erasWide: []string{"Hinapiya yesu", "Yopia yesu"},
- timezones: map[string]string{"OESZ": "OESZ", "LHDT": "LHDT", "ChST": "ChST", "COT": "COT", "HKT": "HKT", "HKST": "HKST", "HAT": "HAT", "CST": "CST", "CHADT": "CHADT", "CLST": "CLST", "WEZ": "WEZ", "ADT": "ADT", "JST": "JST", "SRT": "SRT", "CLT": "CLT", "AEST": "AEST", "GFT": "GFT", "ART": "ART", "CHAST": "CHAST", "ACDT": "ACDT", "CDT": "CDT", "CAT": "CAT", "SGT": "SGT", "TMT": "TMT", "PDT": "PDT", "UYT": "UYT", "AKDT": "AKDT", "BT": "BT", "WITA": "WITA", "WIB": "WIB", "OEZ": "OEZ", "NZST": "NZST", "EST": "EST", "ECT": "ECT", "AWST": "AWST", "LHST": "LHST", "NZDT": "NZDT", "VET": "VET", "COST": "COST", "TMST": "TMST", "MST": "MST", "MDT": "MDT", "AST": "AST", "AWDT": "AWDT", "EDT": "EDT", "IST": "IST", "GMT": "GMT", "MYT": "MYT", "HADT": "HADT", "WART": "WART", "WARST": "WARST", "HNT": "HNT", "MEZ": "MEZ", "AEDT": "AEDT", "BOT": "BOT", "WAT": "WAT", "WAST": "WAST", "ACWST": "ACWST", "ACWDT": "ACWDT", "EAT": "EAT", "ACST": "ACST", "AKST": "AKST", "WESZ": "WESZ", "SAST": "SAST", "JDT": "JDT", "MESZ": "MESZ", "UYST": "UYST", "WIT": "WIT", "ARST": "ARST", "HAST": "HAST", "∅∅∅": "∅∅∅", "PST": "PST", "GYT": "GYT"},
+ timezones: map[string]string{"HKST": "HKST", "PDT": "PDT", "HAT": "HAT", "MYT": "MYT", "ECT": "ECT", "EDT": "EDT", "WEZ": "WEZ", "TMT": "TMT", "CAT": "CAT", "CLST": "CLST", "BT": "BT", "LHDT": "LHDT", "AWST": "AWST", "AWDT": "AWDT", "AST": "AST", "ADT": "ADT", "PST": "PST", "WART": "WART", "ART": "ART", "HAST": "HAST", "COST": "COST", "UYST": "UYST", "MST": "MST", "OESZ": "OESZ", "WAT": "WAT", "OEZ": "OEZ", "GMT": "GMT", "MDT": "MDT", "ACWDT": "ACWDT", "NZDT": "NZDT", "SGT": "SGT", "WIB": "WIB", "ACST": "ACST", "WARST": "WARST", "UYT": "UYT", "LHST": "LHST", "ARST": "ARST", "JST": "JST", "MEZ": "MEZ", "COT": "COT", "TMST": "TMST", "JDT": "JDT", "IST": "IST", "HNT": "HNT", "ACDT": "ACDT", "GFT": "GFT", "BOT": "BOT", "SAST": "SAST", "AEST": "AEST", "SRT": "SRT", "CST": "CST", "HADT": "HADT", "WAST": "WAST", "WESZ": "WESZ", "∅∅∅": "∅∅∅", "WIT": "WIT", "CDT": "CDT", "VET": "VET", "CHADT": "CHADT", "WITA": "WITA", "EST": "EST", "GYT": "GYT", "AKST": "AKST", "NZST": "NZST", "EAT": "EAT", "CLT": "CLT", "HKT": "HKT", "CHAST": "CHAST", "AKDT": "AKDT", "ChST": "ChST", "AEDT": "AEDT", "ACWST": "ACWST", "MESZ": "MESZ"},
}
}
diff --git a/mgh_MZ/mgh_MZ_test.go b/mgh_MZ/mgh_MZ_test.go
new file mode 100644
index 00000000..d164502d
--- /dev/null
+++ b/mgh_MZ/mgh_MZ_test.go
@@ -0,0 +1,1120 @@
+package mgh_MZ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "mgh_MZ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/mgo/mgo.go b/mgo/mgo.go
index 68c11bc2..61c1e80a 100644
--- a/mgo/mgo.go
+++ b/mgo/mgo.go
@@ -70,7 +70,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BCE", "CE"},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"CLST": "CLST", "WESZ": "WESZ", "HKST": "HKST", "WARST": "WARST", "GFT": "GFT", "WAST": "WAST", "ACST": "ACST", "ART": "ART", "PST": "PST", "MESZ": "MESZ", "UYT": "UYT", "ACWST": "ACWST", "∅∅∅": "∅∅∅", "OESZ": "OESZ", "GMT": "GMT", "EDT": "EDT", "SAST": "SAST", "JST": "JST", "UYST": "UYST", "CAT": "CAT", "ARST": "ARST", "MDT": "MDT", "BT": "BT", "IST": "IST", "SRT": "SRT", "MYT": "MYT", "EAT": "EAT", "AWST": "AWST", "MST": "MST", "EST": "EST", "WIT": "WIT", "WIB": "WIB", "HNT": "HNT", "WITA": "WITA", "ACWDT": "ACWDT", "TMT": "TMT", "AWDT": "AWDT", "VET": "VET", "AEST": "AEST", "ADT": "ADT", "AKDT": "AKDT", "GYT": "GYT", "LHDT": "LHDT", "COST": "COST", "ECT": "ECT", "HADT": "HADT", "SGT": "SGT", "HAT": "HAT", "JDT": "JDT", "ChST": "ChST", "HAST": "HAST", "PDT": "PDT", "LHST": "LHST", "MEZ": "MEZ", "NZDT": "NZDT", "AEDT": "AEDT", "WART": "WART", "TMST": "TMST", "AKST": "AKST", "CST": "CST", "NZST": "NZST", "WAT": "WAT", "BOT": "BOT", "CLT": "CLT", "WEZ": "WEZ", "CHAST": "CHAST", "CHADT": "CHADT", "AST": "AST", "CDT": "CDT", "COT": "COT", "HKT": "HKT", "OEZ": "OEZ", "ACDT": "ACDT"},
+ timezones: map[string]string{"BOT": "BOT", "WEZ": "WEZ", "COT": "COT", "CAT": "CAT", "GMT": "GMT", "LHST": "LHST", "UYT": "UYT", "AST": "AST", "CHADT": "CHADT", "NZST": "NZST", "HNT": "HNT", "ChST": "ChST", "BT": "BT", "WIT": "WIT", "WITA": "WITA", "ART": "ART", "HADT": "HADT", "CHAST": "CHAST", "ACWDT": "ACWDT", "AEST": "AEST", "MDT": "MDT", "ECT": "ECT", "TMST": "TMST", "AKST": "AKST", "CLST": "CLST", "CST": "CST", "ARST": "ARST", "MESZ": "MESZ", "PDT": "PDT", "WAST": "WAST", "SGT": "SGT", "GYT": "GYT", "AKDT": "AKDT", "HKST": "HKST", "HAT": "HAT", "EDT": "EDT", "SAST": "SAST", "∅∅∅": "∅∅∅", "WESZ": "WESZ", "COST": "COST", "OESZ": "OESZ", "HKT": "HKT", "JST": "JST", "ADT": "ADT", "WIB": "WIB", "WAT": "WAT", "IST": "IST", "EST": "EST", "UYST": "UYST", "EAT": "EAT", "WART": "WART", "SRT": "SRT", "ACWST": "ACWST", "AWDT": "AWDT", "JDT": "JDT", "PST": "PST", "MYT": "MYT", "CLT": "CLT", "AWST": "AWST", "OEZ": "OEZ", "LHDT": "LHDT", "MST": "MST", "ACST": "ACST", "WARST": "WARST", "VET": "VET", "NZDT": "NZDT", "AEDT": "AEDT", "CDT": "CDT", "GFT": "GFT", "TMT": "TMT", "HAST": "HAST", "ACDT": "ACDT", "MEZ": "MEZ"},
}
}
diff --git a/mgo/mgo_test.go b/mgo/mgo_test.go
new file mode 100644
index 00000000..8f681c6a
--- /dev/null
+++ b/mgo/mgo_test.go
@@ -0,0 +1,1120 @@
+package mgo
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "mgo"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/mgo_CM/mgo_CM.go b/mgo_CM/mgo_CM.go
index 69e489a7..3d20b110 100644
--- a/mgo_CM/mgo_CM.go
+++ b/mgo_CM/mgo_CM.go
@@ -70,7 +70,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BCE", "CE"},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"GMT": "GMT", "∅∅∅": "∅∅∅", "CST": "CST", "AEDT": "AEDT", "SAST": "SAST", "MESZ": "MESZ", "WESZ": "WESZ", "ACWDT": "ACWDT", "BOT": "BOT", "UYT": "UYT", "AEST": "AEST", "WART": "WART", "OEZ": "OEZ", "TMT": "TMT", "MDT": "MDT", "PST": "PST", "ADT": "ADT", "WIT": "WIT", "UYST": "UYST", "VET": "VET", "EST": "EST", "BT": "BT", "WEZ": "WEZ", "ACWST": "ACWST", "CAT": "CAT", "ECT": "ECT", "WIB": "WIB", "TMST": "TMST", "LHDT": "LHDT", "GYT": "GYT", "CLT": "CLT", "CLST": "CLST", "HAT": "HAT", "AWST": "AWST", "CHADT": "CHADT", "HAST": "HAST", "SGT": "SGT", "MST": "MST", "AKST": "AKST", "PDT": "PDT", "MEZ": "MEZ", "CHAST": "CHAST", "HADT": "HADT", "HKST": "HKST", "ACDT": "ACDT", "MYT": "MYT", "JST": "JST", "AST": "AST", "WAST": "WAST", "WARST": "WARST", "WITA": "WITA", "ChST": "ChST", "ART": "ART", "ARST": "ARST", "SRT": "SRT", "COT": "COT", "HKT": "HKT", "GFT": "GFT", "ACST": "ACST", "AWDT": "AWDT", "CDT": "CDT", "WAT": "WAT", "EAT": "EAT", "EDT": "EDT", "AKDT": "AKDT", "NZST": "NZST", "NZDT": "NZDT", "COST": "COST", "IST": "IST", "OESZ": "OESZ", "HNT": "HNT", "JDT": "JDT", "LHST": "LHST"},
+ timezones: map[string]string{"ACWDT": "ACWDT", "HADT": "HADT", "BOT": "BOT", "GMT": "GMT", "CHAST": "CHAST", "AST": "AST", "WESZ": "WESZ", "CLST": "CLST", "HKT": "HKT", "SGT": "SGT", "UYST": "UYST", "WARST": "WARST", "JST": "JST", "HNT": "HNT", "BT": "BT", "CDT": "CDT", "ECT": "ECT", "ARST": "ARST", "NZDT": "NZDT", "WIB": "WIB", "GFT": "GFT", "AKDT": "AKDT", "EDT": "EDT", "PST": "PST", "PDT": "PDT", "AEST": "AEST", "LHST": "LHST", "WART": "WART", "AKST": "AKST", "HAST": "HAST", "SAST": "SAST", "∅∅∅": "∅∅∅", "WIT": "WIT", "IST": "IST", "MEZ": "MEZ", "WEZ": "WEZ", "OESZ": "OESZ", "WITA": "WITA", "TMST": "TMST", "CAT": "CAT", "MST": "MST", "MESZ": "MESZ", "UYT": "UYT", "HKST": "HKST", "CHADT": "CHADT", "ADT": "ADT", "AWST": "AWST", "HAT": "HAT", "LHDT": "LHDT", "MYT": "MYT", "VET": "VET", "ART": "ART", "NZST": "NZST", "COT": "COT", "ChST": "ChST", "EAT": "EAT", "CST": "CST", "AWDT": "AWDT", "EST": "EST", "TMT": "TMT", "ACWST": "ACWST", "JDT": "JDT", "AEDT": "AEDT", "OEZ": "OEZ", "SRT": "SRT", "ACDT": "ACDT", "MDT": "MDT", "WAT": "WAT", "WAST": "WAST", "COST": "COST", "GYT": "GYT", "CLT": "CLT", "ACST": "ACST"},
}
}
diff --git a/mgo_CM/mgo_CM_test.go b/mgo_CM/mgo_CM_test.go
new file mode 100644
index 00000000..fc88b58d
--- /dev/null
+++ b/mgo_CM/mgo_CM_test.go
@@ -0,0 +1,1120 @@
+package mgo_CM
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "mgo_CM"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/mk/mk.go b/mk/mk.go
index dc91dc0c..ae2a6c51 100644
--- a/mk/mk.go
+++ b/mk/mk.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"", ""},
erasNarrow: []string{"пр.н.е.", "н.е."},
erasWide: []string{"пред нашата ера", "од нашата ера"},
- timezones: map[string]string{"EDT": "Источно летно сметање на времето", "SAST": "Време во Јужноафриканска Република", "OEZ": "Источноевропско стандардно време", "OESZ": "Источноевропско летно време", "PDT": "Пацифичко летно сметање на времето", "UYST": "Летно сметање на времето во Уругвај", "NZDT": "Летно сметање на времето во Нов Зеланд", "CLST": "Летно сметање на времето во Чиле", "GMT": "Средно време по Гринич", "HNT": "Стандардно време на Њуфаундленд", "HADT": "Летно сметање на времето во Хаваи - Алеутски острови", "WARST": "Летно сметање на времето во западна Аргентина", "GYT": "Време во Гвајана", "MYT": "Време во Малезија", "LHST": "Стандардно време во Лорд Хау", "CAT": "Средноафриканско време", "EAT": "Источноафриканско време", "AKST": "Стандардно време во Аљаска", "MEZ": "Средноевропско стандардно време", "MESZ": "Средноевропско летно време", "LHDT": "Летно сметање на времето во Лорд Хау", "ACWDT": "Летно сметање на времето во Централна и Западна Австралија", "ADT": "Атлантско летно сметање на времето", "SGT": "Време во Сингапур", "MDT": "MDT", "WEZ": "Западноевропско стандардно време", "ECT": "Време во Еквадор", "IST": "Време во Индија", "WESZ": "Западноевропско летно време", "WIT": "Време во Источна Индонезија", "JST": "Стандардно време во Јапонија", "BOT": "Време во Боливија", "CHAST": "Стандардно време во Четем", "CHADT": "Летно сметање на времето во Четем", "ACWST": "Стандардно време во Централна и Западна Австралија", "HAST": "Стандардно време во Хаваи - Алеутски острови", "WIB": "Време во Западна Индонезија", "WAT": "Западноафриканско стандардно време", "SRT": "Време во Суринам", "PST": "Пацифичко стандардно време", "ChST": "Време во Чаморо", "AST": "Атлантско стандардно време", "∅∅∅": "Летно сметање на времето во Амазон", "CST": "Централно стандардно време во Северна Америка", "ACDT": "Летно сметање на времето во Централна Австралија", "JDT": "Летно сметање на времето во Јапонија", "BT": "Време во Бутан", "WITA": "Време во Централна Индонезија", "TMST": "Летно време во Туркменистан", "CLT": "Стандардно време во Чиле", "AEDT": "Летно сметање на времето во Источна Австралија", "HKST": "Летно време во Хонг Конг", "AKDT": "Летно сметање на времето во Аљаска", "CDT": "Централно летно сметање на времето", "WART": "Стандардно време во западна Аргентина", "WAST": "Западноафриканско летно сметање на времето", "UYT": "Стандардно време во Уругвај", "NZST": "Стандардно време во Нов Зеланд", "VET": "Време во Венецуела", "HKT": "Стандардно време во Хонг Конг", "ART": "Стандардно време во Аргентина", "ARST": "Летно сметање на времето во Аргентина", "AWST": "Стандардно време во Западна Австралија", "AWDT": "Летно сметање на времето во Западна Австралија", "COT": "Стандардно време во Колумбија", "COST": "Летно сметање на времето во Колумбија", "GFT": "Време во Француска Гвајана", "HAT": "Летно сметање на времето на Њуфаундленд", "EST": "Источно стандардно време", "TMT": "Стандардно време во Туркменистан", "MST": "MST", "ACST": "Стандардно време во Централна Австралија", "AEST": "Стандардно време во Источна Австралија"},
+ timezones: map[string]string{"MYT": "Време во Малезија", "SAST": "Време во Јужноафриканска Република", "AEST": "Стандардно време во Источна Австралија", "ART": "Стандардно време во Аргентина", "JDT": "Летно сметање на времето во Јапонија", "NZST": "Стандардно време во Нов Зеланд", "BT": "Време во Бутан", "HKT": "Стандардно време во Хонг Конг", "ACWST": "Стандардно време во Централна и Западна Австралија", "AKST": "Стандардно време во Аљаска", "MEZ": "Средноевропско стандардно време", "WEZ": "Западноевропско стандардно време", "TMT": "Стандардно време во Туркменистан", "CST": "Централно стандардно време во Северна Америка", "CDT": "Централно летно сметање на времето", "CHAST": "Стандардно време во Четем", "BOT": "Време во Боливија", "AKDT": "Летно сметање на времето во Аљаска", "WARST": "Летно сметање на времето во западна Аргентина", "ARST": "Летно сметање на времето во Аргентина", "AWDT": "Летно сметање на времето во Западна Австралија", "JST": "Стандардно време во Јапонија", "PDT": "Пацифичко летно сметање на времето", "ECT": "Време во Еквадор", "AWST": "Стандардно време во Западна Австралија", "HAST": "Стандардно време во Хаваи - Алеутски острови", "HADT": "Летно сметање на времето во Хаваи - Алеутски острови", "NZDT": "Летно сметање на времето во Нов Зеланд", "SGT": "Време во Сингапур", "WIB": "Време во Западна Индонезија", "OESZ": "Источноевропско летно време", "EDT": "Источно летно сметање на времето", "PST": "Пацифичко стандардно време", "MDT": "MDT", "WITA": "Време во Централна Индонезија", "IST": "Време во Индија", "ACST": "Стандардно време во Централна Австралија", "CHADT": "Летно сметање на времето во Четем", "LHDT": "Летно сметање на времето во Лорд Хау", "CLT": "Стандардно време во Чиле", "WIT": "Време во Источна Индонезија", "WAST": "Западноафриканско летно сметање на времето", "GYT": "Време во Гвајана", "OEZ": "Источноевропско стандардно време", "GMT": "Средно време по Гринич", "CLST": "Летно сметање на времето во Чиле", "∅∅∅": "Летно време во Азорес", "AST": "Атлантско стандардно време", "TMST": "Летно време во Туркменистан", "EAT": "Источноафриканско време", "ACDT": "Летно сметање на времето во Централна Австралија", "COT": "Стандардно време во Колумбија", "EST": "Источно стандардно време", "CAT": "Средноафриканско време", "LHST": "Стандардно време во Лорд Хау", "UYST": "Летно сметање на времето во Уругвај", "GFT": "Време во Француска Гвајана", "ADT": "Атлантско летно сметање на времето", "MESZ": "Средноевропско летно време", "AEDT": "Летно сметање на времето во Источна Австралија", "UYT": "Стандардно време во Уругвај", "VET": "Време во Венецуела", "MST": "MST", "HNT": "Стандардно време на Њуфаундленд", "HAT": "Летно сметање на времето на Њуфаундленд", "COST": "Летно сметање на времето во Колумбија", "ACWDT": "Летно сметање на времето во Централна и Западна Австралија", "WESZ": "Западноевропско летно време", "HKST": "Летно време во Хонг Конг", "WAT": "Западноафриканско стандардно време", "ChST": "Време во Чаморо", "WART": "Стандардно време во западна Аргентина", "SRT": "Време во Суринам"},
}
}
@@ -116,8 +116,8 @@ func (mk *mk) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
n := math.Abs(num)
i := int64(n)
- iMod10 := i % 10
iMod100 := i % 100
+ iMod10 := i % 10
if iMod10 == 1 && iMod100 != 11 {
return locales.PluralRuleOne
diff --git a/mk/mk_test.go b/mk/mk_test.go
new file mode 100644
index 00000000..99b7cbe3
--- /dev/null
+++ b/mk/mk_test.go
@@ -0,0 +1,1120 @@
+package mk
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "mk"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/mk_MK/mk_MK.go b/mk_MK/mk_MK.go
index 38c81d0e..e636c56f 100644
--- a/mk_MK/mk_MK.go
+++ b/mk_MK/mk_MK.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"", ""},
erasNarrow: []string{"пр.н.е.", "н.е."},
erasWide: []string{"пред нашата ера", "од нашата ера"},
- timezones: map[string]string{"EDT": "Источно летно сметање на времето", "ADT": "Атлантско летно сметање на времето", "UYT": "Стандардно време во Уругвај", "ACWST": "Стандардно време во Централна и Западна Австралија", "AEST": "Стандардно време во Источна Австралија", "BT": "Време во Бутан", "WIB": "Време во Западна Индонезија", "LHDT": "Летно сметање на времето во Лорд Хау", "HADT": "Летно сметање на времето во Хаваи - Алеутски острови", "HKT": "Стандардно време во Хонг Конг", "HAT": "Летно сметање на времето на Њуфаундленд", "CLT": "Стандардно време во Чиле", "PST": "Пацифичко стандардно време", "CLST": "Летно сметање на времето во Чиле", "MST": "Планинско стандардно време", "CAT": "Средноафриканско време", "AST": "Атлантско стандардно време", "JST": "Стандардно време во Јапонија", "UYST": "Летно сметање на времето во Уругвај", "WESZ": "Западноевропско летно време", "∅∅∅": "Летно сметање на времето во Бразилија", "ECT": "Време во Еквадор", "EAT": "Источноафриканско време", "AKDT": "Летно сметање на времето во Аљаска", "AWST": "Стандардно време во Западна Австралија", "LHST": "Стандардно време во Лорд Хау", "CDT": "Централно летно сметање на времето", "CHADT": "Летно сметање на времето во Четем", "HKST": "Летно време во Хонг Конг", "ACDT": "Летно сметање на времето во Централна Австралија", "ART": "Стандардно време во Аргентина", "ARST": "Летно сметање на времето во Аргентина", "BOT": "Време во Боливија", "GMT": "Средно време по Гринич", "AWDT": "Летно сметање на времето во Западна Австралија", "MEZ": "Средноевропско стандардно време", "OEZ": "Источноевропско стандардно време", "TMST": "Летно време во Туркменистан", "ACST": "Стандардно време во Централна Австралија", "AEDT": "Летно сметање на времето во Источна Австралија", "HAST": "Стандардно време во Хаваи - Алеутски острови", "WAST": "Западноафриканско летно сметање на времето", "WART": "Стандардно време во западна Аргентина", "WIT": "Време во Источна Индонезија", "PDT": "Пацифичко летно сметање на времето", "AKST": "Стандардно време во Аљаска", "NZDT": "Летно сметање на времето во Нов Зеланд", "WEZ": "Западноевропско стандардно време", "MDT": "Планинско летно сметање на времето", "EST": "Источно стандардно време", "WITA": "Време во Централна Индонезија", "GFT": "Време во Француска Гвајана", "COT": "Стандардно време во Колумбија", "IST": "Време во Индија", "MESZ": "Средноевропско летно време", "ACWDT": "Летно сметање на времето во Централна и Западна Австралија", "NZST": "Стандардно време во Нов Зеланд", "COST": "Летно сметање на времето во Колумбија", "SRT": "Време во Суринам", "SAST": "Време во Јужноафриканска Република", "WAT": "Западноафриканско стандардно време", "OESZ": "Источноевропско летно време", "TMT": "Стандардно време во Туркменистан", "MYT": "Време во Малезија", "CHAST": "Стандардно време во Четем", "HNT": "Стандардно време на Њуфаундленд", "JDT": "Летно сметање на времето во Јапонија", "CST": "Централно стандардно време во Северна Америка", "VET": "Време во Венецуела", "ChST": "Време во Чаморо", "SGT": "Време во Сингапур", "WARST": "Летно сметање на времето во западна Аргентина", "GYT": "Време во Гвајана"},
+ timezones: map[string]string{"VET": "Време во Венецуела", "AWDT": "Летно сметање на времето во Западна Австралија", "HADT": "Летно сметање на времето во Хаваи - Алеутски острови", "BOT": "Време во Боливија", "HAT": "Летно сметање на времето на Њуфаундленд", "TMST": "Летно време во Туркменистан", "WARST": "Летно сметање на времето во западна Аргентина", "MDT": "MDT", "CHADT": "Летно сметање на времето во Четем", "AWST": "Стандардно време во Западна Австралија", "JDT": "Летно сметање на времето во Јапонија", "PST": "Пацифичко стандардно време", "PDT": "Пацифичко летно сметање на времето", "MEZ": "Средноевропско стандардно време", "WEZ": "Западноевропско стандардно време", "ACDT": "Летно сметање на времето во Централна Австралија", "CHAST": "Стандардно време во Четем", "AKDT": "Летно сметање на времето во Аљаска", "ACWST": "Стандардно време во Централна и Западна Австралија", "HAST": "Стандардно време во Хаваи - Алеутски острови", "GMT": "Средно време по Гринич", "AEST": "Стандардно време во Источна Австралија", "BT": "Време во Бутан", "MST": "MST", "EDT": "Источно летно сметање на времето", "OEZ": "Источноевропско стандардно време", "LHDT": "Летно сметање на времето во Лорд Хау", "UYT": "Стандардно време во Уругвај", "ARST": "Летно сметање на времето во Аргентина", "WITA": "Време во Централна Индонезија", "OESZ": "Источноевропско летно време", "MYT": "Време во Малезија", "AKST": "Стандардно време во Аљаска", "COT": "Стандардно време во Колумбија", "COST": "Летно сметање на времето во Колумбија", "CLT": "Стандардно време во Чиле", "CLST": "Летно сметање на времето во Чиле", "SRT": "Време во Суринам", "GFT": "Време во Француска Гвајана", "TMT": "Стандардно време во Туркменистан", "GYT": "Време во Гвајана", "LHST": "Стандардно време во Лорд Хау", "∅∅∅": "Летно време во Азорес", "AST": "Атлантско стандардно време", "JST": "Стандардно време во Јапонија", "SAST": "Време во Јужноафриканска Република", "EST": "Источно стандардно време", "NZDT": "Летно сметање на времето во Нов Зеланд", "HNT": "Стандардно време на Њуфаундленд", "ACST": "Стандардно време во Централна Австралија", "HKT": "Стандардно време во Хонг Конг", "UYST": "Летно сметање на времето во Уругвај", "ADT": "Атлантско летно сметање на времето", "ECT": "Време во Еквадор", "ACWDT": "Летно сметање на времето во Централна и Западна Австралија", "ART": "Стандардно време во Аргентина", "WESZ": "Западноевропско летно време", "EAT": "Источноафриканско време", "WIT": "Време во Источна Индонезија", "HKST": "Летно време во Хонг Конг", "SGT": "Време во Сингапур", "IST": "Време во Индија", "NZST": "Стандардно време во Нов Зеланд", "CAT": "Средноафриканско време", "WAT": "Западноафриканско стандардно време", "ChST": "Време во Чаморо", "CST": "Централно стандардно време во Северна Америка", "CDT": "Централно летно сметање на времето", "WART": "Стандардно време во западна Аргентина", "MESZ": "Средноевропско летно време", "WAST": "Западноафриканско летно сметање на времето", "WIB": "Време во Западна Индонезија", "AEDT": "Летно сметање на времето во Источна Австралија"},
}
}
diff --git a/mk_MK/mk_MK_test.go b/mk_MK/mk_MK_test.go
new file mode 100644
index 00000000..f1c3d593
--- /dev/null
+++ b/mk_MK/mk_MK_test.go
@@ -0,0 +1,1120 @@
+package mk_MK
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "mk_MK"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ml/ml.go b/ml/ml.go
index e58d8fe0..39e93343 100644
--- a/ml/ml.go
+++ b/ml/ml.go
@@ -47,7 +47,7 @@ func New() locales.Translator {
locale: "ml",
pluralsCardinal: []locales.PluralRule{2, 6},
pluralsOrdinal: []locales.PluralRule{6},
- pluralsRange: []locales.PluralRule{6, 2},
+ pluralsRange: []locales.PluralRule{2, 6},
decimal: ".",
group: ",",
minus: "-",
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ക്രി.മു.", "എഡി"},
erasNarrow: []string{"", ""},
erasWide: []string{"ക്രിസ്\u200cതുവിന് മുമ്പ്", "ആന്നോ ഡൊമിനി"},
- timezones: map[string]string{"MYT": "മലേഷ്യ സമയം", "MDT": "വടക്കെ അമേരിക്കൻ മൗണ്ടൻ ഡേലൈറ്റ് സമയം", "CHADT": "ചാതം വേനൽക്കാല സമയം", "CLST": "ചിലി ഗ്രീഷ്\u200cമകാല സമയം", "COST": "കൊളംബിയ ഗ്രീഷ്\u200cമകാല സമയം", "ACDT": "ഓസ്ട്രേലിയൻ സെൻട്രൽ ഡേലൈറ്റ് സമയം", "CDT": "വടക്കെ അമേരിക്കൻ സെൻട്രൽ ഡേലൈറ്റ് സമയം", "MEZ": "സെൻട്രൽ യൂറോപ്യൻ സ്റ്റാൻഡേർഡ് സമയം", "AEDT": "ഓസ്\u200cട്രേലിയൻ കിഴക്കൻ ഡേലൈറ്റ് സമയം", "HKT": "ഹോങ്കോങ്ങ് സ്റ്റാൻഡേർഡ് സമയം", "WARST": "പടിഞ്ഞാറൻ അർജന്റീന ഗ്രീഷ്\u200cമകാല സമയം", "LHST": "ലോർഡ് ഹോവ് സ്റ്റാൻഡേർഡ് സമയം", "PDT": "വടക്കെ അമേരിക്കൻ പസഫിക് ഡേലൈറ്റ് സമയം", "IST": "ഇന്ത്യൻ സ്റ്റാൻഡേർഡ് സമയം", "ACST": "ഓസ്ട്രേലിയൻ സെൻട്രൽ സ്റ്റാൻഡേർഡ് സമയം", "LHDT": "ലോർഡ് ഹോവ് ഡേലൈറ്റ് സമയം", "CLT": "ചിലി സ്റ്റാൻഡേർഡ് സമയം", "ACWDT": "ഓസ്ട്രേലിയൻ സെൻട്രൽ പടിഞ്ഞാറൻ ഡേലൈറ്റ് സമയം", "EST": "വടക്കെ അമേരിക്കൻ കിഴക്കൻ സ്റ്റാൻഡേർഡ് സമയം", "HKST": "ഹോങ്കോങ്ങ് ഗ്രീഷ്\u200cമകാല സമയം", "WAST": "പടിഞ്ഞാറൻ ആഫ്രിക്ക ഗ്രീഷ്\u200cമകാല സമയം", "JST": "ജപ്പാൻ സ്റ്റാൻഡേർഡ് സമയം", "WESZ": "പടിഞ്ഞാറൻ യൂറോപ്യൻ ഗ്രീഷ്\u200cമകാല സമയം", "SGT": "സിംഗപ്പൂർ സ്റ്റാൻഡേർഡ് സമയം", "MST": "വടക്കെ അമേരിക്കൻ മൗണ്ടൻ സ്റ്റാൻഡേർഡ് സമയം", "CAT": "മധ്യ ആഫ്രിക്ക സമയം", "WART": "പടിഞ്ഞാറൻ അർജന്റീന സ്റ്റാൻഡേർഡ് സമയം", "BT": "ഭൂട്ടാൻ സമയം", "CHAST": "ചാത്തം സ്റ്റാൻഡേർഡ് സമയം", "ECT": "ഇക്വഡോർ സമയം", "EDT": "വടക്കെ അമേരിക്കൻ കിഴക്കൻ ഡേലൈറ്റ് സമയം", "AWDT": "ഓസ്\u200cട്രേലിയൻ പടിഞ്ഞാറൻ ഡേലൈറ്റ് സമയം", "MESZ": "സെൻട്രൽ യൂറോപ്യൻ ഗ്രീഷ്മകാല സമയം", "∅∅∅": "ബ്രസീലിയ ഗ്രീഷ്\u200cമകാല സമയം", "AST": "അറ്റ്\u200cലാന്റിക് സ്റ്റാൻഡേർഡ് സമയം", "HAST": "ഹവായ്-അലൂഷ്യൻ സ്റ്റാൻഡേർഡ് സമയം", "GMT": "ഗ്രീൻവിച്ച് മീൻ സമയം", "UYST": "ഉറുഗ്വേ ഗ്രീഷ്\u200cമകാല സമയം", "NZST": "ന്യൂസിലാൻഡ് സ്റ്റാൻഡേർഡ് സമയം", "WIT": "കിഴക്കൻ ഇന്തോനേഷ്യ സമയം", "ARST": "അർജന്റീന ഗ്രീഷ്\u200cമകാല സമയം", "AKST": "അലാസ്ക സ്റ്റാൻഡേർഡ് സമയം", "AKDT": "അലാസ്\u200cക ഡേലൈറ്റ് സമയം", "UYT": "ഉറുഗ്വേ സ്റ്റാൻഡേർഡ് സമയം", "TMT": "തുർക്ക്\u200cമെനിസ്ഥാൻ സ്റ്റാൻഡേർഡ് സമയം", "JDT": "ജപ്പാൻ ഡേലൈറ്റ് സമയം", "NZDT": "ന്യൂസിലാൻഡ് ഡേലൈറ്റ് സമയം", "ADT": "അറ്റ്\u200cലാന്റിക് ഡേലൈറ്റ് സമയം", "HAT": "ന്യൂഫൗണ്ട്\u200cലാന്റ് ഡേലൈറ്റ് സമയം", "EAT": "കിഴക്കൻ ആഫ്രിക്ക സമയം", "CST": "വടക്കെ അമേരിക്കൻ സെൻട്രൽ സ്റ്റാൻഡേർഡ് സമയം", "VET": "വെനിസ്വേല സമയം", "TMST": "തുർക്ക്\u200cമെനിസ്ഥാൻ ഗ്രീഷ്\u200cമകാല സമയം", "GYT": "ഗയാന സമയം", "AWST": "ഓസ്\u200cട്രേലിയൻ പടിഞ്ഞാറൻ സ്റ്റാൻഡേർഡ് സമയം", "AEST": "ഓസ്\u200cട്രേലിയൻ കിഴക്കൻ സ്റ്റാൻഡേർഡ് സമയം", "HADT": "ഹവായ്-അലൂഷ്യൻ ഡേലൈറ്റ് സമയം", "GFT": "ഫ്രഞ്ച് ഗയാന സമയം", "OESZ": "കിഴക്കൻ യൂറോപ്യൻ ഗ്രീഷ്മകാല സമയം", "SRT": "സുരിനെയിം സമയം", "BOT": "ബൊളീവിയ സമയം", "COT": "കൊളംബിയ സ്റ്റാൻഡേർഡ് സമയം", "WAT": "പടിഞ്ഞാറൻ ആഫ്രിക്ക സ്റ്റാൻഡേർഡ് സമയം", "HNT": "ന്യൂഫൗണ്ട്\u200cലാന്റ് സ്റ്റാൻഡേർഡ് സമയം", "WITA": "മധ്യ ഇന്തോനേഷ്യ സമയം", "WIB": "പടിഞ്ഞാറൻ ഇന്തോനേഷ്യ സമയം", "OEZ": "കിഴക്കൻ യൂറോപ്യൻ സ്റ്റാൻഡേർഡ് സമയം", "ART": "അർജന്റീന സ്റ്റാൻഡേർഡ് സമയം", "ChST": "ചമോറോ സ്റ്റാൻഡേർഡ് സമയം", "WEZ": "പടിഞ്ഞാറൻ യൂറോപ്യൻ സ്റ്റാൻഡേർഡ് സമയം", "ACWST": "ഓസ്ട്രേലിയൻ സെൻട്രൽ പടിഞ്ഞാറൻ സ്റ്റാൻഡേർഡ് സമയം", "SAST": "ദക്ഷിണാഫ്രിക്ക സ്റ്റാൻഡേർഡ് സമയം", "PST": "വടക്കെ അമേരിക്കൻ പസഫിക് സ്റ്റാൻഡേർഡ് സമയം"},
+ timezones: map[string]string{"COST": "കൊളംബിയ ഗ്രീഷ്\u200cമകാല സമയം", "ChST": "ചമോറോ സ്റ്റാൻഡേർഡ് സമയം", "AEST": "ഓസ്\u200cട്രേലിയൻ കിഴക്കൻ സ്റ്റാൻഡേർഡ് സമയം", "BT": "ഭൂട്ടാൻ സമയം", "ART": "അർജന്റീന സ്റ്റാൻഡേർഡ് സമയം", "WAST": "പടിഞ്ഞാറൻ ആഫ്രിക്ക ഗ്രീഷ്\u200cമകാല സമയം", "CHAST": "ചാത്തം സ്റ്റാൻഡേർഡ് സമയം", "ADT": "അറ്റ്\u200cലാന്റിക് ഡേലൈറ്റ് സമയം", "EDT": "വടക്കെ അമേരിക്കൻ കിഴക്കൻ ഡേലൈറ്റ് സമയം", "COT": "കൊളംബിയ സ്റ്റാൻഡേർഡ് സമയം", "AEDT": "ഓസ്\u200cട്രേലിയൻ കിഴക്കൻ ഡേലൈറ്റ് സമയം", "LHST": "ലോർഡ് ഹോവ് സ്റ്റാൻഡേർഡ് സമയം", "JDT": "ജപ്പാൻ ഡേലൈറ്റ് സമയം", "ACST": "ഓസ്ട്രേലിയൻ സെൻട്രൽ സ്റ്റാൻഡേർഡ് സമയം", "HKT": "ഹോങ്കോങ്ങ് സ്റ്റാൻഡേർഡ് സമയം", "PDT": "വടക്കെ അമേരിക്കൻ പസഫിക് ഡേലൈറ്റ് സമയം", "OESZ": "കിഴക്കൻ യൂറോപ്യൻ ഗ്രീഷ്മകാല സമയം", "SRT": "സുരിനെയിം സമയം", "CST": "വടക്കെ അമേരിക്കൻ സെൻട്രൽ സ്റ്റാൻഡേർഡ് സമയം", "NZDT": "ന്യൂസിലാൻഡ് ഡേലൈറ്റ് സമയം", "SAST": "ദക്ഷിണാഫ്രിക്ക സ്റ്റാൻഡേർഡ് സമയം", "UYST": "ഉറുഗ്വേ ഗ്രീഷ്\u200cമകാല സമയം", "PST": "വടക്കെ അമേരിക്കൻ പസഫിക് സ്റ്റാൻഡേർഡ് സമയം", "MEZ": "സെൻട്രൽ യൂറോപ്യൻ സ്റ്റാൻഡേർഡ് സമയം", "AST": "അറ്റ്\u200cലാന്റിക് സ്റ്റാൻഡേർഡ് സമയം", "IST": "ഇന്ത്യൻ സ്റ്റാൻഡേർഡ് സമയം", "WESZ": "പടിഞ്ഞാറൻ യൂറോപ്യൻ ഗ്രീഷ്\u200cമകാല സമയം", "GMT": "ഗ്രീൻവിച്ച് മീൻ സമയം", "WART": "പടിഞ്ഞാറൻ അർജന്റീന സ്റ്റാൻഡേർഡ് സമയം", "WITA": "മധ്യ ഇന്തോനേഷ്യ സമയം", "ACWDT": "ഓസ്ട്രേലിയൻ സെൻട്രൽ പടിഞ്ഞാറൻ ഡേലൈറ്റ് സമയം", "WIT": "കിഴക്കൻ ഇന്തോനേഷ്യ സമയം", "OEZ": "കിഴക്കൻ യൂറോപ്യൻ സ്റ്റാൻഡേർഡ് സമയം", "MDT": "വടക്കെ അമേരിക്കൻ മൗണ്ടൻ ഡേലൈറ്റ് സമയം", "MYT": "മലേഷ്യ സമയം", "GFT": "ഫ്രഞ്ച് ഗയാന സമയം", "ECT": "ഇക്വഡോർ സമയം", "AKST": "അലാസ്ക സ്റ്റാൻഡേർഡ് സമയം", "AKDT": "അലാസ്\u200cക ഡേലൈറ്റ് സമയം", "WIB": "പടിഞ്ഞാറൻ ഇന്തോനേഷ്യ സമയം", "GYT": "ഗയാന സമയം", "MST": "വടക്കെ അമേരിക്കൻ മൗണ്ടൻ സ്റ്റാൻഡേർഡ് സമയം", "CDT": "വടക്കെ അമേരിക്കൻ സെൻട്രൽ ഡേലൈറ്റ് സമയം", "CAT": "മധ്യ ആഫ്രിക്ക സമയം", "HKST": "ഹോങ്കോങ്ങ് ഗ്രീഷ്\u200cമകാല സമയം", "CHADT": "ചാതം വേനൽക്കാല സമയം", "JST": "ജപ്പാൻ സ്റ്റാൻഡേർഡ് സമയം", "NZST": "ന്യൂസിലാൻഡ് സ്റ്റാൻഡേർഡ് സമയം", "BOT": "ബൊളീവിയ സമയം", "CLT": "ചിലി സ്റ്റാൻഡേർഡ് സമയം", "UYT": "ഉറുഗ്വേ സ്റ്റാൻഡേർഡ് സമയം", "WARST": "പടിഞ്ഞാറൻ അർജന്റീന ഗ്രീഷ്\u200cമകാല സമയം", "EST": "വടക്കെ അമേരിക്കൻ കിഴക്കൻ സ്റ്റാൻഡേർഡ് സമയം", "HAT": "ന്യൂഫൗണ്ട്\u200cലാന്റ് ഡേലൈറ്റ് സമയം", "LHDT": "ലോർഡ് ഹോവ് ഡേലൈറ്റ് സമയം", "ARST": "അർജന്റീന ഗ്രീഷ്\u200cമകാല സമയം", "HADT": "ഹവായ്-അലൂഷ്യൻ ഡേലൈറ്റ് സമയം", "WAT": "പടിഞ്ഞാറൻ ആഫ്രിക്ക സ്റ്റാൻഡേർഡ് സമയം", "WEZ": "പടിഞ്ഞാറൻ യൂറോപ്യൻ സ്റ്റാൻഡേർഡ് സമയം", "ACDT": "ഓസ്ട്രേലിയൻ സെൻട്രൽ ഡേലൈറ്റ് സമയം", "VET": "വെനിസ്വേല സമയം", "SGT": "സിംഗപ്പൂർ സ്റ്റാൻഡേർഡ് സമയം", "TMST": "തുർക്ക്\u200cമെനിസ്ഥാൻ ഗ്രീഷ്\u200cമകാല സമയം", "CLST": "ചിലി ഗ്രീഷ്\u200cമകാല സമയം", "EAT": "കിഴക്കൻ ആഫ്രിക്ക സമയം", "∅∅∅": "ബ്രസീലിയ ഗ്രീഷ്\u200cമകാല സമയം", "HAST": "ഹവായ്-അലൂഷ്യൻ സ്റ്റാൻഡേർഡ് സമയം", "MESZ": "സെൻട്രൽ യൂറോപ്യൻ ഗ്രീഷ്മകാല സമയം", "HNT": "ന്യൂഫൗണ്ട്\u200cലാന്റ് സ്റ്റാൻഡേർഡ് സമയം", "TMT": "തുർക്ക്\u200cമെനിസ്ഥാൻ സ്റ്റാൻഡേർഡ് സമയം", "AWST": "ഓസ്\u200cട്രേലിയൻ പടിഞ്ഞാറൻ സ്റ്റാൻഡേർഡ് സമയം", "AWDT": "ഓസ്\u200cട്രേലിയൻ പടിഞ്ഞാറൻ ഡേലൈറ്റ് സമയം", "ACWST": "ഓസ്ട്രേലിയൻ സെൻട്രൽ പടിഞ്ഞാറൻ സ്റ്റാൻഡേർഡ് സമയം"},
}
}
diff --git a/ml/ml_test.go b/ml/ml_test.go
new file mode 100644
index 00000000..c053e229
--- /dev/null
+++ b/ml/ml_test.go
@@ -0,0 +1,1120 @@
+package ml
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ml"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ml_IN/ml_IN.go b/ml_IN/ml_IN.go
index 21f5fefa..70824562 100644
--- a/ml_IN/ml_IN.go
+++ b/ml_IN/ml_IN.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ക്രി.മു.", "എഡി"},
erasNarrow: []string{"", ""},
erasWide: []string{"ക്രിസ്\u200cതുവിന് മുമ്പ്", "ആന്നോ ഡൊമിനി"},
- timezones: map[string]string{"GYT": "ഗയാന സമയം", "JDT": "ജപ്പാൻ ഡേലൈറ്റ് സമയം", "AEDT": "ഓസ്\u200cട്രേലിയൻ കിഴക്കൻ ഡേലൈറ്റ് സമയം", "WIB": "പടിഞ്ഞാറൻ ഇന്തോനേഷ്യ സമയം", "TMT": "തുർക്ക്\u200cമെനിസ്ഥാൻ സ്റ്റാൻഡേർഡ് സമയം", "ART": "അർജന്റീന സ്റ്റാൻഡേർഡ് സമയം", "UYST": "ഉറുഗ്വേ ഗ്രീഷ്\u200cമകാല സമയം", "CDT": "വടക്കെ അമേരിക്കൻ സെൻട്രൽ ഡേലൈറ്റ് സമയം", "MESZ": "സെൻട്രൽ യൂറോപ്യൻ ഗ്രീഷ്മകാല സമയം", "VET": "വെനിസ്വേല സമയം", "COT": "കൊളംബിയ സ്റ്റാൻഡേർഡ് സമയം", "IST": "ഇന്ത്യൻ സ്റ്റാൻഡേർഡ് സമയം", "TMST": "തുർക്ക്\u200cമെനിസ്ഥാൻ ഗ്രീഷ്\u200cമകാല സമയം", "BT": "ഭൂട്ടാൻ സമയം", "HKST": "ഹോങ്കോങ്ങ് ഗ്രീഷ്\u200cമകാല സമയം", "PDT": "വടക്കെ അമേരിക്കൻ പസഫിക് ഡേലൈറ്റ് സമയം", "NZDT": "ന്യൂസിലാൻഡ് ഡേലൈറ്റ് സമയം", "ECT": "ഇക്വഡോർ സമയം", "AST": "അറ്റ്\u200cലാന്റിക് സ്റ്റാൻഡേർഡ് സമയം", "WART": "പടിഞ്ഞാറൻ അർജന്റീന സ്റ്റാൻഡേർഡ് സമയം", "WAT": "പടിഞ്ഞാറൻ ആഫ്രിക്ക സ്റ്റാൻഡേർഡ് സമയം", "HAST": "ഹവായ്-അലൂഷ്യൻ സ്റ്റാൻഡേർഡ് സമയം", "AWDT": "ഓസ്\u200cട്രേലിയൻ പടിഞ്ഞാറൻ ഡേലൈറ്റ് സമയം", "ACST": "ഓസ്ട്രേലിയൻ സെൻട്രൽ സ്റ്റാൻഡേർഡ് സമയം", "PST": "വടക്കെ അമേരിക്കൻ പസഫിക് സ്റ്റാൻഡേർഡ് സമയം", "WARST": "പടിഞ്ഞാറൻ അർജന്റീന ഗ്രീഷ്\u200cമകാല സമയം", "LHDT": "ലോർഡ് ഹോവ് ഡേലൈറ്റ് സമയം", "HNT": "ന്യൂഫൗണ്ട്\u200cലാന്റ് സ്റ്റാൻഡേർഡ് സമയം", "HAT": "ന്യൂഫൗണ്ട്\u200cലാന്റ് ഡേലൈറ്റ് സമയം", "AWST": "ഓസ്\u200cട്രേലിയൻ പടിഞ്ഞാറൻ സ്റ്റാൻഡേർഡ് സമയം", "MEZ": "സെൻട്രൽ യൂറോപ്യൻ സ്റ്റാൻഡേർഡ് സമയം", "CHADT": "ചാതം വേനൽക്കാല സമയം", "ACWDT": "ഓസ്ട്രേലിയൻ സെൻട്രൽ പടിഞ്ഞാറൻ ഡേലൈറ്റ് സമയം", "MST": "മകൌ സ്റ്റാൻഡേർഡ് സമയം", "SRT": "സുരിനെയിം സമയം", "ARST": "അർജന്റീന ഗ്രീഷ്\u200cമകാല സമയം", "AKDT": "അലാസ്\u200cക ഡേലൈറ്റ് സമയം", "BOT": "ബൊളീവിയ സമയം", "WESZ": "പടിഞ്ഞാറൻ യൂറോപ്യൻ ഗ്രീഷ്\u200cമകാല സമയം", "COST": "കൊളംബിയ ഗ്രീഷ്\u200cമകാല സമയം", "WAST": "പടിഞ്ഞാറൻ ആഫ്രിക്ക ഗ്രീഷ്\u200cമകാല സമയം", "OEZ": "കിഴക്കൻ യൂറോപ്യൻ സ്റ്റാൻഡേർഡ് സമയം", "CLST": "ചിലി ഗ്രീഷ്\u200cമകാല സമയം", "WEZ": "പടിഞ്ഞാറൻ യൂറോപ്യൻ സ്റ്റാൻഡേർഡ് സമയം", "ChST": "ചമോറോ സ്റ്റാൻഡേർഡ് സമയം", "EDT": "വടക്കെ അമേരിക്കൻ കിഴക്കൻ ഡേലൈറ്റ് സമയം", "EAT": "കിഴക്കൻ ആഫ്രിക്ക സമയം", "AKST": "അലാസ്ക സ്റ്റാൻഡേർഡ് സമയം", "WITA": "മധ്യ ഇന്തോനേഷ്യ സമയം", "SGT": "സിംഗപ്പൂർ സ്റ്റാൻഡേർഡ് സമയം", "LHST": "ലോർഡ് ഹോവ് സ്റ്റാൻഡേർഡ് സമയം", "CST": "വടക്കെ അമേരിക്കൻ സെൻട്രൽ സ്റ്റാൻഡേർഡ് സമയം", "CLT": "ചിലി സ്റ്റാൻഡേർഡ് സമയം", "ACWST": "ഓസ്ട്രേലിയൻ സെൻട്രൽ പടിഞ്ഞാറൻ സ്റ്റാൻഡേർഡ് സമയം", "GMT": "ഗ്രീൻവിച്ച് മീൻ സമയം", "∅∅∅": "ആമസോൺ ഗ്രീഷ്\u200cമകാല സമയം", "EST": "വടക്കെ അമേരിക്കൻ കിഴക്കൻ സ്റ്റാൻഡേർഡ് സമയം", "JST": "ജപ്പാൻ സ്റ്റാൻഡേർഡ് സമയം", "UYT": "ഉറുഗ്വേ സ്റ്റാൻഡേർഡ് സമയം", "MYT": "മലേഷ്യ സമയം", "AEST": "ഓസ്\u200cട്രേലിയൻ കിഴക്കൻ സ്റ്റാൻഡേർഡ് സമയം", "CAT": "മധ്യ ആഫ്രിക്ക സമയം", "GFT": "ഫ്രഞ്ച് ഗയാന സമയം", "OESZ": "കിഴക്കൻ യൂറോപ്യൻ ഗ്രീഷ്മകാല സമയം", "WIT": "കിഴക്കൻ ഇന്തോനേഷ്യ സമയം", "ACDT": "ഓസ്ട്രേലിയൻ സെൻട്രൽ ഡേലൈറ്റ് സമയം", "MDT": "മകൌ വേനൽക്കാല സമയം", "NZST": "ന്യൂസിലാൻഡ് സ്റ്റാൻഡേർഡ് സമയം", "CHAST": "ചാത്തം സ്റ്റാൻഡേർഡ് സമയം", "ADT": "അറ്റ്\u200cലാന്റിക് ഡേലൈറ്റ് സമയം", "HADT": "ഹവായ്-അലൂഷ്യൻ ഡേലൈറ്റ് സമയം", "SAST": "ദക്ഷിണാഫ്രിക്ക സ്റ്റാൻഡേർഡ് സമയം", "HKT": "ഹോങ്കോങ്ങ് സ്റ്റാൻഡേർഡ് സമയം"},
+ timezones: map[string]string{"BOT": "ബൊളീവിയ സമയം", "ACWDT": "ഓസ്ട്രേലിയൻ സെൻട്രൽ പടിഞ്ഞാറൻ ഡേലൈറ്റ് സമയം", "JST": "ജപ്പാൻ സ്റ്റാൻഡേർഡ് സമയം", "PST": "വടക്കെ അമേരിക്കൻ പസഫിക് സ്റ്റാൻഡേർഡ് സമയം", "MEZ": "സെൻട്രൽ യൂറോപ്യൻ സ്റ്റാൻഡേർഡ് സമയം", "HAT": "ന്യൂഫൗണ്ട്\u200cലാന്റ് ഡേലൈറ്റ് സമയം", "BT": "ഭൂട്ടാൻ സമയം", "ECT": "ഇക്വഡോർ സമയം", "VET": "വെനിസ്വേല സമയം", "AWDT": "ഓസ്\u200cട്രേലിയൻ പടിഞ്ഞാറൻ ഡേലൈറ്റ് സമയം", "ACWST": "ഓസ്ട്രേലിയൻ സെൻട്രൽ പടിഞ്ഞാറൻ സ്റ്റാൻഡേർഡ് സമയം", "∅∅∅": "ആമസോൺ ഗ്രീഷ്\u200cമകാല സമയം", "COST": "കൊളംബിയ ഗ്രീഷ്\u200cമകാല സമയം", "OESZ": "കിഴക്കൻ യൂറോപ്യൻ ഗ്രീഷ്മകാല സമയം", "UYST": "ഉറുഗ്വേ ഗ്രീഷ്\u200cമകാല സമയം", "HKST": "ഹോങ്കോങ്ങ് ഗ്രീഷ്\u200cമകാല സമയം", "HAST": "ഹവായ്-അലൂഷ്യൻ സ്റ്റാൻഡേർഡ് സമയം", "PDT": "വടക്കെ അമേരിക്കൻ പസഫിക് ഡേലൈറ്റ് സമയം", "HNT": "ന്യൂഫൗണ്ട്\u200cലാന്റ് സ്റ്റാൻഡേർഡ് സമയം", "AKST": "അലാസ്ക സ്റ്റാൻഡേർഡ് സമയം", "ART": "അർജന്റീന സ്റ്റാൻഡേർഡ് സമയം", "TMST": "തുർക്ക്\u200cമെനിസ്ഥാൻ ഗ്രീഷ്\u200cമകാല സമയം", "CLST": "ചിലി ഗ്രീഷ്\u200cമകാല സമയം", "HADT": "ഹവായ്-അലൂഷ്യൻ ഡേലൈറ്റ് സമയം", "WIB": "പടിഞ്ഞാറൻ ഇന്തോനേഷ്യ സമയം", "WESZ": "പടിഞ്ഞാറൻ യൂറോപ്യൻ ഗ്രീഷ്\u200cമകാല സമയം", "GMT": "ഗ്രീൻവിച്ച് മീൻ സമയം", "MYT": "മലേഷ്യ സമയം", "ARST": "അർജന്റീന ഗ്രീഷ്\u200cമകാല സമയം", "SAST": "ദക്ഷിണാഫ്രിക്ക സ്റ്റാൻഡേർഡ് സമയം", "WAST": "പടിഞ്ഞാറൻ ആഫ്രിക്ക ഗ്രീഷ്\u200cമകാല സമയം", "AEDT": "ഓസ്\u200cട്രേലിയൻ കിഴക്കൻ ഡേലൈറ്റ് സമയം", "ChST": "ചമോറോ സ്റ്റാൻഡേർഡ് സമയം", "JDT": "ജപ്പാൻ ഡേലൈറ്റ് സമയം", "AWST": "ഓസ്\u200cട്രേലിയൻ പടിഞ്ഞാറൻ സ്റ്റാൻഡേർഡ് സമയം", "WEZ": "പടിഞ്ഞാറൻ യൂറോപ്യൻ സ്റ്റാൻഡേർഡ് സമയം", "CLT": "ചിലി സ്റ്റാൻഡേർഡ് സമയം", "WIT": "കിഴക്കൻ ഇന്തോനേഷ്യ സമയം", "EAT": "കിഴക്കൻ ആഫ്രിക്ക സമയം", "WITA": "മധ്യ ഇന്തോനേഷ്യ സമയം", "CHAST": "ചാത്തം സ്റ്റാൻഡേർഡ് സമയം", "COT": "കൊളംബിയ സ്റ്റാൻഡേർഡ് സമയം", "WAT": "പടിഞ്ഞാറൻ ആഫ്രിക്ക സ്റ്റാൻഡേർഡ് സമയം", "AEST": "ഓസ്\u200cട്രേലിയൻ കിഴക്കൻ സ്റ്റാൻഡേർഡ് സമയം", "WARST": "പടിഞ്ഞാറൻ അർജന്റീന ഗ്രീഷ്\u200cമകാല സമയം", "GFT": "ഫ്രഞ്ച് ഗയാന സമയം", "NZDT": "ന്യൂസിലാൻഡ് ഡേലൈറ്റ് സമയം", "OEZ": "കിഴക്കൻ യൂറോപ്യൻ സ്റ്റാൻഡേർഡ് സമയം", "CHADT": "ചാതം വേനൽക്കാല സമയം", "SGT": "സിംഗപ്പൂർ സ്റ്റാൻഡേർഡ് സമയം", "UYT": "ഉറുഗ്വേ സ്റ്റാൻഡേർഡ് സമയം", "CDT": "വടക്കെ അമേരിക്കൻ സെൻട്രൽ ഡേലൈറ്റ് സമയം", "SRT": "സുരിനെയിം സമയം", "AKDT": "അലാസ്\u200cക ഡേലൈറ്റ് സമയം", "NZST": "ന്യൂസിലാൻഡ് സ്റ്റാൻഡേർഡ് സമയം", "EDT": "വടക്കെ അമേരിക്കൻ കിഴക്കൻ ഡേലൈറ്റ് സമയം", "CAT": "മധ്യ ആഫ്രിക്ക സമയം", "CST": "വടക്കെ അമേരിക്കൻ സെൻട്രൽ സ്റ്റാൻഡേർഡ് സമയം", "MESZ": "സെൻട്രൽ യൂറോപ്യൻ ഗ്രീഷ്മകാല സമയം", "HKT": "ഹോങ്കോങ്ങ് സ്റ്റാൻഡേർഡ് സമയം", "LHDT": "ലോർഡ് ഹോവ് ഡേലൈറ്റ് സമയം", "MST": "വടക്കെ അമേരിക്കൻ മൗണ്ടൻ സ്റ്റാൻഡേർഡ് സമയം", "WART": "പടിഞ്ഞാറൻ അർജന്റീന സ്റ്റാൻഡേർഡ് സമയം", "AST": "അറ്റ്\u200cലാന്റിക് സ്റ്റാൻഡേർഡ് സമയം", "ADT": "അറ്റ്\u200cലാന്റിക് ഡേലൈറ്റ് സമയം", "MDT": "വടക്കെ അമേരിക്കൻ മൗണ്ടൻ ഡേലൈറ്റ് സമയം", "ACST": "ഓസ്ട്രേലിയൻ സെൻട്രൽ സ്റ്റാൻഡേർഡ് സമയം", "ACDT": "ഓസ്ട്രേലിയൻ സെൻട്രൽ ഡേലൈറ്റ് സമയം", "IST": "ഇന്ത്യൻ സ്റ്റാൻഡേർഡ് സമയം", "EST": "വടക്കെ അമേരിക്കൻ കിഴക്കൻ സ്റ്റാൻഡേർഡ് സമയം", "TMT": "തുർക്ക്\u200cമെനിസ്ഥാൻ സ്റ്റാൻഡേർഡ് സമയം", "GYT": "ഗയാന സമയം", "LHST": "ലോർഡ് ഹോവ് സ്റ്റാൻഡേർഡ് സമയം"},
}
}
diff --git a/ml_IN/ml_IN_test.go b/ml_IN/ml_IN_test.go
new file mode 100644
index 00000000..b23f3209
--- /dev/null
+++ b/ml_IN/ml_IN_test.go
@@ -0,0 +1,1120 @@
+package ml_IN
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ml_IN"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/mn/mn.go b/mn/mn.go
index 1ac0f8f5..fb39fdee 100644
--- a/mn/mn.go
+++ b/mn/mn.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"м.э.ө", "м.э."},
erasNarrow: []string{"МЭӨ", "МЭ"},
erasWide: []string{"манай эриний өмнөх", "манай эриний"},
- timezones: map[string]string{"CHAST": "Чэтамын стандарт цаг", "HKST": "Хонг Конгын зуны цаг", "ART": "Аргентины стандарт цаг", "ARST": "Аргентины зуны цаг", "AKST": "Аляскийн стандарт цаг", "AWDT": "Австралийн баруун эргийн зуны цаг", "MYT": "Малайзийн цаг", "SRT": "Суринамын цаг", "MDT": "Уулын зуны цаг", "HADT": "Хавай-Алеутын зуны цаг", "WARST": "Баруун Аргентины зуны цаг", "MESZ": "Төв Европын зуны цаг", "ChST": "Чаморрогийн цаг", "CHADT": "Чэтамын зуны цаг", "WAST": "Баруун Африкийн зуны цаг", "ACDT": "Төв Австралийн зуны цаг", "MEZ": "Төв Европын стандарт цаг", "BOT": "Боливийн цаг", "VET": "Венесуэлийн цаг", "OEZ": "Зүүн Европын стандарт цаг", "LHDT": "Лорд Хаугийн зуны цаг", "JST": "Японы стандарт цаг", "EDT": "Зүүн эргийн зуны цаг", "ECT": "Эквадорын цаг", "WAT": "Баруун Африкийн стандарт цаг", "OESZ": "Зүүн Европын зуны цаг", "GMT": "Гринвичийн үндсэн цаг", "WIB": "Баруун Индонезийн цаг", "AWST": "Австралийн баруун эргийн стандарт цаг", "MST": "Уулын стандарт цаг", "CLT": "Чилийн стандарт цаг", "COST": "Колумбын зуны цаг", "NZST": "Шинэ Зеландын стандарт цаг", "AEST": "Австралийн зүүн эргийн стандарт цаг", "GFT": "Францын Гияанагийн цаг", "ACST": "Төв Австралийн стандарт цаг", "CLST": "Чилийн зуны цаг", "COT": "Колумбын стандарт цаг", "WIT": "Зүүн Индонезийн цаг", "GYT": "Гуяанагийн цаг", "∅∅∅": "Азорын зуны цаг", "BT": "Бутаны цаг", "PST": "Номхон далайн стандарт цаг", "LHST": "Лорд Хаугийн стандарт цаг", "JDT": "Японы зуны цаг", "ACWDT": "Австралийн төв баруун эргийн зуны цаг", "AEDT": "Австралийн зүүн эргийн зуны цаг", "SGT": "Сингапурын цаг", "IST": "Энэтхэгийн цаг", "TMT": "Туркменистаны стандарт цаг", "CST": "Төв стандарт цаг", "EST": "Зүүн эргийн стандарт цаг", "ACWST": "Австралийн төв баруун эргийн стандарт цаг", "CAT": "Төв Африкийн цаг", "AST": "Атлантын стандарт цаг", "HNT": "Нью-Фаундлендын стандарт цаг", "WITA": "Төв Индонезийн цаг", "WART": "Баруун Аргентины стандарт цаг", "HAT": "Нью-Фаундлендын зуны цаг", "PDT": "Номхон далайн зуны цаг", "NZDT": "Шинэ Зеландын зуны цаг", "UYST": "Уругвайн зуны цаг", "CDT": "Төв зуны цаг", "UYT": "Уругвайн стандарт цаг", "WEZ": "Баруун Европын стандарт цаг", "ADT": "Атлантын зуны цаг", "SAST": "Өмнөд Африкийн стандарт цаг", "AKDT": "Аляскийн зуны цаг", "WESZ": "Баруун Европын зуны цаг", "HAST": "Хавай-Алеутын стандарт цаг", "HKT": "Хонг Конгын стандарт цаг", "EAT": "Зүүн Африкийн цаг", "TMST": "Туркменистаны зуны цаг"},
+ timezones: map[string]string{"UYST": "Уругвайн зуны цаг", "ACST": "Төв Австралийн стандарт цаг", "CHADT": "Чэтамын зуны цаг", "VET": "Венесуэлийн цаг", "JST": "Японы стандарт цаг", "SGT": "Сингапурын цаг", "GMT": "Гринвичийн үндсэн цаг", "MYT": "Малайзийн цаг", "CHAST": "Чэтамын стандарт цаг", "AST": "Атлантын стандарт цаг", "ART": "Аргентины стандарт цаг", "PST": "Номхон далайн стандарт цаг", "NZDT": "Шинэ Зеландын зуны цаг", "BOT": "Боливийн цаг", "WAST": "Баруун Африкийн зуны цаг", "CST": "Төв стандарт цаг", "MEZ": "Төв Европын стандарт цаг", "NZST": "Шинэ Зеландын стандарт цаг", "AEST": "Австралийн зүүн эргийн стандарт цаг", "AEDT": "Австралийн зүүн эргийн зуны цаг", "AKST": "Аляскийн стандарт цаг", "WESZ": "Баруун Европын зуны цаг", "MESZ": "Төв Европын зуны цаг", "WEZ": "Баруун Европын стандарт цаг", "COT": "Колумбын стандарт цаг", "WART": "Баруун Аргентины стандарт цаг", "EDT": "Зүүн эргийн зуны цаг", "MST": "Уулын стандарт цаг", "SRT": "Суринамын цаг", "HKST": "Хонг Конгын зуны цаг", "LHST": "Лорд Хаугийн стандарт цаг", "GYT": "Гуяанагийн цаг", "ECT": "Эквадорын цаг", "WARST": "Баруун Аргентины зуны цаг", "ARST": "Аргентины зуны цаг", "JDT": "Японы зуны цаг", "WIT": "Зүүн Индонезийн цаг", "HKT": "Хонг Конгын стандарт цаг", "HADT": "Хавай-Алеутын зуны цаг", "WAT": "Баруун Африкийн стандарт цаг", "CLST": "Чилийн зуны цаг", "EST": "Зүүн эргийн стандарт цаг", "COST": "Колумбын зуны цаг", "IST": "Энэтхэгийн цаг", "MDT": "Уулын зуны цаг", "ADT": "Атлантын зуны цаг", "HAST": "Хавай-Алеутын стандарт цаг", "SAST": "Өмнөд Африкийн стандарт цаг", "TMT": "Туркменистаны стандарт цаг", "BT": "Бутаны цаг", "UYT": "Уругвайн стандарт цаг", "EAT": "Зүүн Африкийн цаг", "ACWDT": "Австралийн төв баруун эргийн зуны цаг", "WITA": "Төв Индонезийн цаг", "CAT": "Төв Африкийн цаг", "ChST": "Чаморрогийн цаг", "CLT": "Чилийн стандарт цаг", "ACDT": "Төв Австралийн зуны цаг", "WIB": "Баруун Индонезийн цаг", "OESZ": "Зүүн Европын зуны цаг", "∅∅∅": "Перугийн зуны цаг", "ACWST": "Австралийн төв баруун эргийн стандарт цаг", "AWST": "Австралийн баруун эргийн стандарт цаг", "AWDT": "Австралийн баруун эргийн зуны цаг", "PDT": "Номхон далайн зуны цаг", "HAT": "Нью-Фаундлендын зуны цаг", "TMST": "Туркменистаны зуны цаг", "OEZ": "Зүүн Европын стандарт цаг", "GFT": "Францын Гияанагийн цаг", "CDT": "Төв зуны цаг", "AKDT": "Аляскийн зуны цаг", "HNT": "Нью-Фаундлендын стандарт цаг", "LHDT": "Лорд Хаугийн зуны цаг"},
}
}
diff --git a/mn/mn_test.go b/mn/mn_test.go
new file mode 100644
index 00000000..320705b7
--- /dev/null
+++ b/mn/mn_test.go
@@ -0,0 +1,1120 @@
+package mn
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "mn"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/mn_MN/mn_MN.go b/mn_MN/mn_MN.go
index 92cdcb0e..7e541183 100644
--- a/mn_MN/mn_MN.go
+++ b/mn_MN/mn_MN.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"м.э.ө", "м.э."},
erasNarrow: []string{"МЭӨ", "МЭ"},
erasWide: []string{"манай эриний өмнөх", "манай эриний"},
- timezones: map[string]string{"GYT": "Гуяанагийн цаг", "CDT": "Төв зуны цаг", "WIT": "Зүүн Индонезийн цаг", "NZDT": "Шинэ Зеландын зуны цаг", "WAT": "Баруун Африкийн стандарт цаг", "WARST": "Баруун Аргентины зуны цаг", "HNT": "Нью-Фаундлендын стандарт цаг", "VET": "Венесуэлийн цаг", "WART": "Баруун Аргентины стандарт цаг", "LHST": "Лорд Хаугийн стандарт цаг", "CST": "Төв стандарт цаг", "COT": "Колумбын стандарт цаг", "ECT": "Эквадорын цаг", "MST": "MST", "MYT": "Малайзийн цаг", "MEZ": "Төв Европын стандарт цаг", "CHAST": "Чэтамын стандарт цаг", "WIB": "Баруун Индонезийн цаг", "OESZ": "Зүүн Европын зуны цаг", "MDT": "MDT", "UYST": "Уругвайн зуны цаг", "AKST": "Аляскийн стандарт цаг", "ACWST": "Австралийн төв баруун эргийн стандарт цаг", "TMT": "Туркменистаны стандарт цаг", "PST": "Номхон далайн стандарт цаг", "AWST": "Австралийн баруун эргийн стандарт цаг", "WESZ": "Баруун Европын зуны цаг", "ChST": "Чаморрогийн цаг", "WAST": "Баруун Африкийн зуны цаг", "HKST": "Хонг Конгын зуны цаг", "ACDT": "Төв Австралийн зуны цаг", "SRT": "Суринамын цаг", "ACWDT": "Австралийн төв баруун эргийн зуны цаг", "BT": "Бутаны цаг", "GMT": "Гринвичийн үндсэн цаг", "ART": "Аргентины стандарт цаг", "TMST": "Туркменистаны зуны цаг", "MESZ": "Төв Европын зуны цаг", "CLT": "Чилийн стандарт цаг", "EST": "Зүүн эргийн стандарт цаг", "WITA": "Төв Индонезийн цаг", "ACST": "Төв Австралийн стандарт цаг", "AKDT": "Аляскийн зуны цаг", "JST": "Японы стандарт цаг", "OEZ": "Зүүн Европын стандарт цаг", "EAT": "Зүүн Африкийн цаг", "AWDT": "Австралийн баруун эргийн зуны цаг", "AEST": "Австралийн зүүн эргийн стандарт цаг", "CLST": "Чилийн зуны цаг", "HKT": "Хонг Конгын стандарт цаг", "HAT": "Нью-Фаундлендын зуны цаг", "ARST": "Аргентины зуны цаг", "UYT": "Уругвайн стандарт цаг", "WEZ": "Баруун Европын стандарт цаг", "AST": "Атлантын стандарт цаг", "IST": "Энэтхэгийн цаг", "PDT": "Номхон далайн зуны цаг", "LHDT": "Лорд Хаугийн зуны цаг", "NZST": "Шинэ Зеландын стандарт цаг", "AEDT": "Австралийн зүүн эргийн зуны цаг", "CHADT": "Чэтамын зуны цаг", "COST": "Колумбын зуны цаг", "SGT": "Сингапурын цаг", "SAST": "Өмнөд Африкийн стандарт цаг", "GFT": "Францын Гияанагийн цаг", "∅∅∅": "Амазоны зуны цаг", "JDT": "Японы зуны цаг", "CAT": "Төв Африкийн цаг", "EDT": "Зүүн эргийн зуны цаг", "ADT": "Атлантын зуны цаг", "BOT": "Боливийн цаг", "HAST": "Хавай-Алеутын стандарт цаг", "HADT": "Хавай-Алеутын зуны цаг"},
+ timezones: map[string]string{"ACWST": "Австралийн төв баруун эргийн стандарт цаг", "PDT": "Номхон далайн зуны цаг", "MESZ": "Төв Европын зуны цаг", "∅∅∅": "Амазоны зуны цаг", "MYT": "Малайзийн цаг", "CHADT": "Чэтамын зуны цаг", "MST": "MST", "WIB": "Баруун Индонезийн цаг", "LHST": "Лорд Хаугийн стандарт цаг", "UYT": "Уругвайн стандарт цаг", "CDT": "Төв зуны цаг", "CHAST": "Чэтамын стандарт цаг", "JDT": "Японы зуны цаг", "WAST": "Баруун Африкийн зуны цаг", "WESZ": "Баруун Европын зуны цаг", "COT": "Колумбын стандарт цаг", "COST": "Колумбын зуны цаг", "MDT": "MDT", "AKST": "Аляскийн стандарт цаг", "GMT": "Гринвичийн үндсэн цаг", "EAT": "Зүүн Африкийн цаг", "WART": "Баруун Аргентины стандарт цаг", "NZST": "Шинэ Зеландын стандарт цаг", "HNT": "Нью-Фаундлендын стандарт цаг", "TMST": "Туркменистаны зуны цаг", "EDT": "Зүүн эргийн зуны цаг", "HADT": "Хавай-Алеутын зуны цаг", "OEZ": "Зүүн Европын стандарт цаг", "AEDT": "Австралийн зүүн эргийн зуны цаг", "ACST": "Төв Австралийн стандарт цаг", "SRT": "Суринамын цаг", "ADT": "Атлантын зуны цаг", "UYST": "Уругвайн зуны цаг", "HKST": "Хонг Конгын зуны цаг", "ECT": "Эквадорын цаг", "ART": "Аргентины стандарт цаг", "IST": "Энэтхэгийн цаг", "TMT": "Туркменистаны стандарт цаг", "AEST": "Австралийн зүүн эргийн стандарт цаг", "CLST": "Чилийн зуны цаг", "AWST": "Австралийн баруун эргийн стандарт цаг", "AKDT": "Аляскийн зуны цаг", "WIT": "Зүүн Индонезийн цаг", "WARST": "Баруун Аргентины зуны цаг", "VET": "Венесуэлийн цаг", "ACDT": "Төв Австралийн зуны цаг", "SAST": "Өмнөд Африкийн стандарт цаг", "WAT": "Баруун Африкийн стандарт цаг", "WEZ": "Баруун Европын стандарт цаг", "CAT": "Төв Африкийн цаг", "OESZ": "Зүүн Европын зуны цаг", "CST": "Төв стандарт цаг", "GFT": "Францын Гияанагийн цаг", "ARST": "Аргентины зуны цаг", "PST": "Номхон далайн стандарт цаг", "SGT": "Сингапурын цаг", "BT": "Бутаны цаг", "LHDT": "Лорд Хаугийн зуны цаг", "ACWDT": "Австралийн төв баруун эргийн зуны цаг", "EST": "Зүүн эргийн стандарт цаг", "ChST": "Чаморрогийн цаг", "CLT": "Чилийн стандарт цаг", "MEZ": "Төв Европын стандарт цаг", "HAST": "Хавай-Алеутын стандарт цаг", "NZDT": "Шинэ Зеландын зуны цаг", "BOT": "Боливийн цаг", "GYT": "Гуяанагийн цаг", "HKT": "Хонг Конгын стандарт цаг", "AST": "Атлантын стандарт цаг", "AWDT": "Австралийн баруун эргийн зуны цаг", "WITA": "Төв Индонезийн цаг", "JST": "Японы стандарт цаг", "HAT": "Нью-Фаундлендын зуны цаг"},
}
}
diff --git a/mn_MN/mn_MN_test.go b/mn_MN/mn_MN_test.go
new file mode 100644
index 00000000..455c45b8
--- /dev/null
+++ b/mn_MN/mn_MN_test.go
@@ -0,0 +1,1120 @@
+package mn_MN
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "mn_MN"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/mr/mr.go b/mr/mr.go
index 24770e0b..d04728ac 100644
--- a/mr/mr.go
+++ b/mr/mr.go
@@ -67,7 +67,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"इ. स. पू.", "इ. स."},
erasNarrow: []string{"", ""},
erasWide: []string{"ईसवीसनपूर्व", "ईसवीसन"},
- timezones: map[string]string{"ACWST": "ऑस्ट्रेलियन मध्य-पश्चिम प्रमाण वेळ", "HKT": "हाँग काँग प्रमाण वेळ", "OEZ": "पूर्व युरोपियन प्रमाण वेळ", "LHDT": "लॉर्ड होवे सूर्यप्रकाश वेळ", "AST": "अटलांटिक प्रमाण वेळ", "WAST": "पश्चिम आफ्रिका उन्हाळी वेळ", "AWST": "ऑस्ट्रेलियन पश्चिम प्रमाण वेळ", "AEST": "ऑस्ट्रेलियन पूर्व प्रमाण वेळ", "SGT": "सिंगापूर प्रमाण वेळ", "WITA": "मध्\u200dय इंडोनेशिया वेळ", "IST": "भारतीय प्रमाण वेळ", "NZDT": "न्यूझीलंड सूर्यप्रकाश वेळ", "WESZ": "पश्चिम युरोपियन उन्हाळी वेळ", "WAT": "पश्चिम आफ्रिका प्रमाण वेळ", "WIT": "पौर्वात्य इंडोनेशिया वेळ", "OESZ": "पूर्व युरोपियन उन्हाळी वेळ", "WEZ": "पश्चिम युरोपियन प्रमाण वेळ", "AKST": "अलास्का प्रमाण वेळ", "PDT": "पॅसिफिक सूर्यप्रकाश वेळ", "NZST": "न्यूझीलंड प्रमाण वेळ", "UYT": "उरुग्वे प्रमाण वेळ", "ChST": "चामोरो प्रमाण वेळ", "VET": "व्हेनेझुएला वेळ", "ARST": "अर्जेंटिना उन्हाळी वेळ", "TMT": "तुर्कमेनिस्तान प्रमाण वेळ", "CST": "केंद्रीय प्रमाण वेळ", "CLST": "चिली उन्हाळी वेळ", "HKST": "हाँग काँग उन्हाळी वेळ", "WART": "पश्चिमी अर्जेंटिना प्रमाण वेळ", "HNT": "न्यू फाउंडलंड प्रमाण वेळ", "ACDT": "ऑस्ट्रेलियन मध्य सूर्यप्रकाश वेळ", "ART": "अर्जेंटिना प्रमाण वेळ", "CAT": "मध्\u200dय आफ्रिका वेळ", "GYT": "गयाना वेळ", "PST": "पॅसिफिक प्रमाण वेळ", "BOT": "बोलिव्हिया वेळ", "CLT": "चिली प्रमाण वेळ", "COT": "कोलंबिया प्रमाण वेळ", "EST": "पौर्वात्य प्रमाण वेळ", "BT": "भूतान वेळ", "MST": "मकाऊ प्रमाणवेळ", "HAT": "न्यू फाउंडलंड सूर्यप्रकाश वेळ", "AKDT": "अलास्का सूर्यप्रकाश वेळ", "COST": "कोलंबिया उन्हाळी वेळ", "SRT": "सुरिनाम वेळ", "LHST": "लॉर्ड होवे प्रमाण वेळ", "MESZ": "मध्\u200dय युरोपियन उन्हाळी वेळ", "CHAST": "चॅथम प्रमाण वेळ", "ADT": "अटलांटिक सूर्यप्रकाश वेळ", "HADT": "हवाई-अलूशन सूर्यप्रकाश वेळ", "WIB": "पश्चिमी इंडोनेशिया वेळ", "∅∅∅": "अ\u200dॅमेझॉन उन्हाळी वेळ", "UYST": "उरुग्वे उन्हाळी वेळ", "ECT": "इक्वेडोर वेळ", "SAST": "दक्षिण आफ्रिका प्रमाण वेळ", "GMT": "ग्रीनिच प्रमाण वेळ", "JDT": "जपान सूर्यप्रकाश वेळ", "MYT": "मलेशिया वेळ", "HAST": "हवाई-अलूशन प्रमाण वेळ", "ACST": "ऑस्ट्रेलियन मध्य प्रमाण वेळ", "GFT": "फ्रेंच गयाना वेळ", "CHADT": "चॅथम सूर्यप्रकाश वेळ", "CDT": "केंद्रीय सूर्यप्रकाश वेळ", "MEZ": "मध्\u200dय युरोपियन प्रमाण वेळ", "AEDT": "ऑस्ट्रेलियन पूर्व सूर्यप्रकाश वेळ", "AWDT": "ऑस्ट्रेलियन पश्चिम सूर्यप्रकाश वेळ", "EAT": "पूर्व आफ्रिका वेळ", "MDT": "मकाऊ ग्रीष्मकालीन वेळ", "JST": "जपान प्रमाण वेळ", "ACWDT": "ऑस्ट्रेलियन मध्य-पश्चिम सूर्यप्रकाश वेळ", "EDT": "पौर्वात्य सूर्यप्रकाश वेळ", "WARST": "पश्चिमी अर्जेंटिना उन्हाळी वेळ", "TMST": "तुर्कमेनिस्तान उन्हाळी वेळ"},
+ timezones: map[string]string{"UYST": "उरुग्वे उन्हाळी वेळ", "EAT": "पूर्व आफ्रिका वेळ", "CST": "केंद्रीय प्रमाण वेळ", "CDT": "केंद्रीय सूर्यप्रकाश वेळ", "ACST": "ऑस्ट्रेलियन मध्य प्रमाण वेळ", "WITA": "मध्\u200dय इंडोनेशिया वेळ", "AWDT": "ऑस्ट्रेलियन पश्चिम सूर्यप्रकाश वेळ", "OEZ": "पूर्व युरोपियन प्रमाण वेळ", "HKST": "हाँग काँग उन्हाळी वेळ", "WARST": "पश्चिमी अर्जेंटिना उन्हाळी वेळ", "∅∅∅": "अ\u200dॅमेझॉन उन्हाळी वेळ", "TMST": "तुर्कमेनिस्तान उन्हाळी वेळ", "GMT": "ग्रीनिच प्रमाण वेळ", "LHDT": "लॉर्ड होवे सूर्यप्रकाश वेळ", "ACWDT": "ऑस्ट्रेलियन मध्य-पश्चिम सूर्यप्रकाश वेळ", "HADT": "हवाई-अलूशन सूर्यप्रकाश वेळ", "PDT": "पॅसिफिक सूर्यप्रकाश वेळ", "UYT": "उरुग्वे प्रमाण वेळ", "HKT": "हाँग काँग प्रमाण वेळ", "HAST": "हवाई-अलूशन प्रमाण वेळ", "WAST": "पश्चिम आफ्रिका उन्हाळी वेळ", "WESZ": "पश्चिम युरोपियन उन्हाळी वेळ", "CLT": "चिली प्रमाण वेळ", "VET": "व्हेनेझुएला वेळ", "ADT": "अटलांटिक सूर्यप्रकाश वेळ", "AWST": "ऑस्ट्रेलियन पश्चिम प्रमाण वेळ", "IST": "भारतीय प्रमाण वेळ", "WEZ": "पश्चिम युरोपियन प्रमाण वेळ", "WIT": "पौर्वात्य इंडोनेशिया वेळ", "BT": "भूतान वेळ", "AKST": "अलास्का प्रमाण वेळ", "AST": "अटलांटिक प्रमाण वेळ", "MEZ": "मध्\u200dय युरोपियन प्रमाण वेळ", "CHADT": "चॅथम सूर्यप्रकाश वेळ", "NZDT": "न्यूझीलंड सूर्यप्रकाश वेळ", "WAT": "पश्चिम आफ्रिका प्रमाण वेळ", "GFT": "फ्रेंच गयाना वेळ", "GYT": "गयाना वेळ", "AKDT": "अलास्का सूर्यप्रकाश वेळ", "ACWST": "ऑस्ट्रेलियन मध्य-पश्चिम प्रमाण वेळ", "TMT": "तुर्कमेनिस्तान प्रमाण वेळ", "SGT": "सिंगापूर प्रमाण वेळ", "MST": "पर्वतीय प्रमाण वेळ", "ACDT": "ऑस्ट्रेलियन मध्य सूर्यप्रकाश वेळ", "WART": "पश्चिमी अर्जेंटिना प्रमाण वेळ", "ARST": "अर्जेंटिना उन्हाळी वेळ", "EDT": "पौर्वात्य सूर्यप्रकाश वेळ", "HAT": "न्यू फाउंडलंड सूर्यप्रकाश वेळ", "OESZ": "पूर्व युरोपियन उन्हाळी वेळ", "MESZ": "मध्\u200dय युरोपियन उन्हाळी वेळ", "CAT": "मध्\u200dय आफ्रिका वेळ", "AEST": "ऑस्ट्रेलियन पूर्व प्रमाण वेळ", "MYT": "मलेशिया वेळ", "BOT": "बोलिव्हिया वेळ", "SAST": "दक्षिण आफ्रिका प्रमाण वेळ", "PST": "पॅसिफिक प्रमाण वेळ", "HNT": "न्यू फाउंडलंड प्रमाण वेळ", "AEDT": "ऑस्ट्रेलियन पूर्व सूर्यप्रकाश वेळ", "ECT": "इक्वेडोर वेळ", "JST": "जपान प्रमाण वेळ", "EST": "पौर्वात्य प्रमाण वेळ", "SRT": "सुरिनाम वेळ", "MDT": "पर्वतीय सूर्यप्रकाश वेळ", "NZST": "न्यूझीलंड प्रमाण वेळ", "COST": "कोलंबिया उन्हाळी वेळ", "LHST": "लॉर्ड होवे प्रमाण वेळ", "WIB": "पश्चिमी इंडोनेशिया वेळ", "ChST": "चामोरो प्रमाण वेळ", "CLST": "चिली उन्हाळी वेळ", "CHAST": "चॅथम प्रमाण वेळ", "JDT": "जपान सूर्यप्रकाश वेळ", "ART": "अर्जेंटिना प्रमाण वेळ", "COT": "कोलंबिया प्रमाण वेळ"},
}
}
diff --git a/mr/mr_test.go b/mr/mr_test.go
new file mode 100644
index 00000000..004d4a19
--- /dev/null
+++ b/mr/mr_test.go
@@ -0,0 +1,1120 @@
+package mr
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "mr"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/mr_IN/mr_IN.go b/mr_IN/mr_IN.go
index a01f59f4..1c1dacdb 100644
--- a/mr_IN/mr_IN.go
+++ b/mr_IN/mr_IN.go
@@ -67,7 +67,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"इ. स. पू.", "इ. स."},
erasNarrow: []string{"", ""},
erasWide: []string{"ईसवीसनपूर्व", "ईसवीसन"},
- timezones: map[string]string{"HNT": "न्यू फाउंडलंड प्रमाण वेळ", "HAT": "न्यू फाउंडलंड सूर्यप्रकाश वेळ", "ACDT": "ऑस्ट्रेलियन मध्य सूर्यप्रकाश वेळ", "ARST": "अर्जेंटिना उन्हाळी वेळ", "JST": "जपान प्रमाण वेळ", "AKST": "अलास्का प्रमाण वेळ", "VET": "व्हेनेझुएला वेळ", "CHAST": "चॅथम प्रमाण वेळ", "EAT": "पूर्व आफ्रिका वेळ", "SRT": "सुरिनाम वेळ", "LHDT": "लॉर्ड होवे सूर्यप्रकाश वेळ", "CLST": "चिली उन्हाळी वेळ", "ACWDT": "ऑस्ट्रेलियन मध्य-पश्चिम सूर्यप्रकाश वेळ", "ChST": "चामोरो प्रमाण वेळ", "EST": "पौर्वात्य प्रमाण वेळ", "WARST": "पश्चिमी अर्जेंटिना उन्हाळी वेळ", "IST": "भारतीय प्रमाण वेळ", "∅∅∅": "अ\u200dॅमेझॉन उन्हाळी वेळ", "AWST": "ऑस्ट्रेलियन पश्चिम प्रमाण वेळ", "MEZ": "मध्\u200dय युरोपियन प्रमाण वेळ", "ADT": "अटलांटिक सूर्यप्रकाश वेळ", "WAT": "पश्चिम आफ्रिका प्रमाण वेळ", "HKST": "हाँग काँग उन्हाळी वेळ", "OEZ": "पूर्व युरोपियन प्रमाण वेळ", "GFT": "फ्रेंच गयाना वेळ", "MDT": "मकाऊ ग्रीष्मकालीन वेळ", "JDT": "जपान सूर्यप्रकाश वेळ", "NZDT": "न्यूझीलंड सूर्यप्रकाश वेळ", "WEZ": "पश्चिम युरोपियन प्रमाण वेळ", "HAST": "हवाई-अलूशन प्रमाण वेळ", "SAST": "दक्षिण आफ्रिका प्रमाण वेळ", "AWDT": "ऑस्ट्रेलियन पश्चिम सूर्यप्रकाश वेळ", "WESZ": "पश्चिम युरोपियन उन्हाळी वेळ", "COST": "कोलंबिया उन्हाळी वेळ", "AST": "अटलांटिक प्रमाण वेळ", "WAST": "पश्चिम आफ्रिका उन्हाळी वेळ", "HKT": "हाँग काँग प्रमाण वेळ", "AKDT": "अलास्का सूर्यप्रकाश वेळ", "LHST": "लॉर्ड होवे प्रमाण वेळ", "ACWST": "ऑस्ट्रेलियन मध्य-पश्चिम प्रमाण वेळ", "BT": "भूतान वेळ", "OESZ": "पूर्व युरोपियन उन्हाळी वेळ", "WITA": "मध्\u200dय इंडोनेशिया वेळ", "ACST": "ऑस्ट्रेलियन मध्य प्रमाण वेळ", "BOT": "बोलिव्हिया वेळ", "WIB": "पश्चिमी इंडोनेशिया वेळ", "GYT": "गयाना वेळ", "AEST": "ऑस्ट्रेलियन पूर्व प्रमाण वेळ", "PST": "पॅसिफिक प्रमाण वेळ", "CDT": "केंद्रीय सूर्यप्रकाश वेळ", "CLT": "चिली प्रमाण वेळ", "MESZ": "मध्\u200dय युरोपियन उन्हाळी वेळ", "AEDT": "ऑस्ट्रेलियन पूर्व सूर्यप्रकाश वेळ", "ECT": "इक्वेडोर वेळ", "TMT": "तुर्कमेनिस्तान प्रमाण वेळ", "TMST": "तुर्कमेनिस्तान उन्हाळी वेळ", "PDT": "पॅसिफिक सूर्यप्रकाश वेळ", "EDT": "पौर्वात्य सूर्यप्रकाश वेळ", "GMT": "ग्रीनिच प्रमाण वेळ", "MST": "मकाऊ प्रमाणवेळ", "ART": "अर्जेंटिना प्रमाण वेळ", "CST": "केंद्रीय प्रमाण वेळ", "CHADT": "चॅथम सूर्यप्रकाश वेळ", "CAT": "मध्\u200dय आफ्रिका वेळ", "WIT": "पौर्वात्य इंडोनेशिया वेळ", "UYT": "उरुग्वे प्रमाण वेळ", "SGT": "सिंगापूर प्रमाण वेळ", "MYT": "मलेशिया वेळ", "COT": "कोलंबिया प्रमाण वेळ", "WART": "पश्चिमी अर्जेंटिना प्रमाण वेळ", "NZST": "न्यूझीलंड प्रमाण वेळ", "UYST": "उरुग्वे उन्हाळी वेळ", "HADT": "हवाई-अलूशन सूर्यप्रकाश वेळ"},
+ timezones: map[string]string{"OESZ": "पूर्व युरोपियन उन्हाळी वेळ", "JDT": "जपान सूर्यप्रकाश वेळ", "NZST": "न्यूझीलंड प्रमाण वेळ", "SGT": "सिंगापूर प्रमाण वेळ", "UYST": "उरुग्वे उन्हाळी वेळ", "EAT": "पूर्व आफ्रिका वेळ", "GFT": "फ्रेंच गयाना वेळ", "EDT": "पौर्वात्य सूर्यप्रकाश वेळ", "ACST": "ऑस्ट्रेलियन मध्य प्रमाण वेळ", "CHAST": "चॅथम प्रमाण वेळ", "ECT": "इक्वेडोर वेळ", "NZDT": "न्यूझीलंड सूर्यप्रकाश वेळ", "IST": "भारतीय प्रमाण वेळ", "HKST": "हाँग काँग उन्हाळी वेळ", "ACWDT": "ऑस्ट्रेलियन मध्य-पश्चिम सूर्यप्रकाश वेळ", "JST": "जपान प्रमाण वेळ", "OEZ": "पूर्व युरोपियन प्रमाण वेळ", "GYT": "गयाना वेळ", "LHST": "लॉर्ड होवे प्रमाण वेळ", "MST": "पर्वतीय प्रमाण वेळ", "SRT": "सुरिनाम वेळ", "ACWST": "ऑस्ट्रेलियन मध्य-पश्चिम प्रमाण वेळ", "MESZ": "मध्\u200dय युरोपियन उन्हाळी वेळ", "WESZ": "पश्चिम युरोपियन उन्हाळी वेळ", "HNT": "न्यू फाउंडलंड प्रमाण वेळ", "ACDT": "ऑस्ट्रेलियन मध्य सूर्यप्रकाश वेळ", "CHADT": "चॅथम सूर्यप्रकाश वेळ", "AKST": "अलास्का प्रमाण वेळ", "AKDT": "अलास्का सूर्यप्रकाश वेळ", "HAST": "हवाई-अलूशन प्रमाण वेळ", "PST": "पॅसिफिक प्रमाण वेळ", "COT": "कोलंबिया प्रमाण वेळ", "LHDT": "लॉर्ड होवे सूर्यप्रकाश वेळ", "HKT": "हाँग काँग प्रमाण वेळ", "∅∅∅": "अ\u200dॅमेझॉन उन्हाळी वेळ", "WAT": "पश्चिम आफ्रिका प्रमाण वेळ", "UYT": "उरुग्वे प्रमाण वेळ", "WART": "पश्चिमी अर्जेंटिना प्रमाण वेळ", "ADT": "अटलांटिक सूर्यप्रकाश वेळ", "AWDT": "ऑस्ट्रेलियन पश्चिम सूर्यप्रकाश वेळ", "HAT": "न्यू फाउंडलंड सूर्यप्रकाश वेळ", "AEDT": "ऑस्ट्रेलियन पूर्व सूर्यप्रकाश वेळ", "WIT": "पौर्वात्य इंडोनेशिया वेळ", "CST": "केंद्रीय प्रमाण वेळ", "WITA": "मध्\u200dय इंडोनेशिया वेळ", "WEZ": "पश्चिम युरोपियन प्रमाण वेळ", "CDT": "केंद्रीय सूर्यप्रकाश वेळ", "HADT": "हवाई-अलूशन सूर्यप्रकाश वेळ", "SAST": "दक्षिण आफ्रिका प्रमाण वेळ", "MEZ": "मध्\u200dय युरोपियन प्रमाण वेळ", "TMT": "तुर्कमेनिस्तान प्रमाण वेळ", "CAT": "मध्\u200dय आफ्रिका वेळ", "TMST": "तुर्कमेनिस्तान उन्हाळी वेळ", "WARST": "पश्चिमी अर्जेंटिना उन्हाळी वेळ", "AWST": "ऑस्ट्रेलियन पश्चिम प्रमाण वेळ", "GMT": "ग्रीनिच प्रमाण वेळ", "CLT": "चिली प्रमाण वेळ", "MDT": "पर्वतीय सूर्यप्रकाश वेळ", "MYT": "मलेशिया वेळ", "VET": "व्हेनेझुएला वेळ", "COST": "कोलंबिया उन्हाळी वेळ", "WIB": "पश्चिमी इंडोनेशिया वेळ", "BT": "भूतान वेळ", "BOT": "बोलिव्हिया वेळ", "WAST": "पश्चिम आफ्रिका उन्हाळी वेळ", "CLST": "चिली उन्हाळी वेळ", "PDT": "पॅसिफिक सूर्यप्रकाश वेळ", "AEST": "ऑस्ट्रेलियन पूर्व प्रमाण वेळ", "ART": "अर्जेंटिना प्रमाण वेळ", "EST": "पौर्वात्य प्रमाण वेळ", "ChST": "चामोरो प्रमाण वेळ", "AST": "अटलांटिक प्रमाण वेळ", "ARST": "अर्जेंटिना उन्हाळी वेळ"},
}
}
diff --git a/mr_IN/mr_IN_test.go b/mr_IN/mr_IN_test.go
index 7ac7bbb5..2f83811e 100644
--- a/mr_IN/mr_IN_test.go
+++ b/mr_IN/mr_IN_test.go
@@ -1,27 +1,1120 @@
package mr_IN
-import "testing"
+import (
+ "testing"
+ "time"
-func TestGrouping(t *testing.T) {
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "mr_IN"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
tests := []struct {
num float64
v uint64
expected string
}{
- {
- num: 1123456.5643,
- v: 2,
- expected: "11,23,456.56",
- },
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
}
trans := New()
for _, tt := range tests {
- s := string(trans.FmtNumber(tt.num, tt.v))
+ s := trans.FmtPercent(tt.num, tt.v)
if s != tt.expected {
- t.Errorf("Expected '%s' Got '%s", tt.expected, s)
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
}
}
}
diff --git a/ms/ms.go b/ms/ms.go
index ddc65c4f..0bc5ee95 100644
--- a/ms/ms.go
+++ b/ms/ms.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"S.M.", "TM"},
erasNarrow: []string{"", ""},
erasWide: []string{"S.M.", "TM"},
- timezones: map[string]string{"ACWDT": "Waktu Siang Barat Tengah Australia", "SGT": "Waktu Piawai Singapura", "PDT": "Waktu Siang Pasifik", "AKST": "Waktu Piawai Alaska", "WART": "Waktu Piawai Argentina Barat", "JST": "Waktu Piawai Jepun", "MESZ": "Waktu Musim Panas Eropah Tengah", "VET": "Waktu Venezuela", "BT": "Waktu Bhutan", "HNT": "Waktu Piawai Newfoundland", "ARST": "Waktu Musim Panas Argentina", "GYT": "Waktu Guyana", "MEZ": "Waktu Piawai Eropah Tengah", "LHDT": "Waktu Siang Lord Howe", "PST": "Waktu Piawai Pasifik", "AWST": "Waktu Piawai Australia Barat", "MYT": "Waktu Malaysia", "CLST": "Waktu Musim Panas Chile", "AST": "Waktu Piawai Atlantik", "WIB": "Waktu Indonesia Barat", "MST": "MST", "UYT": "Waktu Piawai Uruguay", "UYST": "Waktu Musim Panas Uruguay", "ChST": "Waktu Piawai Chamorro", "HAST": "Waktu Piawai Hawaii-Aleutian", "NZST": "Waktu Piawai New Zealand", "WAST": "Waktu Musim Panas Afrika Barat", "CDT": "Waktu Siang Tengah", "CHADT": "Waktu Siang Chatham", "HAT": "Waktu Siang Newfoundland", "ACDT": "Waktu Siang Australia Tengah", "GMT": "Waktu Min Greenwich", "AWDT": "Waktu Siang Australia Barat", "AEST": "Waktu Piawai Timur Australia", "EDT": "Waktu Siang Timur", "NZDT": "Waktu Siang New Zealand", "EAT": "Waktu Afrika Timur", "WESZ": "Waktu Musim Panas Eropah Barat", "EST": "Waktu Piawai Timur", "COST": "Waktu Musim Panas Colombia", "HADT": "Waktu Siang Hawaii-Aleutian", "WAT": "Waktu Piawai Afrika Barat", "OEZ": "Waktu Piawai Eropah Timur", "ACST": "Waktu Piawai Australia Tengah", "TMT": "Waktu Piawai Turkmenistan", "TMST": "Waktu Musim Panas Turkmenistan", "OESZ": "Waktu Musim Panas Eropah Timur", "IST": "Waktu Piawai India", "ART": "Waktu Piawai Argentina", "HKST": "Waktu Musim Panas Hong Kong", "WITA": "Waktu Indonesia Tengah", "MDT": "MDT", "SRT": "Waktu Suriname", "BOT": "Waktu Bolivia", "AEDT": "Waktu Siang Australia Timur", "CLT": "Waktu Piawai Chile", "ECT": "Waktu Ecuador", "HKT": "Waktu Piawai Hong Kong", "SAST": "Waktu Piawai Afrika Selatan", "∅∅∅": "Waktu Musim Panas Amazon", "JDT": "Waktu Siang Jepun", "CST": "Waktu Piawai Pusat", "CHAST": "Waktu Piawai Chatham", "WEZ": "Waktu Piawai Eropah Barat", "COT": "Waktu Piawai Colombia", "CAT": "Waktu Afrika Tengah", "WARST": "Waktu Musim Panas Argentina Barat", "LHST": "Waktu Piawai Lord Howe", "WIT": "Waktu Indonesia Timur", "GFT": "Waktu Guyana Perancis", "ACWST": "Waktu Piawai Barat Tengah Australia", "ADT": "Waktu Siang Atlantik", "AKDT": "Waktu Siang Alaska"},
+ timezones: map[string]string{"AST": "Waktu Piawai Atlantik", "MEZ": "Waktu Piawai Eropah Tengah", "SGT": "Waktu Piawai Singapura", "TMT": "Waktu Piawai Turkmenistan", "AEDT": "Waktu Siang Australia Timur", "HKST": "Waktu Musim Panas Hong Kong", "ACWDT": "Waktu Siang Barat Tengah Australia", "EST": "Waktu Piawai Timur", "MST": "MST", "JDT": "Waktu Siang Jepun", "COT": "Waktu Piawai Colombia", "COST": "Waktu Musim Panas Colombia", "TMST": "Waktu Musim Panas Turkmenistan", "AEST": "Waktu Piawai Timur Australia", "UYST": "Waktu Musim Panas Uruguay", "EAT": "Waktu Afrika Timur", "ACWST": "Waktu Piawai Barat Tengah Australia", "AKST": "Waktu Piawai Alaska", "WART": "Waktu Piawai Argentina Barat", "ACST": "Waktu Piawai Australia Tengah", "ChST": "Waktu Piawai Chamorro", "OEZ": "Waktu Piawai Eropah Timur", "WARST": "Waktu Musim Panas Argentina Barat", "BOT": "Waktu Bolivia", "IST": "Waktu Piawai India", "OESZ": "Waktu Musim Panas Eropah Timur", "LHST": "Waktu Piawai Lord Howe", "∅∅∅": "Waktu Musim Panas Azores", "SAST": "Waktu Piawai Afrika Selatan", "GYT": "Waktu Guyana", "BT": "Waktu Bhutan", "PDT": "Waktu Siang Pasifik", "MESZ": "Waktu Musim Panas Eropah Tengah", "CHAST": "Waktu Piawai Chatham", "GMT": "Waktu Min Greenwich", "CLST": "Waktu Musim Panas Chile", "HADT": "Waktu Siang Hawaii-Aleutian", "WAT": "Waktu Piawai Afrika Barat", "HAST": "Waktu Piawai Hawaii-Aleutian", "WESZ": "Waktu Musim Panas Eropah Barat", "CLT": "Waktu Piawai Chile", "ARST": "Waktu Musim Panas Argentina", "PST": "Waktu Piawai Pasifik", "EDT": "Waktu Siang Timur", "UYT": "Waktu Piawai Uruguay", "MDT": "MDT", "ART": "Waktu Piawai Argentina", "AWST": "Waktu Piawai Australia Barat", "WAST": "Waktu Musim Panas Afrika Barat", "CHADT": "Waktu Siang Chatham", "VET": "Waktu Venezuela", "WITA": "Waktu Indonesia Tengah", "ADT": "Waktu Siang Atlantik", "HAT": "Waktu Siang Newfoundland", "LHDT": "Waktu Siang Lord Howe", "CDT": "Waktu Siang Tengah", "GFT": "Waktu Guyana Perancis", "ECT": "Waktu Ecuador", "ACDT": "Waktu Siang Australia Tengah", "HKT": "Waktu Piawai Hong Kong", "NZDT": "Waktu Siang New Zealand", "WEZ": "Waktu Piawai Eropah Barat", "HNT": "Waktu Piawai Newfoundland", "CAT": "Waktu Afrika Tengah", "MYT": "Waktu Malaysia", "WIT": "Waktu Indonesia Timur", "CST": "Waktu Piawai Pusat", "AWDT": "Waktu Siang Australia Barat", "NZST": "Waktu Piawai New Zealand", "SRT": "Waktu Suriname", "AKDT": "Waktu Siang Alaska", "WIB": "Waktu Indonesia Barat", "JST": "Waktu Piawai Jepun"},
}
}
diff --git a/ms/ms_test.go b/ms/ms_test.go
new file mode 100644
index 00000000..2662ad32
--- /dev/null
+++ b/ms/ms_test.go
@@ -0,0 +1,1120 @@
+package ms
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ms"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ms_BN/ms_BN.go b/ms_BN/ms_BN.go
index f531c732..cb61fb79 100644
--- a/ms_BN/ms_BN.go
+++ b/ms_BN/ms_BN.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"S.M.", "TM"},
erasNarrow: []string{"", ""},
erasWide: []string{"S.M.", "TM"},
- timezones: map[string]string{"WAT": "Waktu Piawai Afrika Barat", "PDT": "Waktu Siang Pasifik", "CST": "Waktu Piawai Pusat", "ACWST": "Waktu Piawai Barat Tengah Australia", "CLT": "Waktu Piawai Chile", "CAT": "Waktu Afrika Tengah", "GMT": "Waktu Min Greenwich", "ARST": "Waktu Musim Panas Argentina", "UYT": "Waktu Piawai Uruguay", "UYST": "Waktu Musim Panas Uruguay", "EDT": "Waktu Siang Timur", "HADT": "Waktu Siang Hawaii-Aleutian", "HKT": "Waktu Piawai Hong Kong", "WART": "Waktu Piawai Argentina Barat", "GFT": "Waktu Guyana Perancis", "GYT": "Waktu Guyana", "MEZ": "Waktu Piawai Eropah Tengah", "TMT": "Waktu Piawai Turkmenistan", "LHDT": "Waktu Siang Lord Howe", "WEZ": "Waktu Piawai Eropah Barat", "ACWDT": "Waktu Siang Barat Tengah Australia", "CHADT": "Waktu Siang Chatham", "VET": "Waktu Venezuela", "MDT": "MDT", "CLST": "Waktu Musim Panas Chile", "ADT": "Waktu Siang Atlantik", "∅∅∅": "∅∅∅", "OESZ": "Waktu Musim Panas Eropah Timur", "TMST": "Waktu Musim Panas Turkmenistan", "WIT": "Waktu Indonesia Timur", "ACST": "Waktu Piawai Australia Tengah", "JDT": "Waktu Siang Jepun", "MESZ": "Waktu Musim Panas Eropah Tengah", "CHAST": "Waktu Piawai Chatham", "COT": "Waktu Piawai Colombia", "BT": "Waktu Bhutan", "AKDT": "Waktu Siang Alaska", "NZST": "Waktu Piawai New Zealand", "HKST": "Waktu Musim Panas Hong Kong", "PST": "Waktu Piawai Pasifik", "BOT": "Waktu Bolivia", "AEST": "Waktu Piawai Timur Australia", "WARST": "Waktu Musim Panas Argentina Barat", "OEZ": "Waktu Piawai Eropah Timur", "NZDT": "Waktu Siang New Zealand", "ECT": "Waktu Ecuador", "HAST": "Waktu Piawai Hawaii-Aleutian", "WAST": "Waktu Musim Panas Afrika Barat", "HNT": "Waktu Piawai Newfoundland", "WIB": "Waktu Indonesia Barat", "ACDT": "Waktu Siang Australia Tengah", "SRT": "Waktu Suriname", "MYT": "Waktu Malaysia", "JST": "Waktu Piawai Jepun", "WESZ": "Waktu Musim Panas Eropah Barat", "AEDT": "Waktu Siang Australia Timur", "EST": "Waktu Piawai Timur", "CDT": "Waktu Siang Tengah", "AST": "Waktu Piawai Atlantik", "IST": "Waktu Piawai India", "HAT": "Waktu Siang Newfoundland", "AKST": "Waktu Piawai Alaska", "AWDT": "Waktu Siang Australia Barat", "LHST": "Waktu Piawai Lord Howe", "SGT": "Waktu Piawai Singapura", "SAST": "Waktu Piawai Afrika Selatan", "WITA": "Waktu Indonesia Tengah", "EAT": "Waktu Afrika Timur", "AWST": "Waktu Piawai Australia Barat", "COST": "Waktu Musim Panas Colombia", "MST": "MST", "ChST": "Waktu Piawai Chamorro", "ART": "Waktu Piawai Argentina"},
+ timezones: map[string]string{"CST": "Waktu Piawai Pusat", "WART": "Waktu Piawai Argentina Barat", "AKDT": "Waktu Siang Alaska", "AST": "Waktu Piawai Atlantik", "TMT": "Waktu Piawai Turkmenistan", "MYT": "Waktu Malaysia", "WIT": "Waktu Indonesia Timur", "LHDT": "Waktu Siang Lord Howe", "WAT": "Waktu Piawai Afrika Barat", "ChST": "Waktu Piawai Chamorro", "GMT": "Waktu Min Greenwich", "HADT": "Waktu Siang Hawaii-Aleutian", "HNT": "Waktu Piawai Newfoundland", "CLT": "Waktu Piawai Chile", "PDT": "Waktu Siang Pasifik", "MESZ": "Waktu Musim Panas Eropah Tengah", "COST": "Waktu Musim Panas Colombia", "CDT": "Waktu Siang Tengah", "AWST": "Waktu Piawai Australia Barat", "ACWST": "Waktu Piawai Barat Tengah Australia", "WITA": "Waktu Indonesia Tengah", "PST": "Waktu Piawai Pasifik", "HKT": "Waktu Piawai Hong Kong", "MEZ": "Waktu Piawai Eropah Tengah", "EDT": "Waktu Siang Timur", "WAST": "Waktu Musim Panas Afrika Barat", "BT": "Waktu Bhutan", "NZDT": "Waktu Siang New Zealand", "SGT": "Waktu Piawai Singapura", "VET": "Waktu Venezuela", "ART": "Waktu Piawai Argentina", "OESZ": "Waktu Musim Panas Eropah Timur", "AEST": "Waktu Piawai Timur Australia", "AEDT": "Waktu Siang Australia Timur", "UYST": "Waktu Musim Panas Uruguay", "EAT": "Waktu Afrika Timur", "∅∅∅": "Waktu Musim Panas Brasilia", "CAT": "Waktu Afrika Tengah", "GYT": "Waktu Guyana", "ACDT": "Waktu Siang Australia Tengah", "JST": "Waktu Piawai Jepun", "IST": "Waktu Piawai India", "TMST": "Waktu Musim Panas Turkmenistan", "ECT": "Waktu Ecuador", "JDT": "Waktu Siang Jepun", "WIB": "Waktu Indonesia Barat", "EST": "Waktu Piawai Timur", "COT": "Waktu Piawai Colombia", "MDT": "Waktu Hari Siang Pergunungan", "GFT": "Waktu Guyana Perancis", "CHADT": "Waktu Siang Chatham", "ARST": "Waktu Musim Panas Argentina", "ADT": "Waktu Siang Atlantik", "OEZ": "Waktu Piawai Eropah Timur", "AKST": "Waktu Piawai Alaska", "MST": "Waktu Piawai Pergunungan", "LHST": "Waktu Piawai Lord Howe", "AWDT": "Waktu Siang Australia Barat", "HAST": "Waktu Piawai Hawaii-Aleutian", "SRT": "Waktu Suriname", "WARST": "Waktu Musim Panas Argentina Barat", "CHAST": "Waktu Piawai Chatham", "BOT": "Waktu Bolivia", "SAST": "Waktu Piawai Afrika Selatan", "HAT": "Waktu Siang Newfoundland", "WESZ": "Waktu Musim Panas Eropah Barat", "CLST": "Waktu Musim Panas Chile", "UYT": "Waktu Piawai Uruguay", "ACST": "Waktu Piawai Australia Tengah", "WEZ": "Waktu Piawai Eropah Barat", "HKST": "Waktu Musim Panas Hong Kong", "ACWDT": "Waktu Siang Barat Tengah Australia", "NZST": "Waktu Piawai New Zealand"},
}
}
diff --git a/ms_BN/ms_BN_test.go b/ms_BN/ms_BN_test.go
new file mode 100644
index 00000000..c160175f
--- /dev/null
+++ b/ms_BN/ms_BN_test.go
@@ -0,0 +1,1120 @@
+package ms_BN
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ms_BN"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ms_MY/ms_MY.go b/ms_MY/ms_MY.go
index 652d7dcb..c7afd77b 100644
--- a/ms_MY/ms_MY.go
+++ b/ms_MY/ms_MY.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"S.M.", "TM"},
erasNarrow: []string{"", ""},
erasWide: []string{"S.M.", "TM"},
- timezones: map[string]string{"NZDT": "Waktu Siang New Zealand", "SRT": "Waktu Suriname", "UYT": "Waktu Piawai Uruguay", "WEZ": "Waktu Piawai Eropah Barat", "∅∅∅": "Waktu Musim Panas Brasilia", "WART": "Waktu Piawai Argentina Barat", "WITA": "Waktu Indonesia Tengah", "ART": "Waktu Piawai Argentina", "JST": "Waktu Piawai Jepun", "AEST": "Waktu Piawai Timur Australia", "CHADT": "Waktu Siang Chatham", "EAT": "Waktu Afrika Timur", "MEZ": "Waktu Piawai Eropah Tengah", "CDT": "Waktu Siang Tengah", "ACWST": "Waktu Piawai Barat Tengah Australia", "ACWDT": "Waktu Siang Barat Tengah Australia", "CLT": "Waktu Piawai Chile", "EDT": "Waktu Siang Timur", "HKT": "Waktu Piawai Hong Kong", "BOT": "Waktu Bolivia", "MST": "Waktu Piawai Pergunungan", "MDT": "Waktu Hari Siang Pergunungan", "CHAST": "Waktu Piawai Chatham", "WAST": "Waktu Musim Panas Afrika Barat", "WIB": "Waktu Indonesia Barat", "AWDT": "Waktu Siang Australia Barat", "VET": "Waktu Venezuela", "ACST": "Waktu Piawai Australia Tengah", "AWST": "Waktu Piawai Australia Barat", "MYT": "Waktu Malaysia", "NZST": "Waktu Piawai New Zealand", "WESZ": "Waktu Musim Panas Eropah Barat", "GMT": "Waktu Min Greenwich", "GFT": "Waktu Guyana Perancis", "LHDT": "Waktu Siang Lord Howe", "WAT": "Waktu Piawai Afrika Barat", "HAT": "Waktu Siang Newfoundland", "WIT": "Waktu Indonesia Timur", "HADT": "Waktu Siang Hawaii-Aleutian", "HNT": "Waktu Piawai Newfoundland", "ACDT": "Waktu Siang Australia Tengah", "AKST": "Waktu Piawai Alaska", "EST": "Waktu Piawai Timur", "COT": "Waktu Piawai Colombia", "TMT": "Waktu Piawai Turkmenistan", "AEDT": "Waktu Siang Australia Timur", "COST": "Waktu Musim Panas Colombia", "OESZ": "Waktu Musim Panas Eropah Timur", "ARST": "Waktu Musim Panas Argentina", "TMST": "Waktu Musim Panas Turkmenistan", "MESZ": "Waktu Musim Panas Eropah Tengah", "HAST": "Waktu Piawai Hawaii-Aleutian", "AST": "Waktu Piawai Atlantik", "SAST": "Waktu Piawai Afrika Selatan", "JDT": "Waktu Siang Jepun", "AKDT": "Waktu Siang Alaska", "UYST": "Waktu Musim Panas Uruguay", "GYT": "Waktu Guyana", "ADT": "Waktu Siang Atlantik", "OEZ": "Waktu Piawai Eropah Timur", "PST": "Waktu Piawai Pasifik", "PDT": "Waktu Siang Pasifik", "LHST": "Waktu Piawai Lord Howe", "SGT": "Waktu Piawai Singapura", "HKST": "Waktu Musim Panas Hong Kong", "WARST": "Waktu Musim Panas Argentina Barat", "CST": "Waktu Piawai Pusat", "ChST": "Waktu Piawai Chamorro", "CLST": "Waktu Musim Panas Chile", "ECT": "Waktu Ecuador", "CAT": "Waktu Afrika Tengah", "BT": "Waktu Bhutan", "IST": "Waktu Piawai India"},
+ timezones: map[string]string{"GYT": "Waktu Guyana", "CLT": "Waktu Piawai Chile", "UYST": "Waktu Musim Panas Uruguay", "AWST": "Waktu Piawai Australia Barat", "JDT": "Waktu Siang Jepun", "ADT": "Waktu Siang Atlantik", "EDT": "Waktu Siang Timur", "CAT": "Waktu Afrika Tengah", "ACST": "Waktu Piawai Australia Tengah", "ACDT": "Waktu Siang Australia Tengah", "ACWDT": "Waktu Siang Barat Tengah Australia", "PDT": "Waktu Siang Pasifik", "HAT": "Waktu Siang Newfoundland", "COST": "Waktu Musim Panas Colombia", "UYT": "Waktu Piawai Uruguay", "BOT": "Waktu Bolivia", "AWDT": "Waktu Siang Australia Barat", "∅∅∅": "Waktu Musim Panas Amazon", "LHST": "Waktu Piawai Lord Howe", "MST": "MST", "MYT": "Waktu Malaysia", "ARST": "Waktu Musim Panas Argentina", "MEZ": "Waktu Piawai Eropah Tengah", "HKT": "Waktu Piawai Hong Kong", "CHAST": "Waktu Piawai Chatham", "SGT": "Waktu Piawai Singapura", "ChST": "Waktu Piawai Chamorro", "CDT": "Waktu Siang Tengah", "ACWST": "Waktu Piawai Barat Tengah Australia", "CST": "Waktu Piawai Pusat", "GFT": "Waktu Guyana Perancis", "JST": "Waktu Piawai Jepun", "AKDT": "Waktu Siang Alaska", "AST": "Waktu Piawai Atlantik", "MESZ": "Waktu Musim Panas Eropah Tengah", "WIT": "Waktu Indonesia Timur", "CLST": "Waktu Musim Panas Chile", "EAT": "Waktu Afrika Timur", "BT": "Waktu Bhutan", "MDT": "MDT", "ART": "Waktu Piawai Argentina", "HAST": "Waktu Piawai Hawaii-Aleutian", "NZST": "Waktu Piawai New Zealand", "OESZ": "Waktu Musim Panas Eropah Timur", "WART": "Waktu Piawai Argentina Barat", "ECT": "Waktu Ecuador", "SAST": "Waktu Piawai Afrika Selatan", "WAT": "Waktu Piawai Afrika Barat", "WEZ": "Waktu Piawai Eropah Barat", "CHADT": "Waktu Siang Chatham", "TMT": "Waktu Piawai Turkmenistan", "WESZ": "Waktu Musim Panas Eropah Barat", "AEST": "Waktu Piawai Timur Australia", "AEDT": "Waktu Siang Australia Timur", "HNT": "Waktu Piawai Newfoundland", "COT": "Waktu Piawai Colombia", "TMST": "Waktu Musim Panas Turkmenistan", "OEZ": "Waktu Piawai Eropah Timur", "LHDT": "Waktu Siang Lord Howe", "IST": "Waktu Piawai India", "VET": "Waktu Venezuela", "HKST": "Waktu Musim Panas Hong Kong", "WITA": "Waktu Indonesia Tengah", "AKST": "Waktu Piawai Alaska", "NZDT": "Waktu Siang New Zealand", "WARST": "Waktu Musim Panas Argentina Barat", "PST": "Waktu Piawai Pasifik", "EST": "Waktu Piawai Timur", "WIB": "Waktu Indonesia Barat", "WAST": "Waktu Musim Panas Afrika Barat", "SRT": "Waktu Suriname", "HADT": "Waktu Siang Hawaii-Aleutian", "GMT": "Waktu Min Greenwich"},
}
}
diff --git a/ms_MY/ms_MY_test.go b/ms_MY/ms_MY_test.go
new file mode 100644
index 00000000..1f3b5654
--- /dev/null
+++ b/ms_MY/ms_MY_test.go
@@ -0,0 +1,1120 @@
+package ms_MY
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ms_MY"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ms_SG/ms_SG.go b/ms_SG/ms_SG.go
index 68a60664..45471324 100644
--- a/ms_SG/ms_SG.go
+++ b/ms_SG/ms_SG.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"S.M.", "TM"},
erasNarrow: []string{"", ""},
erasWide: []string{"S.M.", "TM"},
- timezones: map[string]string{"OEZ": "Waktu Piawai Eropah Timur", "WITA": "Waktu Indonesia Tengah", "AKST": "Waktu Piawai Alaska", "LHST": "Waktu Piawai Lord Howe", "MYT": "Waktu Malaysia", "MEZ": "Waktu Piawai Eropah Tengah", "UYST": "Waktu Musim Panas Uruguay", "SGT": "Waktu Piawai Singapura", "WIB": "Waktu Indonesia Barat", "AKDT": "Waktu Siang Alaska", "PDT": "Waktu Siang Pasifik", "ADT": "Waktu Siang Atlantik", "HAT": "Waktu Siang Newfoundland", "TMT": "Waktu Piawai Turkmenistan", "JDT": "Waktu Siang Jepun", "AEST": "Waktu Piawai Timur Australia", "OESZ": "Waktu Musim Panas Eropah Timur", "CHAST": "Waktu Piawai Chatham", "CLST": "Waktu Musim Panas Chile", "∅∅∅": "∅∅∅", "MST": "MST", "AWST": "Waktu Piawai Australia Barat", "BOT": "Waktu Bolivia", "EDT": "Waktu Siang Timur", "HKT": "Waktu Piawai Hong Kong", "HKST": "Waktu Musim Panas Hong Kong", "HNT": "Waktu Piawai Newfoundland", "LHDT": "Waktu Siang Lord Howe", "JST": "Waktu Piawai Jepun", "EST": "Waktu Piawai Timur", "BT": "Waktu Bhutan", "GFT": "Waktu Guyana Perancis", "EAT": "Waktu Afrika Timur", "PST": "Waktu Piawai Pasifik", "COST": "Waktu Musim Panas Colombia", "GMT": "Waktu Min Greenwich", "WAST": "Waktu Musim Panas Afrika Barat", "WEZ": "Waktu Piawai Eropah Barat", "AST": "Waktu Piawai Atlantik", "WART": "Waktu Piawai Argentina Barat", "ACST": "Waktu Piawai Australia Tengah", "GYT": "Waktu Guyana", "CST": "Waktu Piawai Pusat", "NZST": "Waktu Piawai New Zealand", "NZDT": "Waktu Siang New Zealand", "WAT": "Waktu Piawai Afrika Barat", "VET": "Waktu Venezuela", "ACWST": "Waktu Piawai Barat Tengah Australia", "ChST": "Waktu Piawai Chamorro", "CHADT": "Waktu Siang Chatham", "ECT": "Waktu Ecuador", "WIT": "Waktu Indonesia Timur", "ACDT": "Waktu Siang Australia Tengah", "TMST": "Waktu Musim Panas Turkmenistan", "WESZ": "Waktu Musim Panas Eropah Barat", "HADT": "Waktu Siang Hawaii-Aleutian", "ARST": "Waktu Musim Panas Argentina", "CDT": "Waktu Siang Tengah", "UYT": "Waktu Piawai Uruguay", "ACWDT": "Waktu Siang Barat Tengah Australia", "AEDT": "Waktu Siang Australia Timur", "WARST": "Waktu Musim Panas Argentina Barat", "MDT": "MDT", "ART": "Waktu Piawai Argentina", "CAT": "Waktu Afrika Tengah", "HAST": "Waktu Piawai Hawaii-Aleutian", "IST": "Waktu Piawai India", "AWDT": "Waktu Siang Australia Barat", "CLT": "Waktu Piawai Chile", "SAST": "Waktu Piawai Afrika Selatan", "MESZ": "Waktu Musim Panas Eropah Tengah", "COT": "Waktu Piawai Colombia", "SRT": "Waktu Suriname"},
+ timezones: map[string]string{"UYT": "Waktu Piawai Uruguay", "EAT": "Waktu Afrika Timur", "HAT": "Waktu Siang Newfoundland", "AEDT": "Waktu Siang Australia Timur", "ART": "Waktu Piawai Argentina", "AKDT": "Waktu Siang Alaska", "ACWST": "Waktu Piawai Barat Tengah Australia", "WITA": "Waktu Indonesia Tengah", "EDT": "Waktu Siang Timur", "CLT": "Waktu Piawai Chile", "UYST": "Waktu Musim Panas Uruguay", "ACDT": "Waktu Siang Australia Tengah", "SAST": "Waktu Piawai Afrika Selatan", "NZST": "Waktu Piawai New Zealand", "AEST": "Waktu Piawai Timur Australia", "OEZ": "Waktu Piawai Eropah Timur", "BT": "Waktu Bhutan", "ACST": "Waktu Piawai Australia Tengah", "HKT": "Waktu Piawai Hong Kong", "ADT": "Waktu Siang Atlantik", "HADT": "Waktu Siang Hawaii-Aleutian", "LHST": "Waktu Piawai Lord Howe", "CHAST": "Waktu Piawai Chatham", "HAST": "Waktu Piawai Hawaii-Aleutian", "COST": "Waktu Musim Panas Colombia", "TMT": "Waktu Piawai Turkmenistan", "MST": "Waktu Piawai Pergunungan", "SRT": "Waktu Suriname", "MEZ": "Waktu Piawai Eropah Tengah", "WAST": "Waktu Musim Panas Afrika Barat", "HNT": "Waktu Piawai Newfoundland", "CAT": "Waktu Afrika Tengah", "CLST": "Waktu Musim Panas Chile", "CHADT": "Waktu Siang Chatham", "AWST": "Waktu Piawai Australia Barat", "JST": "Waktu Piawai Jepun", "IST": "Waktu Piawai India", "GFT": "Waktu Guyana Perancis", "TMST": "Waktu Musim Panas Turkmenistan", "LHDT": "Waktu Siang Lord Howe", "AST": "Waktu Piawai Atlantik", "ACWDT": "Waktu Siang Barat Tengah Australia", "JDT": "Waktu Siang Jepun", "PST": "Waktu Piawai Pasifik", "PDT": "Waktu Siang Pasifik", "WIB": "Waktu Indonesia Barat", "WART": "Waktu Piawai Argentina Barat", "EST": "Waktu Piawai Timur", "WEZ": "Waktu Piawai Eropah Barat", "COT": "Waktu Piawai Colombia", "MDT": "Waktu Hari Siang Pergunungan", "MYT": "Waktu Malaysia", "CST": "Waktu Piawai Pusat", "HKST": "Waktu Musim Panas Hong Kong", "VET": "Waktu Venezuela", "AKST": "Waktu Piawai Alaska", "GMT": "Waktu Min Greenwich", "ECT": "Waktu Ecuador", "MESZ": "Waktu Musim Panas Eropah Tengah", "BOT": "Waktu Bolivia", "GYT": "Waktu Guyana", "OESZ": "Waktu Musim Panas Eropah Timur", "WIT": "Waktu Indonesia Timur", "AWDT": "Waktu Siang Australia Barat", "WAT": "Waktu Piawai Afrika Barat", "SGT": "Waktu Piawai Singapura", "ChST": "Waktu Piawai Chamorro", "∅∅∅": "Waktu Musim Panas Peru", "WARST": "Waktu Musim Panas Argentina Barat", "ARST": "Waktu Musim Panas Argentina", "WESZ": "Waktu Musim Panas Eropah Barat", "CDT": "Waktu Siang Tengah", "NZDT": "Waktu Siang New Zealand"},
}
}
diff --git a/ms_SG/ms_SG_test.go b/ms_SG/ms_SG_test.go
new file mode 100644
index 00000000..6b771c4b
--- /dev/null
+++ b/ms_SG/ms_SG_test.go
@@ -0,0 +1,1120 @@
+package ms_SG
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ms_SG"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/mt/mt.go b/mt/mt.go
index 9abc68a5..2faad1eb 100644
--- a/mt/mt.go
+++ b/mt/mt.go
@@ -65,7 +65,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"QK", "WK"},
erasNarrow: []string{"", ""},
erasWide: []string{"Qabel Kristu", "Wara Kristu"},
- timezones: map[string]string{"ACST": "ACST", "AWST": "AWST", "MDT": "MDT", "EST": "EST", "HADT": "HADT", "SGT": "SGT", "WAT": "WAT", "OEZ": "OEZ", "EAT": "EAT", "MYT": "MYT", "HKT": "HKT", "AWDT": "AWDT", "VET": "VET", "CLT": "CLT", "ACDT": "ACDT", "UYT": "UYT", "HAST": "HAST", "WAST": "WAST", "HNT": "HNT", "ACWDT": "ACWDT", "AST": "AST", "GMT": "GMT", "CLST": "CLST", "CHAST": "CHAST", "IST": "IST", "WESZ": "WESZ", "GYT": "GYT", "COT": "COT", "ART": "ART", "AKST": "AKST", "CDT": "CDT", "WEZ": "WEZ", "CHADT": "CHADT", "ECT": "ECT", "OESZ": "OESZ", "TMST": "TMST", "PDT": "PDT", "NZDT": "NZDT", "UYST": "UYST", "AEDT": "AEDT", "HKST": "HKST", "GFT": "GFT", "PST": "PST", "NZST": "NZST", "BOT": "BOT", "ACWST": "ACWST", "CAT": "CAT", "WIB": "WIB", "ARST": "ARST", "LHDT": "LHDT", "EDT": "EDT", "∅∅∅": "∅∅∅", "AEST": "AEST", "WARST": "WARST", "WITA": "WITA", "JST": "JST", "AKDT": "AKDT", "CST": "CST", "SAST": "SAST", "WART": "WART", "WIT": "WIT", "TMT": "TMT", "SRT": "SRT", "COST": "COST", "ADT": "ADT", "HAT": "HAT", "JDT": "JDT", "MEZ": "Ħin Ċentrali Ewropew Standard", "MESZ": "Ħin Ċentrali Ewropew tas-Sajf", "ChST": "ChST", "MST": "MST", "BT": "BT", "LHST": "LHST"},
+ timezones: map[string]string{"HADT": "HADT", "SAST": "SAST", "TMT": "TMT", "ACWST": "ACWST", "EST": "EST", "ARST": "ARST", "AST": "AST", "CHAST": "CHAST", "TMST": "TMST", "CAT": "CAT", "WART": "WART", "WARST": "WARST", "NZDT": "NZDT", "BOT": "BOT", "SGT": "SGT", "LHST": "LHST", "ACWDT": "ACWDT", "EDT": "EDT", "ChST": "ChST", "MYT": "MYT", "WIT": "WIT", "ACST": "ACST", "GFT": "GFT", "HKST": "HKST", "MEZ": "Ħin Ċentrali Ewropew Standard", "WIB": "WIB", "OESZ": "OESZ", "MDT": "MDT", "EAT": "EAT", "VET": "VET", "AWDT": "AWDT", "WEZ": "WEZ", "COT": "COT", "WAT": "WAT", "CLT": "CLT", "ART": "ART", "WESZ": "WESZ", "WAST": "WAST", "MST": "MST", "CST": "CST", "∅∅∅": "∅∅∅", "LHDT": "LHDT", "ADT": "ADT", "AEDT": "AEDT", "BT": "BT", "JST": "JST", "JDT": "JDT", "HAT": "HAT", "CLST": "CLST", "UYST": "UYST", "CDT": "CDT", "GYT": "GYT", "CHADT": "CHADT", "UYT": "UYT", "SRT": "SRT", "ACDT": "ACDT", "WITA": "WITA", "PST": "PST", "PDT": "PDT", "HAST": "HAST", "GMT": "GMT", "AKST": "AKST", "NZST": "NZST", "IST": "IST", "AEST": "AEST", "HKT": "HKT", "MESZ": "Ħin Ċentrali Ewropew tas-Sajf", "HNT": "HNT", "COST": "COST", "ECT": "ECT", "OEZ": "OEZ", "AWST": "AWST", "AKDT": "AKDT"},
}
}
diff --git a/mt/mt_test.go b/mt/mt_test.go
new file mode 100644
index 00000000..6be1ca29
--- /dev/null
+++ b/mt/mt_test.go
@@ -0,0 +1,1120 @@
+package mt
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "mt"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/mt_MT/mt_MT.go b/mt_MT/mt_MT.go
index feb01b69..32468bdd 100644
--- a/mt_MT/mt_MT.go
+++ b/mt_MT/mt_MT.go
@@ -65,7 +65,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"QK", "WK"},
erasNarrow: []string{"", ""},
erasWide: []string{"Qabel Kristu", "Wara Kristu"},
- timezones: map[string]string{"WEZ": "WEZ", "ACWDT": "ACWDT", "EDT": "EDT", "HNT": "HNT", "JST": "JST", "PDT": "PDT", "ChST": "ChST", "TMT": "TMT", "WESZ": "WESZ", "COST": "COST", "AST": "AST", "WIT": "WIT", "AWDT": "AWDT", "MEZ": "Ħin Ċentrali Ewropew Standard", "COT": "COT", "UYT": "UYT", "BT": "BT", "EST": "EST", "HAST": "HAST", "WITA": "WITA", "OEZ": "OEZ", "GYT": "GYT", "BOT": "BOT", "ACST": "ACST", "ARST": "ARST", "UYST": "UYST", "WAT": "WAT", "IST": "IST", "ART": "ART", "AKDT": "AKDT", "SGT": "SGT", "WART": "WART", "EAT": "EAT", "AWST": "AWST", "JDT": "JDT", "CDT": "CDT", "ADT": "ADT", "HADT": "HADT", "HKST": "HKST", "WARST": "WARST", "TMST": "TMST", "NZST": "NZST", "AEDT": "AEDT", "CAT": "CAT", "WAST": "WAST", "GFT": "GFT", "NZDT": "NZDT", "AEST": "AEST", "SAST": "SAST", "CHADT": "CHADT", "CLT": "CLT", "CLST": "CLST", "HAT": "HAT", "MDT": "MDT", "LHST": "LHST", "MYT": "MYT", "CHAST": "CHAST", "HKT": "HKT", "GMT": "GMT", "OESZ": "OESZ", "∅∅∅": "∅∅∅", "LHDT": "LHDT", "SRT": "SRT", "ACWST": "ACWST", "ECT": "ECT", "CST": "CST", "VET": "VET", "WIB": "WIB", "ACDT": "ACDT", "MST": "MST", "AKST": "AKST", "PST": "PST", "MESZ": "Ħin Ċentrali Ewropew tas-Sajf"},
+ timezones: map[string]string{"SAST": "SAST", "EDT": "EDT", "WAT": "WAT", "AEDT": "AEDT", "CST": "CST", "SRT": "SRT", "ACWST": "ACWST", "JDT": "JDT", "PDT": "PDT", "WEZ": "WEZ", "HNT": "HNT", "CDT": "CDT", "ACDT": "ACDT", "WITA": "WITA", "WESZ": "WESZ", "AWDT": "AWDT", "IST": "IST", "TMST": "TMST", "BT": "BT", "HAST": "HAST", "WAST": "WAST", "UYST": "UYST", "EAT": "EAT", "CHAST": "CHAST", "VET": "VET", "ACWDT": "ACWDT", "CAT": "CAT", "OEZ": "OEZ", "CLST": "CLST", "MDT": "MDT", "∅∅∅": "∅∅∅", "ARST": "ARST", "HADT": "HADT", "TMT": "TMT", "ChST": "ChST", "HKT": "HKT", "NZST": "NZST", "EST": "EST", "MEZ": "Ħin Ċentrali Ewropew Standard", "WIB": "WIB", "GYT": "GYT", "CLT": "CLT", "AST": "AST", "ADT": "ADT", "WART": "WART", "CHADT": "CHADT", "ART": "ART", "MESZ": "Ħin Ċentrali Ewropew tas-Sajf", "COST": "COST", "OESZ": "OESZ", "LHST": "LHST", "GFT": "GFT", "SGT": "SGT", "LHDT": "LHDT", "ACST": "ACST", "AKST": "AKST", "BOT": "BOT", "UYT": "UYT", "WIT": "WIT", "MYT": "MYT", "HKST": "HKST", "AWST": "AWST", "COT": "COT", "HAT": "HAT", "GMT": "GMT", "JST": "JST", "WARST": "WARST", "ECT": "ECT", "AEST": "AEST", "MST": "MST", "AKDT": "AKDT", "NZDT": "NZDT", "PST": "PST"},
}
}
diff --git a/mt_MT/mt_MT_test.go b/mt_MT/mt_MT_test.go
new file mode 100644
index 00000000..3522f265
--- /dev/null
+++ b/mt_MT/mt_MT_test.go
@@ -0,0 +1,1120 @@
+package mt_MT
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "mt_MT"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/mua/mua.go b/mua/mua.go
index e0b14c08..7bcabd1c 100644
--- a/mua/mua.go
+++ b/mua/mua.go
@@ -65,7 +65,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"KK", "PK"},
erasNarrow: []string{"", ""},
erasWide: []string{"KǝPel Kristu", "Pel Kristu"},
- timezones: map[string]string{"EDT": "EDT", "ACST": "ACST", "CHAST": "CHAST", "EST": "EST", "MEZ": "MEZ", "WEZ": "WEZ", "HNT": "HNT", "AKST": "AKST", "PDT": "PDT", "AEST": "AEST", "ChST": "ChST", "COST": "COST", "WAST": "WAST", "GYT": "GYT", "JDT": "JDT", "WIT": "WIT", "AWST": "AWST", "CDT": "CDT", "MESZ": "MESZ", "AST": "AST", "WARST": "WARST", "TMST": "TMST", "PST": "PST", "UYT": "UYT", "WITA": "WITA", "ACDT": "ACDT", "AEDT": "AEDT", "SGT": "SGT", "SAST": "SAST", "HKST": "HKST", "ARST": "ARST", "∅∅∅": "∅∅∅", "UYST": "UYST", "AWDT": "AWDT", "LHDT": "LHDT", "CST": "CST", "CHADT": "CHADT", "IST": "IST", "ART": "ART", "MYT": "MYT", "SRT": "SRT", "MDT": "MDT", "VET": "VET", "TMT": "TMT", "ACWDT": "ACWDT", "ECT": "ECT", "ADT": "ADT", "HAST": "HAST", "HKT": "HKT", "OEZ": "OEZ", "LHST": "LHST", "NZST": "NZST", "CLST": "CLST", "WART": "WART", "WAT": "WAT", "OESZ": "OESZ", "GMT": "GMT", "JST": "JST", "AKDT": "AKDT", "HADT": "HADT", "BT": "BT", "WIB": "WIB", "WESZ": "WESZ", "ACWST": "ACWST", "HAT": "HAT", "CAT": "CAT", "COT": "COT", "MST": "MST", "CLT": "CLT", "GFT": "GFT", "EAT": "EAT", "NZDT": "NZDT", "BOT": "BOT"},
+ timezones: map[string]string{"MST": "MST", "CHADT": "CHADT", "AKST": "AKST", "COT": "COT", "CLT": "CLT", "HKST": "HKST", "NZDT": "NZDT", "SAST": "SAST", "EDT": "EDT", "PST": "PST", "PDT": "PDT", "HAST": "HAST", "HAT": "HAT", "COST": "COST", "ACST": "ACST", "ACWDT": "ACWDT", "MESZ": "MESZ", "WAT": "WAT", "GMT": "GMT", "CLST": "CLST", "NZST": "NZST", "WART": "WART", "SRT": "SRT", "WEZ": "WEZ", "ECT": "ECT", "WITA": "WITA", "∅∅∅": "∅∅∅", "OESZ": "OESZ", "UYT": "UYT", "AWST": "AWST", "MEZ": "MEZ", "HADT": "HADT", "TMST": "TMST", "SGT": "SGT", "BT": "BT", "LHDT": "LHDT", "AST": "AST", "WESZ": "WESZ", "MYT": "MYT", "CST": "CST", "CDT": "CDT", "ACDT": "ACDT", "CHAST": "CHAST", "VET": "VET", "ADT": "ADT", "ARST": "ARST", "IST": "IST", "HNT": "HNT", "TMT": "TMT", "EAT": "EAT", "LHST": "LHST", "HKT": "HKT", "JDT": "JDT", "EST": "EST", "OEZ": "OEZ", "AEDT": "AEDT", "ChST": "ChST", "MDT": "MDT", "ART": "ART", "WIB": "WIB", "CAT": "CAT", "WIT": "WIT", "WARST": "WARST", "GFT": "GFT", "JST": "JST", "AKDT": "AKDT", "ACWST": "ACWST", "GYT": "GYT", "UYST": "UYST", "AWDT": "AWDT", "BOT": "BOT", "WAST": "WAST", "AEST": "AEST"},
}
}
diff --git a/mua/mua_test.go b/mua/mua_test.go
new file mode 100644
index 00000000..4ada0e0f
--- /dev/null
+++ b/mua/mua_test.go
@@ -0,0 +1,1120 @@
+package mua
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "mua"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/mua_CM/mua_CM.go b/mua_CM/mua_CM.go
index c342cfbf..bc5824f7 100644
--- a/mua_CM/mua_CM.go
+++ b/mua_CM/mua_CM.go
@@ -65,7 +65,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"KK", "PK"},
erasNarrow: []string{"", ""},
erasWide: []string{"KǝPel Kristu", "Pel Kristu"},
- timezones: map[string]string{"AKDT": "AKDT", "EST": "EST", "AST": "AST", "HKST": "HKST", "WITA": "WITA", "HAT": "HAT", "MDT": "MDT", "TMST": "TMST", "AKST": "AKST", "UYT": "UYT", "AEDT": "AEDT", "COST": "COST", "OESZ": "OESZ", "WARST": "WARST", "VET": "VET", "ChST": "ChST", "WART": "WART", "ARST": "ARST", "JST": "JST", "WESZ": "WESZ", "ACWST": "ACWST", "PDT": "PDT", "ACST": "ACST", "NZST": "NZST", "WEZ": "WEZ", "CAT": "CAT", "WIT": "WIT", "CHADT": "CHADT", "ADT": "ADT", "WAST": "WAST", "MESZ": "MESZ", "LHST": "LHST", "LHDT": "LHDT", "CST": "CST", "CDT": "CDT", "CLST": "CLST", "HADT": "HADT", "BT": "BT", "IST": "IST", "GMT": "GMT", "MST": "MST", "ACDT": "ACDT", "EDT": "EDT", "SGT": "SGT", "OEZ": "OEZ", "∅∅∅": "∅∅∅", "AWST": "AWST", "ECT": "ECT", "GFT": "GFT", "BOT": "BOT", "UYST": "UYST", "CHAST": "CHAST", "GYT": "GYT", "SRT": "SRT", "AEST": "AEST", "HAST": "HAST", "TMT": "TMT", "SAST": "SAST", "AWDT": "AWDT", "NZDT": "NZDT", "EAT": "EAT", "JDT": "JDT", "ACWDT": "ACWDT", "WAT": "WAT", "HKT": "HKT", "MYT": "MYT", "HNT": "HNT", "ART": "ART", "PST": "PST", "MEZ": "MEZ", "CLT": "CLT", "COT": "COT", "WIB": "WIB"},
+ timezones: map[string]string{"PDT": "PDT", "MESZ": "MESZ", "HAST": "HAST", "GYT": "GYT", "ART": "ART", "IST": "IST", "HNT": "HNT", "SGT": "SGT", "WARST": "WARST", "SRT": "SRT", "ACWDT": "ACWDT", "WESZ": "WESZ", "GMT": "GMT", "HKT": "HKT", "WAT": "WAT", "OEZ": "OEZ", "ACDT": "ACDT", "COST": "COST", "PST": "PST", "NZST": "NZST", "NZDT": "NZDT", "JDT": "JDT", "HADT": "HADT", "WAST": "WAST", "BT": "BT", "MYT": "MYT", "WART": "WART", "CST": "CST", "VET": "VET", "ADT": "ADT", "WIT": "WIT", "AWDT": "AWDT", "GFT": "GFT", "ACWST": "ACWST", "AKDT": "AKDT", "MEZ": "MEZ", "HAT": "HAT", "TMST": "TMST", "MDT": "MDT", "CLST": "CLST", "ECT": "ECT", "AST": "AST", "ChST": "ChST", "MST": "MST", "ACST": "ACST", "CDT": "CDT", "∅∅∅": "∅∅∅", "UYST": "UYST", "CHADT": "CHADT", "COT": "COT", "JST": "JST", "BOT": "BOT", "SAST": "SAST", "WEZ": "WEZ", "CLT": "CLT", "WITA": "WITA", "EST": "EST", "TMT": "TMT", "CAT": "CAT", "OESZ": "OESZ", "LHDT": "LHDT", "EAT": "EAT", "HKST": "HKST", "ARST": "ARST", "CHAST": "CHAST", "AKST": "AKST", "EDT": "EDT", "WIB": "WIB", "AEST": "AEST", "AEDT": "AEDT", "LHST": "LHST", "UYT": "UYT", "AWST": "AWST"},
}
}
diff --git a/mua_CM/mua_CM_test.go b/mua_CM/mua_CM_test.go
new file mode 100644
index 00000000..60a64fd3
--- /dev/null
+++ b/mua_CM/mua_CM_test.go
@@ -0,0 +1,1120 @@
+package mua_CM
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "mua_CM"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/my/my.go b/my/my.go
index 29543086..01758d1c 100644
--- a/my/my.go
+++ b/my/my.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ဘီစီ", "အေဒီ"},
erasNarrow: []string{"", ""},
erasWide: []string{"ခရစ်တော် မပေါ်မီကာလ", "ခရစ်တော် ပေါ်ထွန်းပြီးကာလ"},
- timezones: map[string]string{"AWDT": "အနောက်ပိုင်း ဩစတြေးလျှား နေ့ပိုင်း အချိန်", "JST": "ဂျပန် စံတော်ချိန်", "SRT": "စူးရီနာမ်အချိန်", "WESZ": "အနောက်ပိုင်း ဥရောပ နွေရာသီ အချိန်", "EDT": "အရှေ့ပိုင်း အမေရိက နေ့ပိုင်း အချိန်", "HADT": "ဟာဝိုင်အီ အာလူးရှန်နေ့ပိုင်းအချိန်", "WAT": "အနောက်ပိုင်း အာဖရိက စံတော်ချိန်", "WIB": "အနောက်ပိုင်း အင်ဒိုနီးရှား အချိန်", "CLT": "ချီလီ စံတော်ချိန်", "GMT": "ဂရင်းနစ် စံတော်ချိန်", "MEZ": "ဥရောပ အလယ်ပိုင်း စံတော်ချိန်", "WARST": "အနောက် အာဂျင်တီးနား နွေရာသီ အချိန်", "NZST": "နယူးဇီလန် စံတော်ချိန်", "AEST": "အရှေ့ပိုင်း ဩစတြေးလျှား စံတော်ချိန်", "MDT": "အမေရိက တောင် နေ့ပိုင်း အချိန်", "GFT": "ပြင်သစ် ဂီယာနာ အချိန်", "ACST": "အလယ်ပိုင်း ဩစတြေးလျှား စံတော်ချိန်", "ACDT": "အလယ်ပိုင်း ဩစတြေးလျှား နေ့ပိုင်း အချိန်", "CLST": "ချီလီ နွေရာသီ အချိန်", "ChST": "ချာမိုရိုအချိန်", "PDT": "ပစိဖိတ် နေ့ပိုင်း အချိန်", "LHDT": "လော့ဒ်ဟောင်နေ့ပိုင်းအချိန်", "GYT": "ဂိုင်ရာနားအချိန်", "NZDT": "နယူးဇီလန် နေ့ပိုင်း အချိန်", "UYST": "ဥရုဂွေး နွေရာသီ အချိန်", "AEDT": "အရှေ့ပိုင်း ဩစတြေးလျှား နေ့ပိုင်း အချိန်", "COT": "ကိုလံဘီယာ စံတော်ချိန်", "COST": "ကိုလံဘီယာ နွေရာသီ အချိန်", "WAST": "အနောက်ပိုင်း အာဖရိက နွေရာသီ အချိန်", "WART": "အနောက် အာဂျင်တီးနား စံတော်ချိန်", "ART": "အာဂျင်တီးနား စံတော်ချိန်", "MST": "အမေရိက တောင် စံတော်ချိန်", "HAT": "နယူးဖောင်လန် နေ့ပိုင်း အချိန်", "AWST": "အနောက်ပိုင်း ဩစတြေးလျှား စံတော်ချိန်", "MYT": "မလေးရှား အချိန်", "CDT": "အလယ်ပိုင်း အမေရိက နွေရာသီ အချိန်", "WEZ": "အနောက်ပိုင်း ဥရောပ စံတော်ချိန်", "CHAST": "ချားသမ်စံတော်ချိန်", "CST": "အလယ်ပိုင်း အမေရိက စံတော်ချိန်", "SGT": "စင်္ကာပူ စံတော်ချိန်", "OESZ": "အရှေ့ဥရောပ နွေရာသီ အချိန်", "ARST": "အာဂျင်တီးနား နွေရာသီ အချိန်", "AKDT": "အလာစကာနေ့ပိုင်းအချိန်", "BOT": "ဘိုလီးဘီးယား အချိန်", "ECT": "အီကွေဒေါ အချိန်", "TMT": "တာခ်မီန့စ်တန်စံတော်ချိန်", "∅∅∅": "အာဇိုးစ်နွေရာသီအချိန်", "CHADT": "ချားသမ်နေ့ပိုင်းအချိန်", "ADT": "အတ္ထလန်တစ် နေ့ပိုင်း အချိန်", "HAST": "ဟာဝိုင်အီ အာလူးရှန်စံတော်ချိန်", "VET": "ဗင်နီဇွဲလား အချိန်", "HKST": "ဟောင်ကောင် နွေရာသီ အချိန်", "OEZ": "အရှေ့ဥရောပ စံတော်ချိန်", "TMST": "တာခ်မီန့စ်တန်နွေရာသီအချိန်", "AKST": "အလာစကာစံတော်ချိန်", "MESZ": "ဥရောပ အလယ်ပိုင်း နွေရာသီ အချိန်", "ACWDT": "အလယ်အနောက်ပိုင်း ဩစတြေးလျှား နေ့ပိုင်း အချိန်", "CAT": "အလယ်ပိုင်း အာဖရိက အချိန်", "EAT": "အရှေ့ပိုင်း အာဖရိက အချိန်", "LHST": "လော့ဒ်ဟောင်စံတော်ချိန်", "JDT": "ဂျပန် နေ့ပိုင်း အချိန်", "ACWST": "အလယ်အနောက်ပိုင်း ဩစတြေးလျှား စံတော်ချိန်", "AST": "အတ္ထလန်တစ် စံတော်ချိန်", "BT": "ဘူတန် အချိန်", "WIT": "အရှေ့ပိုင်း အင်ဒိုနီးရှား အချိန်", "PST": "ပစိဖိတ် စံတော်ချိန်", "UYT": "ဥရုဂွေး စံတော်ချိန်", "EST": "အရှေ့ပိုင်း အမေရိက စံတော်ချိန်", "SAST": "တောင်အာဖရိက အချိန်", "HKT": "ဟောင်ကောင် စံတော်ချိန်", "IST": "အိန္ဒြိယ စံတော်ချိန်", "HNT": "နယူးဖောင်လန် စံတော်ချိန်", "WITA": "အလယ်ပိုင်း အင်ဒိုနီးရှား အချိန်"},
+ timezones: map[string]string{"WAST": "အနောက်ပိုင်း အာဖရိက နွေရာသီ အချိန်", "AEDT": "အရှေ့ပိုင်း ဩစတြေးလျှား နေ့ပိုင်း အချိန်", "BT": "ဘူတန် အချိန်", "GFT": "ပြင်သစ် ဂီယာနာ အချိန်", "AWDT": "အနောက်ပိုင်း ဩစတြေးလျှား နေ့ပိုင်း အချိန်", "SAST": "တောင်အာဖရိက အချိန်", "TMST": "တာခ်မီန့စ်တန်နွေရာသီအချိန်", "MYT": "မလေးရှား အချိန်", "HKT": "ဟောင်ကောင် စံတော်ချိန်", "VET": "ဗင်နီဇွဲလား အချိန်", "WITA": "အလယ်ပိုင်း အင်ဒိုနီးရှား အချိန်", "MESZ": "ဥရောပ အလယ်ပိုင်း နွေရာသီ အချိန်", "UYT": "ဥရုဂွေး စံတော်ချိန်", "MDT": "အမေရိက တောင် နေ့ပိုင်း အချိန်", "GMT": "ဂရင်းနစ် စံတော်ချိန်", "WARST": "အနောက် အာဂျင်တီးနား နွေရာသီ အချိန်", "HKST": "ဟောင်ကောင် နွေရာသီ အချိန်", "AKST": "အလာစကာစံတော်ချိန်", "AWST": "အနောက်ပိုင်း ဩစတြေးလျှား စံတော်ချိန်", "ART": "အာဂျင်တီးနား စံတော်ချိန်", "SGT": "စင်္ကာပူ စံတော်ချိန်", "IST": "အိန္ဒြိယ စံတော်ချိန်", "WIT": "အရှေ့ပိုင်း အင်ဒိုနီးရှား အချိန်", "COT": "ကိုလံဘီယာ စံတော်ချိန်", "CLT": "ချီလီ စံတော်ချိန်", "∅∅∅": "ဘရာဇီး နွေရာသီ အချိန်", "ACST": "အလယ်ပိုင်း ဩစတြေးလျှား စံတော်ချိန်", "ADT": "အတ္ထလန်တစ် နေ့ပိုင်း အချိန်", "ACWST": "အလယ်အနောက်ပိုင်း ဩစတြေးလျှား စံတော်ချိန်", "EDT": "အရှေ့ပိုင်း အမေရိက နေ့ပိုင်း အချိန်", "WESZ": "အနောက်ပိုင်း ဥရောပ နွေရာသီ အချိန်", "AKDT": "အလာစကာနေ့ပိုင်းအချိန်", "HAST": "ဟာဝိုင်အီ အာလူးရှန်စံတော်ချိန်", "CST": "အလယ်ပိုင်း အမေရိက စံတော်ချိန်", "CAT": "အလယ်ပိုင်း အာဖရိက အချိန်", "ACDT": "အလယ်ပိုင်း ဩစတြေးလျှား နေ့ပိုင်း အချိန်", "SRT": "စူးရီနာမ်အချိန်", "ECT": "အီကွေဒေါ အချိန်", "TMT": "တာခ်မီန့စ်တန်စံတော်ချိန်", "UYST": "ဥရုဂွေး နွေရာသီ အချိန်", "COST": "ကိုလံဘီယာ နွေရာသီ အချိန်", "CLST": "ချီလီ နွေရာသီ အချိန်", "JDT": "ဂျပန် နေ့ပိုင်း အချိန်", "PDT": "ပစိဖိတ် နေ့ပိုင်း အချိန်", "HAT": "နယူးဖောင်လန် နေ့ပိုင်း အချိန်", "ARST": "အာဂျင်တီးနား နွေရာသီ အချိန်", "ACWDT": "အလယ်အနောက်ပိုင်း ဩစတြေးလျှား နေ့ပိုင်း အချိန်", "MST": "အမေရိက တောင် စံတော်ချိန်", "BOT": "ဘိုလီးဘီးယား အချိန်", "ChST": "ချာမိုရိုအချိန်", "WEZ": "အနောက်ပိုင်း ဥရောပ စံတော်ချိန်", "OEZ": "အရှေ့ဥရောပ စံတော်ချိန်", "OESZ": "အရှေ့ဥရောပ နွေရာသီ အချိန်", "AEST": "အရှေ့ပိုင်း ဩစတြေးလျှား စံတော်ချိန်", "GYT": "ဂိုင်ရာနားအချိန်", "EAT": "အရှေ့ပိုင်း အာဖရိက အချိန်", "LHST": "လော့ဒ်ဟောင်စံတော်ချိန်", "WAT": "အနောက်ပိုင်း အာဖရိက စံတော်ချိန်", "MEZ": "ဥရောပ အလယ်ပိုင်း စံတော်ချိန်", "JST": "ဂျပန် စံတော်ချိန်", "WIB": "အနောက်ပိုင်း အင်ဒိုနီးရှား အချိန်", "CDT": "အလယ်ပိုင်း အမေရိက နွေရာသီ အချိန်", "CHAST": "ချားသမ်စံတော်ချိန်", "HNT": "နယူးဖောင်လန် စံတော်ချိန်", "WART": "အနောက် အာဂျင်တီးနား စံတော်ချိန်", "CHADT": "ချားသမ်နေ့ပိုင်းအချိန်", "AST": "အတ္ထလန်တစ် စံတော်ချိန်", "EST": "အရှေ့ပိုင်း အမေရိက စံတော်ချိန်", "PST": "ပစိဖိတ် စံတော်ချိန်", "HADT": "ဟာဝိုင်အီ အာလူးရှန်နေ့ပိုင်းအချိန်", "NZST": "နယူးဇီလန် စံတော်ချိန်", "LHDT": "လော့ဒ်ဟောင်နေ့ပိုင်းအချိန်", "NZDT": "နယူးဇီလန် နေ့ပိုင်း အချိန်"},
}
}
diff --git a/my/my_test.go b/my/my_test.go
new file mode 100644
index 00000000..84e17969
--- /dev/null
+++ b/my/my_test.go
@@ -0,0 +1,1120 @@
+package my
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "my"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/my_MM/my_MM.go b/my_MM/my_MM.go
index 696ca1e9..f145acfa 100644
--- a/my_MM/my_MM.go
+++ b/my_MM/my_MM.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ဘီစီ", "အေဒီ"},
erasNarrow: []string{"", ""},
erasWide: []string{"ခရစ်တော် မပေါ်မီကာလ", "ခရစ်တော် ပေါ်ထွန်းပြီးကာလ"},
- timezones: map[string]string{"UYT": "ဥရုဂွေး စံတော်ချိန်", "WARST": "အနောက် အာဂျင်တီးနား နွေရာသီ အချိန်", "AEST": "အရှေ့ပိုင်း ဩစတြေးလျှား စံတော်ချိန်", "BT": "ဘူတန် အချိန်", "ARST": "အာဂျင်တီးနား နွေရာသီ အချိန်", "AKST": "အလာစကာစံတော်ချိန်", "AKDT": "အလာစကာနေ့ပိုင်းအချိန်", "CHADT": "ချားသမ်နေ့ပိုင်းအချိန်", "ACWST": "အလယ်အနောက်ပိုင်း ဩစတြေးလျှား စံတော်ချိန်", "WART": "အနောက် အာဂျင်တီးနား စံတော်ချိန်", "SAST": "တောင်အာဖရိက အချိန်", "LHST": "လော့ဒ်ဟောင်စံတော်ချိန်", "TMT": "တာခ်မီန့စ်တန်စံတော်ချိန်", "EDT": "အရှေ့ပိုင်း အမေရိက နေ့ပိုင်း အချိန်", "SGT": "စင်္ကာပူ စံတော်ချိန်", "HNT": "နယူးဖောင်လန် စံတော်ချိန်", "OESZ": "အရှေ့ဥရောပ နွေရာသီ အချိန်", "LHDT": "လော့ဒ်ဟောင်နေ့ပိုင်းအချိန်", "PST": "ပစိဖိတ် စံတော်ချိန်", "MST": "အမေရိက တောင် စံတော်ချိန်", "EST": "အရှေ့ပိုင်း အမေရိက စံတော်ချိန်", "ACDT": "အလယ်ပိုင်း ဩစတြေးလျှား နေ့ပိုင်း အချိန်", "AWDT": "အနောက်ပိုင်း ဩစတြေးလျှား နေ့ပိုင်း အချိန်", "BOT": "ဘိုလီးဘီးယား အချိန်", "MESZ": "ဥရောပ အလယ်ပိုင်း နွေရာသီ အချိန်", "CLST": "ချီလီ နွေရာသီ အချိန်", "ACWDT": "အလယ်အနောက်ပိုင်း ဩစတြေးလျှား နေ့ပိုင်း အချိန်", "ADT": "အတ္ထလန်တစ် နေ့ပိုင်း အချိန်", "GFT": "ပြင်သစ် ဂီယာနာ အချိန်", "IST": "အိန္ဒြိယ စံတော်ချိန်", "MYT": "မလေးရှား အချိန်", "PDT": "ပစိဖိတ် နေ့ပိုင်း အချိန်", "MDT": "အမေရိက တောင် နေ့ပိုင်း အချိန်", "NZDT": "နယူးဇီလန် နေ့ပိုင်း အချိန်", "CLT": "ချီလီ စံတော်ချိန်", "AEDT": "အရှေ့ပိုင်း ဩစတြေးလျှား နေ့ပိုင်း အချိန်", "AWST": "အနောက်ပိုင်း ဩစတြေးလျှား စံတော်ချိန်", "TMST": "တာခ်မီန့စ်တန်နွေရာသီအချိန်", "WIB": "အနောက်ပိုင်း အင်ဒိုနီးရှား အချိန်", "ART": "အာဂျင်တီးနား စံတော်ချိန်", "CDT": "အလယ်ပိုင်း အမေရိက နွေရာသီ အချိန်", "MEZ": "ဥရောပ အလယ်ပိုင်း စံတော်ချိန်", "WEZ": "အနောက်ပိုင်း ဥရောပ စံတော်ချိန်", "GMT": "ဂရင်းနစ် စံတော်ချိန်", "ACST": "အလယ်ပိုင်း ဩစတြေးလျှား စံတော်ချိန်", "WESZ": "အနောက်ပိုင်း ဥရောပ နွေရာသီ အချိန်", "HADT": "ဟာဝိုင်အီ အာလူးရှန်နေ့ပိုင်းအချိန်", "HKST": "ဟောင်ကောင် နွေရာသီ အချိန်", "CAT": "အလယ်ပိုင်း အာဖရိက အချိန်", "HAST": "ဟာဝိုင်အီ အာလူးရှန်စံတော်ချိန်", "HAT": "နယူးဖောင်လန် နေ့ပိုင်း အချိန်", "JDT": "ဂျပန် နေ့ပိုင်း အချိန်", "ChST": "ချာမိုရိုအချိန်", "VET": "ဗင်နီဇွဲလား အချိန်", "OEZ": "အရှေ့ဥရောပ စံတော်ချိန်", "∅∅∅": "အာဇိုးစ်နွေရာသီအချိန်", "AST": "အတ္ထလန်တစ် စံတော်ချိန်", "WAT": "အနောက်ပိုင်း အာဖရိက စံတော်ချိန်", "ECT": "အီကွေဒေါ အချိန်", "COST": "ကိုလံဘီယာ နွေရာသီ အချိန်", "HKT": "ဟောင်ကောင် စံတော်ချိန်", "WAST": "အနောက်ပိုင်း အာဖရိက နွေရာသီ အချိန်", "WITA": "အလယ်ပိုင်း အင်ဒိုနီးရှား အချိန်", "GYT": "ဂိုင်ရာနားအချိန်", "JST": "ဂျပန် စံတော်ချိန်", "CST": "အလယ်ပိုင်း အမေရိက စံတော်ချိန်", "EAT": "အရှေ့ပိုင်း အာဖရိက အချိန်", "SRT": "စူးရီနာမ်အချိန်", "UYST": "ဥရုဂွေး နွေရာသီ အချိန်", "NZST": "နယူးဇီလန် စံတော်ချိန်", "CHAST": "ချားသမ်စံတော်ချိန်", "COT": "ကိုလံဘီယာ စံတော်ချိန်", "WIT": "အရှေ့ပိုင်း အင်ဒိုနီးရှား အချိန်"},
+ timezones: map[string]string{"NZST": "နယူးဇီလန် စံတော်ချိန်", "ChST": "ချာမိုရိုအချိန်", "SRT": "စူးရီနာမ်အချိန်", "CHAST": "ချားသမ်စံတော်ချိန်", "ART": "အာဂျင်တီးနား စံတော်ချိန်", "WITA": "အလယ်ပိုင်း အင်ဒိုနီးရှား အချိန်", "CAT": "အလယ်ပိုင်း အာဖရိက အချိန်", "CLST": "ချီလီ နွေရာသီ အချိန်", "EAT": "အရှေ့ပိုင်း အာဖရိက အချိန်", "AWST": "အနောက်ပိုင်း ဩစတြေးလျှား စံတော်ချိန်", "HNT": "နယူးဖောင်လန် စံတော်ချိန်", "CLT": "ချီလီ စံတော်ချိန်", "UYT": "ဥရုဂွေး စံတော်ချိန်", "GFT": "ပြင်သစ် ဂီယာနာ အချိန်", "JST": "ဂျပန် စံတော်ချိန်", "COT": "ကိုလံဘီယာ စံတော်ချိန်", "CHADT": "ချားသမ်နေ့ပိုင်းအချိန်", "ARST": "အာဂျင်တီးနား နွေရာသီ အချိန်", "SAST": "တောင်အာဖရိက အချိန်", "WAT": "အနောက်ပိုင်း အာဖရိက စံတော်ချိန်", "WESZ": "အနောက်ပိုင်း ဥရောပ နွေရာသီ အချိန်", "ACST": "အလယ်ပိုင်း ဩစတြေးလျှား စံတော်ချိန်", "VET": "ဗင်နီဇွဲလား အချိန်", "JDT": "ဂျပန် နေ့ပိုင်း အချိန်", "PST": "ပစိဖိတ် စံတော်ချိန်", "WEZ": "အနောက်ပိုင်း ဥရောပ စံတော်ချိန်", "OEZ": "အရှေ့ဥရောပ စံတော်ချိန်", "BT": "ဘူတန် အချိန်", "EDT": "အရှေ့ပိုင်း အမေရိက နေ့ပိုင်း အချိန်", "MESZ": "ဥရောပ အလယ်ပိုင်း နွေရာသီ အချိန်", "LHDT": "လော့ဒ်ဟောင်နေ့ပိုင်းအချိန်", "CST": "အလယ်ပိုင်း အမေရိက စံတော်ချိန်", "COST": "ကိုလံဘီယာ နွေရာသီ အချိန်", "WIB": "အနောက်ပိုင်း အင်ဒိုနီးရှား အချိန်", "MDT": "အမေရိက တောင် နေ့ပိုင်း အချိန်", "MEZ": "ဥရောပ အလယ်ပိုင်း စံတော်ချိန်", "HAT": "နယူးဖောင်လန် နေ့ပိုင်း အချိန်", "SGT": "စင်္ကာပူ စံတော်ချိန်", "GMT": "ဂရင်းနစ် စံတော်ချိန်", "MST": "အမေရိက တောင် စံတော်ချိန်", "ACDT": "အလယ်ပိုင်း ဩစတြေးလျှား နေ့ပိုင်း အချိန်", "ECT": "အီကွေဒေါ အချိန်", "EST": "အရှေ့ပိုင်း အမေရိက စံတော်ချိန်", "NZDT": "နယူးဇီလန် နေ့ပိုင်း အချိန်", "GYT": "ဂိုင်ရာနားအချိန်", "LHST": "လော့ဒ်ဟောင်စံတော်ချိန်", "WIT": "အရှေ့ပိုင်း အင်ဒိုနီးရှား အချိန်", "ACWDT": "အလယ်အနောက်ပိုင်း ဩစတြေးလျှား နေ့ပိုင်း အချိန်", "∅∅∅": "အမေဇွန်နွေရာသီအချိန်", "OESZ": "အရှေ့ဥရောပ နွေရာသီ အချိန်", "AWDT": "အနောက်ပိုင်း ဩစတြေးလျှား နေ့ပိုင်း အချိန်", "IST": "အိန္ဒြိယ စံတော်ချိန်", "PDT": "ပစိဖိတ် နေ့ပိုင်း အချိန်", "TMST": "တာခ်မီန့စ်တန်နွေရာသီအချိန်", "AEST": "အရှေ့ပိုင်း ဩစတြေးလျှား စံတော်ချိန်", "HKST": "ဟောင်ကောင် နွေရာသီ အချိန်", "ACWST": "အလယ်အနောက်ပိုင်း ဩစတြေးလျှား စံတော်ချိန်", "HKT": "ဟောင်ကောင် စံတော်ချိန်", "AKDT": "အလာစကာနေ့ပိုင်းအချိန်", "WAST": "အနောက်ပိုင်း အာဖရိက နွေရာသီ အချိန်", "AEDT": "အရှေ့ပိုင်း ဩစတြေးလျှား နေ့ပိုင်း အချိန်", "UYST": "ဥရုဂွေး နွေရာသီ အချိန်", "WARST": "အနောက် အာဂျင်တီးနား နွေရာသီ အချိန်", "ADT": "အတ္ထလန်တစ် နေ့ပိုင်း အချိန်", "HAST": "ဟာဝိုင်အီ အာလူးရှန်စံတော်ချိန်", "MYT": "မလေးရှား အချိန်", "AST": "အတ္ထလန်တစ် စံတော်ချိန်", "AKST": "အလာစကာစံတော်ချိန်", "HADT": "ဟာဝိုင်အီ အာလူးရှန်နေ့ပိုင်းအချိန်", "BOT": "ဘိုလီးဘီးယား အချိန်", "TMT": "တာခ်မီန့စ်တန်စံတော်ချိန်", "WART": "အနောက် အာဂျင်တီးနား စံတော်ချိန်", "CDT": "အလယ်ပိုင်း အမေရိက နွေရာသီ အချိန်"},
}
}
diff --git a/my_MM/my_MM_test.go b/my_MM/my_MM_test.go
new file mode 100644
index 00000000..ce77a4b6
--- /dev/null
+++ b/my_MM/my_MM_test.go
@@ -0,0 +1,1120 @@
+package my_MM
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "my_MM"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/mzn/mzn.go b/mzn/mzn.go
index 54731db3..cf81df3c 100644
--- a/mzn/mzn.go
+++ b/mzn/mzn.go
@@ -53,7 +53,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"پ.م", "م."},
erasNarrow: []string{"", ""},
erasWide: []string{"قبل میلاد", "بعد میلاد"},
- timezones: map[string]string{"AWST": "AWST", "JDT": "JDT", "UYST": "UYST", "BT": "BT", "HKST": "HKST", "WARST": "WARST", "TMST": "TMST", "AWDT": "AWDT", "CST": "CST", "MEZ": "MEZ", "AEDT": "AEDT", "HADT": "HADT", "AKST": "AKST", "MYT": "MYT", "WAST": "WAST", "NZST": "NZST", "SGT": "SGT", "MDT": "MDT", "LHST": "LHST", "WESZ": "WESZ", "CHAST": "CHAST", "CLT": "CLT", "AST": "AST", "ADT": "ADT", "EAT": "EAT", "ACST": "ACST", "LHDT": "LHDT", "VET": "VET", "EST": "EST", "HAT": "HAT", "WIT": "WIT", "∅∅∅": "∅∅∅", "SRT": "SRT", "PDT": "PDT", "GYT": "GYT", "MESZ": "MESZ", "HAST": "HAST", "GFT": "GFT", "MST": "MST", "ACDT": "ACDT", "CDT": "CDT", "WEZ": "WEZ", "CHADT": "CHADT", "COST": "COST", "OESZ": "OESZ", "WITA": "WITA", "BOT": "BOT", "AKDT": "AKDT", "ACWST": "ACWST", "ChST": "ChST", "CLST": "CLST", "CAT": "CAT", "HNT": "HNT", "UYT": "UYT", "AEST": "AEST", "EDT": "EDT", "WIB": "WIB", "OEZ": "OEZ", "JST": "JST", "WART": "WART", "ARST": "ARST", "NZDT": "NZDT", "SAST": "SAST", "TMT": "TMT", "PST": "PST", "WAT": "WAT", "IST": "IST", "GMT": "GMT", "ART": "ART", "ACWDT": "ACWDT", "COT": "COT", "ECT": "ECT", "HKT": "HKT"},
+ timezones: map[string]string{"UYT": "UYT", "MYT": "MYT", "JDT": "JDT", "ACWDT": "ACWDT", "COT": "COT", "WITA": "WITA", "ACWST": "ACWST", "PDT": "PDT", "MESZ": "MESZ", "CAT": "CAT", "GFT": "GFT", "HKT": "HKT", "HKST": "HKST", "ACDT": "ACDT", "GYT": "GYT", "LHDT": "LHDT", "ACST": "ACST", "WESZ": "WESZ", "GMT": "GMT", "ADT": "ADT", "HAST": "HAST", "EDT": "EDT", "CST": "CST", "WART": "WART", "BOT": "BOT", "COST": "COST", "AEST": "AEST", "SGT": "SGT", "CHADT": "CHADT", "EST": "EST", "HAT": "HAT", "OESZ": "OESZ", "CLST": "CLST", "VET": "VET", "WIB": "WIB", "OEZ": "OEZ", "UYST": "UYST", "SRT": "SRT", "∅∅∅": "∅∅∅", "ECT": "ECT", "AEDT": "AEDT", "SAST": "SAST", "TMST": "TMST", "WAT": "WAT", "MDT": "MDT", "AKDT": "AKDT", "AWST": "AWST", "LHST": "LHST", "WARST": "WARST", "AWDT": "AWDT", "IST": "IST", "BT": "BT", "HNT": "HNT", "CHAST": "CHAST", "ARST": "ARST", "TMT": "TMT", "WEZ": "WEZ", "MST": "MST", "JST": "JST", "AST": "AST", "AKST": "AKST", "PST": "PST", "MEZ": "MEZ", "EAT": "EAT", "ART": "ART", "ChST": "ChST", "CLT": "CLT", "WAST": "WAST", "WIT": "WIT", "CDT": "CDT", "HADT": "HADT", "NZST": "NZST", "NZDT": "NZDT"},
}
}
@@ -109,7 +109,7 @@ func (mzn *mzn) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (mzn *mzn) MonthsNarrow() []string {
- return mzn.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/mzn/mzn_test.go b/mzn/mzn_test.go
new file mode 100644
index 00000000..82ec119e
--- /dev/null
+++ b/mzn/mzn_test.go
@@ -0,0 +1,1120 @@
+package mzn
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "mzn"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/mzn_IR/mzn_IR.go b/mzn_IR/mzn_IR.go
index b3b1dbf0..3b7b8228 100644
--- a/mzn_IR/mzn_IR.go
+++ b/mzn_IR/mzn_IR.go
@@ -53,7 +53,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"پ.م", "م."},
erasNarrow: []string{"", ""},
erasWide: []string{"قبل میلاد", "بعد میلاد"},
- timezones: map[string]string{"VET": "VET", "EDT": "EDT", "ECT": "ECT", "WAT": "WAT", "WARST": "WARST", "EAT": "EAT", "ART": "ART", "JDT": "JDT", "GYT": "GYT", "WESZ": "WESZ", "HKT": "HKT", "GFT": "GFT", "ACST": "ACST", "ACDT": "ACDT", "LHST": "LHST", "LHDT": "LHDT", "CDT": "CDT", "CLT": "CLT", "ACWST": "ACWST", "WEZ": "WEZ", "ACWDT": "ACWDT", "WIB": "WIB", "ChST": "ChST", "CHADT": "CHADT", "TMT": "TMT", "TMST": "TMST", "MST": "MST", "SRT": "SRT", "∅∅∅": "∅∅∅", "CST": "CST", "MEZ": "MEZ", "HAST": "HAST", "WITA": "WITA", "MYT": "MYT", "BOT": "BOT", "COST": "COST", "BT": "BT", "CLST": "CLST", "AEDT": "AEDT", "COT": "COT", "HKST": "HKST", "AWDT": "AWDT", "UYST": "UYST", "AEST": "AEST", "CHAST": "CHAST", "WART": "WART", "WIT": "WIT", "IST": "IST", "OESZ": "OESZ", "HNT": "HNT", "SGT": "SGT", "GMT": "GMT", "AKDT": "AKDT", "AWST": "AWST", "UYT": "UYT", "AST": "AST", "ADT": "ADT", "HADT": "HADT", "HAT": "HAT", "MESZ": "MESZ", "CAT": "CAT", "JST": "JST", "AKST": "AKST", "PDT": "PDT", "NZST": "NZST", "EST": "EST", "ARST": "ARST", "PST": "PST", "NZDT": "NZDT", "MDT": "MDT", "SAST": "SAST", "WAST": "WAST", "OEZ": "OEZ"},
+ timezones: map[string]string{"WESZ": "WESZ", "MYT": "MYT", "CLT": "CLT", "UYST": "UYST", "MST": "MST", "AWDT": "AWDT", "ART": "ART", "WITA": "WITA", "JST": "JST", "MESZ": "MESZ", "WIB": "WIB", "OEZ": "OEZ", "ACDT": "ACDT", "GFT": "GFT", "CHADT": "CHADT", "CAT": "CAT", "CHAST": "CHAST", "JDT": "JDT", "AEST": "AEST", "UYT": "UYT", "ACST": "ACST", "HKT": "HKT", "EDT": "EDT", "VET": "VET", "HKST": "HKST", "AKST": "AKST", "BOT": "BOT", "PDT": "PDT", "HNT": "HNT", "GYT": "GYT", "BT": "BT", "NZST": "NZST", "TMT": "TMT", "PST": "PST", "TMST": "TMST", "WEZ": "WEZ", "WIT": "WIT", "MEZ": "MEZ", "EST": "EST", "ACWST": "ACWST", "AWST": "AWST", "NZDT": "NZDT", "COST": "COST", "WAT": "WAT", "WAST": "WAST", "WARST": "WARST", "AST": "AST", "HAT": "HAT", "GMT": "GMT", "OESZ": "OESZ", "ChST": "ChST", "CLST": "CLST", "EAT": "EAT", "WART": "WART", "COT": "COT", "LHST": "LHST", "LHDT": "LHDT", "∅∅∅": "∅∅∅", "SGT": "SGT", "SAST": "SAST", "ADT": "ADT", "HAST": "HAST", "AKDT": "AKDT", "ACWDT": "ACWDT", "CST": "CST", "CDT": "CDT", "ARST": "ARST", "AEDT": "AEDT", "SRT": "SRT", "MDT": "MDT", "IST": "IST", "ECT": "ECT", "HADT": "HADT"},
}
}
@@ -109,7 +109,7 @@ func (mzn *mzn_IR) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (mzn *mzn_IR) MonthsNarrow() []string {
- return mzn.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/mzn_IR/mzn_IR_test.go b/mzn_IR/mzn_IR_test.go
new file mode 100644
index 00000000..52f264bc
--- /dev/null
+++ b/mzn_IR/mzn_IR_test.go
@@ -0,0 +1,1120 @@
+package mzn_IR
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "mzn_IR"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/naq/naq.go b/naq/naq.go
index 6278c400..807eeb24 100644
--- a/naq/naq.go
+++ b/naq/naq.go
@@ -59,7 +59,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"", ""},
erasWide: []string{"Xristub aiǃâ", "Xristub khaoǃgâ"},
- timezones: map[string]string{"MESZ": "MESZ", "AEDT": "AEDT", "WAT": "WAT", "BT": "BT", "WART": "WART", "WITA": "WITA", "PDT": "PDT", "WARST": "WARST", "EAT": "EAT", "ACDT": "ACDT", "HADT": "HADT", "AKDT": "AKDT", "CST": "CST", "CLT": "CLT", "AEST": "AEST", "CHADT": "CHADT", "COT": "COT", "AST": "AST", "WAST": "WAST", "HAT": "HAT", "WEZ": "WEZ", "COST": "COST", "AWST": "AWST", "NZDT": "NZDT", "SGT": "SGT", "SAST": "SAST", "TMT": "TMT", "ARST": "ARST", "MYT": "MYT", "ACWST": "ACWST", "HKT": "HKT", "ACST": "ACST", "ART": "ART", "NZST": "NZST", "UYST": "UYST", "MDT": "MDT", "JST": "JST", "ECT": "ECT", "WIB": "WIB", "UYT": "UYT", "CLST": "CLST", "ACWDT": "ACWDT", "ChST": "ChST", "MST": "MST", "PST": "PST", "LHDT": "LHDT", "HAST": "HAST", "∅∅∅": "∅∅∅", "HKST": "HKST", "IST": "IST", "OESZ": "OESZ", "GMT": "GMT", "TMST": "TMST", "JDT": "JDT", "ADT": "ADT", "HNT": "HNT", "MEZ": "MEZ", "CHAST": "CHAST", "BOT": "BOT", "WIT": "WIT", "GFT": "GFT", "SRT": "SRT", "GYT": "GYT", "EDT": "EDT", "CAT": "CAT", "OEZ": "OEZ", "LHST": "LHST", "CDT": "CDT", "VET": "VET", "WESZ": "WESZ", "AKST": "AKST", "AWDT": "AWDT", "EST": "EST"},
+ timezones: map[string]string{"CAT": "CAT", "WESZ": "WESZ", "VET": "VET", "AST": "AST", "AEDT": "AEDT", "WART": "WART", "HKT": "HKT", "HAST": "HAST", "SAST": "SAST", "NZST": "NZST", "UYST": "UYST", "CST": "CST", "ART": "ART", "WITA": "WITA", "PDT": "PDT", "CLST": "CLST", "EAT": "EAT", "AKST": "AKST", "AEST": "AEST", "ACDT": "ACDT", "NZDT": "NZDT", "SRT": "SRT", "CHAST": "CHAST", "CHADT": "CHADT", "JDT": "JDT", "IST": "IST", "HAT": "HAT", "EDT": "EDT", "GYT": "GYT", "CLT": "CLT", "GFT": "GFT", "AWST": "AWST", "ARST": "ARST", "BOT": "BOT", "HNT": "HNT", "GMT": "GMT", "∅∅∅": "∅∅∅", "CDT": "CDT", "MEZ": "MEZ", "HKST": "HKST", "PST": "PST", "TMST": "TMST", "MST": "MST", "MDT": "MDT", "LHDT": "LHDT", "ECT": "ECT", "HADT": "HADT", "COST": "COST", "ChST": "ChST", "AWDT": "AWDT", "AKDT": "AKDT", "ADT": "ADT", "EST": "EST", "WAST": "WAST", "OEZ": "OEZ", "WIT": "WIT", "BT": "BT", "WARST": "WARST", "WIB": "WIB", "OESZ": "OESZ", "LHST": "LHST", "ACWST": "ACWST", "ACWDT": "ACWDT", "COT": "COT", "WEZ": "WEZ", "UYT": "UYT", "MESZ": "MESZ", "SGT": "SGT", "TMT": "TMT", "MYT": "MYT", "JST": "JST", "WAT": "WAT", "ACST": "ACST"},
}
}
diff --git a/naq/naq_test.go b/naq/naq_test.go
new file mode 100644
index 00000000..c533a2fb
--- /dev/null
+++ b/naq/naq_test.go
@@ -0,0 +1,1120 @@
+package naq
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "naq"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/naq_NA/naq_NA.go b/naq_NA/naq_NA.go
index d02cc42d..d5641aae 100644
--- a/naq_NA/naq_NA.go
+++ b/naq_NA/naq_NA.go
@@ -59,7 +59,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"", ""},
erasWide: []string{"Xristub aiǃâ", "Xristub khaoǃgâ"},
- timezones: map[string]string{"SRT": "SRT", "LHDT": "LHDT", "∅∅∅": "∅∅∅", "ECT": "ECT", "HAST": "HAST", "HKT": "HKT", "HKST": "HKST", "MESZ": "MESZ", "NZDT": "NZDT", "CAT": "CAT", "ACST": "ACST", "LHST": "LHST", "IST": "IST", "WITA": "WITA", "TMST": "TMST", "EAT": "EAT", "PDT": "PDT", "MEZ": "MEZ", "NZST": "NZST", "WIB": "WIB", "OEZ": "OEZ", "HAT": "HAT", "WIT": "WIT", "ART": "ART", "PST": "PST", "ACWDT": "ACWDT", "ADT": "ADT", "WAST": "WAST", "GYT": "GYT", "MYT": "MYT", "BOT": "BOT", "MDT": "MDT", "EDT": "EDT", "UYT": "UYT", "AEDT": "AEDT", "ChST": "ChST", "SAST": "SAST", "JDT": "JDT", "UYST": "UYST", "WEZ": "WEZ", "AEST": "AEST", "EST": "EST", "VET": "VET", "ACWST": "ACWST", "COST": "COST", "BT": "BT", "ARST": "ARST", "AKDT": "AKDT", "TMT": "TMT", "AWST": "AWST", "AWDT": "AWDT", "CHADT": "CHADT", "CLST": "CLST", "SGT": "SGT", "HNT": "HNT", "AKST": "AKST", "MST": "MST", "CLT": "CLT", "WART": "WART", "JST": "JST", "WESZ": "WESZ", "HADT": "HADT", "GMT": "GMT", "ACDT": "ACDT", "CST": "CST", "AST": "AST", "WARST": "WARST", "GFT": "GFT", "CDT": "CDT", "COT": "COT", "WAT": "WAT", "OESZ": "OESZ", "CHAST": "CHAST"},
+ timezones: map[string]string{"GYT": "GYT", "LHST": "LHST", "WARST": "WARST", "ARST": "ARST", "WESZ": "WESZ", "MESZ": "MESZ", "COT": "COT", "WIB": "WIB", "CDT": "CDT", "CHADT": "CHADT", "SAST": "SAST", "SGT": "SGT", "LHDT": "LHDT", "NZDT": "NZDT", "CAT": "CAT", "WAST": "WAST", "AKDT": "AKDT", "IST": "IST", "EST": "EST", "ChST": "ChST", "MYT": "MYT", "CLST": "CLST", "UYST": "UYST", "ACST": "ACST", "ECT": "ECT", "ART": "ART", "AWST": "AWST", "EAT": "EAT", "ACWDT": "ACWDT", "MEZ": "MEZ", "PST": "PST", "AKST": "AKST", "OEZ": "OEZ", "BT": "BT", "∅∅∅": "∅∅∅", "WITA": "WITA", "JST": "JST", "HAT": "HAT", "MST": "MST", "VET": "VET", "PDT": "PDT", "WEZ": "WEZ", "TMST": "TMST", "HNT": "HNT", "AEDT": "AEDT", "UYT": "UYT", "MDT": "MDT", "AWDT": "AWDT", "EDT": "EDT", "JDT": "JDT", "ACWST": "ACWST", "WAT": "WAT", "GMT": "GMT", "HAST": "HAST", "ACDT": "ACDT", "HKT": "HKT", "HKST": "HKST", "GFT": "GFT", "HADT": "HADT", "BOT": "BOT", "COST": "COST", "CLT": "CLT", "WIT": "WIT", "CST": "CST", "SRT": "SRT", "OESZ": "OESZ", "TMT": "TMT", "AEST": "AEST", "WART": "WART", "AST": "AST", "ADT": "ADT", "NZST": "NZST", "CHAST": "CHAST"},
}
}
diff --git a/naq_NA/naq_NA_test.go b/naq_NA/naq_NA_test.go
new file mode 100644
index 00000000..75e63752
--- /dev/null
+++ b/naq_NA/naq_NA_test.go
@@ -0,0 +1,1120 @@
+package naq_NA
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "naq_NA"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/nb/nb.go b/nb/nb.go
index 94260b19..ea0ed67f 100644
--- a/nb/nb.go
+++ b/nb/nb.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"f.Kr.", "e.Kr."},
erasNarrow: []string{"f.Kr.", "e.Kr."},
erasWide: []string{"før Kristus", "etter Kristus"},
- timezones: map[string]string{"CHADT": "sommertid for Chatham", "∅∅∅": "sommertid for Brasilia", "ARST": "argentinsk sommertid", "WITA": "sentralindonesisk tid", "CDT": "sommertid for det sentrale Nord-Amerika", "MESZ": "sentraleuropeisk sommertid", "MDT": "sommertid for Rocky Mountains (USA)", "EDT": "sommertid for den nordamerikanske østkysten", "COT": "colombiansk normaltid", "BOT": "boliviansk tid", "WARST": "vestargentinsk sommertid", "OESZ": "østeuropeisk sommertid", "SRT": "surinamsk tid", "UYST": "uruguayansk sommertid", "MST": "normaltid for Rocky Mountains (USA)", "VET": "venezuelansk tid", "CAT": "sentralafrikansk tid", "HKT": "normaltid for Hongkong", "IST": "indisk tid", "GMT": "Greenwich middeltid", "GYT": "guyansk tid", "UYT": "uruguayansk normaltid", "ACWDT": "vest-sentralaustralsk sommertid", "COST": "colombiansk sommertid", "SGT": "singaporsk tid", "WIB": "vestindonesisk tid", "PST": "normaltid for den nordamerikanske Stillehavskysten", "AEST": "østaustralsk normaltid", "GFT": "tidssone for Fransk Guyana", "ChST": "tidssone for Chamorro", "HAT": "sommertid for Newfoundland", "AST": "atlanterhavskystlig standardtid", "OEZ": "østeuropeisk normaltid", "ACDT": "sentralaustralsk sommertid", "AKST": "alaskisk normaltid", "JDT": "japansk sommertid", "MEZ": "sentraleuropeisk normaltid", "BT": "bhutansk tid", "TMST": "turkmensk sommertid", "EAT": "østafrikansk tid", "LHST": "normaltid for Lord Howe-øya", "PDT": "sommertid for den nordamerikanske Stillehavskysten", "NZDT": "newzealandsk sommertid", "CHAST": "normaltid for Chatham", "WART": "vestargentinsk normaltid", "SAST": "sørafrikansk tid", "MYT": "malaysisk tid", "WAST": "vestafrikansk sommertid", "WIT": "østindonesisk tid", "AWST": "vestaustralsk normaltid", "AWDT": "vestaustralsk sommertid", "JST": "japansk normaltid", "NZST": "newzealandsk normaltid", "ECT": "ecuadoriansk tid", "ADT": "atlanterhavskystlig sommertid", "HADT": "sommertid for Hawaii og Aleutene", "TMT": "turkmensk normaltid", "WEZ": "vesteuropeisk normaltid", "EST": "normaltid for den nordamerikanske østkysten", "HAST": "normaltid for Hawaii og Aleutene", "CST": "normaltid for det sentrale Nord-Amerika", "CLT": "chilensk normaltid", "HKST": "sommertid for Hongkong", "LHDT": "sommertid for Lord Howe-øya", "ACWST": "vest-sentralaustralsk normaltid", "WAT": "vestafrikansk normaltid", "HNT": "normaltid for Newfoundland", "AKDT": "alaskisk sommertid", "CLST": "chilensk sommertid", "WESZ": "vesteuropeisk sommertid", "AEDT": "østaustralsk sommertid", "ART": "argentinsk normaltid", "ACST": "sentralaustralsk normaltid"},
+ timezones: map[string]string{"UYT": "uruguayansk normaltid", "ACDT": "sentralaustralsk sommertid", "∅∅∅": "sommertid for Amazonas", "WEZ": "vesteuropeisk normaltid", "ChST": "tidssone for Chamorro", "GYT": "guyansk tid", "EAT": "østafrikansk tid", "MYT": "malaysisk tid", "PST": "normaltid for den nordamerikanske Stillehavskysten", "UYST": "uruguayansk sommertid", "SRT": "surinamsk tid", "ACWST": "vest-sentralaustralsk normaltid", "WITA": "sentralindonesisk tid", "AEST": "østaustralsk normaltid", "MDT": "sommertid for Rocky Mountains (USA)", "HAST": "normaltid for Hawaii og Aleutene", "WAT": "vestafrikansk normaltid", "WESZ": "vesteuropeisk sommertid", "HAT": "sommertid for Newfoundland", "WIB": "vestindonesisk tid", "GMT": "Greenwich middeltid", "ACST": "sentralaustralsk normaltid", "ECT": "ecuadoriansk tid", "AKDT": "alaskisk sommertid", "PDT": "sommertid for den nordamerikanske Stillehavskysten", "MEZ": "sentraleuropeisk normaltid", "LHST": "normaltid for Lord Howe-øya", "MST": "normaltid for Rocky Mountains (USA)", "WIT": "østindonesisk tid", "SAST": "sørafrikansk tid", "NZST": "newzealandsk normaltid", "HNT": "normaltid for Newfoundland", "BT": "bhutansk tid", "AKST": "alaskisk normaltid", "JDT": "japansk sommertid", "OEZ": "østeuropeisk normaltid", "VET": "venezuelansk tid", "AST": "atlanterhavskystlig standardtid", "ARST": "argentinsk sommertid", "JST": "japansk normaltid", "HADT": "sommertid for Hawaii og Aleutene", "CLT": "chilensk normaltid", "CST": "normaltid for det sentrale Nord-Amerika", "WARST": "vestargentinsk sommertid", "HKT": "normaltid for Hongkong", "ACWDT": "vest-sentralaustralsk sommertid", "WAST": "vestafrikansk sommertid", "BOT": "boliviansk tid", "GFT": "tidssone for Fransk Guyana", "CHADT": "sommertid for Chatham", "AWDT": "vestaustralsk sommertid", "COST": "colombiansk sommertid", "TMST": "turkmensk sommertid", "OESZ": "østeuropeisk sommertid", "CLST": "chilensk sommertid", "AWST": "vestaustralsk normaltid", "TMT": "turkmensk normaltid", "ADT": "atlanterhavskystlig sommertid", "EST": "normaltid for den nordamerikanske østkysten", "MESZ": "sentraleuropeisk sommertid", "NZDT": "newzealandsk sommertid", "WART": "vestargentinsk normaltid", "HKST": "sommertid for Hongkong", "CHAST": "normaltid for Chatham", "EDT": "sommertid for den nordamerikanske østkysten", "SGT": "singaporsk tid", "COT": "colombiansk normaltid", "AEDT": "østaustralsk sommertid", "CDT": "sommertid for det sentrale Nord-Amerika", "ART": "argentinsk normaltid", "IST": "indisk tid", "CAT": "sentralafrikansk tid", "LHDT": "sommertid for Lord Howe-øya"},
}
}
diff --git a/nb/nb_test.go b/nb/nb_test.go
new file mode 100644
index 00000000..24fb15ba
--- /dev/null
+++ b/nb/nb_test.go
@@ -0,0 +1,1120 @@
+package nb
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "nb"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/nb_NO/nb_NO.go b/nb_NO/nb_NO.go
index 54c15d3f..4e84484b 100644
--- a/nb_NO/nb_NO.go
+++ b/nb_NO/nb_NO.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"f.Kr.", "e.Kr."},
erasNarrow: []string{"f.Kr.", "e.Kr."},
erasWide: []string{"før Kristus", "etter Kristus"},
- timezones: map[string]string{"ART": "argentinsk normaltid", "PDT": "sommertid for den nordamerikanske Stillehavskysten", "AWDT": "vestaustralsk sommertid", "UYT": "uruguayansk normaltid", "WAT": "vestafrikansk normaltid", "OEZ": "østeuropeisk normaltid", "WIB": "vestindonesisk tid", "GYT": "guyansk tid", "AEDT": "østaustralsk sommertid", "ECT": "ecuadoriansk tid", "HADT": "sommertid for Hawaii og Aleutene", "SGT": "singaporsk tid", "SAST": "sørafrikansk tid", "WIT": "østindonesisk tid", "JDT": "japansk sommertid", "UYST": "uruguayansk sommertid", "WITA": "sentralindonesisk tid", "MYT": "malaysisk tid", "NZDT": "newzealandsk sommertid", "AEST": "østaustralsk normaltid", "VET": "venezuelansk tid", "EST": "normaltid for den nordamerikanske østkysten", "HKST": "sommertid for Hongkong", "MST": "Macau, standardtid", "BOT": "boliviansk tid", "CHADT": "sommertid for Chatham", "EDT": "sommertid for den nordamerikanske østkysten", "WAST": "vestafrikansk sommertid", "ARST": "argentinsk sommertid", "WESZ": "vesteuropeisk sommertid", "ACWST": "vest-sentralaustralsk normaltid", "HAST": "normaltid for Hawaii og Aleutene", "TMT": "turkmensk normaltid", "ADT": "atlanterhavskystlig sommertid", "HKT": "normaltid for Hongkong", "WART": "vestargentinsk normaltid", "TMST": "turkmensk sommertid", "CST": "normaltid for det sentrale Nord-Amerika", "HNT": "normaltid for Newfoundland", "EAT": "østafrikansk tid", "MEZ": "sentraleuropeisk normaltid", "AST": "atlanterhavskystlig standardtid", "ACDT": "sentralaustralsk sommertid", "JST": "japansk normaltid", "SRT": "surinamsk tid", "WARST": "vestargentinsk sommertid", "IST": "indisk tid", "CDT": "sommertid for det sentrale Nord-Amerika", "ACWDT": "vest-sentralaustralsk sommertid", "CHAST": "normaltid for Chatham", "CAT": "sentralafrikansk tid", "GFT": "tidssone for Fransk Guyana", "MDT": "Macau, sommertid", "MESZ": "sentraleuropeisk sommertid", "ChST": "tidssone for Chamorro", "GMT": "Greenwich middeltid", "HAT": "sommertid for Newfoundland", "AWST": "vestaustralsk normaltid", "CLT": "chilensk normaltid", "COT": "colombiansk normaltid", "∅∅∅": "sommertid for Brasilia", "BT": "bhutansk tid", "OESZ": "østeuropeisk sommertid", "ACST": "sentralaustralsk normaltid", "WEZ": "vesteuropeisk normaltid", "CLST": "chilensk sommertid", "LHST": "normaltid for Lord Howe-øya", "NZST": "newzealandsk normaltid", "COST": "colombiansk sommertid", "AKST": "alaskisk normaltid", "AKDT": "alaskisk sommertid", "PST": "normaltid for den nordamerikanske Stillehavskysten", "LHDT": "sommertid for Lord Howe-øya"},
+ timezones: map[string]string{"HKT": "normaltid for Hongkong", "ACWDT": "vest-sentralaustralsk sommertid", "IST": "indisk tid", "EST": "normaltid for den nordamerikanske østkysten", "ECT": "ecuadoriansk tid", "EDT": "sommertid for den nordamerikanske østkysten", "CLST": "chilensk sommertid", "AST": "atlanterhavskystlig standardtid", "AWDT": "vestaustralsk sommertid", "MESZ": "sentraleuropeisk sommertid", "WAST": "vestafrikansk sommertid", "COST": "colombiansk sommertid", "OESZ": "østeuropeisk sommertid", "BT": "bhutansk tid", "PDT": "sommertid for den nordamerikanske Stillehavskysten", "WIB": "vestindonesisk tid", "OEZ": "østeuropeisk normaltid", "GYT": "guyansk tid", "EAT": "østafrikansk tid", "CST": "normaltid for det sentrale Nord-Amerika", "GFT": "tidssone for Fransk Guyana", "VET": "venezuelansk tid", "BOT": "boliviansk tid", "HAT": "sommertid for Newfoundland", "SGT": "singaporsk tid", "AEST": "østaustralsk normaltid", "LHDT": "sommertid for Lord Howe-øya", "JDT": "japansk sommertid", "AEDT": "østaustralsk sommertid", "LHST": "normaltid for Lord Howe-øya", "MYT": "malaysisk tid", "CHAST": "normaltid for Chatham", "AKDT": "alaskisk sommertid", "ARST": "argentinsk sommertid", "HADT": "sommertid for Hawaii og Aleutene", "WESZ": "vesteuropeisk sommertid", "WART": "vestargentinsk normaltid", "AKST": "alaskisk normaltid", "ADT": "atlanterhavskystlig sommertid", "ART": "argentinsk normaltid", "COT": "colombiansk normaltid", "ChST": "tidssone for Chamorro", "WARST": "vestargentinsk sommertid", "AWST": "vestaustralsk normaltid", "JST": "japansk normaltid", "HAST": "normaltid for Hawaii og Aleutene", "CHADT": "sommertid for Chatham", "PST": "normaltid for den nordamerikanske Stillehavskysten", "TMT": "turkmensk normaltid", "TMST": "turkmensk sommertid", "WAT": "vestafrikansk normaltid", "HNT": "normaltid for Newfoundland", "MDT": "Macau, sommertid", "HKST": "sommertid for Hongkong", "∅∅∅": "sommertid for Amazonas", "WIT": "østindonesisk tid", "CLT": "chilensk normaltid", "UYT": "uruguayansk normaltid", "MST": "Macau, standardtid", "WITA": "sentralindonesisk tid", "SAST": "sørafrikansk tid", "ACST": "sentralaustralsk normaltid", "MEZ": "sentraleuropeisk normaltid", "NZST": "newzealandsk normaltid", "NZDT": "newzealandsk sommertid", "CAT": "sentralafrikansk tid", "CDT": "sommertid for det sentrale Nord-Amerika", "SRT": "surinamsk tid", "ACWST": "vest-sentralaustralsk normaltid", "UYST": "uruguayansk sommertid", "ACDT": "sentralaustralsk sommertid", "WEZ": "vesteuropeisk normaltid", "GMT": "Greenwich middeltid"},
}
}
diff --git a/nb_NO/nb_NO_test.go b/nb_NO/nb_NO_test.go
new file mode 100644
index 00000000..e122ee19
--- /dev/null
+++ b/nb_NO/nb_NO_test.go
@@ -0,0 +1,1120 @@
+package nb_NO
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "nb_NO"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/nb_SJ/nb_SJ.go b/nb_SJ/nb_SJ.go
index 17def24e..ae154740 100644
--- a/nb_SJ/nb_SJ.go
+++ b/nb_SJ/nb_SJ.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"f.Kr.", "e.Kr."},
erasNarrow: []string{"f.Kr.", "e.Kr."},
erasWide: []string{"før Kristus", "etter Kristus"},
- timezones: map[string]string{"PDT": "sommertid for den nordamerikanske Stillehavskysten", "CHAST": "normaltid for Chatham", "EDT": "sommertid for den nordamerikanske østkysten", "COST": "colombiansk sommertid", "HADT": "sommertid for Hawaii og Aleutene", "WARST": "vestargentinsk sommertid", "LHDT": "sommertid for Lord Howe-øya", "CLST": "chilensk sommertid", "EST": "normaltid for den nordamerikanske østkysten", "ACDT": "sentralaustralsk sommertid", "ART": "argentinsk normaltid", "PST": "normaltid for den nordamerikanske Stillehavskysten", "ECT": "ecuadoriansk tid", "ACST": "sentralaustralsk normaltid", "JDT": "japansk sommertid", "ADT": "atlanterhavskystlig sommertid", "AKDT": "alaskisk sommertid", "GYT": "guyansk tid", "JST": "japansk normaltid", "AEST": "østaustralsk normaltid", "NZST": "newzealandsk normaltid", "AST": "atlanterhavskystlig standardtid", "WAST": "vestafrikansk sommertid", "IST": "indisk tid", "HAT": "sommertid for Newfoundland", "MST": "Macau, standardtid", "TMST": "turkmensk sommertid", "SRT": "surinamsk tid", "COT": "colombiansk normaltid", "∅∅∅": "Acre sommertid", "GFT": "tidssone for Fransk Guyana", "WITA": "sentralindonesisk tid", "CST": "normaltid for det sentrale Nord-Amerika", "WAT": "vestafrikansk normaltid", "GMT": "Greenwich middeltid", "WIT": "østindonesisk tid", "AKST": "alaskisk normaltid", "CDT": "sommertid for det sentrale Nord-Amerika", "VET": "venezuelansk tid", "CHADT": "sommertid for Chatham", "HKT": "normaltid for Hongkong", "OESZ": "østeuropeisk sommertid", "HNT": "normaltid for Newfoundland", "TMT": "turkmensk normaltid", "AWDT": "vestaustralsk sommertid", "MYT": "malaysisk tid", "OEZ": "østeuropeisk normaltid", "AWST": "vestaustralsk normaltid", "ACWDT": "vest-sentralaustralsk sommertid", "HKST": "sommertid for Hongkong", "UYT": "uruguayansk normaltid", "UYST": "uruguayansk sommertid", "ACWST": "vest-sentralaustralsk normaltid", "HAST": "normaltid for Hawaii og Aleutene", "SAST": "sørafrikansk tid", "MESZ": "sentraleuropeisk sommertid", "WESZ": "vesteuropeisk sommertid", "CAT": "sentralafrikansk tid", "WART": "vestargentinsk normaltid", "WIB": "vestindonesisk tid", "ARST": "argentinsk sommertid", "NZDT": "newzealandsk sommertid", "ChST": "tidssone for Chamorro", "CLT": "chilensk normaltid", "SGT": "singaporsk tid", "WEZ": "vesteuropeisk normaltid", "AEDT": "østaustralsk sommertid", "BT": "bhutansk tid", "EAT": "østafrikansk tid", "MDT": "Macau, sommertid", "LHST": "normaltid for Lord Howe-øya", "MEZ": "sentraleuropeisk normaltid", "BOT": "boliviansk tid"},
+ timezones: map[string]string{"ACWST": "vest-sentralaustralsk normaltid", "AWST": "vestaustralsk normaltid", "ART": "argentinsk normaltid", "EST": "normaltid for den nordamerikanske østkysten", "HAT": "sommertid for Newfoundland", "EAT": "østafrikansk tid", "MYT": "malaysisk tid", "WITA": "sentralindonesisk tid", "∅∅∅": "sommertid for Amazonas", "WIB": "vestindonesisk tid", "OESZ": "østeuropeisk sommertid", "AEST": "østaustralsk normaltid", "GYT": "guyansk tid", "SRT": "surinamsk tid", "AKDT": "alaskisk sommertid", "CAT": "sentralafrikansk tid", "COT": "colombiansk normaltid", "GMT": "Greenwich middeltid", "BT": "bhutansk tid", "ACST": "sentralaustralsk normaltid", "NZST": "newzealandsk normaltid", "WAST": "vestafrikansk sommertid", "CLST": "chilensk sommertid", "CST": "normaltid for det sentrale Nord-Amerika", "HKST": "sommertid for Hongkong", "WIT": "østindonesisk tid", "MST": "Macau, standardtid", "HKT": "normaltid for Hongkong", "JDT": "japansk sommertid", "PST": "normaltid for den nordamerikanske Stillehavskysten", "HAST": "normaltid for Hawaii og Aleutene", "WEZ": "vesteuropeisk normaltid", "OEZ": "østeuropeisk normaltid", "VET": "venezuelansk tid", "AST": "atlanterhavskystlig standardtid", "IST": "indisk tid", "LHDT": "sommertid for Lord Howe-øya", "WART": "vestargentinsk normaltid", "WARST": "vestargentinsk sommertid", "MDT": "Macau, sommertid", "MEZ": "sentraleuropeisk normaltid", "TMST": "turkmensk sommertid", "AKST": "alaskisk normaltid", "PDT": "sommertid for den nordamerikanske Stillehavskysten", "ACWDT": "vest-sentralaustralsk sommertid", "ChST": "tidssone for Chamorro", "MESZ": "sentraleuropeisk sommertid", "WESZ": "vesteuropeisk sommertid", "COST": "colombiansk sommertid", "CLT": "chilensk normaltid", "GFT": "tidssone for Fransk Guyana", "CHAST": "normaltid for Chatham", "AWDT": "vestaustralsk sommertid", "HADT": "sommertid for Hawaii og Aleutene", "NZDT": "newzealandsk sommertid", "LHST": "normaltid for Lord Howe-øya", "ADT": "atlanterhavskystlig sommertid", "JST": "japansk normaltid", "WAT": "vestafrikansk normaltid", "SGT": "singaporsk tid", "ARST": "argentinsk sommertid", "TMT": "turkmensk normaltid", "UYST": "uruguayansk sommertid", "ACDT": "sentralaustralsk sommertid", "ECT": "ecuadoriansk tid", "SAST": "sørafrikansk tid", "HNT": "normaltid for Newfoundland", "AEDT": "østaustralsk sommertid", "UYT": "uruguayansk normaltid", "CHADT": "sommertid for Chatham", "BOT": "boliviansk tid", "EDT": "sommertid for den nordamerikanske østkysten", "CDT": "sommertid for det sentrale Nord-Amerika"},
}
}
diff --git a/nb_SJ/nb_SJ_test.go b/nb_SJ/nb_SJ_test.go
new file mode 100644
index 00000000..ed39f21d
--- /dev/null
+++ b/nb_SJ/nb_SJ_test.go
@@ -0,0 +1,1120 @@
+package nb_SJ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "nb_SJ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/nd/nd.go b/nd/nd.go
index 63c34f47..75c393f5 100644
--- a/nd/nd.go
+++ b/nd/nd.go
@@ -61,7 +61,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"", ""},
erasWide: []string{"UKristo angakabuyi", "Ukristo ebuyile"},
- timezones: map[string]string{"ChST": "ChST", "MST": "MST", "EDT": "EDT", "HKST": "HKST", "LHDT": "LHDT", "WAST": "WAST", "EAT": "EAT", "TMT": "TMT", "CHAST": "CHAST", "ART": "ART", "MYT": "MYT", "WESZ": "WESZ", "ACWDT": "ACWDT", "WIT": "WIT", "ACST": "ACST", "PDT": "PDT", "SAST": "SAST", "WART": "WART", "WARST": "WARST", "ARST": "ARST", "JST": "JST", "NZDT": "NZDT", "UYST": "UYST", "PST": "PST", "LHST": "LHST", "∅∅∅": "∅∅∅", "WAT": "WAT", "HAT": "HAT", "CHADT": "CHADT", "SGT": "SGT", "GFT": "GFT", "TMST": "TMST", "AKDT": "AKDT", "CLT": "CLT", "COT": "COT", "HAST": "HAST", "HADT": "HADT", "GMT": "GMT", "AWDT": "AWDT", "ADT": "ADT", "OESZ": "OESZ", "WITA": "WITA", "AKST": "AKST", "VET": "VET", "ACWST": "ACWST", "CAT": "CAT", "ECT": "ECT", "OEZ": "OEZ", "CST": "CST", "CDT": "CDT", "WEZ": "WEZ", "AEST": "AEST", "AST": "AST", "AEDT": "AEDT", "EST": "EST", "COST": "COST", "HKT": "HKT", "ACDT": "ACDT", "NZST": "NZST", "MESZ": "MESZ", "CLST": "CLST", "BT": "BT", "WIB": "WIB", "SRT": "SRT", "AWST": "AWST", "JDT": "JDT", "MEZ": "MEZ", "MDT": "MDT", "IST": "IST", "HNT": "HNT", "GYT": "GYT", "BOT": "BOT", "UYT": "UYT"},
+ timezones: map[string]string{"CDT": "CDT", "CHAST": "CHAST", "WIB": "WIB", "ACDT": "ACDT", "JDT": "JDT", "TMT": "TMT", "ChST": "ChST", "ADT": "ADT", "PST": "PST", "WAT": "WAT", "GYT": "GYT", "LHST": "LHST", "ECT": "ECT", "AST": "AST", "AWST": "AWST", "WESZ": "WESZ", "COST": "COST", "MDT": "MDT", "ACST": "ACST", "HKST": "HKST", "WIT": "WIT", "WARST": "WARST", "PDT": "PDT", "HADT": "HADT", "CAT": "CAT", "LHDT": "LHDT", "UYT": "UYT", "WITA": "WITA", "WAST": "WAST", "WEZ": "WEZ", "MYT": "MYT", "HNT": "HNT", "TMST": "TMST", "CLT": "CLT", "AWDT": "AWDT", "NZST": "NZST", "OEZ": "OEZ", "MST": "MST", "ACWST": "ACWST", "ARST": "ARST", "IST": "IST", "EDT": "EDT", "AEDT": "AEDT", "WART": "WART", "EST": "EST", "AEST": "AEST", "SRT": "SRT", "GFT": "GFT", "HKT": "HKT", "ART": "ART", "NZDT": "NZDT", "OESZ": "OESZ", "∅∅∅": "∅∅∅", "AKST": "AKST", "HAST": "HAST", "SGT": "SGT", "GMT": "GMT", "UYST": "UYST", "ACWDT": "ACWDT", "BOT": "BOT", "SAST": "SAST", "HAT": "HAT", "BT": "BT", "CLST": "CLST", "EAT": "EAT", "CST": "CST", "VET": "VET", "AKDT": "AKDT", "COT": "COT", "CHADT": "CHADT", "JST": "JST", "MEZ": "MEZ", "MESZ": "MESZ"},
}
}
diff --git a/nd/nd_test.go b/nd/nd_test.go
new file mode 100644
index 00000000..cf23cb3f
--- /dev/null
+++ b/nd/nd_test.go
@@ -0,0 +1,1120 @@
+package nd
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "nd"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/nd_ZW/nd_ZW.go b/nd_ZW/nd_ZW.go
index 77bd4cdb..e049b4a7 100644
--- a/nd_ZW/nd_ZW.go
+++ b/nd_ZW/nd_ZW.go
@@ -61,7 +61,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"", ""},
erasWide: []string{"UKristo angakabuyi", "Ukristo ebuyile"},
- timezones: map[string]string{"AWST": "AWST", "LHST": "LHST", "GYT": "GYT", "VET": "VET", "AEST": "AEST", "AEDT": "AEDT", "CST": "CST", "UYT": "UYT", "WESZ": "WESZ", "ACWST": "ACWST", "ECT": "ECT", "SAST": "SAST", "WAT": "WAT", "HKST": "HKST", "AKST": "AKST", "NZDT": "NZDT", "EDT": "EDT", "ART": "ART", "JDT": "JDT", "MEZ": "MEZ", "MESZ": "MESZ", "NZST": "NZST", "HAST": "HAST", "HAT": "HAT", "GFT": "GFT", "PST": "PST", "HKT": "HKT", "WARST": "WARST", "OEZ": "OEZ", "ACWDT": "ACWDT", "COT": "COT", "HADT": "HADT", "GMT": "GMT", "ACDT": "ACDT", "LHDT": "LHDT", "CDT": "CDT", "ChST": "ChST", "SGT": "SGT", "WIT": "WIT", "EAT": "EAT", "ARST": "ARST", "∅∅∅": "∅∅∅", "PDT": "PDT", "CHADT": "CHADT", "CAT": "CAT", "EST": "EST", "WIB": "WIB", "JST": "JST", "MST": "MST", "COST": "COST", "SRT": "SRT", "CLT": "CLT", "WEZ": "WEZ", "AWDT": "AWDT", "MYT": "MYT", "AST": "AST", "BT": "BT", "AKDT": "AKDT", "WART": "WART", "IST": "IST", "OESZ": "OESZ", "MDT": "MDT", "ACST": "ACST", "TMT": "TMT", "CHAST": "CHAST", "WAST": "WAST", "HNT": "HNT", "WITA": "WITA", "TMST": "TMST", "BOT": "BOT", "UYST": "UYST", "CLST": "CLST", "ADT": "ADT"},
+ timezones: map[string]string{"BT": "BT", "ADT": "ADT", "ARST": "ARST", "WITA": "WITA", "JDT": "JDT", "HAT": "HAT", "COST": "COST", "WIB": "WIB", "HKST": "HKST", "CHADT": "CHADT", "EAT": "EAT", "LHDT": "LHDT", "WART": "WART", "UYST": "UYST", "AKDT": "AKDT", "MESZ": "MESZ", "HAST": "HAST", "AWDT": "AWDT", "EDT": "EDT", "COT": "COT", "ChST": "ChST", "HKT": "HKT", "VET": "VET", "SAST": "SAST", "PDT": "PDT", "TMT": "TMT", "TMST": "TMST", "ACDT": "ACDT", "AWST": "AWST", "PST": "PST", "HADT": "HADT", "MYT": "MYT", "CLST": "CLST", "ACWDT": "ACWDT", "OESZ": "OESZ", "CLT": "CLT", "MST": "MST", "CHAST": "CHAST", "EST": "EST", "SGT": "SGT", "OEZ": "OEZ", "GYT": "GYT", "NZST": "NZST", "WARST": "WARST", "GFT": "GFT", "∅∅∅": "∅∅∅", "AST": "AST", "ACST": "ACST", "JST": "JST", "CST": "CST", "AKST": "AKST", "WEZ": "WEZ", "WESZ": "WESZ", "SRT": "SRT", "MDT": "MDT", "ECT": "ECT", "ACWST": "ACWST", "IST": "IST", "NZDT": "NZDT", "HNT": "HNT", "UYT": "UYT", "CAT": "CAT", "WAT": "WAT", "WAST": "WAST", "AEDT": "AEDT", "CDT": "CDT", "ART": "ART", "BOT": "BOT", "MEZ": "MEZ", "GMT": "GMT", "AEST": "AEST", "WIT": "WIT", "LHST": "LHST"},
}
}
diff --git a/nd_ZW/nd_ZW_test.go b/nd_ZW/nd_ZW_test.go
new file mode 100644
index 00000000..48960641
--- /dev/null
+++ b/nd_ZW/nd_ZW_test.go
@@ -0,0 +1,1120 @@
+package nd_ZW
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "nd_ZW"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ne/ne.go b/ne/ne.go
index 0c9b61a1..ba4da691 100644
--- a/ne/ne.go
+++ b/ne/ne.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ईसा पूर्व", "सन्"},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"SGT": "सिंगापुर मानक समय", "WAT": "पश्चिम अफ्रिकी मानक समय", "HKT": "हङकङ मानक समय", "SRT": "सुरिनामा समय", "NZDT": "न्यूजिल्यान्ड दिवा समय", "UYST": "उरुग्वे ग्रीष्मकालीन समय", "COST": "कोलम्बियाली ग्रीष्मकालीन समय", "JST": "जापान मानक समय", "JDT": "जापान दिवा समय", "MESZ": "केन्द्रीय युरोपेली ग्रीष्मकालीन समय", "EDT": "पूर्वी दिवा समय", "TMT": "तुर्कमेनिस्तान मानक समय", "MEZ": "केन्द्रीय युरोपेली मानक समय", "CHAST": "चाथाम मानक समय", "HADT": "हवाई-एलुटियन दिवा समय", "AST": "एट्लान्टिक मानक समय", "BT": "भुटानी समय", "SAST": "दक्षिण अफ्रिकी समय", "MYT": "मलेसिया समय", "AKDT": "अलस्का दिवा समय", "AEDT": "पूर्वी अस्ट्रेलिया दिवा समय", "HAST": "हवाई-एलुटियन मानक समय", "MST": "MST", "CHADT": "चाथाम दिवा समय", "∅∅∅": "ब्राजिलीया ग्रीष्मकालीन समय", "ARST": "अर्जेनटिनी ग्रीष्मकालीन समय", "TMST": "तुर्कमेनिस्तान ग्रीष्मकालीन मानक समय", "CST": "केन्द्रीय मानक समय", "ACWDT": "केन्द्रीय पश्चिमी अस्ट्रेलिया दिवा समय", "CLT": "चिली मानक समय", "ADT": "एट्लान्टिक दिवा समय", "WIB": "पश्चिमी इन्डोनेशिया समय", "ACST": "केन्द्रीय अस्ट्रेलिया मानक समय", "ART": "अर्जेनटिनी मानक समय", "LHST": "लर्ड हावे मानक समय", "AKST": "अलास्का मानक समय", "CDT": "केन्द्रीय दिवा समय", "EST": "पूर्वी मानक समय", "WART": "पश्चिमी अर्जेनटिनी मानक समय", "WARST": "पश्चिमी अर्जेनटिनी ग्रीष्मकालीन समय", "WESZ": "युरोपेली ग्रीष्मकालीन समय", "ECT": "ईक्वोडोर समय", "HKST": "हङकङ ग्रीष्मकालीन समय", "HAT": "न्यूफाउन्ल्याण्ड दिवा समय", "IST": "भारतीय मानक समय", "ACDT": "केन्द्रीय अस्ट्रेलिया दिवा समय", "AWST": "पश्चिमी अस्ट्रेलिया मानक समय", "AWDT": "पश्चिमी अस्ट्रेलिया दिवा समय", "OEZ": "पूर्वी युरोपेली मानक समय", "OESZ": "पूर्वी युरोपेली ग्रीष्मकालीन समय", "MDT": "MDT", "LHDT": "लर्ड हावे दिवा समय", "AEST": "पूर्वी अस्ट्रेलिया मानक समय", "WEZ": "पश्चिमी युरोपेली मानक समय", "GMT": "ग्रीनविच मिन समय", "GFT": "फ्रेन्च ग्वाना समय", "PST": "प्यासिफिक मानक समय", "UYT": "उरूग्वे मानक समय", "ChST": "चामोर्रो मानक समय", "HNT": "न्यूफाउन्डल्याण्ड मानक समय", "ACWST": "केन्द्रीय पश्चिमी अस्ट्रेलिया मानक समय", "WAST": "पश्चिम अफ्रिकी ग्रीष्मकालीन समय", "WITA": "केन्द्रीय इन्डोनेशिया समय", "WIT": "पूर्वी इन्डोनेशिया समय", "EAT": "पूर्वी अफ्रिकी समय", "BOT": "बोलिभिया समय", "CLST": "चिली ग्रीष्मकालीन समय", "CAT": "केन्द्रीय अफ्रिकी समय", "PDT": "प्यासिफिक दिवा समय", "GYT": "गुयाना समय", "NZST": "न्यूजिल्यान्ड मानक समय", "COT": "कोलम्बियाली मानक समय", "VET": "भेनेज्युएला समय"},
+ timezones: map[string]string{"HKT": "हङकङ मानक समय", "JDT": "जापान दिवा समय", "AKST": "अलास्का मानक समय", "AST": "एट्लान्टिक मानक समय", "OESZ": "पूर्वी युरोपेली ग्रीष्मकालीन समय", "ChST": "चामोर्रो मानक समय", "UYT": "उरूग्वे मानक समय", "AKDT": "अलस्का दिवा समय", "ART": "अर्जेनटिनी मानक समय", "MEZ": "केन्द्रीय युरोपेली मानक समय", "MESZ": "केन्द्रीय युरोपेली ग्रीष्मकालीन समय", "AEST": "पूर्वी अस्ट्रेलिया मानक समय", "AEDT": "पूर्वी अस्ट्रेलिया दिवा समय", "∅∅∅": "एजोरेस् ग्रीष्मकालीन समय", "HAST": "हवाई-एलुटियन मानक समय", "TMT": "तुर्कमेनिस्तान मानक समय", "OEZ": "पूर्वी युरोपेली मानक समय", "ACST": "केन्द्रीय अस्ट्रेलिया मानक समय", "MST": "MST", "AWDT": "पश्चिमी अस्ट्रेलिया दिवा समय", "SAST": "दक्षिण अफ्रिकी समय", "PST": "प्यासिफिक मानक समय", "HADT": "हवाई-एलुटियन दिवा समय", "CST": "केन्द्रीय मानक समय", "MDT": "MDT", "ACWDT": "केन्द्रीय पश्चिमी अस्ट्रेलिया दिवा समय", "HNT": "न्यूफाउन्डल्याण्ड मानक समय", "JST": "जापान मानक समय", "ARST": "अर्जेनटिनी ग्रीष्मकालीन समय", "IST": "भारतीय मानक समय", "CAT": "केन्द्रीय अफ्रिकी समय", "COT": "कोलम्बियाली मानक समय", "HKST": "हङकङ ग्रीष्मकालीन समय", "SGT": "सिंगापुर मानक समय", "WIT": "पूर्वी इन्डोनेशिया समय", "EAT": "पूर्वी अफ्रिकी समय", "BT": "भुटानी समय", "CHADT": "चाथाम दिवा समय", "WITA": "केन्द्रीय इन्डोनेशिया समय", "NZST": "न्यूजिल्यान्ड मानक समय", "BOT": "बोलिभिया समय", "EDT": "पूर्वी दिवा समय", "CLT": "चिली मानक समय", "CDT": "केन्द्रीय दिवा समय", "EST": "पूर्वी मानक समय", "PDT": "प्यासिफिक दिवा समय", "WAST": "पश्चिम अफ्रिकी ग्रीष्मकालीन समय", "SRT": "सुरिनामा समय", "HAT": "न्यूफाउन्ल्याण्ड दिवा समय", "CLST": "चिली ग्रीष्मकालीन समय", "ECT": "ईक्वोडोर समय", "WEZ": "पश्चिमी युरोपेली मानक समय", "UYST": "उरुग्वे ग्रीष्मकालीन समय", "LHST": "लर्ड हावे मानक समय", "ADT": "एट्लान्टिक दिवा समय", "ACWST": "केन्द्रीय पश्चिमी अस्ट्रेलिया मानक समय", "NZDT": "न्यूजिल्यान्ड दिवा समय", "WAT": "पश्चिम अफ्रिकी मानक समय", "WESZ": "युरोपेली ग्रीष्मकालीन समय", "GMT": "ग्रीनविच मिन समय", "LHDT": "लर्ड हावे दिवा समय", "GFT": "फ्रेन्च ग्वाना समय", "CHAST": "चाथाम मानक समय", "WARST": "पश्चिमी अर्जेनटिनी ग्रीष्मकालीन समय", "AWST": "पश्चिमी अस्ट्रेलिया मानक समय", "TMST": "तुर्कमेनिस्तान ग्रीष्मकालीन मानक समय", "GYT": "गुयाना समय", "MYT": "मलेसिया समय", "ACDT": "केन्द्रीय अस्ट्रेलिया दिवा समय", "VET": "भेनेज्युएला समय", "WIB": "पश्चिमी इन्डोनेशिया समय", "COST": "कोलम्बियाली ग्रीष्मकालीन समय", "WART": "पश्चिमी अर्जेनटिनी मानक समय"},
}
}
diff --git a/ne/ne_test.go b/ne/ne_test.go
new file mode 100644
index 00000000..52401cde
--- /dev/null
+++ b/ne/ne_test.go
@@ -0,0 +1,1120 @@
+package ne
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ne"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ne_IN/ne_IN.go b/ne_IN/ne_IN.go
index 6332aee5..f01e54ac 100644
--- a/ne_IN/ne_IN.go
+++ b/ne_IN/ne_IN.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ईसा पूर्व", "सन्"},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"WEZ": "पश्चिमी युरोपेली मानक समय", "IST": "भारतीय मानक समय", "OEZ": "पूर्वी युरोपेली मानक समय", "TMST": "तुर्कमेनिस्तान ग्रीष्मकालीन मानक समय", "MST": "MST", "MDT": "MDT", "HAST": "हवाई-एलुटियन मानक समय", "GYT": "गुयाना समय", "MEZ": "केन्द्रीय युरोपेली मानक समय", "CHAST": "चाथाम मानक समय", "WESZ": "युरोपेली ग्रीष्मकालीन समय", "CAT": "केन्द्रीय अफ्रिकी समय", "ACDT": "केन्द्रीय अस्ट्रेलिया दिवा समय", "ART": "अर्जेनटिनी मानक समय", "PST": "प्यासिफिक मानक समय", "NZDT": "न्यूजिल्यान्ड दिवा समय", "AST": "एट्लान्टिक मानक समय", "WARST": "पश्चिमी अर्जेनटिनी ग्रीष्मकालीन समय", "TMT": "तुर्कमेनिस्तान मानक समय", "AKST": "अलास्का मानक समय", "AKDT": "अलस्का दिवा समय", "SAST": "दक्षिण अफ्रिकी समय", "HNT": "न्यूफाउन्डल्याण्ड मानक समय", "UYT": "उरूग्वे मानक समय", "HADT": "हवाई-एलुटियन दिवा समय", "GMT": "ग्रीनविच मिन समय", "ARST": "अर्जेनटिनी ग्रीष्मकालीन समय", "SRT": "सुरिनामा समय", "MESZ": "केन्द्रीय युरोपेली ग्रीष्मकालीन समय", "MYT": "मलेसिया समय", "ACWST": "केन्द्रीय पश्चिमी अस्ट्रेलिया मानक समय", "GFT": "फ्रेन्च ग्वाना समय", "JST": "जापान मानक समय", "CST": "केन्द्रीय मानक समय", "EDT": "पूर्वी दिवा समय", "COT": "कोलम्बियाली मानक समय", "ECT": "ईक्वोडोर समय", "WART": "पश्चिमी अर्जेनटिनी मानक समय", "OESZ": "पूर्वी युरोपेली ग्रीष्मकालीन समय", "BOT": "बोलिभिया समय", "ADT": "एट्लान्टिक दिवा समय", "CHADT": "चाथाम दिवा समय", "AEST": "पूर्वी अस्ट्रेलिया मानक समय", "VET": "भेनेज्युएला समय", "WAST": "पश्चिम अफ्रिकी ग्रीष्मकालीन समय", "WIT": "पूर्वी इन्डोनेशिया समय", "PDT": "प्यासिफिक दिवा समय", "LHST": "लर्ड हावे मानक समय", "CDT": "केन्द्रीय दिवा समय", "COST": "कोलम्बियाली ग्रीष्मकालीन समय", "WAT": "पश्चिम अफ्रिकी मानक समय", "WIB": "पश्चिमी इन्डोनेशिया समय", "AWST": "पश्चिमी अस्ट्रेलिया मानक समय", "AEDT": "पूर्वी अस्ट्रेलिया दिवा समय", "NZST": "न्यूजिल्यान्ड मानक समय", "CLST": "चिली ग्रीष्मकालीन समय", "HKT": "हङकङ मानक समय", "HKST": "हङकङ ग्रीष्मकालीन समय", "AWDT": "पश्चिमी अस्ट्रेलिया दिवा समय", "ChST": "चामोर्रो मानक समय", "JDT": "जापान दिवा समय", "UYST": "उरुग्वे ग्रीष्मकालीन समय", "CLT": "चिली मानक समय", "EST": "पूर्वी मानक समय", "SGT": "सिंगापुर मानक समय", "BT": "भुटानी समय", "HAT": "न्यूफाउन्ल्याण्ड दिवा समय", "EAT": "पूर्वी अफ्रिकी समय", "∅∅∅": "ब्राजिलीया ग्रीष्मकालीन समय", "WITA": "केन्द्रीय इन्डोनेशिया समय", "LHDT": "लर्ड हावे दिवा समय", "ACST": "केन्द्रीय अस्ट्रेलिया मानक समय", "ACWDT": "केन्द्रीय पश्चिमी अस्ट्रेलिया दिवा समय"},
+ timezones: map[string]string{"JST": "जापान मानक समय", "HAST": "हवाई-एलुटियन मानक समय", "TMST": "तुर्कमेनिस्तान ग्रीष्मकालीन मानक समय", "UYST": "उरुग्वे ग्रीष्मकालीन समय", "GFT": "फ्रेन्च ग्वाना समय", "NZDT": "न्यूजिल्यान्ड दिवा समय", "CAT": "केन्द्रीय अफ्रिकी समय", "GMT": "ग्रीनविच मिन समय", "VET": "भेनेज्युएला समय", "MEZ": "केन्द्रीय युरोपेली मानक समय", "MESZ": "केन्द्रीय युरोपेली ग्रीष्मकालीन समय", "WAST": "पश्चिम अफ्रिकी ग्रीष्मकालीन समय", "ECT": "ईक्वोडोर समय", "JDT": "जापान दिवा समय", "ADT": "एट्लान्टिक दिवा समय", "IST": "भारतीय मानक समय", "COT": "कोलम्बियाली मानक समय", "EAT": "पूर्वी अफ्रिकी समय", "WART": "पश्चिमी अर्जेनटिनी मानक समय", "WAT": "पश्चिम अफ्रिकी मानक समय", "BT": "भुटानी समय", "∅∅∅": "ब्राजिलीया ग्रीष्मकालीन समय", "AWST": "पश्चिमी अस्ट्रेलिया मानक समय", "ART": "अर्जेनटिनी मानक समय", "WEZ": "पश्चिमी युरोपेली मानक समय", "HNT": "न्यूफाउन्डल्याण्ड मानक समय", "OESZ": "पूर्वी युरोपेली ग्रीष्मकालीन समय", "WIT": "पूर्वी इन्डोनेशिया समय", "MST": "हिमाली मानक समय", "ACDT": "केन्द्रीय अस्ट्रेलिया दिवा समय", "AWDT": "पश्चिमी अस्ट्रेलिया दिवा समय", "HAT": "न्यूफाउन्ल्याण्ड दिवा समय", "OEZ": "पूर्वी युरोपेली मानक समय", "AKST": "अलास्का मानक समय", "ACWST": "केन्द्रीय पश्चिमी अस्ट्रेलिया मानक समय", "NZST": "न्यूजिल्यान्ड मानक समय", "SGT": "सिंगापुर मानक समय", "MDT": "हिमाली दिवा समय", "HKST": "हङकङ ग्रीष्मकालीन समय", "CHAST": "चाथाम मानक समय", "HADT": "हवाई-एलुटियन दिवा समय", "TMT": "तुर्कमेनिस्तान मानक समय", "ARST": "अर्जेनटिनी ग्रीष्मकालीन समय", "BOT": "बोलिभिया समय", "SAST": "दक्षिण अफ्रिकी समय", "LHDT": "लर्ड हावे दिवा समय", "ACST": "केन्द्रीय अस्ट्रेलिया मानक समय", "SRT": "सुरिनामा समय", "HKT": "हङकङ मानक समय", "CHADT": "चाथाम दिवा समय", "EDT": "पूर्वी दिवा समय", "AEST": "पूर्वी अस्ट्रेलिया मानक समय", "CLST": "चिली ग्रीष्मकालीन समय", "CDT": "केन्द्रीय दिवा समय", "WESZ": "युरोपेली ग्रीष्मकालीन समय", "GYT": "गुयाना समय", "AST": "एट्लान्टिक मानक समय", "ACWDT": "केन्द्रीय पश्चिमी अस्ट्रेलिया दिवा समय", "PDT": "प्यासिफिक दिवा समय", "COST": "कोलम्बियाली ग्रीष्मकालीन समय", "CLT": "चिली मानक समय", "LHST": "लर्ड हावे मानक समय", "WARST": "पश्चिमी अर्जेनटिनी ग्रीष्मकालीन समय", "WITA": "केन्द्रीय इन्डोनेशिया समय", "WIB": "पश्चिमी इन्डोनेशिया समय", "ChST": "चामोर्रो मानक समय", "CST": "केन्द्रीय मानक समय", "EST": "पूर्वी मानक समय", "PST": "प्यासिफिक मानक समय", "AEDT": "पूर्वी अस्ट्रेलिया दिवा समय", "MYT": "मलेसिया समय", "AKDT": "अलस्का दिवा समय", "UYT": "उरूग्वे मानक समय"},
}
}
diff --git a/ne_IN/ne_IN_test.go b/ne_IN/ne_IN_test.go
new file mode 100644
index 00000000..19faa4f8
--- /dev/null
+++ b/ne_IN/ne_IN_test.go
@@ -0,0 +1,1120 @@
+package ne_IN
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ne_IN"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ne_NP/ne_NP.go b/ne_NP/ne_NP.go
index f7fb1c41..1a92ec22 100644
--- a/ne_NP/ne_NP.go
+++ b/ne_NP/ne_NP.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ईसा पूर्व", "सन्"},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"HKT": "हङकङ मानक समय", "ACWST": "केन्द्रीय पश्चिमी अस्ट्रेलिया मानक समय", "ChST": "चामोर्रो मानक समय", "EDT": "पूर्वी दिवा समय", "AST": "एट्लान्टिक मानक समय", "GMT": "ग्रीनविच मिन समय", "ARST": "अर्जेनटिनी ग्रीष्मकालीन समय", "SRT": "सुरिनामा समय", "EST": "पूर्वी मानक समय", "SGT": "सिंगापुर मानक समय", "PDT": "प्यासिफिक दिवा समय", "HADT": "हवाई-एलुटियन दिवा समय", "ACST": "केन्द्रीय अस्ट्रेलिया मानक समय", "ART": "अर्जेनटिनी मानक समय", "MEZ": "केन्द्रीय युरोपेली मानक समय", "UYT": "उरूग्वे मानक समय", "WEZ": "पश्चिमी युरोपेली मानक समय", "WARST": "पश्चिमी अर्जेनटिनी ग्रीष्मकालीन समय", "OEZ": "पूर्वी युरोपेली मानक समय", "IST": "भारतीय मानक समय", "MYT": "मलेसिया समय", "NZDT": "न्यूजिल्यान्ड दिवा समय", "GFT": "फ्रेन्च ग्वाना समय", "MESZ": "केन्द्रीय युरोपेली ग्रीष्मकालीन समय", "ECT": "ईक्वोडोर समय", "MST": "MST", "CDT": "केन्द्रीय दिवा समय", "VET": "भेनेज्युएला समय", "WESZ": "युरोपेली ग्रीष्मकालीन समय", "WITA": "केन्द्रीय इन्डोनेशिया समय", "ACWDT": "केन्द्रीय पश्चिमी अस्ट्रेलिया दिवा समय", "COST": "कोलम्बियाली ग्रीष्मकालीन समय", "HKST": "हङकङ ग्रीष्मकालीन समय", "HAT": "न्यूफाउन्ल्याण्ड दिवा समय", "TMST": "तुर्कमेनिस्तान ग्रीष्मकालीन मानक समय", "AWDT": "पश्चिमी अस्ट्रेलिया दिवा समय", "CHADT": "चाथाम दिवा समय", "HNT": "न्यूफाउन्डल्याण्ड मानक समय", "JDT": "जापान दिवा समय", "AKDT": "अलस्का दिवा समय", "CLT": "चिली मानक समय", "CLST": "चिली ग्रीष्मकालीन समय", "COT": "कोलम्बियाली मानक समय", "WART": "पश्चिमी अर्जेनटिनी मानक समय", "OESZ": "पूर्वी युरोपेली ग्रीष्मकालीन समय", "ACDT": "केन्द्रीय अस्ट्रेलिया दिवा समय", "EAT": "पूर्वी अफ्रिकी समय", "AKST": "अलास्का मानक समय", "AEDT": "पूर्वी अस्ट्रेलिया दिवा समय", "HAST": "हवाई-एलुटियन मानक समय", "WAT": "पश्चिम अफ्रिकी मानक समय", "PST": "प्यासिफिक मानक समय", "AWST": "पश्चिमी अस्ट्रेलिया मानक समय", "BOT": "बोलिभिया समय", "CST": "केन्द्रीय मानक समय", "CAT": "केन्द्रीय अफ्रिकी समय", "LHST": "लर्ड हावे मानक समय", "LHDT": "लर्ड हावे दिवा समय", "NZST": "न्यूजिल्यान्ड मानक समय", "UYST": "उरुग्वे ग्रीष्मकालीन समय", "CHAST": "चाथाम मानक समय", "WAST": "पश्चिम अफ्रिकी ग्रीष्मकालीन समय", "WIT": "पूर्वी इन्डोनेशिया समय", "AEST": "पूर्वी अस्ट्रेलिया मानक समय", "ADT": "एट्लान्टिक दिवा समय", "BT": "भुटानी समय", "WIB": "पश्चिमी इन्डोनेशिया समय", "MDT": "MDT", "JST": "जापान मानक समय", "SAST": "दक्षिण अफ्रिकी समय", "∅∅∅": "अमेजन ग्रीष्मकालीन समय", "TMT": "तुर्कमेनिस्तान मानक समय", "GYT": "गुयाना समय"},
+ timezones: map[string]string{"SAST": "दक्षिण अफ्रिकी समय", "WAST": "पश्चिम अफ्रिकी ग्रीष्मकालीन समय", "HKST": "हङकङ ग्रीष्मकालीन समय", "NZDT": "न्यूजिल्यान्ड दिवा समय", "BOT": "बोलिभिया समय", "TMT": "तुर्कमेनिस्तान मानक समय", "AEST": "पूर्वी अस्ट्रेलिया मानक समय", "LHDT": "लर्ड हावे दिवा समय", "AKDT": "अलस्का दिवा समय", "CLT": "चिली मानक समय", "WIT": "पूर्वी इन्डोनेशिया समय", "EAT": "पूर्वी अफ्रिकी समय", "VET": "भेनेज्युएला समय", "HAT": "न्यूफाउन्ल्याण्ड दिवा समय", "CST": "केन्द्रीय मानक समय", "COST": "कोलम्बियाली ग्रीष्मकालीन समय", "TMST": "तुर्कमेनिस्तान ग्रीष्मकालीन मानक समय", "HNT": "न्यूफाउन्डल्याण्ड मानक समय", "EDT": "पूर्वी दिवा समय", "PDT": "प्यासिफिक दिवा समय", "ACST": "केन्द्रीय अस्ट्रेलिया मानक समय", "JST": "जापान मानक समय", "ACWST": "केन्द्रीय पश्चिमी अस्ट्रेलिया मानक समय", "BT": "भुटानी समय", "WART": "पश्चिमी अर्जेनटिनी मानक समय", "HKT": "हङकङ मानक समय", "ChST": "चामोर्रो मानक समय", "MYT": "मलेसिया समय", "CHADT": "चाथाम दिवा समय", "JDT": "जापान दिवा समय", "AST": "एट्लान्टिक मानक समय", "ACWDT": "केन्द्रीय पश्चिमी अस्ट्रेलिया दिवा समय", "ARST": "अर्जेनटिनी ग्रीष्मकालीन समय", "HAST": "हवाई-एलुटियन मानक समय", "OEZ": "पूर्वी युरोपेली मानक समय", "CLST": "चिली ग्रीष्मकालीन समय", "MDT": "हिमाली दिवा समय", "AWST": "पश्चिमी अस्ट्रेलिया मानक समय", "IST": "भारतीय मानक समय", "∅∅∅": "अमेजन ग्रीष्मकालीन समय", "COT": "कोलम्बियाली मानक समय", "WIB": "पश्चिमी इन्डोनेशिया समय", "GFT": "फ्रेन्च ग्वाना समय", "ECT": "ईक्वोडोर समय", "UYST": "उरुग्वे ग्रीष्मकालीन समय", "HADT": "हवाई-एलुटियन दिवा समय", "NZST": "न्यूजिल्यान्ड मानक समय", "MEZ": "केन्द्रीय युरोपेली मानक समय", "MESZ": "केन्द्रीय युरोपेली ग्रीष्मकालीन समय", "CAT": "केन्द्रीय अफ्रिकी समय", "CDT": "केन्द्रीय दिवा समय", "WITA": "केन्द्रीय इन्डोनेशिया समय", "AKST": "अलास्का मानक समय", "WEZ": "पश्चिमी युरोपेली मानक समय", "GMT": "ग्रीनविच मिन समय", "LHST": "लर्ड हावे मानक समय", "ACDT": "केन्द्रीय अस्ट्रेलिया दिवा समय", "WARST": "पश्चिमी अर्जेनटिनी ग्रीष्मकालीन समय", "AWDT": "पश्चिमी अस्ट्रेलिया दिवा समय", "ART": "अर्जेनटिनी मानक समय", "OESZ": "पूर्वी युरोपेली ग्रीष्मकालीन समय", "GYT": "गुयाना समय", "MST": "हिमाली मानक समय", "PST": "प्यासिफिक मानक समय", "CHAST": "चाथाम मानक समय", "WAT": "पश्चिम अफ्रिकी मानक समय", "SGT": "सिंगापुर मानक समय", "SRT": "सुरिनामा समय", "ADT": "एट्लान्टिक दिवा समय", "EST": "पूर्वी मानक समय", "WESZ": "युरोपेली ग्रीष्मकालीन समय", "AEDT": "पूर्वी अस्ट्रेलिया दिवा समय", "UYT": "उरूग्वे मानक समय"},
}
}
diff --git a/ne_NP/ne_NP_test.go b/ne_NP/ne_NP_test.go
new file mode 100644
index 00000000..cc31a6bb
--- /dev/null
+++ b/ne_NP/ne_NP_test.go
@@ -0,0 +1,1120 @@
+package ne_NP
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ne_NP"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/nl/nl.go b/nl/nl.go
index aac425d0..d1a77305 100644
--- a/nl/nl.go
+++ b/nl/nl.go
@@ -67,7 +67,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"v.Chr.", "n.Chr."},
erasNarrow: []string{"v.C.", "n.C."},
erasWide: []string{"voor Christus", "na Christus"},
- timezones: map[string]string{"ACWDT": "Midden-Australische westelijke zomertijd", "ACST": "Midden-Australische standaardtijd", "CST": "Central-standaardtijd", "ChST": "Chamorro-tijd", "AKST": "Alaska-standaardtijd", "UYT": "Uruguayaanse standaardtijd", "EST": "Eastern-standaardtijd", "AST": "Atlantic-standaardtijd", "WIB": "West-Indonesische tijd", "OESZ": "Oost-Europese zomertijd", "TMST": "Turkmeense zomertijd", "JST": "Japanse standaardtijd", "CLT": "Chileense standaardtijd", "MST": "Mountain-standaardtijd", "IST": "Indiase tijd", "ECT": "Ecuadoraanse tijd", "BT": "Bhutaanse tijd", "JDT": "Japanse zomertijd", "LHST": "Lord Howe-eilandse standaardtijd", "MEZ": "Midden-Europese standaardtijd", "CHAST": "Chatham-standaardtijd", "CHADT": "Chatham-zomertijd", "WAT": "West-Afrikaanse standaardtijd", "HKST": "Hongkongse zomertijd", "WARST": "West-Argentijnse zomertijd", "NZDT": "Nieuw-Zeelandse zomertijd", "VET": "Venezolaanse tijd", "ACWST": "Midden-Australische westelijke standaardtijd", "COT": "Colombiaanse standaardtijd", "ARST": "Argentijnse zomertijd", "MYT": "Maleisische tijd", "BOT": "Boliviaanse tijd", "SAST": "Zuid-Afrikaanse tijd", "LHDT": "Lord Howe-eilandse zomertijd", "MESZ": "Midden-Europese zomertijd", "UYST": "Uruguayaanse zomertijd", "CLST": "Chileense zomertijd", "WIT": "Oost-Indonesische tijd", "SRT": "Surinaamse tijd", "AWDT": "West-Australische zomertijd", "HAST": "Hawaii-Aleoetische standaardtijd", "NZST": "Nieuw-Zeelandse standaardtijd", "AEST": "Oost-Australische standaardtijd", "HADT": "Hawaii-Aleoetische zomertijd", "SGT": "Singaporese standaardtijd", "GMT": "Greenwich Mean Time", "ART": "Argentijnse standaardtijd", "AKDT": "Alaska-zomertijd", "PDT": "Pacific-zomertijd", "CAT": "Centraal-Afrikaanse tijd", "EDT": "Eastern-zomertijd", "OEZ": "Oost-Europese standaardtijd", "HNT": "Newfoundland-standaardtijd", "CDT": "Central-zomertijd", "ADT": "Atlantic-zomertijd", "HKT": "Hongkongse standaardtijd", "ACDT": "Midden-Australische zomertijd", "PST": "Pacific-standaardtijd", "WEZ": "West-Europese standaardtijd", "AEDT": "Oost-Australische zomertijd", "∅∅∅": "Braziliaanse zomertijd", "HAT": "Newfoundland-zomertijd", "WITA": "Centraal-Indonesische tijd", "AWST": "West-Australische standaardtijd", "MDT": "Mountain-zomertijd", "WAST": "West-Afrikaanse zomertijd", "GFT": "Frans-Guyaanse tijd", "WESZ": "West-Europese zomertijd", "COST": "Colombiaanse zomertijd", "WART": "West-Argentijnse standaardtijd", "EAT": "Oost-Afrikaanse tijd", "TMT": "Turkmeense standaardtijd", "GYT": "Guyaanse tijd"},
+ timezones: map[string]string{"GMT": "Greenwich Mean Time", "WIB": "West-Indonesische tijd", "EST": "Eastern-standaardtijd", "COT": "Colombiaanse standaardtijd", "CAT": "Centraal-Afrikaanse tijd", "UYST": "Uruguayaanse zomertijd", "CST": "Central-standaardtijd", "ARST": "Argentijnse zomertijd", "JDT": "Japanse zomertijd", "WEZ": "West-Europese standaardtijd", "HAT": "Newfoundland-zomertijd", "ACWDT": "Midden-Australische westelijke zomertijd", "ADT": "Atlantic-zomertijd", "HAST": "Hawaii-Aleoetische standaardtijd", "BOT": "Boliviaanse tijd", "CHADT": "Chatham-zomertijd", "HADT": "Hawaii-Aleoetische zomertijd", "LHST": "Lord Howe-eilandse standaardtijd", "MYT": "Maleisische tijd", "CDT": "Central-zomertijd", "GFT": "Frans-Guyaanse tijd", "CLT": "Chileense standaardtijd", "SAST": "Zuid-Afrikaanse tijd", "IST": "Indiase tijd", "AEST": "Oost-Australische standaardtijd", "MDT": "Mountain-zomertijd", "CHAST": "Chatham-standaardtijd", "JST": "Japanse standaardtijd", "AWDT": "West-Australische zomertijd", "AEDT": "Oost-Australische zomertijd", "GYT": "Guyaanse tijd", "WARST": "West-Argentijnse zomertijd", "ECT": "Ecuadoraanse tijd", "WITA": "Centraal-Indonesische tijd", "ChST": "Chamorro-tijd", "CLST": "Chileense zomertijd", "SRT": "Surinaamse tijd", "ACDT": "Midden-Australische zomertijd", "ART": "Argentijnse standaardtijd", "AKDT": "Alaska-zomertijd", "HNT": "Newfoundland-standaardtijd", "WAST": "West-Afrikaanse zomertijd", "MST": "Mountain-standaardtijd", "WIT": "Oost-Indonesische tijd", "VET": "Venezolaanse tijd", "AKST": "Alaska-standaardtijd", "∅∅∅": "Braziliaanse zomertijd", "HKT": "Hongkongse standaardtijd", "TMT": "Turkmeense standaardtijd", "HKST": "Hongkongse zomertijd", "AST": "Atlantic-standaardtijd", "PST": "Pacific-standaardtijd", "MEZ": "Midden-Europese standaardtijd", "UYT": "Uruguayaanse standaardtijd", "EDT": "Eastern-zomertijd", "PDT": "Pacific-zomertijd", "NZST": "Nieuw-Zeelandse standaardtijd", "AWST": "West-Australische standaardtijd", "NZDT": "Nieuw-Zeelandse zomertijd", "TMST": "Turkmeense zomertijd", "EAT": "Oost-Afrikaanse tijd", "BT": "Bhutaanse tijd", "WART": "West-Argentijnse standaardtijd", "ACWST": "Midden-Australische westelijke standaardtijd", "WAT": "West-Afrikaanse standaardtijd", "OEZ": "Oost-Europese standaardtijd", "OESZ": "Oost-Europese zomertijd", "LHDT": "Lord Howe-eilandse zomertijd", "ACST": "Midden-Australische standaardtijd", "MESZ": "Midden-Europese zomertijd", "WESZ": "West-Europese zomertijd", "SGT": "Singaporese standaardtijd", "COST": "Colombiaanse zomertijd"},
}
}
diff --git a/nl/nl_test.go b/nl/nl_test.go
new file mode 100644
index 00000000..5ce8df53
--- /dev/null
+++ b/nl/nl_test.go
@@ -0,0 +1,1120 @@
+package nl
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "nl"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/nl_AW/nl_AW.go b/nl_AW/nl_AW.go
index f7163966..90c57d4b 100644
--- a/nl_AW/nl_AW.go
+++ b/nl_AW/nl_AW.go
@@ -67,7 +67,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"v.Chr.", "n.Chr."},
erasNarrow: []string{"v.C.", "n.C."},
erasWide: []string{"voor Christus", "na Christus"},
- timezones: map[string]string{"∅∅∅": "Amazone-zomertijd", "WIB": "West-Indonesische tijd", "IST": "Indiase tijd", "ACWDT": "Midden-Australische westelijke zomertijd", "SGT": "Singaporese standaardtijd", "OESZ": "Oost-Europese zomertijd", "EAT": "Oost-Afrikaanse tijd", "AWST": "West-Australische standaardtijd", "UYT": "Uruguayaanse standaardtijd", "CHADT": "Chatham-zomertijd", "WESZ": "West-Europese zomertijd", "WAST": "West-Afrikaanse zomertijd", "JST": "Japanse standaardtijd", "AKDT": "Alaska-zomertijd", "COST": "Colombiaanse zomertijd", "ECT": "Ecuadoraanse tijd", "AST": "Atlantic-standaardtijd", "MYT": "Maleisische tijd", "GFT": "Frans-Guyaanse tijd", "NZST": "Nieuw-Zeelandse standaardtijd", "ACWST": "Midden-Australische westelijke standaardtijd", "HNT": "Newfoundland-standaardtijd", "CST": "Central-standaardtijd", "AEDT": "Oost-Australische zomertijd", "CHAST": "Chatham-standaardtijd", "HAT": "Newfoundland-zomertijd", "WART": "West-Argentijnse standaardtijd", "OEZ": "Oost-Europese standaardtijd", "MDT": "Macause zomertijd", "ACST": "Midden-Australische standaardtijd", "ARST": "Argentijnse zomertijd", "CDT": "Central-zomertijd", "ChST": "Chamorro-tijd", "WAT": "West-Afrikaanse standaardtijd", "COT": "Colombiaanse standaardtijd", "TMST": "Turkmeense zomertijd", "GYT": "Guyaanse tijd", "CLT": "Chileense standaardtijd", "ACDT": "Midden-Australische zomertijd", "LHDT": "Lord Howe-eilandse zomertijd", "NZDT": "Nieuw-Zeelandse zomertijd", "VET": "Venezolaanse tijd", "BT": "Bhutaanse tijd", "HKST": "Hongkongse zomertijd", "LHST": "Lord Howe-eilandse standaardtijd", "JDT": "Japanse zomertijd", "UYST": "Uruguayaanse zomertijd", "AEST": "Oost-Australische standaardtijd", "HKT": "Hongkongse standaardtijd", "PST": "Pacific-standaardtijd", "EDT": "Eastern-zomertijd", "HAST": "Hawaii-Aleoetische standaardtijd", "WITA": "Centraal-Indonesische tijd", "MST": "Macause standaardtijd", "TMT": "Turkmeense standaardtijd", "EST": "Eastern-standaardtijd", "CAT": "Centraal-Afrikaanse tijd", "WIT": "Oost-Indonesische tijd", "SRT": "Surinaamse tijd", "ADT": "Atlantic-zomertijd", "WARST": "West-Argentijnse zomertijd", "AKST": "Alaska-standaardtijd", "AWDT": "West-Australische zomertijd", "GMT": "Greenwich Mean Time", "MESZ": "Midden-Europese zomertijd", "SAST": "Zuid-Afrikaanse tijd", "PDT": "Pacific-zomertijd", "MEZ": "Midden-Europese standaardtijd", "BOT": "Boliviaanse tijd", "CLST": "Chileense zomertijd", "WEZ": "West-Europese standaardtijd", "HADT": "Hawaii-Aleoetische zomertijd", "ART": "Argentijnse standaardtijd"},
+ timezones: map[string]string{"SGT": "Singaporese standaardtijd", "MST": "Mountain-standaardtijd", "AST": "Atlantic-standaardtijd", "HAST": "Hawaii-Aleoetische standaardtijd", "NZST": "Nieuw-Zeelandse standaardtijd", "EST": "Eastern-standaardtijd", "CDT": "Central-zomertijd", "ACDT": "Midden-Australische zomertijd", "NZDT": "Nieuw-Zeelandse zomertijd", "OESZ": "Oost-Europese zomertijd", "WITA": "Centraal-Indonesische tijd", "GYT": "Guyaanse tijd", "UYST": "Uruguayaanse zomertijd", "WIT": "Oost-Indonesische tijd", "WARST": "West-Argentijnse zomertijd", "HKT": "Hongkongse standaardtijd", "CHAST": "Chatham-standaardtijd", "ACWST": "Midden-Australische westelijke standaardtijd", "MESZ": "Midden-Europese zomertijd", "AEST": "Oost-Australische standaardtijd", "CST": "Central-standaardtijd", "VET": "Venezolaanse tijd", "ART": "Argentijnse standaardtijd", "AKDT": "Alaska-zomertijd", "ADT": "Atlantic-zomertijd", "SRT": "Surinaamse tijd", "WART": "West-Argentijnse standaardtijd", "ECT": "Ecuadoraanse tijd", "TMT": "Turkmeense standaardtijd", "GMT": "Greenwich Mean Time", "CLT": "Chileense standaardtijd", "UYT": "Uruguayaanse standaardtijd", "EAT": "Oost-Afrikaanse tijd", "∅∅∅": "Braziliaanse zomertijd", "ChST": "Chamorro-tijd", "PST": "Pacific-standaardtijd", "EDT": "Eastern-zomertijd", "HNT": "Newfoundland-standaardtijd", "WIB": "West-Indonesische tijd", "GFT": "Frans-Guyaanse tijd", "CHADT": "Chatham-zomertijd", "ACWDT": "Midden-Australische westelijke zomertijd", "SAST": "Zuid-Afrikaanse tijd", "ARST": "Argentijnse zomertijd", "JST": "Japanse standaardtijd", "HADT": "Hawaii-Aleoetische zomertijd", "BT": "Bhutaanse tijd", "HKST": "Hongkongse zomertijd", "AKST": "Alaska-standaardtijd", "CAT": "Centraal-Afrikaanse tijd", "MEZ": "Midden-Europese standaardtijd", "MYT": "Maleisische tijd", "JDT": "Japanse zomertijd", "HAT": "Newfoundland-zomertijd", "CLST": "Chileense zomertijd", "BOT": "Boliviaanse tijd", "WAST": "West-Afrikaanse zomertijd", "AEDT": "Oost-Australische zomertijd", "PDT": "Pacific-zomertijd", "COST": "Colombiaanse zomertijd", "OEZ": "Oost-Europese standaardtijd", "TMST": "Turkmeense zomertijd", "LHDT": "Lord Howe-eilandse zomertijd", "ACST": "Midden-Australische standaardtijd", "AWST": "West-Australische standaardtijd", "AWDT": "West-Australische zomertijd", "COT": "Colombiaanse standaardtijd", "WESZ": "West-Europese zomertijd", "MDT": "Mountain-zomertijd", "LHST": "Lord Howe-eilandse standaardtijd", "IST": "Indiase tijd", "WAT": "West-Afrikaanse standaardtijd", "WEZ": "West-Europese standaardtijd"},
}
}
diff --git a/nl_AW/nl_AW_test.go b/nl_AW/nl_AW_test.go
new file mode 100644
index 00000000..77bacd0d
--- /dev/null
+++ b/nl_AW/nl_AW_test.go
@@ -0,0 +1,1120 @@
+package nl_AW
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "nl_AW"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/nl_BE/nl_BE.go b/nl_BE/nl_BE.go
index 4fd21db6..a9ac034f 100644
--- a/nl_BE/nl_BE.go
+++ b/nl_BE/nl_BE.go
@@ -47,7 +47,7 @@ func New() locales.Translator {
locale: "nl_BE",
pluralsCardinal: []locales.PluralRule{2, 6},
pluralsOrdinal: []locales.PluralRule{6},
- pluralsRange: []locales.PluralRule{2, 6},
+ pluralsRange: []locales.PluralRule{6, 2},
timeSeparator: ":",
currencies: []string{"ADP ", "AED ", "AFA ", "AFN ", "ALK ", "ALL ", "AMD ", "ANG ", "AOA ", "AOK ", "AON ", "AOR ", "ARA ", "ARL ", "ARM ", "ARP ", "ARS ", "ATS ", "AUD ", "AWG ", "AZM ", "AZN ", "BAD ", "BAM ", "BAN ", "BBD ", "BDT ", "BEC ", "BEF ", "BEL ", "BGL ", "BGM ", "BGN ", "BGO ", "BHD ", "BIF ", "BMD ", "BND ", "BOB ", "BOL ", "BOP ", "BOV ", "BRB ", "BRC ", "BRE ", "BRL ", "BRN ", "BRR ", "BRZ ", "BSD ", "BTN ", "BUK ", "BWP ", "BYB ", "BYR ", "BZD ", "CAD ", "CDF ", "CHE ", "CHF ", "CHW ", "CLE ", "CLF ", "CLP ", "CNX ", "CNY ", "COP ", "COU ", "CRC ", "CSD ", "CSK ", "CUC ", "CUP ", "CVE ", "CYP ", "CZK ", "DDM ", "DEM ", "DJF ", "DKK ", "DOP ", "DZD ", "ECS ", "ECV ", "EEK ", "EGP ", "ERN ", "ESA ", "ESB ", "ESP ", "ETB ", "EUR ", "FIM ", "FJD ", "FKP ", "FRF ", "GBP ", "GEK ", "GEL ", "GHC ", "GHS ", "GIP ", "GMD ", "GNF ", "GNS ", "GQE ", "GRD ", "GTQ ", "GWE ", "GWP ", "GYD ", "HKD ", "HNL ", "HRD ", "HRK ", "HTG ", "HUF ", "IDR ", "IEP ", "ILP ", "ILR ", "ILS ", "INR ", "IQD ", "IRR ", "ISJ ", "ISK ", "ITL ", "JMD ", "JOD ", "JPY ", "KES ", "KGS ", "KHR ", "KMF ", "KPW ", "KRH ", "KRO ", "KRW ", "KWD ", "KYD ", "KZT ", "LAK ", "LBP ", "LKR ", "LRD ", "LSL ", "LTL ", "LTT ", "LUC ", "LUF ", "LUL ", "LVL ", "LVR ", "LYD ", "MAD ", "MAF ", "MCF ", "MDC ", "MDL ", "MGA ", "MGF ", "MKD ", "MKN ", "MLF ", "MMK ", "MNT ", "MOP ", "MRO ", "MTL ", "MTP ", "MUR ", "MVP ", "MVR ", "MWK ", "MXN ", "MXP ", "MXV ", "MYR ", "MZE ", "MZM ", "MZN ", "NAD ", "NGN ", "NIC ", "NIO ", "NLG ", "NOK ", "NPR ", "NZD ", "OMR ", "PAB ", "PEI ", "PEN ", "PES ", "PGK ", "PHP ", "PKR ", "PLN ", "PLZ ", "PTE ", "PYG ", "QAR ", "RHD ", "ROL ", "RON ", "RSD ", "RUB ", "RUR ", "RWF ", "SAR ", "SBD ", "SCR ", "SDD ", "SDG ", "SDP ", "SEK ", "SGD ", "SHP ", "SIT ", "SKK ", "SLL ", "SOS ", "SRD ", "SRG ", "SSP ", "STD ", "SUR ", "SVC ", "SYP ", "SZL ", "THB ", "TJR ", "TJS ", "TMM ", "TMT ", "TND ", "TOP ", "TPE ", "TRL ", "TRY ", "TTD ", "TWD ", "TZS ", "UAH ", "UAK ", "UGS ", "UGX ", "USD ", "USN ", "USS ", "UYI ", "UYP ", "UYU ", "UZS ", "VEB ", "VEF ", "VND ", "VNN ", "VUV ", "WST ", "XAF ", "XAG ", "XAU ", "XBA ", "XBB ", "XBC ", "XBD ", "XCD ", "XDR ", "XEU ", "XFO ", "XFU ", "XOF ", "XPD ", "XPF ", "XPT ", "XRE ", "XSU ", "XTS ", "XUA ", "XXX ", "YDD ", "YER ", "YUD ", "YUM ", "YUN ", "YUR ", "ZAL ", "ZAR ", "ZMK ", "ZMW ", "ZRN ", "ZRZ ", "ZWD ", "ZWL ", "ZWR "},
currencyPositiveSuffix: " ",
@@ -65,7 +65,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"v.Chr.", "n.Chr."},
erasNarrow: []string{"v.C.", "n.C."},
erasWide: []string{"voor Christus", "na Christus"},
- timezones: map[string]string{"CLST": "Chileense zomertijd", "AEDT": "Oost-Australische zomertijd", "GFT": "Frans-Guyaanse tijd", "LHST": "Lord Howe-eilandse standaardtijd", "LHDT": "Lord Howe-eilandse zomertijd", "WITA": "Centraal-Indonesische tijd", "MYT": "Maleisische tijd", "MEZ": "Midden-Europese standaardtijd", "GMT": "Greenwich Mean Time", "AKDT": "Alaska-zomertijd", "PDT": "Pacific-zomertijd", "EDT": "Eastern-zomertijd", "HKT": "Hongkongse standaardtijd", "OEZ": "Oost-Europese standaardtijd", "ACST": "Midden-Australische standaardtijd", "AKST": "Alaska-standaardtijd", "PST": "Pacific-standaardtijd", "CST": "Central-standaardtijd", "CHADT": "Chatham-zomertijd", "WAST": "West-Afrikaanse zomertijd", "HAT": "Newfoundland-zomertijd", "OESZ": "Oost-Europese zomertijd", "ACWDT": "Midden-Australische westelijke zomertijd", "WAT": "West-Afrikaanse standaardtijd", "UYST": "Uruguayaanse zomertijd", "CHAST": "Chatham-standaardtijd", "CLT": "Chileense standaardtijd", "HKST": "Hongkongse zomertijd", "WART": "West-Argentijnse standaardtijd", "MESZ": "Midden-Europese zomertijd", "AWDT": "West-Australische zomertijd", "BOT": "Boliviaanse tijd", "ACWST": "Midden-Australische westelijke standaardtijd", "COST": "Colombiaanse zomertijd", "JDT": "Japanse zomertijd", "SRT": "Surinaamse tijd", "GYT": "Guyaanse tijd", "∅∅∅": "Braziliaanse zomertijd", "HADT": "Hawaii-Aleoetische zomertijd", "BT": "Bhutaanse tijd", "TMT": "Turkmeense standaardtijd", "TMST": "Turkmeense zomertijd", "CDT": "Central-zomertijd", "WESZ": "West-Europese zomertijd", "ECT": "Ecuadoraanse tijd", "COT": "Colombiaanse standaardtijd", "WIT": "Oost-Indonesische tijd", "EST": "Eastern-standaardtijd", "ChST": "Chamorro-tijd", "HNT": "Newfoundland-standaardtijd", "EAT": "Oost-Afrikaanse tijd", "VET": "Venezolaanse tijd", "IST": "Indiase tijd", "MDT": "Macause zomertijd", "ACDT": "Midden-Australische zomertijd", "AWST": "West-Australische standaardtijd", "AST": "Atlantic-standaardtijd", "HAST": "Hawaii-Aleoetische standaardtijd", "SGT": "Singaporese standaardtijd", "JST": "Japanse standaardtijd", "NZST": "Nieuw-Zeelandse standaardtijd", "WEZ": "West-Europese standaardtijd", "WARST": "West-Argentijnse zomertijd", "WIB": "West-Indonesische tijd", "MST": "Macause standaardtijd", "CAT": "Centraal-Afrikaanse tijd", "ART": "Argentijnse standaardtijd", "ARST": "Argentijnse zomertijd", "ADT": "Atlantic-zomertijd", "SAST": "Zuid-Afrikaanse tijd", "UYT": "Uruguayaanse standaardtijd", "NZDT": "Nieuw-Zeelandse zomertijd", "AEST": "Oost-Australische standaardtijd"},
+ timezones: map[string]string{"COT": "Colombiaanse standaardtijd", "MDT": "Mountain-zomertijd", "JST": "Japanse standaardtijd", "ARST": "Argentijnse zomertijd", "WAST": "West-Afrikaanse zomertijd", "UYST": "Uruguayaanse zomertijd", "LHST": "Lord Howe-eilandse standaardtijd", "LHDT": "Lord Howe-eilandse zomertijd", "ACWST": "Midden-Australische westelijke standaardtijd", "WAT": "West-Afrikaanse standaardtijd", "SGT": "Singaporese standaardtijd", "CLST": "Chileense zomertijd", "CHADT": "Chatham-zomertijd", "HAST": "Hawaii-Aleoetische standaardtijd", "WESZ": "West-Europese zomertijd", "OEZ": "Oost-Europese standaardtijd", "GMT": "Greenwich Mean Time", "ADT": "Atlantic-zomertijd", "PST": "Pacific-standaardtijd", "MEZ": "Midden-Europese standaardtijd", "TMT": "Turkmeense standaardtijd", "AKST": "Alaska-standaardtijd", "NZDT": "Nieuw-Zeelandse zomertijd", "BOT": "Boliviaanse tijd", "IST": "Indiase tijd", "PDT": "Pacific-zomertijd", "TMST": "Turkmeense zomertijd", "MST": "Mountain-standaardtijd", "CDT": "Central-zomertijd", "SRT": "Surinaamse tijd", "GFT": "Frans-Guyaanse tijd", "ECT": "Ecuadoraanse tijd", "ACWDT": "Midden-Australische westelijke zomertijd", "AEDT": "Oost-Australische zomertijd", "ChST": "Chamorro-tijd", "MYT": "Maleisische tijd", "ACDT": "Midden-Australische zomertijd", "HNT": "Newfoundland-standaardtijd", "OESZ": "Oost-Europese zomertijd", "GYT": "Guyaanse tijd", "EAT": "Oost-Afrikaanse tijd", "WARST": "West-Argentijnse zomertijd", "JDT": "Japanse zomertijd", "AST": "Atlantic-standaardtijd", "NZST": "Nieuw-Zeelandse standaardtijd", "CLT": "Chileense standaardtijd", "VET": "Venezolaanse tijd", "AKDT": "Alaska-zomertijd", "AWST": "West-Australische standaardtijd", "HAT": "Newfoundland-zomertijd", "COST": "Colombiaanse zomertijd", "∅∅∅": "Braziliaanse zomertijd", "BT": "Bhutaanse tijd", "CAT": "Centraal-Afrikaanse tijd", "HKT": "Hongkongse standaardtijd", "HKST": "Hongkongse zomertijd", "WEZ": "West-Europese standaardtijd", "CST": "Central-standaardtijd", "CHAST": "Chatham-standaardtijd", "WIT": "Oost-Indonesische tijd", "ACST": "Midden-Australische standaardtijd", "WART": "West-Argentijnse standaardtijd", "SAST": "Zuid-Afrikaanse tijd", "EST": "Eastern-standaardtijd", "MESZ": "Midden-Europese zomertijd", "WIB": "West-Indonesische tijd", "AEST": "Oost-Australische standaardtijd", "AWDT": "West-Australische zomertijd", "EDT": "Eastern-zomertijd", "UYT": "Uruguayaanse standaardtijd", "ART": "Argentijnse standaardtijd", "WITA": "Centraal-Indonesische tijd", "HADT": "Hawaii-Aleoetische zomertijd"},
}
}
diff --git a/nl_BE/nl_BE_test.go b/nl_BE/nl_BE_test.go
new file mode 100644
index 00000000..584cc643
--- /dev/null
+++ b/nl_BE/nl_BE_test.go
@@ -0,0 +1,1120 @@
+package nl_BE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "nl_BE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/nl_BQ/nl_BQ.go b/nl_BQ/nl_BQ.go
index 60a4d38a..1ac8025c 100644
--- a/nl_BQ/nl_BQ.go
+++ b/nl_BQ/nl_BQ.go
@@ -48,7 +48,7 @@ func New() locales.Translator {
locale: "nl_BQ",
pluralsCardinal: []locales.PluralRule{2, 6},
pluralsOrdinal: []locales.PluralRule{6},
- pluralsRange: []locales.PluralRule{6, 2},
+ pluralsRange: []locales.PluralRule{2, 6},
timeSeparator: ":",
currencies: []string{"ADP ", "AED ", "AFA ", "AFN ", "ALK ", "ALL ", "AMD ", "ANG ", "AOA ", "AOK ", "AON ", "AOR ", "ARA ", "ARL ", "ARM ", "ARP ", "ARS ", "ATS ", "AUD ", "AWG ", "AZM ", "AZN ", "BAD ", "BAM ", "BAN ", "BBD ", "BDT ", "BEC ", "BEF ", "BEL ", "BGL ", "BGM ", "BGN ", "BGO ", "BHD ", "BIF ", "BMD ", "BND ", "BOB ", "BOL ", "BOP ", "BOV ", "BRB ", "BRC ", "BRE ", "BRL ", "BRN ", "BRR ", "BRZ ", "BSD ", "BTN ", "BUK ", "BWP ", "BYB ", "BYR ", "BZD ", "CAD ", "CDF ", "CHE ", "CHF ", "CHW ", "CLE ", "CLF ", "CLP ", "CNX ", "CNY ", "COP ", "COU ", "CRC ", "CSD ", "CSK ", "CUC ", "CUP ", "CVE ", "CYP ", "CZK ", "DDM ", "DEM ", "DJF ", "DKK ", "DOP ", "DZD ", "ECS ", "ECV ", "EEK ", "EGP ", "ERN ", "ESA ", "ESB ", "ESP ", "ETB ", "EUR ", "FIM ", "FJD ", "FKP ", "FRF ", "GBP ", "GEK ", "GEL ", "GHC ", "GHS ", "GIP ", "GMD ", "GNF ", "GNS ", "GQE ", "GRD ", "GTQ ", "GWE ", "GWP ", "GYD ", "HKD ", "HNL ", "HRD ", "HRK ", "HTG ", "HUF ", "IDR ", "IEP ", "ILP ", "ILR ", "ILS ", "INR ", "IQD ", "IRR ", "ISJ ", "ISK ", "ITL ", "JMD ", "JOD ", "JPY ", "KES ", "KGS ", "KHR ", "KMF ", "KPW ", "KRH ", "KRO ", "KRW ", "KWD ", "KYD ", "KZT ", "LAK ", "LBP ", "LKR ", "LRD ", "LSL ", "LTL ", "LTT ", "LUC ", "LUF ", "LUL ", "LVL ", "LVR ", "LYD ", "MAD ", "MAF ", "MCF ", "MDC ", "MDL ", "MGA ", "MGF ", "MKD ", "MKN ", "MLF ", "MMK ", "MNT ", "MOP ", "MRO ", "MTL ", "MTP ", "MUR ", "MVP ", "MVR ", "MWK ", "MXN ", "MXP ", "MXV ", "MYR ", "MZE ", "MZM ", "MZN ", "NAD ", "NGN ", "NIC ", "NIO ", "NLG ", "NOK ", "NPR ", "NZD ", "OMR ", "PAB ", "PEI ", "PEN ", "PES ", "PGK ", "PHP ", "PKR ", "PLN ", "PLZ ", "PTE ", "PYG ", "QAR ", "RHD ", "ROL ", "RON ", "RSD ", "RUB ", "RUR ", "RWF ", "SAR ", "SBD ", "SCR ", "SDD ", "SDG ", "SDP ", "SEK ", "SGD ", "SHP ", "SIT ", "SKK ", "SLL ", "SOS ", "SRD ", "SRG ", "SSP ", "STD ", "SUR ", "SVC ", "SYP ", "SZL ", "THB ", "TJR ", "TJS ", "TMM ", "TMT ", "TND ", "TOP ", "TPE ", "TRL ", "TRY ", "TTD ", "TWD ", "TZS ", "UAH ", "UAK ", "UGS ", "UGX ", "$", "USN ", "USS ", "UYI ", "UYP ", "UYU ", "UZS ", "VEB ", "VEF ", "VND ", "VNN ", "VUV ", "WST ", "XAF ", "XAG ", "XAU ", "XBA ", "XBB ", "XBC ", "XBD ", "XCD ", "XDR ", "XEU ", "XFO ", "XFU ", "XOF ", "XPD ", "XPF ", "XPT ", "XRE ", "XSU ", "XTS ", "XUA ", "XXX ", "YDD ", "YER ", "YUD ", "YUM ", "YUN ", "YUR ", "ZAL ", "ZAR ", "ZMK ", "ZMW ", "ZRN ", "ZRZ ", "ZWD ", "ZWL ", "ZWR "},
currencyPositivePrefix: " ",
@@ -67,7 +67,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"v.Chr.", "n.Chr."},
erasNarrow: []string{"v.C.", "n.C."},
erasWide: []string{"voor Christus", "na Christus"},
- timezones: map[string]string{"ACDT": "Midden-Australische zomertijd", "SRT": "Surinaamse tijd", "MESZ": "Midden-Europese zomertijd", "CLT": "Chileense standaardtijd", "COST": "Colombiaanse zomertijd", "ADT": "Atlantic-zomertijd", "HAST": "Hawaii-Aleoetische standaardtijd", "MDT": "Macause zomertijd", "ARST": "Argentijnse zomertijd", "AKDT": "Alaska-zomertijd", "CST": "Central-standaardtijd", "BOT": "Boliviaanse tijd", "ChST": "Chamorro-tijd", "OEZ": "Oost-Europese standaardtijd", "ACWST": "Midden-Australische westelijke standaardtijd", "CAT": "Centraal-Afrikaanse tijd", "ECT": "Ecuadoraanse tijd", "AST": "Atlantic-standaardtijd", "HADT": "Hawaii-Aleoetische zomertijd", "WARST": "West-Argentijnse zomertijd", "OESZ": "Oost-Europese zomertijd", "AEDT": "Oost-Australische zomertijd", "CHAST": "Chatham-standaardtijd", "GFT": "Frans-Guyaanse tijd", "GYT": "Guyaanse tijd", "JDT": "Japanse zomertijd", "IST": "Indiase tijd", "WIT": "Oost-Indonesische tijd", "PDT": "Pacific-zomertijd", "UYT": "Uruguayaanse standaardtijd", "GMT": "Greenwich Mean Time", "AWST": "West-Australische standaardtijd", "MEZ": "Midden-Europese standaardtijd", "AEST": "Oost-Australische standaardtijd", "CHADT": "Chatham-zomertijd", "EST": "Eastern-standaardtijd", "WAT": "West-Afrikaanse standaardtijd", "EAT": "Oost-Afrikaanse tijd", "PST": "Pacific-standaardtijd", "∅∅∅": "Amazone-zomertijd", "MST": "Macause standaardtijd", "CDT": "Central-zomertijd", "WAST": "West-Afrikaanse zomertijd", "HAT": "Newfoundland-zomertijd", "UYST": "Uruguayaanse zomertijd", "VET": "Venezolaanse tijd", "LHST": "Lord Howe-eilandse standaardtijd", "TMST": "Turkmeense zomertijd", "WEZ": "West-Europese standaardtijd", "EDT": "Eastern-zomertijd", "BT": "Bhutaanse tijd", "ART": "Argentijnse standaardtijd", "HKT": "Hongkongse standaardtijd", "WART": "West-Argentijnse standaardtijd", "NZST": "Nieuw-Zeelandse standaardtijd", "TMT": "Turkmeense standaardtijd", "AKST": "Alaska-standaardtijd", "AWDT": "West-Australische zomertijd", "JST": "Japanse standaardtijd", "ACWDT": "Midden-Australische westelijke zomertijd", "SAST": "Zuid-Afrikaanse tijd", "HNT": "Newfoundland-standaardtijd", "LHDT": "Lord Howe-eilandse zomertijd", "NZDT": "Nieuw-Zeelandse zomertijd", "WESZ": "West-Europese zomertijd", "CLST": "Chileense zomertijd", "SGT": "Singaporese standaardtijd", "WITA": "Centraal-Indonesische tijd", "COT": "Colombiaanse standaardtijd", "HKST": "Hongkongse zomertijd", "WIB": "West-Indonesische tijd", "MYT": "Maleisische tijd", "ACST": "Midden-Australische standaardtijd"},
+ timezones: map[string]string{"NZST": "Nieuw-Zeelandse standaardtijd", "WAT": "West-Afrikaanse standaardtijd", "AEST": "Oost-Australische standaardtijd", "ACWST": "Midden-Australische westelijke standaardtijd", "TMT": "Turkmeense standaardtijd", "LHDT": "Lord Howe-eilandse zomertijd", "CST": "Central-standaardtijd", "WARST": "West-Argentijnse zomertijd", "MDT": "Macause zomertijd", "HKST": "Hongkongse zomertijd", "ADT": "Atlantic-zomertijd", "ARST": "Argentijnse zomertijd", "JDT": "Japanse zomertijd", "HADT": "Hawaii-Aleoetische zomertijd", "CAT": "Centraal-Afrikaanse tijd", "WESZ": "West-Europese zomertijd", "HKT": "Hongkongse standaardtijd", "GYT": "Guyaanse tijd", "ChST": "Chamorro-tijd", "LHST": "Lord Howe-eilandse standaardtijd", "OESZ": "Oost-Europese zomertijd", "JST": "Japanse standaardtijd", "EST": "Eastern-standaardtijd", "MYT": "Maleisische tijd", "SRT": "Surinaamse tijd", "CHAST": "Chatham-standaardtijd", "WITA": "Centraal-Indonesische tijd", "SAST": "Zuid-Afrikaanse tijd", "PST": "Pacific-standaardtijd", "MEZ": "Midden-Europese standaardtijd", "WAST": "West-Afrikaanse zomertijd", "EAT": "Oost-Afrikaanse tijd", "ECT": "Ecuadoraanse tijd", "AWST": "West-Australische standaardtijd", "EDT": "Eastern-zomertijd", "HNT": "Newfoundland-standaardtijd", "COST": "Colombiaanse zomertijd", "UYST": "Uruguayaanse zomertijd", "GFT": "Frans-Guyaanse tijd", "NZDT": "Nieuw-Zeelandse zomertijd", "HAT": "Newfoundland-zomertijd", "WART": "West-Argentijnse standaardtijd", "∅∅∅": "Azoren-zomertijd", "TMST": "Turkmeense zomertijd", "WIT": "Oost-Indonesische tijd", "MESZ": "Midden-Europese zomertijd", "IST": "Indiase tijd", "WIB": "West-Indonesische tijd", "OEZ": "Oost-Europese standaardtijd", "ACDT": "Midden-Australische zomertijd", "AKST": "Alaska-standaardtijd", "AKDT": "Alaska-zomertijd", "ACWDT": "Midden-Australische westelijke zomertijd", "BOT": "Boliviaanse tijd", "AEDT": "Oost-Australische zomertijd", "CLST": "Chileense zomertijd", "MST": "Macause standaardtijd", "CDT": "Central-zomertijd", "BT": "Bhutaanse tijd", "AWDT": "West-Australische zomertijd", "PDT": "Pacific-zomertijd", "CLT": "Chileense standaardtijd", "UYT": "Uruguayaanse standaardtijd", "CHADT": "Chatham-zomertijd", "AST": "Atlantic-standaardtijd", "HAST": "Hawaii-Aleoetische standaardtijd", "SGT": "Singaporese standaardtijd", "COT": "Colombiaanse standaardtijd", "VET": "Venezolaanse tijd", "WEZ": "West-Europese standaardtijd", "GMT": "Greenwich Mean Time", "ACST": "Midden-Australische standaardtijd", "ART": "Argentijnse standaardtijd"},
}
}
diff --git a/nl_BQ/nl_BQ_test.go b/nl_BQ/nl_BQ_test.go
new file mode 100644
index 00000000..fc9b52fc
--- /dev/null
+++ b/nl_BQ/nl_BQ_test.go
@@ -0,0 +1,1120 @@
+package nl_BQ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "nl_BQ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/nl_CW/nl_CW.go b/nl_CW/nl_CW.go
index 88509d2c..b01a4498 100644
--- a/nl_CW/nl_CW.go
+++ b/nl_CW/nl_CW.go
@@ -67,7 +67,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"v.Chr.", "n.Chr."},
erasNarrow: []string{"v.C.", "n.C."},
erasWide: []string{"voor Christus", "na Christus"},
- timezones: map[string]string{"ADT": "Atlantic-zomertijd", "HAST": "Hawaii-Aleoetische standaardtijd", "AKST": "Alaska-standaardtijd", "AEST": "Oost-Australische standaardtijd", "AST": "Atlantic-standaardtijd", "HKT": "Hongkongse standaardtijd", "WIT": "Oost-Indonesische tijd", "WIB": "West-Indonesische tijd", "UYT": "Uruguayaanse standaardtijd", "CAT": "Centraal-Afrikaanse tijd", "COST": "Colombiaanse zomertijd", "∅∅∅": "Acre-zomertijd", "MDT": "Macause zomertijd", "PDT": "Pacific-zomertijd", "CST": "Central-standaardtijd", "NZST": "Nieuw-Zeelandse standaardtijd", "CHAST": "Chatham-standaardtijd", "TMT": "Turkmeense standaardtijd", "AKDT": "Alaska-zomertijd", "MESZ": "Midden-Europese zomertijd", "UYST": "Uruguayaanse zomertijd", "CHADT": "Chatham-zomertijd", "HADT": "Hawaii-Aleoetische zomertijd", "SGT": "Singaporese standaardtijd", "ACDT": "Midden-Australische zomertijd", "ACWDT": "Midden-Australische westelijke zomertijd", "EDT": "Eastern-zomertijd", "MST": "Macause standaardtijd", "AWDT": "West-Australische zomertijd", "VET": "Venezolaanse tijd", "ACST": "Midden-Australische standaardtijd", "IST": "Indiase tijd", "OEZ": "Oost-Europese standaardtijd", "EST": "Eastern-standaardtijd", "COT": "Colombiaanse standaardtijd", "SAST": "Zuid-Afrikaanse tijd", "GFT": "Frans-Guyaanse tijd", "ARST": "Argentijnse zomertijd", "BT": "Bhutaanse tijd", "WART": "West-Argentijnse standaardtijd", "HNT": "Newfoundland-standaardtijd", "HAT": "Newfoundland-zomertijd", "NZDT": "Nieuw-Zeelandse zomertijd", "AWST": "West-Australische standaardtijd", "GYT": "Guyaanse tijd", "MEZ": "Midden-Europese standaardtijd", "WESZ": "West-Europese zomertijd", "WAT": "West-Afrikaanse standaardtijd", "WARST": "West-Argentijnse zomertijd", "OESZ": "Oost-Europese zomertijd", "LHDT": "Lord Howe-eilandse zomertijd", "MYT": "Maleisische tijd", "WEZ": "West-Europese standaardtijd", "ACWST": "Midden-Australische westelijke standaardtijd", "ART": "Argentijnse standaardtijd", "CDT": "Central-zomertijd", "CLST": "Chileense zomertijd", "AEDT": "Oost-Australische zomertijd", "ChST": "Chamorro-tijd", "GMT": "Greenwich Mean Time", "TMST": "Turkmeense zomertijd", "SRT": "Surinaamse tijd", "WAST": "West-Afrikaanse zomertijd", "JST": "Japanse standaardtijd", "PST": "Pacific-standaardtijd", "BOT": "Boliviaanse tijd", "ECT": "Ecuadoraanse tijd", "HKST": "Hongkongse zomertijd", "WITA": "Centraal-Indonesische tijd", "EAT": "Oost-Afrikaanse tijd", "JDT": "Japanse zomertijd", "LHST": "Lord Howe-eilandse standaardtijd", "CLT": "Chileense standaardtijd"},
+ timezones: map[string]string{"AEST": "Oost-Australische standaardtijd", "ChST": "Chamorro-tijd", "LHDT": "Lord Howe-eilandse zomertijd", "VET": "Venezolaanse tijd", "ACWDT": "Midden-Australische westelijke zomertijd", "HAST": "Hawaii-Aleoetische standaardtijd", "WESZ": "West-Europese zomertijd", "MYT": "Maleisische tijd", "ECT": "Ecuadoraanse tijd", "PST": "Pacific-standaardtijd", "GYT": "Guyaanse tijd", "CLST": "Chileense zomertijd", "MDT": "Mountain-zomertijd", "CHADT": "Chatham-zomertijd", "∅∅∅": "Amazone-zomertijd", "WIT": "Oost-Indonesische tijd", "WART": "West-Argentijnse standaardtijd", "SRT": "Surinaamse tijd", "ARST": "Argentijnse zomertijd", "MEZ": "Midden-Europese standaardtijd", "CDT": "Central-zomertijd", "AWDT": "West-Australische zomertijd", "NZST": "Nieuw-Zeelandse standaardtijd", "IST": "Indiase tijd", "AEDT": "Oost-Australische zomertijd", "ADT": "Atlantic-zomertijd", "HADT": "Hawaii-Aleoetische zomertijd", "WAT": "West-Afrikaanse standaardtijd", "CST": "Central-standaardtijd", "ACST": "Midden-Australische standaardtijd", "HAT": "Newfoundland-zomertijd", "GMT": "Greenwich Mean Time", "LHST": "Lord Howe-eilandse standaardtijd", "ART": "Argentijnse standaardtijd", "NZDT": "Nieuw-Zeelandse zomertijd", "COT": "Colombiaanse standaardtijd", "TMT": "Turkmeense standaardtijd", "TMST": "Turkmeense zomertijd", "ACDT": "Midden-Australische zomertijd", "HKT": "Hongkongse standaardtijd", "ACWST": "Midden-Australische westelijke standaardtijd", "UYT": "Uruguayaanse standaardtijd", "MST": "Mountain-standaardtijd", "CHAST": "Chatham-standaardtijd", "WITA": "Centraal-Indonesische tijd", "AKDT": "Alaska-zomertijd", "SAST": "Zuid-Afrikaanse tijd", "EST": "Eastern-standaardtijd", "WAST": "West-Afrikaanse zomertijd", "AST": "Atlantic-standaardtijd", "HNT": "Newfoundland-standaardtijd", "OEZ": "Oost-Europese standaardtijd", "HKST": "Hongkongse zomertijd", "EDT": "Eastern-zomertijd", "COST": "Colombiaanse zomertijd", "OESZ": "Oost-Europese zomertijd", "EAT": "Oost-Afrikaanse tijd", "PDT": "Pacific-zomertijd", "CAT": "Centraal-Afrikaanse tijd", "WEZ": "West-Europese standaardtijd", "WARST": "West-Argentijnse zomertijd", "JST": "Japanse standaardtijd", "AKST": "Alaska-standaardtijd", "AWST": "West-Australische standaardtijd", "UYST": "Uruguayaanse zomertijd", "GFT": "Frans-Guyaanse tijd", "JDT": "Japanse zomertijd", "BOT": "Boliviaanse tijd", "SGT": "Singaporese standaardtijd", "CLT": "Chileense standaardtijd", "BT": "Bhutaanse tijd", "MESZ": "Midden-Europese zomertijd", "WIB": "West-Indonesische tijd"},
}
}
diff --git a/nl_CW/nl_CW_test.go b/nl_CW/nl_CW_test.go
new file mode 100644
index 00000000..dd86e21d
--- /dev/null
+++ b/nl_CW/nl_CW_test.go
@@ -0,0 +1,1120 @@
+package nl_CW
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "nl_CW"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/nl_NL/nl_NL.go b/nl_NL/nl_NL.go
index 7e4a8b95..a2806234 100644
--- a/nl_NL/nl_NL.go
+++ b/nl_NL/nl_NL.go
@@ -67,7 +67,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"v.Chr.", "n.Chr."},
erasNarrow: []string{"v.C.", "n.C."},
erasWide: []string{"voor Christus", "na Christus"},
- timezones: map[string]string{"TMT": "Turkmeense standaardtijd", "LHDT": "Lord Howe-eilandse zomertijd", "HADT": "Hawaii-Aleoetische zomertijd", "SGT": "Singaporese standaardtijd", "SAST": "Zuid-Afrikaanse tijd", "NZST": "Nieuw-Zeelandse standaardtijd", "CHAST": "Chatham-standaardtijd", "COT": "Colombiaanse standaardtijd", "WAT": "West-Afrikaanse standaardtijd", "HKST": "Hongkongse zomertijd", "WIT": "Oost-Indonesische tijd", "PDT": "Pacific-zomertijd", "AWDT": "West-Australische zomertijd", "AKST": "Alaska-standaardtijd", "ACST": "Midden-Australische standaardtijd", "BOT": "Boliviaanse tijd", "WESZ": "West-Europese zomertijd", "WAST": "West-Afrikaanse zomertijd", "EAT": "Oost-Afrikaanse tijd", "ChST": "Chamorro-tijd", "WEZ": "West-Europese standaardtijd", "EDT": "Eastern-zomertijd", "∅∅∅": "Amazone-zomertijd", "CDT": "Central-zomertijd", "HKT": "Hongkongse standaardtijd", "GMT": "Greenwich Mean Time", "IST": "Indiase tijd", "LHST": "Lord Howe-eilandse standaardtijd", "AKDT": "Alaska-zomertijd", "OEZ": "Oost-Europese standaardtijd", "HNT": "Newfoundland-standaardtijd", "MDT": "Macause zomertijd", "GYT": "Guyaanse tijd", "SRT": "Surinaamse tijd", "AEST": "Oost-Australische standaardtijd", "CHADT": "Chatham-zomertijd", "ADT": "Atlantic-zomertijd", "OESZ": "Oost-Europese zomertijd", "HAT": "Newfoundland-zomertijd", "WITA": "Centraal-Indonesische tijd", "PST": "Pacific-standaardtijd", "MYT": "Maleisische tijd", "MEZ": "Midden-Europese standaardtijd", "UYT": "Uruguayaanse standaardtijd", "MST": "Macause standaardtijd", "AST": "Atlantic-standaardtijd", "WART": "West-Argentijnse standaardtijd", "ARST": "Argentijnse zomertijd", "UYST": "Uruguayaanse zomertijd", "ACWST": "Midden-Australische westelijke standaardtijd", "ACWDT": "Midden-Australische westelijke zomertijd", "AEDT": "Oost-Australische zomertijd", "TMST": "Turkmeense zomertijd", "JDT": "Japanse zomertijd", "HAST": "Hawaii-Aleoetische standaardtijd", "ACDT": "Midden-Australische zomertijd", "ART": "Argentijnse standaardtijd", "COST": "Colombiaanse zomertijd", "JST": "Japanse standaardtijd", "MESZ": "Midden-Europese zomertijd", "CST": "Central-standaardtijd", "WARST": "West-Argentijnse zomertijd", "WIB": "West-Indonesische tijd", "AWST": "West-Australische standaardtijd", "NZDT": "Nieuw-Zeelandse zomertijd", "CLT": "Chileense standaardtijd", "EST": "Eastern-standaardtijd", "BT": "Bhutaanse tijd", "CLST": "Chileense zomertijd", "VET": "Venezolaanse tijd", "ECT": "Ecuadoraanse tijd", "CAT": "Centraal-Afrikaanse tijd", "GFT": "Frans-Guyaanse tijd"},
+ timezones: map[string]string{"VET": "Venezolaanse tijd", "BT": "Bhutaanse tijd", "NZDT": "Nieuw-Zeelandse zomertijd", "CDT": "Central-zomertijd", "ACDT": "Midden-Australische zomertijd", "ECT": "Ecuadoraanse tijd", "EST": "Eastern-standaardtijd", "HAT": "Newfoundland-zomertijd", "WIB": "West-Indonesische tijd", "AST": "Atlantic-standaardtijd", "MESZ": "Midden-Europese zomertijd", "MST": "Mountain-standaardtijd", "UYST": "Uruguayaanse zomertijd", "SRT": "Surinaamse tijd", "ADT": "Atlantic-zomertijd", "WITA": "Centraal-Indonesische tijd", "∅∅∅": "Amazone-zomertijd", "LHDT": "Lord Howe-eilandse zomertijd", "CLST": "Chileense zomertijd", "UYT": "Uruguayaanse standaardtijd", "ACWDT": "Midden-Australische westelijke zomertijd", "HAST": "Hawaii-Aleoetische standaardtijd", "TMST": "Turkmeense zomertijd", "WAT": "West-Afrikaanse standaardtijd", "GMT": "Greenwich Mean Time", "MYT": "Maleisische tijd", "MEZ": "Midden-Europese standaardtijd", "CAT": "Centraal-Afrikaanse tijd", "AEDT": "Oost-Australische zomertijd", "JST": "Japanse standaardtijd", "ACWST": "Midden-Australische westelijke standaardtijd", "PST": "Pacific-standaardtijd", "TMT": "Turkmeense standaardtijd", "WAST": "West-Afrikaanse zomertijd", "COST": "Colombiaanse zomertijd", "CST": "Central-standaardtijd", "AKDT": "Alaska-zomertijd", "WIT": "Oost-Indonesische tijd", "CLT": "Chileense standaardtijd", "NZST": "Nieuw-Zeelandse standaardtijd", "WESZ": "West-Europese zomertijd", "HNT": "Newfoundland-standaardtijd", "AEST": "Oost-Australische standaardtijd", "WART": "West-Argentijnse standaardtijd", "GFT": "Frans-Guyaanse tijd", "HKT": "Hongkongse standaardtijd", "CHADT": "Chatham-zomertijd", "JDT": "Japanse zomertijd", "GYT": "Guyaanse tijd", "WARST": "West-Argentijnse zomertijd", "PDT": "Pacific-zomertijd", "ChST": "Chamorro-tijd", "EAT": "Oost-Afrikaanse tijd", "CHAST": "Chatham-standaardtijd", "IST": "Indiase tijd", "SAST": "Zuid-Afrikaanse tijd", "EDT": "Eastern-zomertijd", "WEZ": "West-Europese standaardtijd", "OESZ": "Oost-Europese zomertijd", "ART": "Argentijnse standaardtijd", "MDT": "Mountain-zomertijd", "ACST": "Midden-Australische standaardtijd", "HKST": "Hongkongse zomertijd", "COT": "Colombiaanse standaardtijd", "AWST": "West-Australische standaardtijd", "BOT": "Boliviaanse tijd", "SGT": "Singaporese standaardtijd", "LHST": "Lord Howe-eilandse standaardtijd", "AKST": "Alaska-standaardtijd", "ARST": "Argentijnse zomertijd", "HADT": "Hawaii-Aleoetische zomertijd", "OEZ": "Oost-Europese standaardtijd", "AWDT": "West-Australische zomertijd"},
}
}
diff --git a/nl_NL/nl_NL_test.go b/nl_NL/nl_NL_test.go
new file mode 100644
index 00000000..63fbdf3e
--- /dev/null
+++ b/nl_NL/nl_NL_test.go
@@ -0,0 +1,1120 @@
+package nl_NL
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "nl_NL"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/nl_SR/nl_SR.go b/nl_SR/nl_SR.go
index 6650e588..5b463cf7 100644
--- a/nl_SR/nl_SR.go
+++ b/nl_SR/nl_SR.go
@@ -67,7 +67,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"v.Chr.", "n.Chr."},
erasNarrow: []string{"v.C.", "n.C."},
erasWide: []string{"voor Christus", "na Christus"},
- timezones: map[string]string{"CHAST": "Chatham-standaardtijd", "COT": "Colombiaanse standaardtijd", "OEZ": "Oost-Europese standaardtijd", "AKDT": "Alaska-zomertijd", "WESZ": "West-Europese zomertijd", "ADT": "Atlantic-zomertijd", "GMT": "Greenwich Mean Time", "ACDT": "Midden-Australische zomertijd", "GYT": "Guyaanse tijd", "EAT": "Oost-Afrikaanse tijd", "ACWST": "Midden-Australische westelijke standaardtijd", "ChST": "Chamorro-tijd", "AST": "Atlantic-standaardtijd", "HADT": "Hawaii-Aleoetische zomertijd", "SGT": "Singaporese standaardtijd", "SAST": "Zuid-Afrikaanse tijd", "WAST": "West-Afrikaanse zomertijd", "ARST": "Argentijnse zomertijd", "AKST": "Alaska-standaardtijd", "PST": "Pacific-standaardtijd", "BOT": "Boliviaanse tijd", "ACWDT": "Midden-Australische westelijke zomertijd", "MST": "Mountain-standaardtijd", "EST": "Eastern-standaardtijd", "HAST": "Hawaii-Aleoetische standaardtijd", "PDT": "Pacific-zomertijd", "UYST": "Uruguayaanse zomertijd", "AEST": "Oost-Australische standaardtijd", "CLST": "Chileense zomertijd", "COST": "Colombiaanse zomertijd", "∅∅∅": "Braziliaanse zomertijd", "BT": "Bhutaanse tijd", "CST": "Central-standaardtijd", "WAT": "West-Afrikaanse standaardtijd", "WITA": "Centraal-Indonesische tijd", "SRT": "Surinaamse tijd", "JDT": "Japanse zomertijd", "IST": "Indiase tijd", "WIT": "Oost-Indonesische tijd", "JST": "Japanse standaardtijd", "CLT": "Chileense standaardtijd", "WIB": "West-Indonesische tijd", "AWST": "West-Australische standaardtijd", "LHST": "Lord Howe-eilandse standaardtijd", "AEDT": "Oost-Australische zomertijd", "ECT": "Ecuadoraanse tijd", "OESZ": "Oost-Europese zomertijd", "ART": "Argentijnse standaardtijd", "TMT": "Turkmeense standaardtijd", "CHADT": "Chatham-zomertijd", "HKST": "Hongkongse zomertijd", "WARST": "West-Argentijnse zomertijd", "HAT": "Newfoundland-zomertijd", "AWDT": "West-Australische zomertijd", "NZST": "Nieuw-Zeelandse standaardtijd", "WART": "West-Argentijnse standaardtijd", "LHDT": "Lord Howe-eilandse zomertijd", "MYT": "Maleisische tijd", "MDT": "Mountain-zomertijd", "ACST": "Midden-Australische standaardtijd", "CDT": "Central-zomertijd", "EDT": "Eastern-zomertijd", "VET": "Venezolaanse tijd", "WEZ": "West-Europese standaardtijd", "CAT": "Centraal-Afrikaanse tijd", "HKT": "Hongkongse standaardtijd", "GFT": "Frans-Guyaanse tijd", "MEZ": "Midden-Europese standaardtijd", "MESZ": "Midden-Europese zomertijd", "TMST": "Turkmeense zomertijd", "NZDT": "Nieuw-Zeelandse zomertijd", "HNT": "Newfoundland-standaardtijd", "UYT": "Uruguayaanse standaardtijd"},
+ timezones: map[string]string{"CAT": "Centraal-Afrikaanse tijd", "HNT": "Newfoundland-standaardtijd", "CDT": "Central-zomertijd", "CHADT": "Chatham-zomertijd", "AWDT": "West-Australische zomertijd", "JST": "Japanse standaardtijd", "COST": "Colombiaanse zomertijd", "MYT": "Maleisische tijd", "WART": "West-Argentijnse standaardtijd", "AKST": "Alaska-standaardtijd", "ACWDT": "Midden-Australische westelijke zomertijd", "AEST": "Oost-Australische standaardtijd", "GYT": "Guyaanse tijd", "∅∅∅": "Braziliaanse zomertijd", "ACWST": "Midden-Australische westelijke standaardtijd", "WITA": "Centraal-Indonesische tijd", "UYST": "Uruguayaanse zomertijd", "HKT": "Hongkongse standaardtijd", "AKDT": "Alaska-zomertijd", "ADT": "Atlantic-zomertijd", "ART": "Argentijnse standaardtijd", "NZST": "Nieuw-Zeelandse standaardtijd", "OESZ": "Oost-Europese zomertijd", "ChST": "Chamorro-tijd", "ACST": "Midden-Australische standaardtijd", "GFT": "Frans-Guyaanse tijd", "CHAST": "Chatham-standaardtijd", "ECT": "Ecuadoraanse tijd", "NZDT": "Nieuw-Zeelandse zomertijd", "WAT": "West-Afrikaanse standaardtijd", "WIB": "West-Indonesische tijd", "GMT": "Greenwich Mean Time", "WIT": "Oost-Indonesische tijd", "WARST": "West-Argentijnse zomertijd", "IST": "Indiase tijd", "CST": "Central-standaardtijd", "VET": "Venezolaanse tijd", "TMT": "Turkmeense standaardtijd", "WAST": "West-Afrikaanse zomertijd", "SGT": "Singaporese standaardtijd", "COT": "Colombiaanse standaardtijd", "AEDT": "Oost-Australische zomertijd", "BT": "Bhutaanse tijd", "EST": "Eastern-standaardtijd", "AST": "Atlantic-standaardtijd", "AWST": "West-Australische standaardtijd", "JDT": "Japanse zomertijd", "HKST": "Hongkongse zomertijd", "HAT": "Newfoundland-zomertijd", "WESZ": "West-Europese zomertijd", "LHST": "Lord Howe-eilandse standaardtijd", "MDT": "Mountain-zomertijd", "ACDT": "Midden-Australische zomertijd", "SAST": "Zuid-Afrikaanse tijd", "TMST": "Turkmeense zomertijd", "CLT": "Chileense standaardtijd", "CLST": "Chileense zomertijd", "ARST": "Argentijnse zomertijd", "PDT": "Pacific-zomertijd", "MESZ": "Midden-Europese zomertijd", "HAST": "Hawaii-Aleoetische standaardtijd", "MEZ": "Midden-Europese standaardtijd", "WEZ": "West-Europese standaardtijd", "OEZ": "Oost-Europese standaardtijd", "EAT": "Oost-Afrikaanse tijd", "LHDT": "Lord Howe-eilandse zomertijd", "MST": "Mountain-standaardtijd", "UYT": "Uruguayaanse standaardtijd", "EDT": "Eastern-zomertijd", "HADT": "Hawaii-Aleoetische zomertijd", "SRT": "Surinaamse tijd", "BOT": "Boliviaanse tijd", "PST": "Pacific-standaardtijd"},
}
}
diff --git a/nl_SR/nl_SR_test.go b/nl_SR/nl_SR_test.go
new file mode 100644
index 00000000..b4b7d8f9
--- /dev/null
+++ b/nl_SR/nl_SR_test.go
@@ -0,0 +1,1120 @@
+package nl_SR
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "nl_SR"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/nl_SX/nl_SX.go b/nl_SX/nl_SX.go
index 575b97db..06c8b96a 100644
--- a/nl_SX/nl_SX.go
+++ b/nl_SX/nl_SX.go
@@ -67,7 +67,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"v.Chr.", "n.Chr."},
erasNarrow: []string{"v.C.", "n.C."},
erasWide: []string{"voor Christus", "na Christus"},
- timezones: map[string]string{"GFT": "Frans-Guyaanse tijd", "JDT": "Japanse zomertijd", "MEZ": "Midden-Europese standaardtijd", "UYT": "Uruguayaanse standaardtijd", "AEDT": "Oost-Australische zomertijd", "PDT": "Pacific-zomertijd", "NZST": "Nieuw-Zeelandse standaardtijd", "BOT": "Boliviaanse tijd", "ACWDT": "Midden-Australische westelijke zomertijd", "HADT": "Hawaii-Aleoetische zomertijd", "WART": "West-Argentijnse standaardtijd", "HNT": "Newfoundland-standaardtijd", "TMT": "Turkmeense standaardtijd", "AWST": "West-Australische standaardtijd", "LHST": "Lord Howe-eilandse standaardtijd", "ChST": "Chamorro-tijd", "WAST": "West-Afrikaanse zomertijd", "SGT": "Singaporese standaardtijd", "IST": "Indiase tijd", "ACST": "Midden-Australische standaardtijd", "PST": "Pacific-standaardtijd", "AWDT": "West-Australische zomertijd", "NZDT": "Nieuw-Zeelandse zomertijd", "AST": "Atlantic-standaardtijd", "WIT": "Oost-Indonesische tijd", "TMST": "Turkmeense zomertijd", "SRT": "Surinaamse tijd", "LHDT": "Lord Howe-eilandse zomertijd", "HKST": "Hongkongse zomertijd", "∅∅∅": "Amazone-zomertijd", "AEST": "Oost-Australische standaardtijd", "CHADT": "Chatham-zomertijd", "CLST": "Chileense zomertijd", "ACDT": "Midden-Australische zomertijd", "COST": "Colombiaanse zomertijd", "AKST": "Alaska-standaardtijd", "SAST": "Zuid-Afrikaanse tijd", "WAT": "West-Afrikaanse standaardtijd", "HAT": "Newfoundland-zomertijd", "WIB": "West-Indonesische tijd", "EAT": "Oost-Afrikaanse tijd", "AKDT": "Alaska-zomertijd", "ACWST": "Midden-Australische westelijke standaardtijd", "COT": "Colombiaanse standaardtijd", "HKT": "Hongkongse standaardtijd", "OESZ": "Oost-Europese zomertijd", "MDT": "Macause zomertijd", "MESZ": "Midden-Europese zomertijd", "VET": "Venezolaanse tijd", "EDT": "Eastern-zomertijd", "HAST": "Hawaii-Aleoetische standaardtijd", "OEZ": "Oost-Europese standaardtijd", "ARST": "Argentijnse zomertijd", "MYT": "Maleisische tijd", "WEZ": "West-Europese standaardtijd", "MST": "Macause standaardtijd", "ART": "Argentijnse standaardtijd", "CDT": "Central-zomertijd", "EST": "Eastern-standaardtijd", "ADT": "Atlantic-zomertijd", "WARST": "West-Argentijnse zomertijd", "GYT": "Guyaanse tijd", "CST": "Central-standaardtijd", "WESZ": "West-Europese zomertijd", "CHAST": "Chatham-standaardtijd", "ECT": "Ecuadoraanse tijd", "BT": "Bhutaanse tijd", "GMT": "Greenwich Mean Time", "JST": "Japanse standaardtijd", "UYST": "Uruguayaanse zomertijd", "CLT": "Chileense standaardtijd", "WITA": "Centraal-Indonesische tijd", "CAT": "Centraal-Afrikaanse tijd"},
+ timezones: map[string]string{"MEZ": "Midden-Europese standaardtijd", "HADT": "Hawaii-Aleoetische zomertijd", "WEZ": "West-Europese standaardtijd", "OESZ": "Oost-Europese zomertijd", "HKST": "Hongkongse zomertijd", "NZDT": "Nieuw-Zeelandse zomertijd", "WESZ": "West-Europese zomertijd", "ADT": "Atlantic-zomertijd", "TMT": "Turkmeense standaardtijd", "CAT": "Centraal-Afrikaanse tijd", "MDT": "Macause zomertijd", "∅∅∅": "Azoren-zomertijd", "BOT": "Boliviaanse tijd", "GMT": "Greenwich Mean Time", "MYT": "Maleisische tijd", "ACDT": "Midden-Australische zomertijd", "AKST": "Alaska-standaardtijd", "EDT": "Eastern-zomertijd", "CDT": "Central-zomertijd", "NZST": "Nieuw-Zeelandse standaardtijd", "TMST": "Turkmeense zomertijd", "WITA": "Centraal-Indonesische tijd", "CHAST": "Chatham-standaardtijd", "CHADT": "Chatham-zomertijd", "IST": "Indiase tijd", "PDT": "Pacific-zomertijd", "ChST": "Chamorro-tijd", "WART": "West-Argentijnse standaardtijd", "AST": "Atlantic-standaardtijd", "ACWDT": "Midden-Australische westelijke zomertijd", "WAST": "West-Afrikaanse zomertijd", "OEZ": "Oost-Europese standaardtijd", "CLST": "Chileense zomertijd", "UYST": "Uruguayaanse zomertijd", "ECT": "Ecuadoraanse tijd", "WIB": "West-Indonesische tijd", "GYT": "Guyaanse tijd", "BT": "Bhutaanse tijd", "JST": "Japanse standaardtijd", "ARST": "Argentijnse zomertijd", "HNT": "Newfoundland-standaardtijd", "ACST": "Midden-Australische standaardtijd", "VET": "Venezolaanse tijd", "HAST": "Hawaii-Aleoetische standaardtijd", "CLT": "Chileense standaardtijd", "EAT": "Oost-Afrikaanse tijd", "HKT": "Hongkongse standaardtijd", "ART": "Argentijnse standaardtijd", "SAST": "Zuid-Afrikaanse tijd", "WAT": "West-Afrikaanse standaardtijd", "AEDT": "Oost-Australische zomertijd", "LHST": "Lord Howe-eilandse standaardtijd", "MST": "Macause standaardtijd", "COST": "Colombiaanse zomertijd", "AEST": "Oost-Australische standaardtijd", "AWST": "West-Australische standaardtijd", "JDT": "Japanse zomertijd", "EST": "Eastern-standaardtijd", "PST": "Pacific-standaardtijd", "MESZ": "Midden-Europese zomertijd", "LHDT": "Lord Howe-eilandse zomertijd", "UYT": "Uruguayaanse standaardtijd", "AWDT": "West-Australische zomertijd", "SRT": "Surinaamse tijd", "GFT": "Frans-Guyaanse tijd", "AKDT": "Alaska-zomertijd", "SGT": "Singaporese standaardtijd", "WARST": "West-Argentijnse zomertijd", "ACWST": "Midden-Australische westelijke standaardtijd", "HAT": "Newfoundland-zomertijd", "COT": "Colombiaanse standaardtijd", "WIT": "Oost-Indonesische tijd", "CST": "Central-standaardtijd"},
}
}
diff --git a/nl_SX/nl_SX_test.go b/nl_SX/nl_SX_test.go
new file mode 100644
index 00000000..a84896c5
--- /dev/null
+++ b/nl_SX/nl_SX_test.go
@@ -0,0 +1,1120 @@
+package nl_SX
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "nl_SX"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/nmg/nmg.go b/nmg/nmg.go
index 2da48011..367d5ad0 100644
--- a/nmg/nmg.go
+++ b/nmg/nmg.go
@@ -64,7 +64,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BL", "PB"},
erasNarrow: []string{"", ""},
erasWide: []string{"Bó Lahlɛ̄", "Pfiɛ Burī"},
- timezones: map[string]string{"AEST": "AEST", "CHADT": "CHADT", "WIB": "WIB", "CST": "CST", "MEZ": "MEZ", "AEDT": "AEDT", "ECT": "ECT", "CAT": "CAT", "SAST": "SAST", "GFT": "GFT", "SGT": "SGT", "HNT": "HNT", "WITA": "WITA", "LHST": "LHST", "JDT": "JDT", "NZST": "NZST", "EDT": "EDT", "HKT": "HKT", "WAT": "WAT", "WIT": "WIT", "LHDT": "LHDT", "CLST": "CLST", "WESZ": "WESZ", "EST": "EST", "GMT": "GMT", "HAT": "HAT", "COST": "COST", "HAST": "HAST", "ART": "ART", "TMT": "TMT", "TMST": "TMST", "BOT": "BOT", "CDT": "CDT", "WART": "WART", "WARST": "WARST", "AKST": "AKST", "CHAST": "CHAST", "ACWDT": "ACWDT", "ADT": "ADT", "GYT": "GYT", "MYT": "MYT", "VET": "VET", "COT": "COT", "∅∅∅": "∅∅∅", "SRT": "SRT", "UYT": "UYT", "MESZ": "MESZ", "AKDT": "AKDT", "PST": "PST", "ACWST": "ACWST", "HKST": "HKST", "OEZ": "OEZ", "ChST": "ChST", "ACST": "ACST", "MST": "MST", "UYST": "UYST", "WEZ": "WEZ", "OESZ": "OESZ", "JST": "JST", "MDT": "MDT", "AWDT": "AWDT", "PDT": "PDT", "BT": "BT", "EAT": "EAT", "ACDT": "ACDT", "HADT": "HADT", "WAST": "WAST", "IST": "IST", "ARST": "ARST", "AWST": "AWST", "AST": "AST", "NZDT": "NZDT", "CLT": "CLT"},
+ timezones: map[string]string{"NZST": "NZST", "WART": "WART", "BOT": "BOT", "∅∅∅": "∅∅∅", "WAT": "WAT", "WESZ": "WESZ", "LHST": "LHST", "GFT": "GFT", "CHAST": "CHAST", "CAT": "CAT", "WAST": "WAST", "COT": "COT", "AEST": "AEST", "GYT": "GYT", "ACST": "ACST", "HKT": "HKT", "MESZ": "MESZ", "ChST": "ChST", "ECT": "ECT", "JST": "JST", "SGT": "SGT", "OESZ": "OESZ", "SRT": "SRT", "ACWST": "ACWST", "ACWDT": "ACWDT", "ART": "ART", "EDT": "EDT", "PDT": "PDT", "UYST": "UYST", "HKST": "HKST", "AST": "AST", "UYT": "UYT", "CLT": "CLT", "NZDT": "NZDT", "HADT": "HADT", "OEZ": "OEZ", "MDT": "MDT", "WARST": "WARST", "AKDT": "AKDT", "AWDT": "AWDT", "ARST": "ARST", "COST": "COST", "MST": "MST", "ACDT": "ACDT", "AKST": "AKST", "PST": "PST", "WIB": "WIB", "TMT": "TMT", "HAT": "HAT", "LHDT": "LHDT", "CDT": "CDT", "SAST": "SAST", "IST": "IST", "GMT": "GMT", "AWST": "AWST", "MEZ": "MEZ", "TMST": "TMST", "VET": "VET", "WEZ": "WEZ", "WIT": "WIT", "EAT": "EAT", "MYT": "MYT", "EST": "EST", "HAST": "HAST", "HNT": "HNT", "AEDT": "AEDT", "BT": "BT", "CST": "CST", "JDT": "JDT", "ADT": "ADT", "CLST": "CLST", "CHADT": "CHADT", "WITA": "WITA"},
}
}
@@ -120,7 +120,7 @@ func (nmg *nmg) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (nmg *nmg) MonthsNarrow() []string {
- return nmg.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/nmg/nmg_test.go b/nmg/nmg_test.go
new file mode 100644
index 00000000..4b830745
--- /dev/null
+++ b/nmg/nmg_test.go
@@ -0,0 +1,1120 @@
+package nmg
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "nmg"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/nmg_CM/nmg_CM.go b/nmg_CM/nmg_CM.go
index 575b8c09..cc49268a 100644
--- a/nmg_CM/nmg_CM.go
+++ b/nmg_CM/nmg_CM.go
@@ -64,7 +64,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BL", "PB"},
erasNarrow: []string{"", ""},
erasWide: []string{"Bó Lahlɛ̄", "Pfiɛ Burī"},
- timezones: map[string]string{"ACDT": "ACDT", "LHDT": "LHDT", "UYST": "UYST", "ACWDT": "ACWDT", "AEST": "AEST", "VET": "VET", "WEZ": "WEZ", "ART": "ART", "SAST": "SAST", "AKST": "AKST", "BOT": "BOT", "HAT": "HAT", "NZST": "NZST", "MST": "MST", "ACST": "ACST", "MYT": "MYT", "CST": "CST", "WESZ": "WESZ", "CAT": "CAT", "HKST": "HKST", "OESZ": "OESZ", "TMT": "TMT", "AKDT": "AKDT", "CHAST": "CHAST", "COT": "COT", "AST": "AST", "GYT": "GYT", "SGT": "SGT", "WITA": "WITA", "TMST": "TMST", "AWST": "AWST", "MEZ": "MEZ", "HKT": "HKT", "WART": "WART", "GMT": "GMT", "WIT": "WIT", "∅∅∅": "∅∅∅", "PDT": "PDT", "LHST": "LHST", "BT": "BT", "HNT": "HNT", "ARST": "ARST", "MESZ": "MESZ", "UYT": "UYT", "CHADT": "CHADT", "SRT": "SRT", "ChST": "ChST", "CLST": "CLST", "HADT": "HADT", "WAT": "WAT", "WAST": "WAST", "GFT": "GFT", "JDT": "JDT", "COST": "COST", "ECT": "ECT", "OEZ": "OEZ", "WIB": "WIB", "IST": "IST", "EAT": "EAT", "PST": "PST", "JST": "JST", "EDT": "EDT", "HAST": "HAST", "WARST": "WARST", "MDT": "MDT", "CDT": "CDT", "ACWST": "ACWST", "CLT": "CLT", "EST": "EST", "ADT": "ADT", "AWDT": "AWDT", "NZDT": "NZDT", "AEDT": "AEDT"},
+ timezones: map[string]string{"CLST": "CLST", "HKST": "HKST", "JST": "JST", "PST": "PST", "MESZ": "MESZ", "MST": "MST", "MYT": "MYT", "∅∅∅": "∅∅∅", "AST": "AST", "NZST": "NZST", "OEZ": "OEZ", "GMT": "GMT", "ACDT": "ACDT", "ACWST": "ACWST", "JDT": "JDT", "WAST": "WAST", "LHDT": "LHDT", "VET": "VET", "AWDT": "AWDT", "EAT": "EAT", "WART": "WART", "SRT": "SRT", "ADT": "ADT", "ACWDT": "ACWDT", "EST": "EST", "AEDT": "AEDT", "ChST": "ChST", "AWST": "AWST", "WEZ": "WEZ", "WIB": "WIB", "WAT": "WAT", "SGT": "SGT", "MDT": "MDT", "CHADT": "CHADT", "ECT": "ECT", "IST": "IST", "MEZ": "MEZ", "CAT": "CAT", "HKT": "HKT", "AKDT": "AKDT", "COT": "COT", "TMT": "TMT", "AEST": "AEST", "AKST": "AKST", "WITA": "WITA", "PDT": "PDT", "OESZ": "OESZ", "GYT": "GYT", "LHST": "LHST", "UYT": "UYT", "ACST": "ACST", "CHAST": "CHAST", "NZDT": "NZDT", "WARST": "WARST", "GFT": "GFT", "HAST": "HAST", "HNT": "HNT", "WIT": "WIT", "ART": "ART", "SAST": "SAST", "HADT": "HADT", "TMST": "TMST", "CST": "CST", "BOT": "BOT", "WESZ": "WESZ", "COST": "COST", "UYST": "UYST", "CDT": "CDT", "ARST": "ARST", "EDT": "EDT", "BT": "BT", "CLT": "CLT", "HAT": "HAT"},
}
}
@@ -120,7 +120,7 @@ func (nmg *nmg_CM) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (nmg *nmg_CM) MonthsNarrow() []string {
- return nmg.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/nmg_CM/nmg_CM_test.go b/nmg_CM/nmg_CM_test.go
new file mode 100644
index 00000000..61ebc1d5
--- /dev/null
+++ b/nmg_CM/nmg_CM_test.go
@@ -0,0 +1,1120 @@
+package nmg_CM
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "nmg_CM"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/nn/nn.go b/nn/nn.go
index 7ba2d768..484cef1e 100644
--- a/nn/nn.go
+++ b/nn/nn.go
@@ -72,7 +72,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"f.Kr.", "e.Kr."},
erasNarrow: []string{"f.Kr.", "e.Kr."},
erasWide: []string{"f.Kr.", "e.Kr."},
- timezones: map[string]string{"UYST": "UYST", "EDT": "EDT", "ECT": "ECT", "WART": "WART", "MDT": "MDT", "LHST": "LHST", "NZDT": "NZDT", "OESZ": "austeuropeisk sommartid", "MST": "MST", "ART": "ART", "PDT": "PDT", "GYT": "GYT", "CDT": "CDT", "WAST": "vestafrikansk sommartid", "AWDT": "vestaustralsk sommartid", "MESZ": "sentraleuropeisk sommartid", "CLT": "CLT", "CHADT": "CHADT", "HKT": "HKT", "SRT": "SRT", "CLST": "CLST", "TMST": "TMST", "UYT": "UYT", "EST": "EST", "WAT": "vestafrikansk standardtid", "BT": "BT", "WIB": "WIB", "GFT": "GFT", "ACST": "sentralaustralsk standardtid", "ACWDT": "vest-sentralaustralsk sommartid", "JDT": "JDT", "AWST": "vestaustralsk standardtid", "HKST": "HKST", "WARST": "WARST", "IST": "IST", "WITA": "WITA", "COST": "COST", "WIT": "WIT", "PST": "PST", "ACWST": "vest-sentralaustralsk standardtid", "ChST": "ChST", "CHAST": "CHAST", "HNT": "HNT", "HAT": "HAT", "EAT": "austafrikansk tid", "MYT": "MYT", "WESZ": "vesteuropeisk sommartid", "CAT": "sentralafrikansk tid", "∅∅∅": "∅∅∅", "WEZ": "vesteuropeisk standardtid", "AEST": "austaustralsk standardtid", "AEDT": "austaustralsk sommartid", "OEZ": "austeuropeisk standardtid", "AKST": "AKST", "CST": "CST", "MEZ": "sentraleuropeisk standardtid", "BOT": "BOT", "VET": "VET", "TMT": "TMT", "JST": "JST", "COT": "COT", "AST": "AST", "HAST": "HAST", "SAST": "sørafrikansk tid", "ACDT": "sentralaustralsk sommartid", "ARST": "ARST", "HADT": "HADT", "SGT": "SGT", "AKDT": "AKDT", "LHDT": "LHDT", "NZST": "NZST", "ADT": "ADT", "GMT": "greenwich middeltid"},
+ timezones: map[string]string{"BT": "BT", "CST": "CST", "WARST": "WARST", "CDT": "CDT", "ACST": "sentralaustralsk standardtid", "ECT": "ECT", "JDT": "JDT", "NZST": "NZST", "TMT": "TMT", "TMST": "TMST", "MDT": "MDT", "AKST": "AKST", "NZDT": "NZDT", "HNT": "HNT", "UYST": "UYST", "CAT": "sentralafrikansk tid", "WITA": "WITA", "ACWST": "vest-sentralaustralsk standardtid", "PDT": "PDT", "SAST": "sørafrikansk tid", "WIB": "WIB", "CHADT": "CHADT", "ARST": "ARST", "CLT": "CLT", "UYT": "UYT", "HKST": "HKST", "EST": "EST", "SGT": "SGT", "WEZ": "vesteuropeisk standardtid", "GFT": "GFT", "PST": "PST", "MESZ": "sentraleuropeisk sommartid", "HAT": "HAT", "GYT": "GYT", "SRT": "SRT", "CHAST": "CHAST", "JST": "JST", "EAT": "austafrikansk tid", "ACDT": "sentralaustralsk sommartid", "ACWDT": "vest-sentralaustralsk sommartid", "MEZ": "sentraleuropeisk standardtid", "COST": "COST", "WAT": "vestafrikansk standardtid", "OEZ": "austeuropeisk standardtid", "VET": "VET", "ART": "ART", "ADT": "ADT", "OESZ": "austeuropeisk sommartid", "WART": "WART", "LHDT": "LHDT", "∅∅∅": "∅∅∅", "HAST": "HAST", "WAST": "vestafrikansk sommartid", "WESZ": "vesteuropeisk sommartid", "WIT": "WIT", "MST": "MST", "HKT": "HKT", "IST": "IST", "MYT": "MYT", "AWST": "vestaustralsk standardtid", "ChST": "ChST", "AEDT": "austaustralsk sommartid", "LHST": "LHST", "HADT": "HADT", "BOT": "BOT", "COT": "COT", "GMT": "greenwich middeltid", "AEST": "austaustralsk standardtid", "AWDT": "vestaustralsk sommartid", "AKDT": "AKDT", "AST": "AST", "EDT": "EDT", "CLST": "CLST"},
}
}
diff --git a/nn/nn_test.go b/nn/nn_test.go
new file mode 100644
index 00000000..2f7d74e3
--- /dev/null
+++ b/nn/nn_test.go
@@ -0,0 +1,1120 @@
+package nn
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "nn"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/nn_NO/nn_NO.go b/nn_NO/nn_NO.go
index f34bf496..2085fb6d 100644
--- a/nn_NO/nn_NO.go
+++ b/nn_NO/nn_NO.go
@@ -72,7 +72,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"f.Kr.", "e.Kr."},
erasNarrow: []string{"f.Kr.", "e.Kr."},
erasWide: []string{"f.Kr.", "e.Kr."},
- timezones: map[string]string{"IST": "IST", "ACST": "sentralaustralsk standardtid", "CST": "CST", "HKST": "HKST", "WIB": "WIB", "PST": "PST", "MYT": "MYT", "ACWDT": "vest-sentralaustralsk sommartid", "COST": "COST", "WAT": "vestafrikansk standardtid", "ACDT": "sentralaustralsk sommartid", "BOT": "BOT", "AEDT": "austaustralsk sommartid", "ARST": "ARST", "TMST": "TMST", "NZDT": "NZDT", "ChST": "ChST", "MDT": "MDT", "ART": "ART", "ACWST": "vest-sentralaustralsk standardtid", "CLST": "CLST", "EST": "EST", "BT": "BT", "LHDT": "LHDT", "SRT": "SRT", "MESZ": "sentraleuropeisk sommartid", "UYST": "UYST", "CDT": "CDT", "SGT": "SGT", "OESZ": "austeuropeisk sommartid", "PDT": "PDT", "GYT": "GYT", "AKDT": "AKDT", "VET": "VET", "WEZ": "vesteuropeisk standardtid", "CAT": "sentralafrikansk tid", "GMT": "greenwich middeltid", "GFT": "GFT", "WAST": "vestafrikansk sommartid", "WART": "WART", "WITA": "WITA", "EAT": "austafrikansk tid", "MEZ": "sentraleuropeisk standardtid", "AEST": "austaustralsk standardtid", "CHADT": "CHADT", "COT": "COT", "ADT": "ADT", "UYT": "UYT", "CHAST": "CHAST", "WESZ": "vesteuropeisk sommartid", "MST": "MST", "∅∅∅": "∅∅∅", "LHST": "LHST", "EDT": "EDT", "HNT": "HNT", "JDT": "JDT", "CLT": "CLT", "HADT": "HADT", "AST": "AST", "AWST": "vestaustralsk standardtid", "OEZ": "austeuropeisk standardtid", "HAT": "HAT", "JST": "JST", "AKST": "AKST", "ECT": "ECT", "HAST": "HAST", "WIT": "WIT", "TMT": "TMT", "AWDT": "vestaustralsk sommartid", "NZST": "NZST", "HKT": "HKT", "WARST": "WARST", "SAST": "sørafrikansk tid"},
+ timezones: map[string]string{"CLT": "CLT", "UYST": "UYST", "ACDT": "sentralaustralsk sommartid", "IST": "IST", "CAT": "sentralafrikansk tid", "MYT": "MYT", "WARST": "WARST", "VET": "VET", "AWDT": "vestaustralsk sommartid", "EDT": "EDT", "∅∅∅": "∅∅∅", "TMST": "TMST", "WAT": "vestafrikansk standardtid", "WIB": "WIB", "EAT": "austafrikansk tid", "ADT": "ADT", "SAST": "sørafrikansk tid", "OESZ": "austeuropeisk sommartid", "GYT": "GYT", "UYT": "UYT", "HKT": "HKT", "ACWDT": "vest-sentralaustralsk sommartid", "ARST": "ARST", "PDT": "PDT", "COT": "COT", "AST": "AST", "NZDT": "NZDT", "AEST": "austaustralsk standardtid", "CST": "CST", "SRT": "SRT", "AKST": "AKST", "AKDT": "AKDT", "CDT": "CDT", "TMT": "TMT", "COST": "COST", "AEDT": "austaustralsk sommartid", "ChST": "ChST", "BT": "BT", "LHST": "LHST", "CLST": "CLST", "MEZ": "sentraleuropeisk standardtid", "MESZ": "sentraleuropeisk sommartid", "HAST": "HAST", "NZST": "NZST", "HAT": "HAT", "CHAST": "CHAST", "JST": "JST", "HADT": "HADT", "WESZ": "vesteuropeisk sommartid", "OEZ": "austeuropeisk standardtid", "CHADT": "CHADT", "ECT": "ECT", "ART": "ART", "WITA": "WITA", "EST": "EST", "WEZ": "vesteuropeisk standardtid", "HNT": "HNT", "MST": "MST", "GFT": "GFT", "JDT": "JDT", "SGT": "SGT", "GMT": "greenwich middeltid", "WIT": "WIT", "ACST": "sentralaustralsk standardtid", "HKST": "HKST", "ACWST": "vest-sentralaustralsk standardtid", "AWST": "vestaustralsk standardtid", "BOT": "BOT", "PST": "PST", "WART": "WART", "WAST": "vestafrikansk sommartid", "MDT": "MDT", "LHDT": "LHDT"},
}
}
diff --git a/nn_NO/nn_NO_test.go b/nn_NO/nn_NO_test.go
new file mode 100644
index 00000000..15cf9522
--- /dev/null
+++ b/nn_NO/nn_NO_test.go
@@ -0,0 +1,1120 @@
+package nn_NO
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "nn_NO"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/nnh/nnh.go b/nnh/nnh.go
index b944e733..b8012875 100644
--- a/nnh/nnh.go
+++ b/nnh/nnh.go
@@ -65,7 +65,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"m.z.Y.", "m.g.n.Y."},
erasNarrow: []string{"", ""},
erasWide: []string{"mé zyé Yěsô", "mé gÿo ńzyé Yěsô"},
- timezones: map[string]string{"UYT": "UYT", "ACWST": "ACWST", "COT": "COT", "HAST": "HAST", "TMST": "TMST", "GYT": "GYT", "AEST": "AEST", "HADT": "HADT", "OEZ": "OEZ", "MST": "MST", "CST": "CST", "MEZ": "MEZ", "MYT": "MYT", "AKDT": "AKDT", "AEDT": "AEDT", "CAT": "CAT", "WART": "WART", "WARST": "WARST", "EAT": "EAT", "ART": "ART", "ECT": "ECT", "NZST": "NZST", "NZDT": "NZDT", "VET": "VET", "WIT": "WIT", "IST": "IST", "JST": "JST", "LHST": "LHST", "AWST": "AWST", "CHAST": "CHAST", "BT": "BT", "ACST": "ACST", "ARST": "ARST", "SRT": "SRT", "BOT": "BOT", "OESZ": "OESZ", "HAT": "HAT", "∅∅∅": "∅∅∅", "TMT": "TMT", "WAST": "WAST", "AKST": "AKST", "LHDT": "LHDT", "ACWDT": "ACWDT", "JDT": "JDT", "ChST": "ChST", "ADT": "ADT", "SGT": "SGT", "WAT": "WAT", "UYST": "UYST", "EDT": "EDT", "EST": "EST", "GFT": "GFT", "AWDT": "AWDT", "MESZ": "MESZ", "CLT": "CLT", "PDT": "PDT", "CLST": "CLST", "COST": "COST", "SAST": "SAST", "HKST": "HKST", "WITA": "WITA", "PST": "PST", "HKT": "HKT", "HNT": "HNT", "ACDT": "ACDT", "CHADT": "CHADT", "WIB": "WIB", "GMT": "GMT", "CDT": "CDT", "MDT": "MDT", "WEZ": "WEZ", "WESZ": "WESZ", "AST": "AST"},
+ timezones: map[string]string{"AKST": "AKST", "EDT": "EDT", "SGT": "SGT", "WAT": "WAT", "CLT": "CLT", "WIT": "WIT", "ECT": "ECT", "JST": "JST", "HKST": "HKST", "CHAST": "CHAST", "SAST": "SAST", "HAT": "HAT", "ChST": "ChST", "MST": "MST", "WART": "WART", "AKDT": "AKDT", "HADT": "HADT", "ADT": "ADT", "ACWDT": "ACWDT", "WIB": "WIB", "CST": "CST", "CHADT": "CHADT", "AEDT": "AEDT", "GFT": "GFT", "TMT": "TMT", "WEZ": "WEZ", "HNT": "HNT", "ART": "ART", "AWDT": "AWDT", "MEZ": "MEZ", "MESZ": "MESZ", "MYT": "MYT", "LHST": "LHST", "WARST": "WARST", "HKT": "HKT", "GYT": "GYT", "COST": "COST", "EAT": "EAT", "MDT": "MDT", "∅∅∅": "∅∅∅", "ACWST": "ACWST", "CLST": "CLST", "CDT": "CDT", "PST": "PST", "AST": "AST", "PDT": "PDT", "COT": "COT", "GMT": "GMT", "HAST": "HAST", "EST": "EST", "CAT": "CAT", "AEST": "AEST", "UYT": "UYT", "LHDT": "LHDT", "NZST": "NZST", "WAST": "WAST", "JDT": "JDT", "BOT": "BOT", "TMST": "TMST", "OEZ": "OEZ", "ACST": "ACST", "ACDT": "ACDT", "VET": "VET", "WITA": "WITA", "OESZ": "OESZ", "BT": "BT", "ARST": "ARST", "AWST": "AWST", "IST": "IST", "UYST": "UYST", "SRT": "SRT", "NZDT": "NZDT", "WESZ": "WESZ"},
}
}
@@ -128,7 +128,7 @@ func (nnh *nnh) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (nnh *nnh) MonthsNarrow() []string {
- return nnh.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/nnh/nnh_test.go b/nnh/nnh_test.go
new file mode 100644
index 00000000..ca05ac53
--- /dev/null
+++ b/nnh/nnh_test.go
@@ -0,0 +1,1120 @@
+package nnh
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "nnh"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/nnh_CM/nnh_CM.go b/nnh_CM/nnh_CM.go
index df66a23b..7bf5f145 100644
--- a/nnh_CM/nnh_CM.go
+++ b/nnh_CM/nnh_CM.go
@@ -65,7 +65,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"m.z.Y.", "m.g.n.Y."},
erasNarrow: []string{"", ""},
erasWide: []string{"mé zyé Yěsô", "mé gÿo ńzyé Yěsô"},
- timezones: map[string]string{"EST": "EST", "CST": "CST", "AEST": "AEST", "ADT": "ADT", "JDT": "JDT", "NZDT": "NZDT", "CLT": "CLT", "HAT": "HAT", "ART": "ART", "MYT": "MYT", "AST": "AST", "WIT": "WIT", "AWST": "AWST", "ACWDT": "ACWDT", "ECT": "ECT", "HKT": "HKT", "GFT": "GFT", "EAT": "EAT", "PST": "PST", "WESZ": "WESZ", "WAST": "WAST", "HKST": "HKST", "GMT": "GMT", "CDT": "CDT", "CHAST": "CHAST", "SAST": "SAST", "JST": "JST", "PDT": "PDT", "NZST": "NZST", "WEZ": "WEZ", "WIB": "WIB", "ACST": "ACST", "ACDT": "ACDT", "TMST": "TMST", "WARST": "WARST", "OESZ": "OESZ", "MEZ": "MEZ", "CLST": "CLST", "MDT": "MDT", "CAT": "CAT", "COT": "COT", "HAST": "HAST", "ChST": "ChST", "CHADT": "CHADT", "HADT": "HADT", "AWDT": "AWDT", "LHST": "LHST", "LHDT": "LHDT", "AEDT": "AEDT", "∅∅∅": "∅∅∅", "AKST": "AKST", "MESZ": "MESZ", "VET": "VET", "SGT": "SGT", "BT": "BT", "OEZ": "OEZ", "WITA": "WITA", "UYST": "UYST", "ACWST": "ACWST", "IST": "IST", "SRT": "SRT", "AKDT": "AKDT", "MST": "MST", "COST": "COST", "WART": "WART", "BOT": "BOT", "EDT": "EDT", "WAT": "WAT", "ARST": "ARST", "GYT": "GYT", "UYT": "UYT", "HNT": "HNT", "TMT": "TMT"},
+ timezones: map[string]string{"JST": "JST", "GYT": "GYT", "CDT": "CDT", "ACDT": "ACDT", "MDT": "MDT", "AWDT": "AWDT", "SAST": "SAST", "PST": "PST", "NZDT": "NZDT", "CHAST": "CHAST", "ECT": "ECT", "ADT": "ADT", "WEZ": "WEZ", "LHST": "LHST", "CST": "CST", "HKST": "HKST", "CHADT": "CHADT", "ACWST": "ACWST", "TMT": "TMT", "OESZ": "OESZ", "CLT": "CLT", "CLST": "CLST", "WARST": "WARST", "ART": "ART", "WITA": "WITA", "COT": "COT", "∅∅∅": "∅∅∅", "AKST": "AKST", "ARST": "ARST", "WIB": "WIB", "AEDT": "AEDT", "UYST": "UYST", "GFT": "GFT", "AWST": "AWST", "BT": "BT", "LHDT": "LHDT", "UYT": "UYT", "MEZ": "MEZ", "MYT": "MYT", "IST": "IST", "WESZ": "WESZ", "ChST": "ChST", "TMST": "TMST", "EAT": "EAT", "BOT": "BOT", "PDT": "PDT", "SGT": "SGT", "GMT": "GMT", "MST": "MST", "AKDT": "AKDT", "ACWDT": "ACWDT", "ACST": "ACST", "HKT": "HKT", "AST": "AST", "JDT": "JDT", "HAST": "HAST", "HADT": "HADT", "WAT": "WAT", "OEZ": "OEZ", "NZST": "NZST", "WAST": "WAST", "HAT": "HAT", "COST": "COST", "EDT": "EDT", "MESZ": "MESZ", "SRT": "SRT", "VET": "VET", "EST": "EST", "CAT": "CAT", "HNT": "HNT", "AEST": "AEST", "WIT": "WIT", "WART": "WART"},
}
}
@@ -128,7 +128,7 @@ func (nnh *nnh_CM) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (nnh *nnh_CM) MonthsNarrow() []string {
- return nnh.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/nnh_CM/nnh_CM_test.go b/nnh_CM/nnh_CM_test.go
new file mode 100644
index 00000000..58d4d94d
--- /dev/null
+++ b/nnh_CM/nnh_CM_test.go
@@ -0,0 +1,1120 @@
+package nnh_CM
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "nnh_CM"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/nus/nus.go b/nus/nus.go
index dbc563ab..91c8748b 100644
--- a/nus/nus.go
+++ b/nus/nus.go
@@ -65,7 +65,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"AY", "ƐY"},
erasNarrow: []string{"", ""},
erasWide: []string{"A ka̱n Yecu ni dap", "Ɛ ca Yecu dap"},
- timezones: map[string]string{"JST": "JST", "ACWST": "ACWST", "AST": "AST", "WITA": "WITA", "MYT": "MYT", "CDT": "CDT", "UYT": "UYT", "HKST": "HKST", "JDT": "JDT", "LHST": "LHST", "PDT": "PDT", "LHDT": "LHDT", "MESZ": "MESZ", "NZST": "NZST", "WART": "WART", "SRT": "SRT", "AKST": "AKST", "ChST": "ChST", "EST": "EST", "WAT": "WAT", "ACWDT": "ACWDT", "ARST": "ARST", "CST": "CST", "UYST": "UYST", "CLT": "CLT", "WESZ": "WESZ", "WARST": "WARST", "WIB": "WIB", "OEZ": "OEZ", "AEST": "AEST", "TMST": "TMST", "NZDT": "NZDT", "CHAST": "CHAST", "OESZ": "OESZ", "HNT": "HNT", "MEZ": "MEZ", "HAST": "HAST", "HKT": "HKT", "WIT": "WIT", "AKDT": "AKDT", "AWST": "AWST", "GYT": "GYT", "COT": "COT", "IST": "IST", "ACST": "ACST", "HAT": "HAT", "CLST": "CLST", "AWDT": "AWDT", "SAST": "SAST", "EAT": "EAT", "PST": "PST", "ACDT": "ACDT", "ART": "ART", "BOT": "BOT", "CAT": "CAT", "COST": "COST", "BT": "BT", "WAST": "WAST", "CHADT": "CHADT", "HADT": "HADT", "SGT": "SGT", "AEDT": "AEDT", "ADT": "ADT", "MST": "MST", "WEZ": "WEZ", "VET": "VET", "∅∅∅": "∅∅∅", "GFT": "GFT", "MDT": "MDT", "TMT": "TMT", "EDT": "EDT", "ECT": "ECT", "GMT": "GMT"},
+ timezones: map[string]string{"NZDT": "NZDT", "WAT": "WAT", "WEZ": "WEZ", "GYT": "GYT", "BT": "BT", "ACWDT": "ACWDT", "UYST": "UYST", "WAST": "WAST", "TMT": "TMT", "OEZ": "OEZ", "EAT": "EAT", "AKST": "AKST", "AKDT": "AKDT", "WITA": "WITA", "SGT": "SGT", "WART": "WART", "AST": "AST", "AWDT": "AWDT", "PST": "PST", "MDT": "MDT", "MYT": "MYT", "UYT": "UYT", "ACST": "ACST", "HADT": "HADT", "WIB": "WIB", "AEDT": "AEDT", "LHDT": "LHDT", "WIT": "WIT", "HKT": "HKT", "CST": "CST", "JDT": "JDT", "∅∅∅": "∅∅∅", "TMST": "TMST", "MST": "MST", "CHAST": "CHAST", "CHADT": "CHADT", "CAT": "CAT", "COT": "COT", "COST": "COST", "HKST": "HKST", "ART": "ART", "MEZ": "MEZ", "NZST": "NZST", "CLT": "CLT", "CLST": "CLST", "WARST": "WARST", "ADT": "ADT", "JST": "JST", "SAST": "SAST", "MESZ": "MESZ", "HNT": "HNT", "OESZ": "OESZ", "SRT": "SRT", "VET": "VET", "ACWST": "ACWST", "EST": "EST", "EDT": "EDT", "PDT": "PDT", "WESZ": "WESZ", "AEST": "AEST", "AWST": "AWST", "BOT": "BOT", "HAT": "HAT", "ChST": "ChST", "LHST": "LHST", "HAST": "HAST", "GMT": "GMT", "CDT": "CDT", "ACDT": "ACDT", "IST": "IST", "GFT": "GFT", "ECT": "ECT", "ARST": "ARST"},
}
}
diff --git a/nus/nus_test.go b/nus/nus_test.go
new file mode 100644
index 00000000..327437e1
--- /dev/null
+++ b/nus/nus_test.go
@@ -0,0 +1,1120 @@
+package nus
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "nus"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/nus_SS/nus_SS.go b/nus_SS/nus_SS.go
index a773853b..a9b08a28 100644
--- a/nus_SS/nus_SS.go
+++ b/nus_SS/nus_SS.go
@@ -65,7 +65,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"AY", "ƐY"},
erasNarrow: []string{"", ""},
erasWide: []string{"A ka̱n Yecu ni dap", "Ɛ ca Yecu dap"},
- timezones: map[string]string{"ACWST": "ACWST", "ECT": "ECT", "WAT": "WAT", "WAST": "WAST", "CHAST": "CHAST", "CHADT": "CHADT", "EDT": "EDT", "EAT": "EAT", "PDT": "PDT", "BOT": "BOT", "HAST": "HAST", "ARST": "ARST", "LHST": "LHST", "LHDT": "LHDT", "GYT": "GYT", "COT": "COT", "SRT": "SRT", "AKST": "AKST", "AWST": "AWST", "MEZ": "MEZ", "HKT": "HKT", "HNT": "HNT", "GMT": "GMT", "ART": "ART", "JDT": "JDT", "WART": "WART", "GFT": "GFT", "TMT": "TMT", "ChST": "ChST", "CLST": "CLST", "AEDT": "AEDT", "WIB": "WIB", "ACST": "ACST", "MYT": "MYT", "∅∅∅": "∅∅∅", "ADT": "ADT", "IST": "IST", "OEZ": "OEZ", "OESZ": "OESZ", "CST": "CST", "NZDT": "NZDT", "CLT": "CLT", "VET": "VET", "SAST": "SAST", "PST": "PST", "UYST": "UYST", "HADT": "HADT", "WITA": "WITA", "WIT": "WIT", "TMST": "TMST", "UYT": "UYT", "AST": "AST", "WARST": "WARST", "JST": "JST", "CDT": "CDT", "WESZ": "WESZ", "ACWDT": "ACWDT", "HKST": "HKST", "HAT": "HAT", "AKDT": "AKDT", "MST": "MST", "AEST": "AEST", "COST": "COST", "SGT": "SGT", "ACDT": "ACDT", "BT": "BT", "NZST": "NZST", "MESZ": "MESZ", "MDT": "MDT", "WEZ": "WEZ", "CAT": "CAT", "EST": "EST", "AWDT": "AWDT"},
+ timezones: map[string]string{"AST": "AST", "PST": "PST", "CHAST": "CHAST", "ART": "ART", "WIB": "WIB", "TMT": "TMT", "WEZ": "WEZ", "WESZ": "WESZ", "CLST": "CLST", "LHST": "LHST", "CDT": "CDT", "ACDT": "ACDT", "NZDT": "NZDT", "GFT": "GFT", "HAST": "HAST", "ACST": "ACST", "JDT": "JDT", "ARST": "ARST", "WITA": "WITA", "MESZ": "MESZ", "WAST": "WAST", "UYST": "UYST", "WIT": "WIT", "∅∅∅": "∅∅∅", "MDT": "MDT", "AKST": "AKST", "PDT": "PDT", "JST": "JST", "ACWST": "ACWST", "MEZ": "MEZ", "WAT": "WAT", "HAT": "HAT", "ChST": "ChST", "SRT": "SRT", "HKT": "HKT", "ADT": "ADT", "BOT": "BOT", "IST": "IST", "CAT": "CAT", "GYT": "GYT", "OESZ": "OESZ", "CST": "CST", "ECT": "ECT", "AEST": "AEST", "CLT": "CLT", "AWDT": "AWDT", "NZST": "NZST", "EST": "EST", "EDT": "EDT", "EAT": "EAT", "LHDT": "LHDT", "VET": "VET", "CHADT": "CHADT", "HADT": "HADT", "SAST": "SAST", "UYT": "UYT", "WARST": "WARST", "MST": "MST", "SGT": "SGT", "BT": "BT", "HKST": "HKST", "AWST": "AWST", "OEZ": "OEZ", "AKDT": "AKDT", "HNT": "HNT", "AEDT": "AEDT", "ACWDT": "ACWDT", "COT": "COT", "TMST": "TMST", "GMT": "GMT", "MYT": "MYT", "WART": "WART", "COST": "COST"},
}
}
diff --git a/nus_SS/nus_SS_test.go b/nus_SS/nus_SS_test.go
new file mode 100644
index 00000000..b57b0524
--- /dev/null
+++ b/nus_SS/nus_SS_test.go
@@ -0,0 +1,1120 @@
+package nus_SS
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "nus_SS"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/nyn/nyn.go b/nyn/nyn.go
index 6d739eb9..26c83f2c 100644
--- a/nyn/nyn.go
+++ b/nyn/nyn.go
@@ -57,7 +57,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"", ""},
erasWide: []string{"Kurisito Atakaijire", "Kurisito Yaijire"},
- timezones: map[string]string{"BT": "BT", "WAST": "WAST", "JST": "JST", "CHAST": "CHAST", "∅∅∅": "∅∅∅", "MST": "MST", "NZDT": "NZDT", "CHADT": "CHADT", "AEDT": "AEDT", "ADT": "ADT", "ARST": "ARST", "MDT": "MDT", "GYT": "GYT", "AEST": "AEST", "WART": "WART", "WIT": "WIT", "CDT": "CDT", "MYT": "MYT", "UYST": "UYST", "ACWST": "ACWST", "HADT": "HADT", "HKT": "HKT", "HKST": "HKST", "GMT": "GMT", "IST": "IST", "NZST": "NZST", "CLT": "CLT", "COT": "COT", "CLST": "CLST", "EAT": "EAT", "JDT": "JDT", "PDT": "PDT", "UYT": "UYT", "AKST": "AKST", "SGT": "SGT", "TMT": "TMT", "TMST": "TMST", "AWST": "AWST", "AWDT": "AWDT", "LHDT": "LHDT", "PST": "PST", "BOT": "BOT", "WEZ": "WEZ", "SAST": "SAST", "HAT": "HAT", "WIB": "WIB", "ACDT": "ACDT", "HAST": "HAST", "WAT": "WAT", "HNT": "HNT", "AKDT": "AKDT", "ACWDT": "ACWDT", "MESZ": "MESZ", "ChST": "ChST", "CAT": "CAT", "WARST": "WARST", "GFT": "GFT", "ART": "ART", "LHST": "LHST", "ECT": "ECT", "MEZ": "MEZ", "WITA": "WITA", "WESZ": "WESZ", "AST": "AST", "OESZ": "OESZ", "ACST": "ACST", "CST": "CST", "COST": "COST", "EDT": "EDT", "OEZ": "OEZ", "SRT": "SRT", "VET": "VET", "EST": "EST"},
+ timezones: map[string]string{"CHAST": "CHAST", "CHADT": "CHADT", "JDT": "JDT", "AST": "AST", "OEZ": "OEZ", "CLT": "CLT", "∅∅∅": "∅∅∅", "ACWST": "ACWST", "WAT": "WAT", "LHST": "LHST", "LHDT": "LHDT", "PDT": "PDT", "WAST": "WAST", "GFT": "GFT", "AKDT": "AKDT", "EST": "EST", "MEZ": "MEZ", "WEZ": "WEZ", "ACST": "ACST", "SRT": "SRT", "VET": "VET", "EDT": "EDT", "PST": "PST", "HAST": "HAST", "UYST": "UYST", "WIT": "WIT", "HKT": "HKT", "AKST": "AKST", "HADT": "HADT", "COT": "COT", "OESZ": "OESZ", "ARST": "ARST", "SAST": "SAST", "WESZ": "WESZ", "GYT": "GYT", "MST": "MST", "AWDT": "AWDT", "TMT": "TMT", "AWST": "AWST", "ART": "ART", "GMT": "GMT", "ACWDT": "ACWDT", "WITA": "WITA", "MESZ": "MESZ", "COST": "COST", "UYT": "UYT", "MDT": "MDT", "HKST": "HKST", "CDT": "CDT", "NZST": "NZST", "NZDT": "NZDT", "CAT": "CAT", "ChST": "ChST", "WART": "WART", "BT": "BT", "JST": "JST", "HNT": "HNT", "SGT": "SGT", "AEST": "AEST", "AEDT": "AEDT", "CLST": "CLST", "CST": "CST", "ECT": "ECT", "WIB": "WIB", "ACDT": "ACDT", "WARST": "WARST", "ADT": "ADT", "BOT": "BOT", "IST": "IST", "TMST": "TMST", "HAT": "HAT", "EAT": "EAT", "MYT": "MYT"},
}
}
diff --git a/nyn/nyn_test.go b/nyn/nyn_test.go
new file mode 100644
index 00000000..9c77419a
--- /dev/null
+++ b/nyn/nyn_test.go
@@ -0,0 +1,1120 @@
+package nyn
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "nyn"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/nyn_UG/nyn_UG.go b/nyn_UG/nyn_UG.go
index 2a2b9665..8c47378c 100644
--- a/nyn_UG/nyn_UG.go
+++ b/nyn_UG/nyn_UG.go
@@ -57,7 +57,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"", ""},
erasWide: []string{"Kurisito Atakaijire", "Kurisito Yaijire"},
- timezones: map[string]string{"CST": "CST", "CHADT": "CHADT", "VET": "VET", "CAT": "CAT", "HAT": "HAT", "TMT": "TMT", "ACDT": "ACDT", "WAST": "WAST", "HKT": "HKT", "HKST": "HKST", "IST": "IST", "EAT": "EAT", "JDT": "JDT", "WAT": "WAT", "BT": "BT", "ARST": "ARST", "WESZ": "WESZ", "EDT": "EDT", "ChST": "ChST", "AST": "AST", "AEDT": "AEDT", "ADT": "ADT", "ACST": "ACST", "PST": "PST", "PDT": "PDT", "MESZ": "MESZ", "ACWST": "ACWST", "ACWDT": "ACWDT", "ART": "ART", "AKST": "AKST", "AWST": "AWST", "GFT": "GFT", "WEZ": "WEZ", "WITA": "WITA", "OEZ": "OEZ", "OESZ": "OESZ", "HAST": "HAST", "BOT": "BOT", "UYST": "UYST", "ECT": "ECT", "AWDT": "AWDT", "LHDT": "LHDT", "NZDT": "NZDT", "COST": "COST", "TMST": "TMST", "JST": "JST", "AKDT": "AKDT", "HADT": "HADT", "SRT": "SRT", "MEZ": "MEZ", "CLST": "CLST", "WIB": "WIB", "MDT": "MDT", "EST": "EST", "WART": "WART", "WIT": "WIT", "GMT": "GMT", "HNT": "HNT", "CLT": "CLT", "SAST": "SAST", "MST": "MST", "∅∅∅": "∅∅∅", "LHST": "LHST", "NZST": "NZST", "COT": "COT", "WARST": "WARST", "GYT": "GYT", "SGT": "SGT", "CHAST": "CHAST", "AEST": "AEST", "MYT": "MYT", "CDT": "CDT", "UYT": "UYT"},
+ timezones: map[string]string{"CAT": "CAT", "AEDT": "AEDT", "GYT": "GYT", "EST": "EST", "NZDT": "NZDT", "TMST": "TMST", "OEZ": "OEZ", "OESZ": "OESZ", "ChST": "ChST", "LHST": "LHST", "ACST": "ACST", "BOT": "BOT", "PST": "PST", "GMT": "GMT", "EDT": "EDT", "JDT": "JDT", "HAST": "HAST", "NZST": "NZST", "WAST": "WAST", "WIT": "WIT", "EAT": "EAT", "ACDT": "ACDT", "HKST": "HKST", "AKDT": "AKDT", "IST": "IST", "MESZ": "MESZ", "WART": "WART", "WESZ": "WESZ", "HNT": "HNT", "CHAST": "CHAST", "AKST": "AKST", "ADT": "ADT", "SAST": "SAST", "PDT": "PDT", "MST": "MST", "CDT": "CDT", "HKT": "HKT", "ECT": "ECT", "AST": "AST", "WEZ": "WEZ", "WAT": "WAT", "JST": "JST", "MYT": "MYT", "CLT": "CLT", "CLST": "CLST", "SRT": "SRT", "CHADT": "CHADT", "ACWST": "ACWST", "ART": "ART", "SGT": "SGT", "∅∅∅": "∅∅∅", "GFT": "GFT", "WITA": "WITA", "HAT": "HAT", "MDT": "MDT", "ARST": "ARST", "HADT": "HADT", "LHDT": "LHDT", "CST": "CST", "VET": "VET", "TMT": "TMT", "COST": "COST", "ACWDT": "ACWDT", "COT": "COT", "WIB": "WIB", "AEST": "AEST", "BT": "BT", "UYT": "UYT", "UYST": "UYST", "WARST": "WARST", "AWST": "AWST", "AWDT": "AWDT", "MEZ": "MEZ"},
}
}
diff --git a/nyn_UG/nyn_UG_test.go b/nyn_UG/nyn_UG_test.go
new file mode 100644
index 00000000..3ad50282
--- /dev/null
+++ b/nyn_UG/nyn_UG_test.go
@@ -0,0 +1,1120 @@
+package nyn_UG
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "nyn_UG"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/om/om.go b/om/om.go
index 920c2e32..5963ad4d 100644
--- a/om/om.go
+++ b/om/om.go
@@ -59,7 +59,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"KD", "KB"},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"ACWDT": "ACWDT", "EAT": "EAT", "JST": "JST", "WAT": "WAT", "BT": "BT", "HKST": "HKST", "TMST": "TMST", "COST": "COST", "SAST": "SAST", "SRT": "SRT", "UYT": "UYT", "AEST": "AEST", "CHADT": "CHADT", "HKT": "HKT", "WIT": "WIT", "IST": "IST", "GFT": "GFT", "ACDT": "ACDT", "ARST": "ARST", "AKDT": "AKDT", "VET": "VET", "WEZ": "WEZ", "ChST": "ChST", "MST": "MST", "CAT": "CAT", "EDT": "EDT", "AEDT": "AEDT", "PDT": "PDT", "MEZ": "MEZ", "NZDT": "NZDT", "CHAST": "CHAST", "EST": "EST", "WIB": "WIB", "AWDT": "AWDT", "WAST": "WAST", "ART": "ART", "PST": "PST", "CST": "CST", "CDT": "CDT", "MESZ": "MESZ", "GMT": "GMT", "MYT": "MYT", "NZST": "NZST", "ECT": "ECT", "OESZ": "OESZ", "HNT": "HNT", "ACST": "ACST", "UYST": "UYST", "CLT": "CLT", "ACWST": "ACWST", "JDT": "JDT", "BOT": "BOT", "COT": "COT", "ADT": "ADT", "LHDT": "LHDT", "WITA": "WITA", "CLST": "CLST", "AST": "AST", "HADT": "HADT", "WART": "WART", "WARST": "WARST", "TMT": "TMT", "AWST": "AWST", "LHST": "LHST", "WESZ": "WESZ", "HAST": "HAST", "SGT": "SGT", "MDT": "MDT", "∅∅∅": "∅∅∅", "OEZ": "OEZ", "HAT": "HAT", "AKST": "AKST", "GYT": "GYT"},
+ timezones: map[string]string{"GMT": "GMT", "EAT": "EAT", "BT": "BT", "GYT": "GYT", "HKST": "HKST", "EDT": "EDT", "ChST": "ChST", "HKT": "HKT", "IST": "IST", "MESZ": "MESZ", "HADT": "HADT", "WAST": "WAST", "CST": "CST", "JST": "JST", "SAST": "SAST", "EST": "EST", "MEZ": "MEZ", "HAT": "HAT", "MST": "MST", "MYT": "MYT", "WARST": "WARST", "OEZ": "OEZ", "AEST": "AEST", "LHDT": "LHDT", "ACWDT": "ACWDT", "SRT": "SRT", "AWDT": "AWDT", "NZST": "NZST", "WIB": "WIB", "WIT": "WIT", "CLST": "CLST", "JDT": "JDT", "ADT": "ADT", "BOT": "BOT", "WEZ": "WEZ", "WESZ": "WESZ", "UYST": "UYST", "MDT": "MDT", "AKST": "AKST", "AKDT": "AKDT", "ARST": "ARST", "HAST": "HAST", "CAT": "CAT", "WART": "WART", "ECT": "ECT", "NZDT": "NZDT", "COT": "COT", "AEDT": "AEDT", "ACDT": "ACDT", "LHST": "LHST", "CLT": "CLT", "VET": "VET", "ACWST": "ACWST", "WITA": "WITA", "COST": "COST", "CDT": "CDT", "ACST": "ACST", "PST": "PST", "TMST": "TMST", "∅∅∅": "∅∅∅", "CHADT": "CHADT", "AWST": "AWST", "PDT": "PDT", "TMT": "TMT", "HNT": "HNT", "SGT": "SGT", "GFT": "GFT", "AST": "AST", "WAT": "WAT", "OESZ": "OESZ", "UYT": "UYT", "CHAST": "CHAST", "ART": "ART"},
}
}
diff --git a/om/om_test.go b/om/om_test.go
new file mode 100644
index 00000000..9c1e3dce
--- /dev/null
+++ b/om/om_test.go
@@ -0,0 +1,1120 @@
+package om
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "om"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/om_ET/om_ET.go b/om_ET/om_ET.go
index 1832252f..ec8d4845 100644
--- a/om_ET/om_ET.go
+++ b/om_ET/om_ET.go
@@ -59,7 +59,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"KD", "KB"},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"COST": "COST", "SAST": "SAST", "SRT": "SRT", "PDT": "PDT", "GYT": "GYT", "UYT": "UYT", "WEZ": "WEZ", "CHADT": "CHADT", "WIB": "WIB", "HKT": "HKT", "HKST": "HKST", "HAT": "HAT", "GFT": "GFT", "TMT": "TMT", "MYT": "MYT", "AEST": "AEST", "AEDT": "AEDT", "ChST": "ChST", "CLST": "CLST", "TMST": "TMST", "LHDT": "LHDT", "VET": "VET", "WESZ": "WESZ", "AST": "AST", "MST": "MST", "AKST": "AKST", "EST": "EST", "SGT": "SGT", "HNT": "HNT", "MDT": "MDT", "ACDT": "ACDT", "LHST": "LHST", "WITA": "WITA", "AWST": "AWST", "MEZ": "MEZ", "EDT": "EDT", "WAT": "WAT", "CST": "CST", "MESZ": "MESZ", "NZST": "NZST", "CHAST": "CHAST", "HAST": "HAST", "OEZ": "OEZ", "PST": "PST", "BOT": "BOT", "UYST": "UYST", "WART": "WART", "ART": "ART", "∅∅∅": "∅∅∅", "NZDT": "NZDT", "ACWDT": "ACWDT", "ADT": "ADT", "WAST": "WAST", "ACST": "ACST", "AKDT": "AKDT", "AWDT": "AWDT", "JST": "JST", "CAT": "CAT", "JDT": "JDT", "ACWST": "ACWST", "CLT": "CLT", "HADT": "HADT", "WARST": "WARST", "GMT": "GMT", "BT": "BT", "OESZ": "OESZ", "EAT": "EAT", "CDT": "CDT", "IST": "IST", "WIT": "WIT", "ARST": "ARST", "COT": "COT", "ECT": "ECT"},
+ timezones: map[string]string{"HADT": "HADT", "COT": "COT", "MDT": "MDT", "BOT": "BOT", "AEDT": "AEDT", "HKST": "HKST", "JST": "JST", "PDT": "PDT", "HAST": "HAST", "TMST": "TMST", "HNT": "HNT", "GYT": "GYT", "CLT": "CLT", "SRT": "SRT", "SAST": "SAST", "TMT": "TMT", "WAST": "WAST", "WEZ": "WEZ", "OESZ": "OESZ", "GMT": "GMT", "WIT": "WIT", "WARST": "WARST", "WITA": "WITA", "ECT": "ECT", "ACWST": "ACWST", "PST": "PST", "NZST": "NZST", "∅∅∅": "∅∅∅", "CHADT": "CHADT", "AKST": "AKST", "HKT": "HKT", "WAT": "WAT", "UYST": "UYST", "CST": "CST", "WART": "WART", "MST": "MST", "JDT": "JDT", "EST": "EST", "EDT": "EDT", "AEST": "AEST", "ChST": "ChST", "ART": "ART", "COST": "COST", "ARST": "ARST", "CAT": "CAT", "WESZ": "WESZ", "SGT": "SGT", "LHDT": "LHDT", "UYT": "UYT", "IST": "IST", "OEZ": "OEZ", "BT": "BT", "MYT": "MYT", "GFT": "GFT", "MEZ": "MEZ", "NZDT": "NZDT", "WIB": "WIB", "CLST": "CLST", "ACST": "ACST", "CHAST": "CHAST", "AST": "AST", "MESZ": "MESZ", "ACWDT": "ACWDT", "ACDT": "ACDT", "ADT": "ADT", "AWST": "AWST", "AWDT": "AWDT", "HAT": "HAT", "EAT": "EAT", "LHST": "LHST", "CDT": "CDT", "VET": "VET", "AKDT": "AKDT"},
}
}
diff --git a/om_ET/om_ET_test.go b/om_ET/om_ET_test.go
new file mode 100644
index 00000000..f1977b80
--- /dev/null
+++ b/om_ET/om_ET_test.go
@@ -0,0 +1,1120 @@
+package om_ET
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "om_ET"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/om_KE/om_KE.go b/om_KE/om_KE.go
index 74555558..fea02407 100644
--- a/om_KE/om_KE.go
+++ b/om_KE/om_KE.go
@@ -59,7 +59,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"KD", "KB"},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"MESZ": "MESZ", "ECT": "ECT", "HAST": "HAST", "HADT": "HADT", "HNT": "HNT", "PDT": "PDT", "SGT": "SGT", "ART": "ART", "JST": "JST", "EDT": "EDT", "CST": "CST", "WART": "WART", "JDT": "JDT", "SRT": "SRT", "AKST": "AKST", "WARST": "WARST", "WIT": "WIT", "TMT": "TMT", "∅∅∅": "∅∅∅", "LHST": "LHST", "CHADT": "CHADT", "WESZ": "WESZ", "BOT": "BOT", "CDT": "CDT", "ADT": "ADT", "WAT": "WAT", "IST": "IST", "AWST": "AWST", "AEST": "AEST", "COT": "COT", "SAST": "SAST", "HAT": "HAT", "UYST": "UYST", "MEZ": "MEZ", "BT": "BT", "HKST": "HKST", "ARST": "ARST", "CLST": "CLST", "GMT": "GMT", "TMST": "TMST", "VET": "VET", "HKT": "HKT", "EAT": "EAT", "COST": "COST", "ACWST": "ACWST", "CAT": "CAT", "AST": "AST", "WITA": "WITA", "MYT": "MYT", "NZDT": "NZDT", "AEDT": "AEDT", "ChST": "ChST", "CHAST": "CHAST", "WEZ": "WEZ", "OEZ": "OEZ", "MDT": "MDT", "PST": "PST", "UYT": "UYT", "ACST": "ACST", "AWDT": "AWDT", "GYT": "GYT", "NZST": "NZST", "WIB": "WIB", "MST": "MST", "ACWDT": "ACWDT", "EST": "EST", "WAST": "WAST", "GFT": "GFT", "OESZ": "OESZ", "ACDT": "ACDT", "LHDT": "LHDT", "AKDT": "AKDT", "CLT": "CLT"},
+ timezones: map[string]string{"IST": "IST", "WESZ": "WESZ", "LHST": "LHST", "CLST": "CLST", "GFT": "GFT", "MDT": "MDT", "JST": "JST", "ACWDT": "ACWDT", "SAST": "SAST", "PST": "PST", "AEST": "AEST", "BT": "BT", "JDT": "JDT", "ADT": "ADT", "EDT": "EDT", "WIB": "WIB", "MYT": "MYT", "WARST": "WARST", "HKT": "HKT", "PDT": "PDT", "COT": "COT", "WAT": "WAT", "CHADT": "CHADT", "AST": "AST", "MEZ": "MEZ", "OESZ": "OESZ", "ACST": "ACST", "AKDT": "AKDT", "WEZ": "WEZ", "UYT": "UYT", "AWDT": "AWDT", "WITA": "WITA", "HADT": "HADT", "OEZ": "OEZ", "ChST": "ChST", "BOT": "BOT", "MESZ": "MESZ", "SRT": "SRT", "ART": "ART", "ARST": "ARST", "NZDT": "NZDT", "SGT": "SGT", "AEDT": "AEDT", "WIT": "WIT", "MST": "MST", "VET": "VET", "EST": "EST", "LHDT": "LHDT", "ACDT": "ACDT", "TMST": "TMST", "GMT": "GMT", "UYST": "UYST", "EAT": "EAT", "CLT": "CLT", "CDT": "CDT", "CHAST": "CHAST", "AKST": "AKST", "ACWST": "ACWST", "NZST": "NZST", "HNT": "HNT", "WART": "WART", "ECT": "ECT", "TMT": "TMT", "WAST": "WAST", "HAT": "HAT", "CST": "CST", "HKST": "HKST", "AWST": "AWST", "CAT": "CAT", "COST": "COST", "GYT": "GYT", "∅∅∅": "∅∅∅", "HAST": "HAST"},
}
}
diff --git a/om_KE/om_KE_test.go b/om_KE/om_KE_test.go
new file mode 100644
index 00000000..89473929
--- /dev/null
+++ b/om_KE/om_KE_test.go
@@ -0,0 +1,1120 @@
+package om_KE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "om_KE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/or/or.go b/or/or.go
index 2d24f1c8..c839ce93 100644
--- a/or/or.go
+++ b/or/or.go
@@ -63,7 +63,7 @@ func New() locales.Translator {
periodsAbbreviated: []string{"am", "pm"},
periodsNarrow: []string{"am", "pm"},
periodsWide: []string{"am", "pm"},
- timezones: map[string]string{"UYST": "UYST", "EDT": "EDT", "OEZ": "OEZ", "VET": "VET", "SGT": "SGT", "BT": "BT", "ADT": "ADT", "JST": "JST", "HKT": "HKT", "AWDT": "AWDT", "PDT": "PDT", "HAST": "HAST", "WIT": "WIT", "ARST": "ARST", "TMT": "TMT", "EAT": "EAT", "LHDT": "LHDT", "GYT": "GYT", "NZDT": "NZDT", "GFT": "GFT", "OESZ": "OESZ", "ACWST": "ACWST", "CDT": "CDT", "CLT": "CLT", "SRT": "SRT", "MESZ": "MESZ", "ChST": "ChST", "CLST": "CLST", "WEZ": "WEZ", "AST": "AST", "WAST": "WAST", "UYT": "UYT", "ECT": "ECT", "CAT": "CAT", "SAST": "SAST", "AKST": "AKST", "ACST": "ACST", "COST": "COST", "JDT": "JDT", "PST": "PST", "EST": "EST", "HADT": "HADT", "AWST": "AWST", "HNT": "HNT", "WITA": "WITA", "AKDT": "AKDT", "WESZ": "WESZ", "COT": "COT", "WAT": "WAT", "GMT": "GMT", "TMST": "TMST", "AEST": "AEST", "WARST": "WARST", "HAT": "HAT", "WIB": "WIB", "ART": "ART", "MDT": "MDT", "AEDT": "AEDT", "HKST": "HKST", "WART": "WART", "CHADT": "CHADT", "MST": "MST", "LHST": "LHST", "ACWDT": "ACWDT", "∅∅∅": "∅∅∅", "IST": "IST", "BOT": "BOT", "CST": "CST", "NZST": "NZST", "MEZ": "MEZ", "CHAST": "CHAST", "ACDT": "ACDT", "MYT": "MYT"},
+ timezones: map[string]string{"WAST": "WAST", "AST": "AST", "SGT": "SGT", "TMT": "TMT", "AEST": "AEST", "BT": "BT", "JST": "JST", "ChST": "ChST", "PST": "PST", "MDT": "MDT", "∅∅∅": "∅∅∅", "CHAST": "CHAST", "CHADT": "CHADT", "WITA": "WITA", "NZST": "NZST", "NZDT": "NZDT", "HAT": "HAT", "MST": "MST", "ECT": "ECT", "HKST": "HKST", "GYT": "GYT", "WEZ": "WEZ", "WESZ": "WESZ", "CLT": "CLT", "AWST": "AWST", "EST": "EST", "WART": "WART", "WIT": "WIT", "LHST": "LHST", "SRT": "SRT", "CST": "CST", "ART": "ART", "PDT": "PDT", "UYT": "UYT", "COT": "COT", "WIB": "WIB", "ARST": "ARST", "SAST": "SAST", "WAT": "WAT", "GMT": "GMT", "CLST": "CLST", "EAT": "EAT", "VET": "VET", "AKST": "AKST", "ACWST": "ACWST", "BOT": "BOT", "EDT": "EDT", "OESZ": "OESZ", "MYT": "MYT", "LHDT": "LHDT", "ACDT": "ACDT", "AEDT": "AEDT", "HAST": "HAST", "WARST": "WARST", "HKT": "HKT", "ADT": "ADT", "ACST": "ACST", "JDT": "JDT", "AKDT": "AKDT", "TMST": "TMST", "AWDT": "AWDT", "MESZ": "MESZ", "HNT": "HNT", "MEZ": "MEZ", "HADT": "HADT", "OEZ": "OEZ", "UYST": "UYST", "GFT": "GFT", "ACWDT": "ACWDT", "CAT": "CAT", "CDT": "CDT", "IST": "IST", "COST": "COST"},
}
}
diff --git a/or/or_test.go b/or/or_test.go
new file mode 100644
index 00000000..0d57e29d
--- /dev/null
+++ b/or/or_test.go
@@ -0,0 +1,1120 @@
+package or
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "or"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/or_IN/or_IN.go b/or_IN/or_IN.go
index 59cc8421..7e2a0ae0 100644
--- a/or_IN/or_IN.go
+++ b/or_IN/or_IN.go
@@ -63,7 +63,7 @@ func New() locales.Translator {
periodsAbbreviated: []string{"am", "pm"},
periodsNarrow: []string{"am", "pm"},
periodsWide: []string{"am", "pm"},
- timezones: map[string]string{"NZDT": "NZDT", "CHAST": "CHAST", "WESZ": "WESZ", "BT": "BT", "HAT": "HAT", "MDT": "MDT", "MYT": "MYT", "MESZ": "MESZ", "EDT": "EDT", "∅∅∅": "∅∅∅", "WITA": "WITA", "IST": "IST", "GMT": "GMT", "BOT": "BOT", "COST": "COST", "ECT": "ECT", "GFT": "GFT", "JST": "JST", "LHST": "LHST", "MEZ": "MEZ", "EST": "EST", "CAT": "CAT", "HAST": "HAST", "HADT": "HADT", "HKT": "HKT", "WART": "WART", "WIB": "WIB", "AWDT": "AWDT", "UYT": "UYT", "AEST": "AEST", "AST": "AST", "WAST": "WAST", "HNT": "HNT", "ACDT": "ACDT", "AWST": "AWST", "WARST": "WARST", "LHDT": "LHDT", "COT": "COT", "ADT": "ADT", "OEZ": "OEZ", "AKST": "AKST", "CHADT": "CHADT", "WEZ": "WEZ", "ACST": "ACST", "NZST": "NZST", "UYST": "UYST", "WAT": "WAT", "SRT": "SRT", "GYT": "GYT", "AEDT": "AEDT", "WIT": "WIT", "TMT": "TMT", "ART": "ART", "ARST": "ARST", "CDT": "CDT", "SGT": "SGT", "TMST": "TMST", "AKDT": "AKDT", "ChST": "ChST", "MST": "MST", "CLT": "CLT", "VET": "VET", "ACWDT": "ACWDT", "SAST": "SAST", "HKST": "HKST", "OESZ": "OESZ", "EAT": "EAT", "PST": "PST", "PDT": "PDT", "CST": "CST", "ACWST": "ACWST", "JDT": "JDT", "CLST": "CLST"},
+ timezones: map[string]string{"HNT": "HNT", "CDT": "CDT", "ACST": "ACST", "GFT": "GFT", "CHAST": "CHAST", "AKST": "AKST", "ART": "ART", "WEZ": "WEZ", "HAT": "HAT", "SRT": "SRT", "MYT": "MYT", "UYST": "UYST", "CST": "CST", "ACWDT": "ACWDT", "AWDT": "AWDT", "PST": "PST", "NZDT": "NZDT", "ChST": "ChST", "LHST": "LHST", "WARST": "WARST", "WITA": "WITA", "JST": "JST", "EST": "EST", "TMST": "TMST", "CLST": "CLST", "MESZ": "MESZ", "COT": "COT", "OESZ": "OESZ", "CLT": "CLT", "BOT": "BOT", "EDT": "EDT", "PDT": "PDT", "NZST": "NZST", "WAT": "WAT", "COST": "COST", "WART": "WART", "HKST": "HKST", "AST": "AST", "ADT": "ADT", "JDT": "JDT", "WAST": "WAST", "UYT": "UYT", "MDT": "MDT", "AKDT": "AKDT", "SAST": "SAST", "GMT": "GMT", "HADT": "HADT", "CAT": "CAT", "WESZ": "WESZ", "∅∅∅": "∅∅∅", "MST": "MST", "AWST": "AWST", "SGT": "SGT", "AEDT": "AEDT", "CHADT": "CHADT", "ECT": "ECT", "IST": "IST", "HAST": "HAST", "OEZ": "OEZ", "EAT": "EAT", "TMT": "TMT", "WIB": "WIB", "AEST": "AEST", "GYT": "GYT", "BT": "BT", "LHDT": "LHDT", "ACDT": "ACDT", "ACWST": "ACWST", "ARST": "ARST", "HKT": "HKT", "VET": "VET", "MEZ": "MEZ", "WIT": "WIT"},
}
}
diff --git a/or_IN/or_IN_test.go b/or_IN/or_IN_test.go
new file mode 100644
index 00000000..4bae01cd
--- /dev/null
+++ b/or_IN/or_IN_test.go
@@ -0,0 +1,1120 @@
+package or_IN
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "or_IN"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/os/os.go b/os/os.go
index 5db1c7fe..bfe2d72a 100644
--- a/os/os.go
+++ b/os/os.go
@@ -69,7 +69,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"н.д.а.", "н.д."},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"PDT": "PDT", "LHDT": "LHDT", "CLT": "CLT", "CLST": "CLST", "COST": "COST", "WART": "WART", "MYT": "MYT", "AWST": "AWST", "NZST": "NZST", "CHAST": "CHAST", "EAT": "EAT", "WEZ": "Ныгъуылӕн Европӕйаг стандартон рӕстӕг", "HKT": "HKT", "ART": "ART", "∅∅∅": "∅∅∅", "ChST": "ChST", "HKST": "HKST", "HAT": "HAT", "AWDT": "AWDT", "NZDT": "NZDT", "SAST": "SAST", "HNT": "HNT", "LHST": "LHST", "GYT": "GYT", "HAST": "HAST", "ACDT": "ACDT", "ACST": "ACST", "AKST": "AKST", "AEDT": "AEDT", "MST": "MST", "CAT": "CAT", "EST": "EST", "BT": "BT", "MEZ": "Астӕуккаг Европӕйаг стандартон рӕстӕг", "UYST": "UYST", "VET": "VET", "COT": "COT", "ARST": "ARST", "AKDT": "AKDT", "MESZ": "Астӕуккаг Европӕйаг сӕрдыгон рӕстӕг", "WESZ": "Ныгъуылӕн Европӕйаг сӕрдыгон рӕстӕг", "AST": "AST", "WAT": "WAT", "OEZ": "Скӕсӕн Европӕйаг стандартон рӕстӕг", "UYT": "UYT", "ADT": "ADT", "CST": "CST", "MDT": "MDT", "HADT": "HADT", "IST": "IST", "GFT": "GFT", "TMT": "TMT", "CDT": "CDT", "ACWDT": "ACWDT", "SGT": "SGT", "OESZ": "Скӕсӕн Европӕйаг сӕрдыгон рӕстӕг", "SRT": "SRT", "AEST": "AEST", "WARST": "WARST", "WITA": "WITA", "WIT": "WIT", "PST": "PST", "JST": "JST", "BOT": "BOT", "ACWST": "ACWST", "ECT": "ECT", "TMST": "TMST", "JDT": "JDT", "CHADT": "CHADT", "EDT": "EDT", "WAST": "WAST", "GMT": "Гринвичы рӕстӕмбис рӕстӕг", "WIB": "WIB"},
+ timezones: map[string]string{"CHAST": "CHAST", "MST": "MST", "IST": "IST", "AEST": "AEST", "CLST": "CLST", "CDT": "CDT", "AWDT": "AWDT", "WITA": "WITA", "BT": "BT", "HKST": "HKST", "COST": "COST", "MYT": "MYT", "EST": "EST", "ACWST": "ACWST", "MESZ": "Астӕуккаг Европӕйаг сӕрдыгон рӕстӕг", "OEZ": "Скӕсӕн Европӕйаг стандартон рӕстӕг", "AST": "AST", "LHST": "LHST", "CST": "CST", "CHADT": "CHADT", "HNT": "HNT", "SGT": "SGT", "ACST": "ACST", "ART": "ART", "LHDT": "LHDT", "CLT": "CLT", "WARST": "WARST", "WIB": "WIB", "GMT": "Гринвичы рӕстӕмбис рӕстӕг", "AWST": "AWST", "BOT": "BOT", "JST": "JST", "EDT": "EDT", "UYT": "UYT", "ADT": "ADT", "NZDT": "NZDT", "HAT": "HAT", "AEDT": "AEDT", "GYT": "GYT", "GFT": "GFT", "AKST": "AKST", "AKDT": "AKDT", "SAST": "SAST", "SRT": "SRT", "WESZ": "Ныгъуылӕн Европӕйаг сӕрдыгон рӕстӕг", "ChST": "ChST", "WIT": "WIT", "EAT": "EAT", "MDT": "MDT", "WART": "WART", "∅∅∅": "∅∅∅", "VET": "VET", "ARST": "ARST", "JDT": "JDT", "MEZ": "Астӕуккаг Европӕйаг стандартон рӕстӕг", "HADT": "HADT", "ACDT": "ACDT", "COT": "COT", "NZST": "NZST", "WAT": "WAT", "WAST": "WAST", "OESZ": "Скӕсӕн Европӕйаг сӕрдыгон рӕстӕг", "UYST": "UYST", "ECT": "ECT", "ACWDT": "ACWDT", "PST": "PST", "PDT": "PDT", "HAST": "HAST", "WEZ": "Ныгъуылӕн Европӕйаг стандартон рӕстӕг", "TMT": "TMT", "TMST": "TMST", "HKT": "HKT", "CAT": "CAT"},
}
}
diff --git a/os/os_test.go b/os/os_test.go
new file mode 100644
index 00000000..3a139e8c
--- /dev/null
+++ b/os/os_test.go
@@ -0,0 +1,1120 @@
+package os
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "os"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/os_GE/os_GE.go b/os_GE/os_GE.go
index 02349ff8..7ae806e8 100644
--- a/os_GE/os_GE.go
+++ b/os_GE/os_GE.go
@@ -69,7 +69,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"н.д.а.", "н.д."},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"COT": "COT", "COST": "COST", "BT": "BT", "OEZ": "Скӕсӕн Европӕйаг стандартон рӕстӕг", "JST": "JST", "MDT": "MDT", "CDT": "CDT", "WEZ": "Ныгъуылӕн Европӕйаг стандартон рӕстӕг", "CAT": "CAT", "CST": "CST", "ARST": "ARST", "AWST": "AWST", "CLST": "CLST", "MST": "MST", "WIT": "WIT", "IST": "IST", "EAT": "EAT", "LHDT": "LHDT", "VET": "VET", "ACWDT": "ACWDT", "ADT": "ADT", "HNT": "HNT", "TMT": "TMT", "CLT": "CLT", "NZST": "NZST", "CHADT": "CHADT", "AEST": "AEST", "HKST": "HKST", "HAT": "HAT", "TMST": "TMST", "AEDT": "AEDT", "HAST": "HAST", "SAST": "SAST", "ACDT": "ACDT", "GMT": "Гринвичы рӕстӕмбис рӕстӕг", "AKST": "AKST", "WESZ": "Ныгъуылӕн Европӕйаг сӕрдыгон рӕстӕг", "AST": "AST", "HADT": "HADT", "WAT": "WAT", "WAST": "WAST", "ART": "ART", "GYT": "GYT", "UYST": "UYST", "NZDT": "NZDT", "HKT": "HKT", "WART": "WART", "WITA": "WITA", "WIB": "WIB", "PST": "PST", "OESZ": "Скӕсӕн Европӕйаг сӕрдыгон рӕстӕг", "∅∅∅": "∅∅∅", "WARST": "WARST", "MEZ": "Астӕуккаг Европӕйаг стандартон рӕстӕг", "BOT": "BOT", "EST": "EST", "GFT": "GFT", "AKDT": "AKDT", "AWDT": "AWDT", "SRT": "SRT", "PDT": "PDT", "ACWST": "ACWST", "ChST": "ChST", "ECT": "ECT", "ACST": "ACST", "MYT": "MYT", "MESZ": "Астӕуккаг Европӕйаг сӕрдыгон рӕстӕг", "UYT": "UYT", "CHAST": "CHAST", "EDT": "EDT", "SGT": "SGT", "JDT": "JDT", "LHST": "LHST"},
+ timezones: map[string]string{"MST": "MST", "UYT": "UYT", "AKDT": "AKDT", "ADT": "ADT", "AWST": "AWST", "MEZ": "Астӕуккаг Европӕйаг стандартон рӕстӕг", "NZST": "NZST", "HAT": "HAT", "CLT": "CLT", "WART": "WART", "WITA": "WITA", "JST": "JST", "WESZ": "Ныгъуылӕн Европӕйаг сӕрдыгон рӕстӕг", "LHST": "LHST", "HKST": "HKST", "VET": "VET", "AKST": "AKST", "AST": "AST", "COT": "COT", "GYT": "GYT", "LHDT": "LHDT", "OESZ": "Скӕсӕн Европӕйаг сӕрдыгон рӕстӕг", "MDT": "MDT", "ACWST": "ACWST", "MESZ": "Астӕуккаг Европӕйаг сӕрдыгон рӕстӕг", "AEDT": "AEDT", "WIT": "WIT", "ACDT": "ACDT", "HKT": "HKT", "CHAST": "CHAST", "ACWDT": "ACWDT", "AWDT": "AWDT", "SAST": "SAST", "WIB": "WIB", "JDT": "JDT", "GFT": "GFT", "AEST": "AEST", "EST": "EST", "PST": "PST", "NZDT": "NZDT", "GMT": "Гринвичы рӕстӕмбис рӕстӕг", "WAST": "WAST", "WEZ": "Ныгъуылӕн Европӕйаг стандартон рӕстӕг", "BT": "BT", "MYT": "MYT", "CLST": "CLST", "IST": "IST", "WAT": "WAT", "ACST": "ACST", "CST": "CST", "COST": "COST", "OEZ": "Скӕсӕн Европӕйаг стандартон рӕстӕг", "UYST": "UYST", "WARST": "WARST", "SRT": "SRT", "CHADT": "CHADT", "EDT": "EDT", "CAT": "CAT", "ART": "ART", "ARST": "ARST", "BOT": "BOT", "ECT": "ECT", "TMT": "TMT", "ChST": "ChST", "EAT": "EAT", "∅∅∅": "∅∅∅", "TMST": "TMST", "SGT": "SGT", "CDT": "CDT", "PDT": "PDT", "HAST": "HAST", "HADT": "HADT", "HNT": "HNT"},
}
}
diff --git a/os_GE/os_GE_test.go b/os_GE/os_GE_test.go
new file mode 100644
index 00000000..022c8810
--- /dev/null
+++ b/os_GE/os_GE_test.go
@@ -0,0 +1,1120 @@
+package os_GE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "os_GE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/os_RU/os_RU.go b/os_RU/os_RU.go
index fae11597..6519167f 100644
--- a/os_RU/os_RU.go
+++ b/os_RU/os_RU.go
@@ -69,7 +69,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"н.д.а.", "н.д."},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"TMST": "TMST", "AKST": "AKST", "AWDT": "AWDT", "UYST": "UYST", "CLT": "CLT", "ChST": "ChST", "HAST": "HAST", "SGT": "SGT", "GFT": "GFT", "EST": "EST", "HAT": "HAT", "MST": "MST", "ACDT": "ACDT", "CLST": "CLST", "WITA": "WITA", "MESZ": "Астӕуккаг Европӕйаг сӕрдыгон рӕстӕг", "NZST": "NZST", "CHADT": "CHADT", "EDT": "EDT", "∅∅∅": "∅∅∅", "MDT": "MDT", "TMT": "TMT", "PDT": "PDT", "LHST": "LHST", "WESZ": "Ныгъуылӕн Европӕйаг сӕрдыгон рӕстӕг", "HKT": "HKT", "BOT": "BOT", "WEZ": "Ныгъуылӕн Европӕйаг стандартон рӕстӕг", "CHAST": "CHAST", "UYT": "UYT", "AEDT": "AEDT", "ECT": "ECT", "WAST": "WAST", "JDT": "JDT", "SRT": "SRT", "AWST": "AWST", "ACWST": "ACWST", "WART": "WART", "WIB": "WIB", "ARST": "ARST", "CST": "CST", "CDT": "CDT", "IST": "IST", "HNT": "HNT", "MYT": "MYT", "ACWDT": "ACWDT", "OEZ": "Скӕсӕн Европӕйаг стандартон рӕстӕг", "OESZ": "Скӕсӕн Европӕйаг сӕрдыгон рӕстӕг", "PST": "PST", "LHDT": "LHDT", "NZDT": "NZDT", "HKST": "HKST", "COT": "COT", "GMT": "Гринвичы рӕстӕмбис рӕстӕг", "ART": "ART", "AKDT": "AKDT", "GYT": "GYT", "SAST": "SAST", "ACST": "ACST", "HADT": "HADT", "WAT": "WAT", "BT": "BT", "WARST": "WARST", "WIT": "WIT", "EAT": "EAT", "MEZ": "Астӕуккаг Европӕйаг стандартон рӕстӕг", "AEST": "AEST", "CAT": "CAT", "COST": "COST", "AST": "AST", "ADT": "ADT", "JST": "JST", "VET": "VET"},
+ timezones: map[string]string{"MEZ": "Астӕуккаг Европӕйаг стандартон рӕстӕг", "COT": "COT", "AKDT": "AKDT", "EDT": "EDT", "GYT": "GYT", "WART": "WART", "TMT": "TMT", "WEZ": "Ныгъуылӕн Европӕйаг стандартон рӕстӕг", "OEZ": "Скӕсӕн Европӕйаг стандартон рӕстӕг", "JDT": "JDT", "WITA": "WITA", "BOT": "BOT", "MESZ": "Астӕуккаг Европӕйаг сӕрдыгон рӕстӕг", "EAT": "EAT", "ACST": "ACST", "GFT": "GFT", "JST": "JST", "ACWST": "ACWST", "EST": "EST", "ADT": "ADT", "ACWDT": "ACWDT", "ARST": "ARST", "AKST": "AKST", "HNT": "HNT", "ECT": "ECT", "AWDT": "AWDT", "∅∅∅": "∅∅∅", "WIB": "WIB", "ChST": "ChST", "UYST": "UYST", "MDT": "MDT", "CLST": "CLST", "CDT": "CDT", "HKT": "HKT", "IST": "IST", "AST": "AST", "TMST": "TMST", "AEST": "AEST", "LHDT": "LHDT", "VET": "VET", "SAST": "SAST", "CLT": "CLT", "CST": "CST", "CHADT": "CHADT", "ART": "ART", "MYT": "MYT", "WAST": "WAST", "GMT": "Гринвичы рӕстӕмбис рӕстӕг", "HAST": "HAST", "WAT": "WAT", "NZDT": "NZDT", "SGT": "SGT", "AEDT": "AEDT", "BT": "BT", "LHST": "LHST", "ACDT": "ACDT", "PST": "PST", "OESZ": "Скӕсӕн Европӕйаг сӕрдыгон рӕстӕг", "UYT": "UYT", "WARST": "WARST", "CAT": "CAT", "WIT": "WIT", "MST": "MST", "SRT": "SRT", "HKST": "HKST", "AWST": "AWST", "HADT": "HADT", "PDT": "PDT", "COST": "COST", "NZST": "NZST", "HAT": "HAT", "CHAST": "CHAST", "WESZ": "Ныгъуылӕн Европӕйаг сӕрдыгон рӕстӕг"},
}
}
diff --git a/os_RU/os_RU_test.go b/os_RU/os_RU_test.go
new file mode 100644
index 00000000..4304bcea
--- /dev/null
+++ b/os_RU/os_RU_test.go
@@ -0,0 +1,1120 @@
+package os_RU
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "os_RU"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/pa/pa.go b/pa/pa.go
index 4b50bffe..04b8fa92 100644
--- a/pa/pa.go
+++ b/pa/pa.go
@@ -67,7 +67,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ਈ. ਪੂ.", "ਸੰਨ"},
erasNarrow: []string{"ਈ. ਪੂ.", "ਸੰਨ"},
erasWide: []string{"ਈਸਵੀ ਪੂਰਵ", "ਈਸਵੀ ਸੰਨ"},
- timezones: map[string]string{"AKST": "ਅਲਾਸਕਾ ਮਿਆਰੀ ਸਮਾਂ", "EDT": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਪੂਰਬੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "WIT": "ਪੂਰਬੀ ਇੰਡੋਨੇਸ਼ੀਆ ਸਮਾਂ", "ACST": "ਆਸਟ੍ਰੇਲੀਆਈ ਕੇਂਦਰੀ ਮਿਆਰੀ ਸਮਾਂ", "ACDT": "ਆਸਟ੍ਰੇਲੀਆਈ ਕੇਂਦਰੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "PST": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਪੈਸਿਫਿਕ ਮਿਆਰੀ ਸਮਾਂ", "EST": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਪੂਰਬੀ ਮਿਆਰੀ ਸਮਾਂ", "HAST": "ਹਵਾਈ-ਅਲੇਯੂਸ਼ਿਅਨ ਮਿਆਰੀ ਸਮਾਂ", "OESZ": "ਪੂਰਬੀ ਯੂਰਪੀ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "EAT": "ਪੂਰਬੀ ਅਫਰੀਕਾ ਸਮਾਂ", "TMT": "ਤੁਰਕਮੇਨਿਸਤਾਨ ਮਿਆਰੀ ਸਮਾਂ", "SRT": "ਸੂਰੀਨਾਮ ਸਮਾਂ", "JDT": "ਜਪਾਨ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "MEZ": "ਮੱਧ ਯੂਰਪੀ ਮਿਆਰੀ ਸਮਾਂ", "COT": "ਕੋਲੰਬੀਆ ਮਿਆਰੀ ਸਮਾਂ", "HKST": "ਹਾਂਗ ਕਾਂਗ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "TMST": "ਤੁਰਕਮੇਨਿਸਤਾਨ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "ACWDT": "ਆਸਟ੍ਰੇਲੀਆਈ ਕੇਂਦਰੀ ਪੱਛਮੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "CHADT": "ਚੈਥਮ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "AST": "ਅਟਲਾਂਟਿਕ ਮਿਆਰੀ ਸਮਾਂ", "ADT": "ਅਟਲਾਂਟਿਕ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "HKT": "ਹਾਂਗ ਕਾਂਗ ਮਿਆਰੀ ਸਮਾਂ", "HNT": "ਨਿਊਫਾਉਂਡਲੈਂਡ ਮਿਆਰੀ ਸਮਾਂ", "WAT": "ਪੱਛਮੀ ਅਫਰੀਕਾ ਮਿਆਰੀ ਸਮਾਂ", "WAST": "ਪੱਛਮੀ ਅਫਰੀਕਾ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "HAT": "ਨਿਊਫਾਉਂਡਲੈਂਡ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "LHST": "ਲੌਰਡ ਹੋਵੇ ਮਿਆਰੀ ਸਮਾਂ", "GYT": "ਗੁਯਾਨਾ ਸਮਾਂ", "JST": "ਜਪਾਨ ਮਿਆਰੀ ਸਮਾਂ", "CST": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਕੇਂਦਰੀ ਮਿਆਰੀ ਸਮਾਂ", "MESZ": "ਮੱਧ ਯੂਰਪੀ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "CAT": "ਕੇਂਦਰੀ ਅਫਰੀਕਾ ਸਮਾਂ", "OEZ": "ਪੂਰਬੀ ਯੂਰਪੀ ਮਿਆਰੀ ਸਮਾਂ", "NZST": "ਨਿਊਜ਼ੀਲੈਂਡ ਮਿਆਰੀ ਸਮਾਂ", "SAST": "ਦੱਖਣੀ ਅਫ਼ਰੀਕਾ ਮਿਆਰੀ ਸਮਾਂ", "PDT": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਪੈਸਿਫਿਕ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "LHDT": "ਲੌਰਡ ਹੋਵੇ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "BT": "ਭੂਟਾਨ ਸਮਾਂ", "WIB": "ਪੱਛਮੀ ਇੰਡੋਨੇਸ਼ੀਆ ਸਮਾਂ", "MST": "ਮਕਾਉ ਮਿਆਰੀ ਸਮਾਂ", "∅∅∅": "ਅਮੇਜ਼ਨ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "WESZ": "ਪੱਛਮੀ ਯੂਰਪੀ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "CHAST": "ਚੈਥਮ ਮਿਆਰੀ ਸਮਾਂ", "CLST": "ਚਿਲੀ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "COST": "ਕੋਲੰਬੀਆ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "WART": "ਪੱਛਮੀ ਅਰਜਨਟੀਨਾ ਮਿਆਰੀ ਸਮਾਂ", "ECT": "ਇਕਵੇਡੋਰ ਸਮਾਂ", "AKDT": "ਅਲਾਸਕਾ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "MYT": "ਮਲੇਸ਼ੀਆ ਸਮਾਂ", "NZDT": "ਨਿਊਜ਼ੀਲੈਂਡ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "UYT": "ਉਰੂਗਵੇ ਮਿਆਰੀ ਸਮਾਂ", "UYST": "ਉਰੂਗਵੇ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "ChST": "ਚਾਮੋਰੋ ਮਿਆਰੀ ਸਮਾਂ", "CLT": "ਚਿਲੀ ਮਿਆਰੀ ਸਮਾਂ", "HADT": "ਹਵਾਈ-ਅਲੇਯੂਸ਼ਿਅਨ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "VET": "ਵੈਨੇਜ਼ੂਏਲਾ ਸਮਾਂ", "GFT": "ਫ੍ਰੈਂਚ ਗੁਏਨਾ ਸਮਾਂ", "WEZ": "ਪੱਛਮੀ ਯੂਰਪੀ ਮਿਆਰੀ ਸਮਾਂ", "ACWST": "ਆਸਟ੍ਰੇਲੀਆਈ ਕੇਂਦਰੀ ਪੱਛਮੀ ਮਿਆਰੀ ਸਮਾਂ", "SGT": "ਸਿੰਗਾਪੁਰ ਮਿਆਰੀ ਸਮਾਂ", "WITA": "ਮੱਧ ਇੰਡੋਨੇਸ਼ੀਆਈ ਸਮਾਂ", "ART": "ਅਰਜਨਟੀਨਾ ਮਿਆਰੀ ਸਮਾਂ", "AWST": "ਆਸਟ੍ਰੇਲੀਆਈ ਪੱਛਮੀ ਮਿਆਰੀ ਸਮਾਂ", "ARST": "ਅਰਜਨਟੀਨਾ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "AWDT": "ਆਸਟ੍ਰੇਲੀਆਈ ਪੱਛਮੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "CDT": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਕੇਂਦਰੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "AEST": "ਆਸਟ੍ਰੇਲੀਆਈ ਪੂਰਬੀ ਮਿਆਰੀ ਸਮਾਂ", "AEDT": "ਆਸਟ੍ਰੇਲੀਆਈ ਪੂਰਬੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "MDT": "ਮਕਾਉ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "BOT": "ਬੋਲੀਵੀਆ ਸਮਾਂ", "WARST": "ਪੱਛਮੀ ਅਰਜਨਟੀਨਾ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "IST": "ਭਾਰਤੀ ਮਿਆਰੀ ਸਮਾਂ", "GMT": "ਗ੍ਰੀਨਵਿਚ ਮੀਨ ਟਾਈਮ"},
+ timezones: map[string]string{"WART": "ਪੱਛਮੀ ਅਰਜਨਟੀਨਾ ਮਿਆਰੀ ਸਮਾਂ", "CDT": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਕੇਂਦਰੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "ACDT": "ਆਸਟ੍ਰੇਲੀਆਈ ਕੇਂਦਰੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "MESZ": "ਮੱਧ ਯੂਰਪੀ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "SAST": "ਦੱਖਣੀ ਅਫ਼ਰੀਕਾ ਮਿਆਰੀ ਸਮਾਂ", "SGT": "ਸਿੰਗਾਪੁਰ ਮਿਆਰੀ ਸਮਾਂ", "UYST": "ਉਰੂਗਵੇ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "JST": "ਜਪਾਨ ਮਿਆਰੀ ਸਮਾਂ", "GYT": "ਗੁਯਾਨਾ ਸਮਾਂ", "ACST": "ਆਸਟ੍ਰੇਲੀਆਈ ਕੇਂਦਰੀ ਮਿਆਰੀ ਸਮਾਂ", "JDT": "ਜਪਾਨ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "MEZ": "ਮੱਧ ਯੂਰਪੀ ਮਿਆਰੀ ਸਮਾਂ", "IST": "ਭਾਰਤੀ ਮਿਆਰੀ ਸਮਾਂ", "CLT": "ਚਿਲੀ ਮਿਆਰੀ ਸਮਾਂ", "CHADT": "ਚੈਥਮ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "MDT": "ਮਕਾਉ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "ACWST": "ਆਸਟ੍ਰੇਲੀਆਈ ਕੇਂਦਰੀ ਪੱਛਮੀ ਮਿਆਰੀ ਸਮਾਂ", "AWDT": "ਆਸਟ੍ਰੇਲੀਆਈ ਪੱਛਮੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "CLST": "ਚਿਲੀ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "WIT": "ਪੂਰਬੀ ਇੰਡੋਨੇਸ਼ੀਆ ਸਮਾਂ", "ECT": "ਇਕਵੇਡੋਰ ਸਮਾਂ", "HKT": "ਹਾਂਗ ਕਾਂਗ ਮਿਆਰੀ ਸਮਾਂ", "BOT": "ਬੋਲੀਵੀਆ ਸਮਾਂ", "LHST": "ਲੌਰਡ ਹੋਵੇ ਮਿਆਰੀ ਸਮਾਂ", "CHAST": "ਚੈਥਮ ਮਿਆਰੀ ਸਮਾਂ", "AEDT": "ਆਸਟ੍ਰੇਲੀਆਈ ਪੂਰਬੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "EAT": "ਪੂਰਬੀ ਅਫਰੀਕਾ ਸਮਾਂ", "ChST": "ਚਾਮੋਰੋ ਮਿਆਰੀ ਸਮਾਂ", "GMT": "ਗ੍ਰੀਨਵਿਚ ਮੀਨ ਟਾਈਮ", "VET": "ਵੈਨੇਜ਼ੂਏਲਾ ਸਮਾਂ", "HADT": "ਹਵਾਈ-ਅਲੇਯੂਸ਼ਿਅਨ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "NZDT": "ਨਿਊਜ਼ੀਲੈਂਡ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "TMT": "ਤੁਰਕਮੇਨਿਸਤਾਨ ਮਿਆਰੀ ਸਮਾਂ", "SRT": "ਸੂਰੀਨਾਮ ਸਮਾਂ", "WITA": "ਮੱਧ ਇੰਡੋਨੇਸ਼ੀਆਈ ਸਮਾਂ", "AKDT": "ਅਲਾਸਕਾ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "COT": "ਕੋਲੰਬੀਆ ਮਿਆਰੀ ਸਮਾਂ", "TMST": "ਤੁਰਕਮੇਨਿਸਤਾਨ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "MST": "ਮਕਾਉ ਮਿਆਰੀ ਸਮਾਂ", "∅∅∅": "∅∅∅", "LHDT": "ਲੌਰਡ ਹੋਵੇ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "AST": "ਅਟਲਾਂਟਿਕ ਮਿਆਰੀ ਸਮਾਂ", "NZST": "ਨਿਊਜ਼ੀਲੈਂਡ ਮਿਆਰੀ ਸਮਾਂ", "HNT": "ਨਿਊਫਾਉਂਡਲੈਂਡ ਮਿਆਰੀ ਸਮਾਂ", "GFT": "ਫ੍ਰੈਂਚ ਗੁਏਨਾ ਸਮਾਂ", "AWST": "ਆਸਟ੍ਰੇਲੀਆਈ ਪੱਛਮੀ ਮਿਆਰੀ ਸਮਾਂ", "PST": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਪੈਸਿਫਿਕ ਮਿਆਰੀ ਸਮਾਂ", "WEZ": "ਪੱਛਮੀ ਯੂਰਪੀ ਮਿਆਰੀ ਸਮਾਂ", "WESZ": "ਪੱਛਮੀ ਯੂਰਪੀ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "CAT": "ਕੇਂਦਰੀ ਅਫਰੀਕਾ ਸਮਾਂ", "OEZ": "ਪੂਰਬੀ ਯੂਰਪੀ ਮਿਆਰੀ ਸਮਾਂ", "BT": "ਭੂਟਾਨ ਸਮਾਂ", "WARST": "ਪੱਛਮੀ ਅਰਜਨਟੀਨਾ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "PDT": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਪੈਸਿਫਿਕ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "OESZ": "ਪੂਰਬੀ ਯੂਰਪੀ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "CST": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਕੇਂਦਰੀ ਮਿਆਰੀ ਸਮਾਂ", "HAT": "ਨਿਊਫਾਉਂਡਲੈਂਡ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "COST": "ਕੋਲੰਬੀਆ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "HKST": "ਹਾਂਗ ਕਾਂਗ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "ARST": "ਅਰਜਨਟੀਨਾ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "AKST": "ਅਲਾਸਕਾ ਮਿਆਰੀ ਸਮਾਂ", "ADT": "ਅਟਲਾਂਟਿਕ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "EST": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਪੂਰਬੀ ਮਿਆਰੀ ਸਮਾਂ", "UYT": "ਉਰੂਗਵੇ ਮਿਆਰੀ ਸਮਾਂ", "ART": "ਅਰਜਨਟੀਨਾ ਮਿਆਰੀ ਸਮਾਂ", "WAST": "ਪੱਛਮੀ ਅਫਰੀਕਾ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "AEST": "ਆਸਟ੍ਰੇਲੀਆਈ ਪੂਰਬੀ ਮਿਆਰੀ ਸਮਾਂ", "MYT": "ਮਲੇਸ਼ੀਆ ਸਮਾਂ", "WAT": "ਪੱਛਮੀ ਅਫਰੀਕਾ ਮਿਆਰੀ ਸਮਾਂ", "ACWDT": "ਆਸਟ੍ਰੇਲੀਆਈ ਕੇਂਦਰੀ ਪੱਛਮੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "EDT": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਪੂਰਬੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "HAST": "ਹਵਾਈ-ਅਲੇਯੂਸ਼ਿਅਨ ਮਿਆਰੀ ਸਮਾਂ", "WIB": "ਪੱਛਮੀ ਇੰਡੋਨੇਸ਼ੀਆ ਸਮਾਂ"},
}
}
diff --git a/pa/pa_test.go b/pa/pa_test.go
new file mode 100644
index 00000000..36933ba7
--- /dev/null
+++ b/pa/pa_test.go
@@ -0,0 +1,1120 @@
+package pa
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "pa"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/pa_Arab/pa_Arab.go b/pa_Arab/pa_Arab.go
index c6e9765d..1eb07edc 100644
--- a/pa_Arab/pa_Arab.go
+++ b/pa_Arab/pa_Arab.go
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ايساپورو", "سں"},
erasNarrow: []string{"", ""},
erasWide: []string{"ايساپورو", "سں"},
- timezones: map[string]string{"GFT": "ਫ੍ਰੈਂਚ ਗੁਏਨਾ ਸਮਾਂ", "MST": "ਮਕਾਉ ਮਿਆਰੀ ਸਮਾਂ", "PST": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਪੈਸਿਫਿਕ ਮਿਆਰੀ ਸਮਾਂ", "MYT": "ਮਲੇਸ਼ੀਆ ਸਮਾਂ", "SAST": "ਦੱਖਣੀ ਅਫ਼ਰੀਕਾ ਮਿਆਰੀ ਸਮਾਂ", "ACST": "ਆਸਟ੍ਰੇਲੀਆਈ ਕੇਂਦਰੀ ਮਿਆਰੀ ਸਮਾਂ", "TMT": "ਤੁਰਕਮੇਨਿਸਤਾਨ ਮਿਆਰੀ ਸਮਾਂ", "MESZ": "ਮੱਧ ਯੂਰਪੀ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "NZST": "ਨਿਊਜ਼ੀਲੈਂਡ ਮਿਆਰੀ ਸਮਾਂ", "WEZ": "ਪੱਛਮੀ ਯੂਰਪੀ ਮਿਆਰੀ ਸਮਾਂ", "HAT": "ਨਿਊਫਾਉਂਡਲੈਂਡ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "HADT": "ਹਵਾਈ-ਅਲੇਯੂਸ਼ਿਅਨ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "HKT": "ਹਾਂਗ ਕਾਂਗ ਮਿਆਰੀ ਸਮਾਂ", "HKST": "ਹਾਂਗ ਕਾਂਗ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "AEST": "ਆਸਟ੍ਰੇਲੀਆਈ ਪੂਰਬੀ ਮਿਆਰੀ ਸਮਾਂ", "∅∅∅": "ਬ੍ਰਾਜ਼ੀਲੀਆ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "JST": "ਜਪਾਨ ਮਿਆਰੀ ਸਮਾਂ", "WARST": "ਪੱਛਮੀ ਅਰਜਨਟੀਨਾ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "WITA": "ਮੱਧ ਇੰਡੋਨੇਸ਼ੀਆਈ ਸਮਾਂ", "VET": "ਵੈਨੇਜ਼ੂਏਲਾ ਸਮਾਂ", "AST": "ਅਟਲਾਂਟਿਕ ਮਿਆਰੀ ਸਮਾਂ", "ECT": "ਇਕਵੇਡੋਰ ਸਮਾਂ", "SGT": "ਸਿੰਗਾਪੁਰ ਮਿਆਰੀ ਸਮਾਂ", "BT": "ਭੂਟਾਨ ਸਮਾਂ", "OEZ": "ਪੂਰਬੀ ਯੂਰਪੀ ਮਿਆਰੀ ਸਮਾਂ", "OESZ": "ਪੂਰਬੀ ਯੂਰਪੀ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "ART": "ਅਰਜਨਟੀਨਾ ਮਿਆਰੀ ਸਮਾਂ", "WESZ": "ਪੱਛਮੀ ਯੂਰਪੀ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "EST": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਪੂਰਬੀ ਮਿਆਰੀ ਸਮਾਂ", "LHDT": "ਲੌਰਡ ਹੋਵੇ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "GYT": "ਗੁਯਾਨਾ ਸਮਾਂ", "CLST": "ਚਿਲੀ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "PDT": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਪੈਸਿਫਿਕ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "COT": "ਕੋਲੰਬੀਆ ਮਿਆਰੀ ਸਮਾਂ", "COST": "ਕੋਲੰਬੀਆ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "WAST": "ਪੱਛਮੀ ਅਫਰੀਕਾ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "WIT": "ਪੂਰਬੀ ਇੰਡੋਨੇਸ਼ੀਆ ਸਮਾਂ", "SRT": "ਸੂਰੀਨਾਮ ਸਮਾਂ", "BOT": "ਬੋਲੀਵੀਆ ਸਮਾਂ", "ACWDT": "ਆਸਟ੍ਰੇਲੀਆਈ ਕੇਂਦਰੀ ਪੱਛਮੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "EDT": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਪੂਰਬੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "ARST": "ਅਰਜਨਟੀਨਾ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "ChST": "ਚਾਮੋਰੋ ਮਿਆਰੀ ਸਮਾਂ", "CHAST": "ਚੈਥਮ ਮਿਆਰੀ ਸਮਾਂ", "WAT": "ਪੱਛਮੀ ਅਫਰੀਕਾ ਮਿਆਰੀ ਸਮਾਂ", "IST": "ਭਾਰਤੀ ਮਿਆਰੀ ਸਮਾਂ", "TMST": "ਤੁਰਕਮੇਨਿਸਤਾਨ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "ACWST": "ਆਸਟ੍ਰੇਲੀਆਈ ਕੇਂਦਰੀ ਪੱਛਮੀ ਮਿਆਰੀ ਸਮਾਂ", "ADT": "ਅਟਲਾਂਟਿਕ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "WIB": "ਪੱਛਮੀ ਇੰਡੋਨੇਸ਼ੀਆ ਸਮਾਂ", "GMT": "ਗ੍ਰੀਨਵਿਚ ਮੀਨ ਟਾਈਮ", "HNT": "ਨਿਊਫਾਉਂਡਲੈਂਡ ਮਿਆਰੀ ਸਮਾਂ", "EAT": "ਪੂਰਬੀ ਅਫਰੀਕਾ ਸਮਾਂ", "MEZ": "ਮੱਧ ਯੂਰਪੀ ਮਿਆਰੀ ਸਮਾਂ", "CLT": "ਚਿਲੀ ਮਿਆਰੀ ਸਮਾਂ", "HAST": "ਹਵਾਈ-ਅਲੇਯੂਸ਼ਿਅਨ ਮਿਆਰੀ ਸਮਾਂ", "CST": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਕੇਂਦਰੀ ਮਿਆਰੀ ਸਮਾਂ", "ACDT": "ਆਸਟ੍ਰੇਲੀਆਈ ਕੇਂਦਰੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "MDT": "ਮਕਾਉ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "CAT": "ਕੇਂਦਰੀ ਅਫਰੀਕਾ ਸਮਾਂ", "JDT": "ਜਪਾਨ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "CDT": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਕੇਂਦਰੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "LHST": "ਲੌਰਡ ਹੋਵੇ ਮਿਆਰੀ ਸਮਾਂ", "AKST": "ਅਲਾਸਕਾ ਮਿਆਰੀ ਸਮਾਂ", "AWST": "ਆਸਟ੍ਰੇਲੀਆਈ ਪੱਛਮੀ ਮਿਆਰੀ ਸਮਾਂ", "AWDT": "ਆਸਟ੍ਰੇਲੀਆਈ ਪੱਛਮੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "NZDT": "ਨਿਊਜ਼ੀਲੈਂਡ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "UYT": "ਉਰੂਗਵੇ ਮਿਆਰੀ ਸਮਾਂ", "UYST": "ਉਰੂਗਵੇ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "CHADT": "ਚੈਥਮ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "WART": "ਪੱਛਮੀ ਅਰਜਨਟੀਨਾ ਮਿਆਰੀ ਸਮਾਂ", "AEDT": "ਆਸਟ੍ਰੇਲੀਆਈ ਪੂਰਬੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "AKDT": "ਅਲਾਸਕਾ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ"},
+ timezones: map[string]string{"PST": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਪੈਸਿਫਿਕ ਮਿਆਰੀ ਸਮਾਂ", "EST": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਪੂਰਬੀ ਮਿਆਰੀ ਸਮਾਂ", "CAT": "ਕੇਂਦਰੀ ਅਫਰੀਕਾ ਸਮਾਂ", "ACST": "ਆਸਟ੍ਰੇਲੀਆਈ ਕੇਂਦਰੀ ਮਿਆਰੀ ਸਮਾਂ", "ECT": "ਇਕਵੇਡੋਰ ਸਮਾਂ", "JDT": "ਜਪਾਨ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "ADT": "ਅਟਲਾਂਟਿਕ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "ChST": "ਚਾਮੋਰੋ ਮਿਆਰੀ ਸਮਾਂ", "OESZ": "ਪੂਰਬੀ ਯੂਰਪੀ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "VET": "ਵੈਨੇਜ਼ੂਏਲਾ ਸਮਾਂ", "AWST": "ਆਸਟ੍ਰੇਲੀਆਈ ਪੱਛਮੀ ਮਿਆਰੀ ਸਮਾਂ", "WESZ": "ਪੱਛਮੀ ਯੂਰਪੀ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "BOT": "ਬੋਲੀਵੀਆ ਸਮਾਂ", "TMT": "ਤੁਰਕਮੇਨਿਸਤਾਨ ਮਿਆਰੀ ਸਮਾਂ", "LHST": "ਲੌਰਡ ਹੋਵੇ ਮਿਆਰੀ ਸਮਾਂ", "CDT": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਕੇਂਦਰੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "MEZ": "ਮੱਧ ਯੂਰਪੀ ਮਿਆਰੀ ਸਮਾਂ", "IST": "ਭਾਰਤੀ ਮਿਆਰੀ ਸਮਾਂ", "WIT": "ਪੂਰਬੀ ਇੰਡੋਨੇਸ਼ੀਆ ਸਮਾਂ", "EDT": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਪੂਰਬੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "BT": "ਭੂਟਾਨ ਸਮਾਂ", "SAST": "ਦੱਖਣੀ ਅਫ਼ਰੀਕਾ ਮਿਆਰੀ ਸਮਾਂ", "OEZ": "ਪੂਰਬੀ ਯੂਰਪੀ ਮਿਆਰੀ ਸਮਾਂ", "HKT": "ਹਾਂਗ ਕਾਂਗ ਮਿਆਰੀ ਸਮਾਂ", "ACWST": "ਆਸਟ੍ਰੇਲੀਆਈ ਕੇਂਦਰੀ ਪੱਛਮੀ ਮਿਆਰੀ ਸਮਾਂ", "NZST": "ਨਿਊਜ਼ੀਲੈਂਡ ਮਿਆਰੀ ਸਮਾਂ", "AEST": "ਆਸਟ੍ਰੇਲੀਆਈ ਪੂਰਬੀ ਮਿਆਰੀ ਸਮਾਂ", "ACWDT": "ਆਸਟ੍ਰੇਲੀਆਈ ਕੇਂਦਰੀ ਪੱਛਮੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "HNT": "ਨਿਊਫਾਉਂਡਲੈਂਡ ਮਿਆਰੀ ਸਮਾਂ", "COST": "ਕੋਲੰਬੀਆ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "MYT": "ਮਲੇਸ਼ੀਆ ਸਮਾਂ", "MST": "ਮਕਾਉ ਮਿਆਰੀ ਸਮਾਂ", "HKST": "ਹਾਂਗ ਕਾਂਗ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "WITA": "ਮੱਧ ਇੰਡੋਨੇਸ਼ੀਆਈ ਸਮਾਂ", "SRT": "ਸੂਰੀਨਾਮ ਸਮਾਂ", "GFT": "ਫ੍ਰੈਂਚ ਗੁਏਨਾ ਸਮਾਂ", "JST": "ਜਪਾਨ ਮਿਆਰੀ ਸਮਾਂ", "GYT": "ਗੁਯਾਨਾ ਸਮਾਂ", "WEZ": "ਪੱਛਮੀ ਯੂਰਪੀ ਮਿਆਰੀ ਸਮਾਂ", "CLT": "ਚਿਲੀ ਮਿਆਰੀ ਸਮਾਂ", "ARST": "ਅਰਜਨਟੀਨਾ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "AKST": "ਅਲਾਸਕਾ ਮਿਆਰੀ ਸਮਾਂ", "SGT": "ਸਿੰਗਾਪੁਰ ਮਿਆਰੀ ਸਮਾਂ", "∅∅∅": "ਅਜੋਰੇਸ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "ART": "ਅਰਜਨਟੀਨਾ ਮਿਆਰੀ ਸਮਾਂ", "GMT": "ਗ੍ਰੀਨਵਿਚ ਮੀਨ ਟਾਈਮ", "EAT": "ਪੂਰਬੀ ਅਫਰੀਕਾ ਸਮਾਂ", "PDT": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਪੈਸਿਫਿਕ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "HAT": "ਨਿਊਫਾਉਂਡਲੈਂਡ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "WAT": "ਪੱਛਮੀ ਅਫਰੀਕਾ ਮਿਆਰੀ ਸਮਾਂ", "UYT": "ਉਰੂਗਵੇ ਮਿਆਰੀ ਸਮਾਂ", "AKDT": "ਅਲਾਸਕਾ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "TMST": "ਤੁਰਕਮੇਨਿਸਤਾਨ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "AEDT": "ਆਸਟ੍ਰੇਲੀਆਈ ਪੂਰਬੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "WARST": "ਪੱਛਮੀ ਅਰਜਨਟੀਨਾ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "AWDT": "ਆਸਟ੍ਰੇਲੀਆਈ ਪੱਛਮੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "HADT": "ਹਵਾਈ-ਅਲੇਯੂਸ਼ਿਅਨ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "COT": "ਕੋਲੰਬੀਆ ਮਿਆਰੀ ਸਮਾਂ", "NZDT": "ਨਿਊਜ਼ੀਲੈਂਡ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "WIB": "ਪੱਛਮੀ ਇੰਡੋਨੇਸ਼ੀਆ ਸਮਾਂ", "WAST": "ਪੱਛਮੀ ਅਫਰੀਕਾ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "CLST": "ਚਿਲੀ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "UYST": "ਉਰੂਗਵੇ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "MDT": "ਮਕਾਉ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "AST": "ਅਟਲਾਂਟਿਕ ਮਿਆਰੀ ਸਮਾਂ", "MESZ": "ਮੱਧ ਯੂਰਪੀ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "LHDT": "ਲੌਰਡ ਹੋਵੇ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "CST": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਕੇਂਦਰੀ ਮਿਆਰੀ ਸਮਾਂ", "WART": "ਪੱਛਮੀ ਅਰਜਨਟੀਨਾ ਮਿਆਰੀ ਸਮਾਂ", "ACDT": "ਆਸਟ੍ਰੇਲੀਆਈ ਕੇਂਦਰੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "CHAST": "ਚੈਥਮ ਮਿਆਰੀ ਸਮਾਂ", "CHADT": "ਚੈਥਮ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "HAST": "ਹਵਾਈ-ਅਲੇਯੂਸ਼ਿਅਨ ਮਿਆਰੀ ਸਮਾਂ"},
}
}
diff --git a/pa_Arab/pa_Arab_test.go b/pa_Arab/pa_Arab_test.go
new file mode 100644
index 00000000..c2979f38
--- /dev/null
+++ b/pa_Arab/pa_Arab_test.go
@@ -0,0 +1,1120 @@
+package pa_Arab
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "pa_Arab"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/pa_Arab_PK/pa_Arab_PK.go b/pa_Arab_PK/pa_Arab_PK.go
index 9e232e61..3730143d 100644
--- a/pa_Arab_PK/pa_Arab_PK.go
+++ b/pa_Arab_PK/pa_Arab_PK.go
@@ -67,7 +67,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ਈ. ਪੂ.", "ਸੰਨ"},
erasNarrow: []string{"ਈ. ਪੂ.", "ਸੰਨ"},
erasWide: []string{"ਈਸਵੀ ਪੂਰਵ", "ਈਸਵੀ ਸੰਨ"},
- timezones: map[string]string{"AWDT": "ਆਸਟ੍ਰੇਲੀਆਈ ਪੱਛਮੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "NZST": "ਨਿਊਜ਼ੀਲੈਂਡ ਮਿਆਰੀ ਸਮਾਂ", "NZDT": "ਨਿਊਜ਼ੀਲੈਂਡ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "MDT": "ਮਕਾਉ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "CLST": "ਚਿਲੀ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "ECT": "ਇਕਵੇਡੋਰ ਸਮਾਂ", "HKT": "ਹਾਂਗ ਕਾਂਗ ਮਿਆਰੀ ਸਮਾਂ", "EAT": "ਪੂਰਬੀ ਅਫਰੀਕਾ ਸਮਾਂ", "PDT": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਪੈਸਿਫਿਕ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "COST": "ਕੋਲੰਬੀਆ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "TMT": "ਤੁਰਕਮੇਨਿਸਤਾਨ ਮਿਆਰੀ ਸਮਾਂ", "AWST": "ਆਸਟ੍ਰੇਲੀਆਈ ਪੱਛਮੀ ਮਿਆਰੀ ਸਮਾਂ", "LHST": "ਲੌਰਡ ਹੋਵੇ ਮਿਆਰੀ ਸਮਾਂ", "CAT": "ਕੇਂਦਰੀ ਅਫਰੀਕਾ ਸਮਾਂ", "SAST": "ਦੱਖਣੀ ਅਫ਼ਰੀਕਾ ਮਿਆਰੀ ਸਮਾਂ", "HNT": "ਨਿਊਫਾਉਂਡਲੈਂਡ ਮਿਆਰੀ ਸਮਾਂ", "ACST": "ਆਸਟ੍ਰੇਲੀਆਈ ਕੇਂਦਰੀ ਮਿਆਰੀ ਸਮਾਂ", "CHADT": "ਚੈਥਮ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "ChST": "ਚਾਮੋਰੋ ਮਿਆਰੀ ਸਮਾਂ", "SGT": "ਸਿੰਗਾਪੁਰ ਮਿਆਰੀ ਸਮਾਂ", "AST": "ਅਟਲਾਂਟਿਕ ਮਿਆਰੀ ਸਮਾਂ", "HKST": "ਹਾਂਗ ਕਾਂਗ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "LHDT": "ਲੌਰਡ ਹੋਵੇ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "CHAST": "ਚੈਥਮ ਮਿਆਰੀ ਸਮਾਂ", "CLT": "ਚਿਲੀ ਮਿਆਰੀ ਸਮਾਂ", "WEZ": "ਪੱਛਮੀ ਯੂਰਪੀ ਮਿਆਰੀ ਸਮਾਂ", "WITA": "ਮੱਧ ਇੰਡੋਨੇਸ਼ੀਆਈ ਸਮਾਂ", "OEZ": "ਪੂਰਬੀ ਯੂਰਪੀ ਮਿਆਰੀ ਸਮਾਂ", "JST": "ਜਪਾਨ ਮਿਆਰੀ ਸਮਾਂ", "AEDT": "ਆਸਟ੍ਰੇਲੀਆਈ ਪੂਰਬੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "WART": "ਪੱਛਮੀ ਅਰਜਨਟੀਨਾ ਮਿਆਰੀ ਸਮਾਂ", "GFT": "ਫ੍ਰੈਂਚ ਗੁਏਨਾ ਸਮਾਂ", "SRT": "ਸੂਰੀਨਾਮ ਸਮਾਂ", "COT": "ਕੋਲੰਬੀਆ ਮਿਆਰੀ ਸਮਾਂ", "EST": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਪੂਰਬੀ ਮਿਆਰੀ ਸਮਾਂ", "BT": "ਭੂਟਾਨ ਸਮਾਂ", "WESZ": "ਪੱਛਮੀ ਯੂਰਪੀ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "TMST": "ਤੁਰਕਮੇਨਿਸਤਾਨ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "ARST": "ਅਰਜਨਟੀਨਾ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "EDT": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਪੂਰਬੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "HAST": "ਹਵਾਈ-ਅਲੇਯੂਸ਼ਿਅਨ ਮਿਆਰੀ ਸਮਾਂ", "HADT": "ਹਵਾਈ-ਅਲੇਯੂਸ਼ਿਅਨ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "GMT": "ਗ੍ਰੀਨਵਿਚ ਮੀਨ ਟਾਈਮ", "WIT": "ਪੂਰਬੀ ਇੰਡੋਨੇਸ਼ੀਆ ਸਮਾਂ", "JDT": "ਜਪਾਨ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "ACWDT": "ਆਸਟ੍ਰੇਲੀਆਈ ਕੇਂਦਰੀ ਪੱਛਮੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "ADT": "ਅਟਲਾਂਟਿਕ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "WARST": "ਪੱਛਮੀ ਅਰਜਨਟੀਨਾ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "WIB": "ਪੱਛਮੀ ਇੰਡੋਨੇਸ਼ੀਆ ਸਮਾਂ", "∅∅∅": "ਅਮੇਜ਼ਨ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "ART": "ਅਰਜਨਟੀਨਾ ਮਿਆਰੀ ਸਮਾਂ", "BOT": "ਬੋਲੀਵੀਆ ਸਮਾਂ", "VET": "ਵੈਨੇਜ਼ੂਏਲਾ ਸਮਾਂ", "WAST": "ਪੱਛਮੀ ਅਫਰੀਕਾ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "ACDT": "ਆਸਟ੍ਰੇਲੀਆਈ ਕੇਂਦਰੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "MYT": "ਮਲੇਸ਼ੀਆ ਸਮਾਂ", "UYT": "ਉਰੂਗਵੇ ਮਿਆਰੀ ਸਮਾਂ", "AEST": "ਆਸਟ੍ਰੇਲੀਆਈ ਪੂਰਬੀ ਮਿਆਰੀ ਸਮਾਂ", "ACWST": "ਆਸਟ੍ਰੇਲੀਆਈ ਕੇਂਦਰੀ ਪੱਛਮੀ ਮਿਆਰੀ ਸਮਾਂ", "OESZ": "ਪੂਰਬੀ ਯੂਰਪੀ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "MST": "ਮਕਾਉ ਮਿਆਰੀ ਸਮਾਂ", "PST": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਪੈਸਿਫਿਕ ਮਿਆਰੀ ਸਮਾਂ", "UYST": "ਉਰੂਗਵੇ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "MESZ": "ਮੱਧ ਯੂਰਪੀ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "WAT": "ਪੱਛਮੀ ਅਫਰੀਕਾ ਮਿਆਰੀ ਸਮਾਂ", "HAT": "ਨਿਊਫਾਉਂਡਲੈਂਡ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "AKST": "ਅਲਾਸਕਾ ਮਿਆਰੀ ਸਮਾਂ", "AKDT": "ਅਲਾਸਕਾ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "CST": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਕੇਂਦਰੀ ਮਿਆਰੀ ਸਮਾਂ", "CDT": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਕੇਂਦਰੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "MEZ": "ਮੱਧ ਯੂਰਪੀ ਮਿਆਰੀ ਸਮਾਂ", "IST": "ਭਾਰਤੀ ਮਿਆਰੀ ਸਮਾਂ", "GYT": "ਗੁਯਾਨਾ ਸਮਾਂ"},
+ timezones: map[string]string{"CLT": "ਚਿਲੀ ਮਿਆਰੀ ਸਮਾਂ", "ACWST": "ਆਸਟ੍ਰੇਲੀਆਈ ਕੇਂਦਰੀ ਪੱਛਮੀ ਮਿਆਰੀ ਸਮਾਂ", "HAST": "ਹਵਾਈ-ਅਲੇਯੂਸ਼ਿਅਨ ਮਿਆਰੀ ਸਮਾਂ", "HNT": "ਨਿਊਫਾਉਂਡਲੈਂਡ ਮਿਆਰੀ ਸਮਾਂ", "MST": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਮਾਉਂਟੇਨ ਮਿਆਰੀ ਸਮਾਂ", "UYT": "ਉਰੂਗਵੇ ਮਿਆਰੀ ਸਮਾਂ", "SRT": "ਸੂਰੀਨਾਮ ਸਮਾਂ", "COST": "ਕੋਲੰਬੀਆ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "LHST": "ਲੌਰਡ ਹੋਵੇ ਮਿਆਰੀ ਸਮਾਂ", "ADT": "ਅਟਲਾਂਟਿਕ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "SGT": "ਸਿੰਗਾਪੁਰ ਮਿਆਰੀ ਸਮਾਂ", "GYT": "ਗੁਯਾਨਾ ਸਮਾਂ", "CDT": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਕੇਂਦਰੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "IST": "ਭਾਰਤੀ ਮਿਆਰੀ ਸਮਾਂ", "HKST": "ਹਾਂਗ ਕਾਂਗ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "PDT": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਪੈਸਿਫਿਕ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "GMT": "ਗ੍ਰੀਨਵਿਚ ਮੀਨ ਟਾਈਮ", "UYST": "ਉਰੂਗਵੇ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "∅∅∅": "ਬ੍ਰਾਜ਼ੀਲੀਆ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "CST": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਕੇਂਦਰੀ ਮਿਆਰੀ ਸਮਾਂ", "WART": "ਪੱਛਮੀ ਅਰਜਨਟੀਨਾ ਮਿਆਰੀ ਸਮਾਂ", "GFT": "ਫ੍ਰੈਂਚ ਗੁਏਨਾ ਸਮਾਂ", "CHADT": "ਚੈਥਮ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "HADT": "ਹਵਾਈ-ਅਲੇਯੂਸ਼ਿਅਨ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "AKST": "ਅਲਾਸਕਾ ਮਿਆਰੀ ਸਮਾਂ", "AKDT": "ਅਲਾਸਕਾ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "MESZ": "ਮੱਧ ਯੂਰਪੀ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "BOT": "ਬੋਲੀਵੀਆ ਸਮਾਂ", "OEZ": "ਪੂਰਬੀ ਯੂਰਪੀ ਮਿਆਰੀ ਸਮਾਂ", "ChST": "ਚਾਮੋਰੋ ਮਿਆਰੀ ਸਮਾਂ", "HKT": "ਹਾਂਗ ਕਾਂਗ ਮਿਆਰੀ ਸਮਾਂ", "JST": "ਜਪਾਨ ਮਿਆਰੀ ਸਮਾਂ", "WAT": "ਪੱਛਮੀ ਅਫਰੀਕਾ ਮਿਆਰੀ ਸਮਾਂ", "LHDT": "ਲੌਰਡ ਹੋਵੇ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "MDT": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਮਾਉਂਟੇਨ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "VET": "ਵੈਨੇਜ਼ੂਏਲਾ ਸਮਾਂ", "PST": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਪੈਸਿਫਿਕ ਮਿਆਰੀ ਸਮਾਂ", "CAT": "ਕੇਂਦਰੀ ਅਫਰੀਕਾ ਸਮਾਂ", "TMT": "ਤੁਰਕਮੇਨਿਸਤਾਨ ਮਿਆਰੀ ਸਮਾਂ", "BT": "ਭੂਟਾਨ ਸਮਾਂ", "AST": "ਅਟਲਾਂਟਿਕ ਮਿਆਰੀ ਸਮਾਂ", "AWDT": "ਆਸਟ੍ਰੇਲੀਆਈ ਪੱਛਮੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "WEZ": "ਪੱਛਮੀ ਯੂਰਪੀ ਮਿਆਰੀ ਸਮਾਂ", "CLST": "ਚਿਲੀ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "WIT": "ਪੂਰਬੀ ਇੰਡੋਨੇਸ਼ੀਆ ਸਮਾਂ", "AWST": "ਆਸਟ੍ਰੇਲੀਆਈ ਪੱਛਮੀ ਮਿਆਰੀ ਸਮਾਂ", "JDT": "ਜਪਾਨ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "WITA": "ਮੱਧ ਇੰਡੋਨੇਸ਼ੀਆਈ ਸਮਾਂ", "EST": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਪੂਰਬੀ ਮਿਆਰੀ ਸਮਾਂ", "HAT": "ਨਿਊਫਾਉਂਡਲੈਂਡ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "TMST": "ਤੁਰਕਮੇਨਿਸਤਾਨ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "MYT": "ਮਲੇਸ਼ੀਆ ਸਮਾਂ", "CHAST": "ਚੈਥਮ ਮਿਆਰੀ ਸਮਾਂ", "ART": "ਅਰਜਨਟੀਨਾ ਮਿਆਰੀ ਸਮਾਂ", "ARST": "ਅਰਜਨਟੀਨਾ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "MEZ": "ਮੱਧ ਯੂਰਪੀ ਮਿਆਰੀ ਸਮਾਂ", "NZST": "ਨਿਊਜ਼ੀਲੈਂਡ ਮਿਆਰੀ ਸਮਾਂ", "WESZ": "ਪੱਛਮੀ ਯੂਰਪੀ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "OESZ": "ਪੂਰਬੀ ਯੂਰਪੀ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "ACST": "ਆਸਟ੍ਰੇਲੀਆਈ ਕੇਂਦਰੀ ਮਿਆਰੀ ਸਮਾਂ", "ACDT": "ਆਸਟ੍ਰੇਲੀਆਈ ਕੇਂਦਰੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "ACWDT": "ਆਸਟ੍ਰੇਲੀਆਈ ਕੇਂਦਰੀ ਪੱਛਮੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "SAST": "ਦੱਖਣੀ ਅਫ਼ਰੀਕਾ ਮਿਆਰੀ ਸਮਾਂ", "WAST": "ਪੱਛਮੀ ਅਫਰੀਕਾ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "WIB": "ਪੱਛਮੀ ਇੰਡੋਨੇਸ਼ੀਆ ਸਮਾਂ", "AEDT": "ਆਸਟ੍ਰੇਲੀਆਈ ਪੂਰਬੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "EAT": "ਪੂਰਬੀ ਅਫਰੀਕਾ ਸਮਾਂ", "ECT": "ਇਕਵੇਡੋਰ ਸਮਾਂ", "COT": "ਕੋਲੰਬੀਆ ਮਿਆਰੀ ਸਮਾਂ", "AEST": "ਆਸਟ੍ਰੇਲੀਆਈ ਪੂਰਬੀ ਮਿਆਰੀ ਸਮਾਂ", "WARST": "ਪੱਛਮੀ ਅਰਜਨਟੀਨਾ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "EDT": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਪੂਰਬੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "NZDT": "ਨਿਊਜ਼ੀਲੈਂਡ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ"},
}
}
diff --git a/pa_Arab_PK/pa_Arab_PK_test.go b/pa_Arab_PK/pa_Arab_PK_test.go
new file mode 100644
index 00000000..248330b2
--- /dev/null
+++ b/pa_Arab_PK/pa_Arab_PK_test.go
@@ -0,0 +1,1120 @@
+package pa_Arab_PK
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "pa_Arab_PK"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/pa_Guru/pa_Guru.go b/pa_Guru/pa_Guru.go
index 0b2bd614..6e12b0ad 100644
--- a/pa_Guru/pa_Guru.go
+++ b/pa_Guru/pa_Guru.go
@@ -67,7 +67,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ਈ. ਪੂ.", "ਸੰਨ"},
erasNarrow: []string{"ਈ. ਪੂ.", "ਸੰਨ"},
erasWide: []string{"ਈਸਵੀ ਪੂਰਵ", "ਈਸਵੀ ਸੰਨ"},
- timezones: map[string]string{"SAST": "ਦੱਖਣੀ ਅਫ਼ਰੀਕਾ ਮਿਆਰੀ ਸਮਾਂ", "AKDT": "ਅਲਾਸਕਾ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "AEST": "ਆਸਟ੍ਰੇਲੀਆਈ ਪੂਰਬੀ ਮਿਆਰੀ ਸਮਾਂ", "HAST": "ਹਵਾਈ-ਅਲੇਯੂਸ਼ਿਅਨ ਮਿਆਰੀ ਸਮਾਂ", "AST": "ਅਟਲਾਂਟਿਕ ਮਿਆਰੀ ਸਮਾਂ", "OEZ": "ਪੂਰਬੀ ਯੂਰਪੀ ਮਿਆਰੀ ਸਮਾਂ", "ARST": "ਅਰਜਨਟੀਨਾ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "UYT": "ਉਰੂਗਵੇ ਮਿਆਰੀ ਸਮਾਂ", "HNT": "ਨਿਊਫਾਉਂਡਲੈਂਡ ਮਿਆਰੀ ਸਮਾਂ", "ACST": "ਆਸਟ੍ਰੇਲੀਆਈ ਕੇਂਦਰੀ ਮਿਆਰੀ ਸਮਾਂ", "MEZ": "ਮੱਧ ਯੂਰਪੀ ਮਿਆਰੀ ਸਮਾਂ", "EDT": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਪੂਰਬੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "COST": "ਕੋਲੰਬੀਆ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "HAT": "ਨਿਊਫਾਉਂਡਲੈਂਡ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "JDT": "ਜਪਾਨ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "MDT": "ਮਕਾਉ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "AKST": "ਅਲਾਸਕਾ ਮਿਆਰੀ ਸਮਾਂ", "AEDT": "ਆਸਟ੍ਰੇਲੀਆਈ ਪੂਰਬੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "COT": "ਕੋਲੰਬੀਆ ਮਿਆਰੀ ਸਮਾਂ", "BT": "ਭੂਟਾਨ ਸਮਾਂ", "GMT": "ਗ੍ਰੀਨਵਿਚ ਮੀਨ ਟਾਈਮ", "TMT": "ਤੁਰਕਮੇਨਿਸਤਾਨ ਮਿਆਰੀ ਸਮਾਂ", "EAT": "ਪੂਰਬੀ ਅਫਰੀਕਾ ਸਮਾਂ", "CDT": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਕੇਂਦਰੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "VET": "ਵੈਨੇਜ਼ੂਏਲਾ ਸਮਾਂ", "ECT": "ਇਕਵੇਡੋਰ ਸਮਾਂ", "WART": "ਪੱਛਮੀ ਅਰਜਨਟੀਨਾ ਮਿਆਰੀ ਸਮਾਂ", "GYT": "ਗੁਯਾਨਾ ਸਮਾਂ", "CHAST": "ਚੈਥਮ ਮਿਆਰੀ ਸਮਾਂ", "SGT": "ਸਿੰਗਾਪੁਰ ਮਿਆਰੀ ਸਮਾਂ", "WARST": "ਪੱਛਮੀ ਅਰਜਨਟੀਨਾ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "ACDT": "ਆਸਟ੍ਰੇਲੀਆਈ ਕੇਂਦਰੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "TMST": "ਤੁਰਕਮੇਨਿਸਤਾਨ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "HADT": "ਹਵਾਈ-ਅਲੇਯੂਸ਼ਿਅਨ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "WITA": "ਮੱਧ ਇੰਡੋਨੇਸ਼ੀਆਈ ਸਮਾਂ", "PST": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਪੈਸਿਫਿਕ ਮਿਆਰੀ ਸਮਾਂ", "AWST": "ਆਸਟ੍ਰੇਲੀਆਈ ਪੱਛਮੀ ਮਿਆਰੀ ਸਮਾਂ", "LHST": "ਲੌਰਡ ਹੋਵੇ ਮਿਆਰੀ ਸਮਾਂ", "CHADT": "ਚੈਥਮ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "WESZ": "ਪੱਛਮੀ ਯੂਰਪੀ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "WAT": "ਪੱਛਮੀ ਅਫਰੀਕਾ ਮਿਆਰੀ ਸਮਾਂ", "OESZ": "ਪੂਰਬੀ ਯੂਰਪੀ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "AWDT": "ਆਸਟ੍ਰੇਲੀਆਈ ਪੱਛਮੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "ChST": "ਚਾਮੋਰੋ ਮਿਆਰੀ ਸਮਾਂ", "EST": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਪੂਰਬੀ ਮਿਆਰੀ ਸਮਾਂ", "CAT": "ਕੇਂਦਰੀ ਅਫਰੀਕਾ ਸਮਾਂ", "MST": "ਮਕਾਉ ਮਿਆਰੀ ਸਮਾਂ", "NZDT": "ਨਿਊਜ਼ੀਲੈਂਡ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "ACWDT": "ਆਸਟ੍ਰੇਲੀਆਈ ਕੇਂਦਰੀ ਪੱਛਮੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "WEZ": "ਪੱਛਮੀ ਯੂਰਪੀ ਮਿਆਰੀ ਸਮਾਂ", "HKT": "ਹਾਂਗ ਕਾਂਗ ਮਿਆਰੀ ਸਮਾਂ", "WIB": "ਪੱਛਮੀ ਇੰਡੋਨੇਸ਼ੀਆ ਸਮਾਂ", "PDT": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਪੈਸਿਫਿਕ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "SRT": "ਸੂਰੀਨਾਮ ਸਮਾਂ", "CLST": "ਚਿਲੀ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "WAST": "ਪੱਛਮੀ ਅਫਰੀਕਾ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "HKST": "ਹਾਂਗ ਕਾਂਗ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "GFT": "ਫ੍ਰੈਂਚ ਗੁਏਨਾ ਸਮਾਂ", "ART": "ਅਰਜਨਟੀਨਾ ਮਿਆਰੀ ਸਮਾਂ", "JST": "ਜਪਾਨ ਮਿਆਰੀ ਸਮਾਂ", "NZST": "ਨਿਊਜ਼ੀਲੈਂਡ ਮਿਆਰੀ ਸਮਾਂ", "∅∅∅": "ਬ੍ਰਾਜ਼ੀਲੀਆ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "WIT": "ਪੂਰਬੀ ਇੰਡੋਨੇਸ਼ੀਆ ਸਮਾਂ", "IST": "ਭਾਰਤੀ ਮਿਆਰੀ ਸਮਾਂ", "BOT": "ਬੋਲੀਵੀਆ ਸਮਾਂ", "LHDT": "ਲੌਰਡ ਹੋਵੇ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "MYT": "ਮਲੇਸ਼ੀਆ ਸਮਾਂ", "MESZ": "ਮੱਧ ਯੂਰਪੀ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "UYST": "ਉਰੂਗਵੇ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "CLT": "ਚਿਲੀ ਮਿਆਰੀ ਸਮਾਂ", "ADT": "ਅਟਲਾਂਟਿਕ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "CST": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਕੇਂਦਰੀ ਮਿਆਰੀ ਸਮਾਂ", "ACWST": "ਆਸਟ੍ਰੇਲੀਆਈ ਕੇਂਦਰੀ ਪੱਛਮੀ ਮਿਆਰੀ ਸਮਾਂ"},
+ timezones: map[string]string{"ChST": "ਚਾਮੋਰੋ ਮਿਆਰੀ ਸਮਾਂ", "LHDT": "ਲੌਰਡ ਹੋਵੇ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "ACDT": "ਆਸਟ੍ਰੇਲੀਆਈ ਕੇਂਦਰੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "HKST": "ਹਾਂਗ ਕਾਂਗ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "EST": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਪੂਰਬੀ ਮਿਆਰੀ ਸਮਾਂ", "PST": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਪੈਸਿਫਿਕ ਮਿਆਰੀ ਸਮਾਂ", "GMT": "ਗ੍ਰੀਨਵਿਚ ਮੀਨ ਟਾਈਮ", "HKT": "ਹਾਂਗ ਕਾਂਗ ਮਿਆਰੀ ਸਮਾਂ", "WESZ": "ਪੱਛਮੀ ਯੂਰਪੀ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "WIT": "ਪੂਰਬੀ ਇੰਡੋਨੇਸ਼ੀਆ ਸਮਾਂ", "ARST": "ਅਰਜਨਟੀਨਾ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "PDT": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਪੈਸਿਫਿਕ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "ECT": "ਇਕਵੇਡੋਰ ਸਮਾਂ", "HAST": "ਹਵਾਈ-ਅਲੇਯੂਸ਼ਿਅਨ ਮਿਆਰੀ ਸਮਾਂ", "NZST": "ਨਿਊਜ਼ੀਲੈਂਡ ਮਿਆਰੀ ਸਮਾਂ", "OESZ": "ਪੂਰਬੀ ਯੂਰਪੀ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "CDT": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਕੇਂਦਰੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "MDT": "ਮਕਾਉ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "JST": "ਜਪਾਨ ਮਿਆਰੀ ਸਮਾਂ", "AST": "ਅਟਲਾਂਟਿਕ ਮਿਆਰੀ ਸਮਾਂ", "IST": "ਭਾਰਤੀ ਮਿਆਰੀ ਸਮਾਂ", "ACWDT": "ਆਸਟ੍ਰੇਲੀਆਈ ਕੇਂਦਰੀ ਪੱਛਮੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "EDT": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਪੂਰਬੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "SGT": "ਸਿੰਗਾਪੁਰ ਮਿਆਰੀ ਸਮਾਂ", "WAT": "ਪੱਛਮੀ ਅਫਰੀਕਾ ਮਿਆਰੀ ਸਮਾਂ", "HAT": "ਨਿਊਫਾਉਂਡਲੈਂਡ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "UYST": "ਉਰੂਗਵੇ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "GFT": "ਫ੍ਰੈਂਚ ਗੁਏਨਾ ਸਮਾਂ", "AKST": "ਅਲਾਸਕਾ ਮਿਆਰੀ ਸਮਾਂ", "MEZ": "ਮੱਧ ਯੂਰਪੀ ਮਿਆਰੀ ਸਮਾਂ", "SAST": "ਦੱਖਣੀ ਅਫ਼ਰੀਕਾ ਮਿਆਰੀ ਸਮਾਂ", "LHST": "ਲੌਰਡ ਹੋਵੇ ਮਿਆਰੀ ਸਮਾਂ", "CST": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਕੇਂਦਰੀ ਮਿਆਰੀ ਸਮਾਂ", "CHAST": "ਚੈਥਮ ਮਿਆਰੀ ਸਮਾਂ", "ACWST": "ਆਸਟ੍ਰੇਲੀਆਈ ਕੇਂਦਰੀ ਪੱਛਮੀ ਮਿਆਰੀ ਸਮਾਂ", "AWDT": "ਆਸਟ੍ਰੇਲੀਆਈ ਪੱਛਮੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "AEDT": "ਆਸਟ੍ਰੇਲੀਆਈ ਪੂਰਬੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "VET": "ਵੈਨੇਜ਼ੂਏਲਾ ਸਮਾਂ", "WAST": "ਪੱਛਮੀ ਅਫਰੀਕਾ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "MYT": "ਮਲੇਸ਼ੀਆ ਸਮਾਂ", "SRT": "ਸੂਰੀਨਾਮ ਸਮਾਂ", "∅∅∅": "ਅਜੋਰੇਸ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "ART": "ਅਰਜਨਟੀਨਾ ਮਿਆਰੀ ਸਮਾਂ", "ADT": "ਅਟਲਾਂਟਿਕ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "CAT": "ਕੇਂਦਰੀ ਅਫਰੀਕਾ ਸਮਾਂ", "TMT": "ਤੁਰਕਮੇਨਿਸਤਾਨ ਮਿਆਰੀ ਸਮਾਂ", "HNT": "ਨਿਊਫਾਉਂਡਲੈਂਡ ਮਿਆਰੀ ਸਮਾਂ", "GYT": "ਗੁਯਾਨਾ ਸਮਾਂ", "CLT": "ਚਿਲੀ ਮਿਆਰੀ ਸਮਾਂ", "CHADT": "ਚੈਥਮ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "AKDT": "ਅਲਾਸਕਾ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "BOT": "ਬੋਲੀਵੀਆ ਸਮਾਂ", "COST": "ਕੋਲੰਬੀਆ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "CLST": "ਚਿਲੀ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "BT": "ਭੂਟਾਨ ਸਮਾਂ", "WITA": "ਮੱਧ ਇੰਡੋਨੇਸ਼ੀਆਈ ਸਮਾਂ", "OEZ": "ਪੂਰਬੀ ਯੂਰਪੀ ਮਿਆਰੀ ਸਮਾਂ", "EAT": "ਪੂਰਬੀ ਅਫਰੀਕਾ ਸਮਾਂ", "WARST": "ਪੱਛਮੀ ਅਰਜਨਟੀਨਾ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "MST": "ਮਕਾਉ ਮਿਆਰੀ ਸਮਾਂ", "COT": "ਕੋਲੰਬੀਆ ਮਿਆਰੀ ਸਮਾਂ", "TMST": "ਤੁਰਕਮੇਨਿਸਤਾਨ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "ACST": "ਆਸਟ੍ਰੇਲੀਆਈ ਕੇਂਦਰੀ ਮਿਆਰੀ ਸਮਾਂ", "WART": "ਪੱਛਮੀ ਅਰਜਨਟੀਨਾ ਮਿਆਰੀ ਸਮਾਂ", "JDT": "ਜਪਾਨ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "NZDT": "ਨਿਊਜ਼ੀਲੈਂਡ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "WIB": "ਪੱਛਮੀ ਇੰਡੋਨੇਸ਼ੀਆ ਸਮਾਂ", "AEST": "ਆਸਟ੍ਰੇਲੀਆਈ ਪੂਰਬੀ ਮਿਆਰੀ ਸਮਾਂ", "UYT": "ਉਰੂਗਵੇ ਮਿਆਰੀ ਸਮਾਂ", "AWST": "ਆਸਟ੍ਰੇਲੀਆਈ ਪੱਛਮੀ ਮਿਆਰੀ ਸਮਾਂ", "MESZ": "ਮੱਧ ਯੂਰਪੀ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "HADT": "ਹਵਾਈ-ਅਲੇਯੂਸ਼ਿਅਨ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "WEZ": "ਪੱਛਮੀ ਯੂਰਪੀ ਮਿਆਰੀ ਸਮਾਂ"},
}
}
diff --git a/pa_Guru/pa_Guru_test.go b/pa_Guru/pa_Guru_test.go
new file mode 100644
index 00000000..d33a9c6d
--- /dev/null
+++ b/pa_Guru/pa_Guru_test.go
@@ -0,0 +1,1120 @@
+package pa_Guru
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "pa_Guru"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/pa_Guru_IN/pa_Guru_IN.go b/pa_Guru_IN/pa_Guru_IN.go
index 7e1ff553..5944235f 100644
--- a/pa_Guru_IN/pa_Guru_IN.go
+++ b/pa_Guru_IN/pa_Guru_IN.go
@@ -67,7 +67,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ਈ. ਪੂ.", "ਸੰਨ"},
erasNarrow: []string{"ਈ. ਪੂ.", "ਸੰਨ"},
erasWide: []string{"ਈਸਵੀ ਪੂਰਵ", "ਈਸਵੀ ਸੰਨ"},
- timezones: map[string]string{"WIT": "ਪੂਰਬੀ ਇੰਡੋਨੇਸ਼ੀਆ ਸਮਾਂ", "∅∅∅": "ਅਮੇਜ਼ਨ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "NZST": "ਨਿਊਜ਼ੀਲੈਂਡ ਮਿਆਰੀ ਸਮਾਂ", "ACWDT": "ਆਸਟ੍ਰੇਲੀਆਈ ਕੇਂਦਰੀ ਪੱਛਮੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "AEDT": "ਆਸਟ੍ਰੇਲੀਆਈ ਪੂਰਬੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "EST": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਪੂਰਬੀ ਮਿਆਰੀ ਸਮਾਂ", "AWDT": "ਆਸਟ੍ਰੇਲੀਆਈ ਪੱਛਮੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "CHAST": "ਚੈਥਮ ਮਿਆਰੀ ਸਮਾਂ", "WESZ": "ਪੱਛਮੀ ਯੂਰਪੀ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "HKT": "ਹਾਂਗ ਕਾਂਗ ਮਿਆਰੀ ਸਮਾਂ", "GYT": "ਗੁਯਾਨਾ ਸਮਾਂ", "AKST": "ਅਲਾਸਕਾ ਮਿਆਰੀ ਸਮਾਂ", "ARST": "ਅਰਜਨਟੀਨਾ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "UYT": "ਉਰੂਗਵੇ ਮਿਆਰੀ ਸਮਾਂ", "CLST": "ਚਿਲੀ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "EDT": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਪੂਰਬੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "SGT": "ਸਿੰਗਾਪੁਰ ਮਿਆਰੀ ਸਮਾਂ", "BT": "ਭੂਟਾਨ ਸਮਾਂ", "HAT": "ਨਿਊਫਾਉਂਡਲੈਂਡ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "OEZ": "ਪੂਰਬੀ ਯੂਰਪੀ ਮਿਆਰੀ ਸਮਾਂ", "SRT": "ਸੂਰੀਨਾਮ ਸਮਾਂ", "HNT": "ਨਿਊਫਾਉਂਡਲੈਂਡ ਮਿਆਰੀ ਸਮਾਂ", "GFT": "ਫ੍ਰੈਂਚ ਗੁਏਨਾ ਸਮਾਂ", "TMST": "ਤੁਰਕਮੇਨਿਸਤਾਨ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "PST": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਪੈਸਿਫਿਕ ਮਿਆਰੀ ਸਮਾਂ", "PDT": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਪੈਸਿਫਿਕ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "UYST": "ਉਰੂਗਵੇ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "MYT": "ਮਲੇਸ਼ੀਆ ਸਮਾਂ", "ACWST": "ਆਸਟ੍ਰੇਲੀਆਈ ਕੇਂਦਰੀ ਪੱਛਮੀ ਮਿਆਰੀ ਸਮਾਂ", "WAST": "ਪੱਛਮੀ ਅਫਰੀਕਾ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "IST": "ਭਾਰਤੀ ਮਿਆਰੀ ਸਮਾਂ", "ACST": "ਆਸਟ੍ਰੇਲੀਆਈ ਕੇਂਦਰੀ ਮਿਆਰੀ ਸਮਾਂ", "COT": "ਕੋਲੰਬੀਆ ਮਿਆਰੀ ਸਮਾਂ", "HAST": "ਹਵਾਈ-ਅਲੇਯੂਸ਼ਿਅਨ ਮਿਆਰੀ ਸਮਾਂ", "ART": "ਅਰਜਨਟੀਨਾ ਮਿਆਰੀ ਸਮਾਂ", "MDT": "ਮਕਾਉ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "JST": "ਜਪਾਨ ਮਿਆਰੀ ਸਮਾਂ", "MESZ": "ਮੱਧ ਯੂਰਪੀ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "CHADT": "ਚੈਥਮ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "WEZ": "ਪੱਛਮੀ ਯੂਰਪੀ ਮਿਆਰੀ ਸਮਾਂ", "AEST": "ਆਸਟ੍ਰੇਲੀਆਈ ਪੂਰਬੀ ਮਿਆਰੀ ਸਮਾਂ", "ECT": "ਇਕਵੇਡੋਰ ਸਮਾਂ", "EAT": "ਪੂਰਬੀ ਅਫਰੀਕਾ ਸਮਾਂ", "LHDT": "ਲੌਰਡ ਹੋਵੇ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "BOT": "ਬੋਲੀਵੀਆ ਸਮਾਂ", "CAT": "ਕੇਂਦਰੀ ਅਫਰੀਕਾ ਸਮਾਂ", "AST": "ਅਟਲਾਂਟਿਕ ਮਿਆਰੀ ਸਮਾਂ", "CST": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਕੇਂਦਰੀ ਮਿਆਰੀ ਸਮਾਂ", "WITA": "ਮੱਧ ਇੰਡੋਨੇਸ਼ੀਆਈ ਸਮਾਂ", "TMT": "ਤੁਰਕਮੇਨਿਸਤਾਨ ਮਿਆਰੀ ਸਮਾਂ", "JDT": "ਜਪਾਨ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "ChST": "ਚਾਮੋਰੋ ਮਿਆਰੀ ਸਮਾਂ", "CLT": "ਚਿਲੀ ਮਿਆਰੀ ਸਮਾਂ", "HKST": "ਹਾਂਗ ਕਾਂਗ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "ACDT": "ਆਸਟ੍ਰੇਲੀਆਈ ਕੇਂਦਰੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "LHST": "ਲੌਰਡ ਹੋਵੇ ਮਿਆਰੀ ਸਮਾਂ", "CDT": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਕੇਂਦਰੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "WIB": "ਪੱਛਮੀ ਇੰਡੋਨੇਸ਼ੀਆ ਸਮਾਂ", "GMT": "ਗ੍ਰੀਨਵਿਚ ਮੀਨ ਟਾਈਮ", "AKDT": "ਅਲਾਸਕਾ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "HADT": "ਹਵਾਈ-ਅਲੇਯੂਸ਼ਿਅਨ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "WART": "ਪੱਛਮੀ ਅਰਜਨਟੀਨਾ ਮਿਆਰੀ ਸਮਾਂ", "SAST": "ਦੱਖਣੀ ਅਫ਼ਰੀਕਾ ਮਿਆਰੀ ਸਮਾਂ", "OESZ": "ਪੂਰਬੀ ਯੂਰਪੀ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "COST": "ਕੋਲੰਬੀਆ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "ADT": "ਅਟਲਾਂਟਿਕ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "MST": "ਮਕਾਉ ਮਿਆਰੀ ਸਮਾਂ", "MEZ": "ਮੱਧ ਯੂਰਪੀ ਮਿਆਰੀ ਸਮਾਂ", "VET": "ਵੈਨੇਜ਼ੂਏਲਾ ਸਮਾਂ", "WARST": "ਪੱਛਮੀ ਅਰਜਨਟੀਨਾ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "NZDT": "ਨਿਊਜ਼ੀਲੈਂਡ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "WAT": "ਪੱਛਮੀ ਅਫਰੀਕਾ ਮਿਆਰੀ ਸਮਾਂ", "AWST": "ਆਸਟ੍ਰੇਲੀਆਈ ਪੱਛਮੀ ਮਿਆਰੀ ਸਮਾਂ"},
+ timezones: map[string]string{"UYT": "ਉਰੂਗਵੇ ਮਿਆਰੀ ਸਮਾਂ", "GFT": "ਫ੍ਰੈਂਚ ਗੁਏਨਾ ਸਮਾਂ", "VET": "ਵੈਨੇਜ਼ੂਏਲਾ ਸਮਾਂ", "MESZ": "ਮੱਧ ਯੂਰਪੀ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "SGT": "ਸਿੰਗਾਪੁਰ ਮਿਆਰੀ ਸਮਾਂ", "WAST": "ਪੱਛਮੀ ਅਫਰੀਕਾ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "HNT": "ਨਿਊਫਾਉਂਡਲੈਂਡ ਮਿਆਰੀ ਸਮਾਂ", "LHST": "ਲੌਰਡ ਹੋਵੇ ਮਿਆਰੀ ਸਮਾਂ", "JDT": "ਜਪਾਨ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "AKST": "ਅਲਾਸਕਾ ਮਿਆਰੀ ਸਮਾਂ", "ACWST": "ਆਸਟ੍ਰੇਲੀਆਈ ਕੇਂਦਰੀ ਪੱਛਮੀ ਮਿਆਰੀ ਸਮਾਂ", "EST": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਪੂਰਬੀ ਮਿਆਰੀ ਸਮਾਂ", "COT": "ਕੋਲੰਬੀਆ ਮਿਆਰੀ ਸਮਾਂ", "TMT": "ਤੁਰਕਮੇਨਿਸਤਾਨ ਮਿਆਰੀ ਸਮਾਂ", "ACDT": "ਆਸਟ੍ਰੇਲੀਆਈ ਕੇਂਦਰੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "HKST": "ਹਾਂਗ ਕਾਂਗ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "PST": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਪੈਸਿਫਿਕ ਮਿਆਰੀ ਸਮਾਂ", "PDT": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਪੈਸਿਫਿਕ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "HKT": "ਹਾਂਗ ਕਾਂਗ ਮਿਆਰੀ ਸਮਾਂ", "ACWDT": "ਆਸਟ੍ਰੇਲੀਆਈ ਕੇਂਦਰੀ ਪੱਛਮੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "UYST": "ਉਰੂਗਵੇ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "BT": "ਭੂਟਾਨ ਸਮਾਂ", "ECT": "ਇਕਵੇਡੋਰ ਸਮਾਂ", "WEZ": "ਪੱਛਮੀ ਯੂਰਪੀ ਮਿਆਰੀ ਸਮਾਂ", "ChST": "ਚਾਮੋਰੋ ਮਿਆਰੀ ਸਮਾਂ", "WARST": "ਪੱਛਮੀ ਅਰਜਨਟੀਨਾ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "SRT": "ਸੂਰੀਨਾਮ ਸਮਾਂ", "MDT": "ਮਕਾਉ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "CHAST": "ਚੈਥਮ ਮਿਆਰੀ ਸਮਾਂ", "AST": "ਅਟਲਾਂਟਿਕ ਮਿਆਰੀ ਸਮਾਂ", "NZST": "ਨਿਊਜ਼ੀਲੈਂਡ ਮਿਆਰੀ ਸਮਾਂ", "EDT": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਪੂਰਬੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "CLST": "ਚਿਲੀ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "∅∅∅": "ਅਜੋਰੇਸ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "MEZ": "ਮੱਧ ਯੂਰਪੀ ਮਿਆਰੀ ਸਮਾਂ", "OEZ": "ਪੂਰਬੀ ਯੂਰਪੀ ਮਿਆਰੀ ਸਮਾਂ", "AEST": "ਆਸਟ੍ਰੇਲੀਆਈ ਪੂਰਬੀ ਮਿਆਰੀ ਸਮਾਂ", "CST": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਕੇਂਦਰੀ ਮਿਆਰੀ ਸਮਾਂ", "ARST": "ਅਰਜਨਟੀਨਾ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "COST": "ਕੋਲੰਬੀਆ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "WESZ": "ਪੱਛਮੀ ਯੂਰਪੀ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "NZDT": "ਨਿਊਜ਼ੀਲੈਂਡ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "TMST": "ਤੁਰਕਮੇਨਿਸਤਾਨ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "WAT": "ਪੱਛਮੀ ਅਫਰੀਕਾ ਮਿਆਰੀ ਸਮਾਂ", "MYT": "ਮਲੇਸ਼ੀਆ ਸਮਾਂ", "CDT": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਕੇਂਦਰੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "MST": "ਮਕਾਉ ਮਿਆਰੀ ਸਮਾਂ", "SAST": "ਦੱਖਣੀ ਅਫ਼ਰੀਕਾ ਮਿਆਰੀ ਸਮਾਂ", "IST": "ਭਾਰਤੀ ਮਿਆਰੀ ਸਮਾਂ", "EAT": "ਪੂਰਬੀ ਅਫਰੀਕਾ ਸਮਾਂ", "LHDT": "ਲੌਰਡ ਹੋਵੇ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "ACST": "ਆਸਟ੍ਰੇਲੀਆਈ ਕੇਂਦਰੀ ਮਿਆਰੀ ਸਮਾਂ", "ADT": "ਅਟਲਾਂਟਿਕ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "CAT": "ਕੇਂਦਰੀ ਅਫਰੀਕਾ ਸਮਾਂ", "AEDT": "ਆਸਟ੍ਰੇਲੀਆਈ ਪੂਰਬੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "ART": "ਅਰਜਨਟੀਨਾ ਮਿਆਰੀ ਸਮਾਂ", "HAST": "ਹਵਾਈ-ਅਲੇਯੂਸ਼ਿਅਨ ਮਿਆਰੀ ਸਮਾਂ", "GYT": "ਗੁਯਾਨਾ ਸਮਾਂ", "WART": "ਪੱਛਮੀ ਅਰਜਨਟੀਨਾ ਮਿਆਰੀ ਸਮਾਂ", "WITA": "ਮੱਧ ਇੰਡੋਨੇਸ਼ੀਆਈ ਸਮਾਂ", "AWDT": "ਆਸਟ੍ਰੇਲੀਆਈ ਪੱਛਮੀ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "OESZ": "ਪੂਰਬੀ ਯੂਰਪੀ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "JST": "ਜਪਾਨ ਮਿਆਰੀ ਸਮਾਂ", "AKDT": "ਅਲਾਸਕਾ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "WIB": "ਪੱਛਮੀ ਇੰਡੋਨੇਸ਼ੀਆ ਸਮਾਂ", "HAT": "ਨਿਊਫਾਉਂਡਲੈਂਡ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "GMT": "ਗ੍ਰੀਨਵਿਚ ਮੀਨ ਟਾਈਮ", "CLT": "ਚਿਲੀ ਮਿਆਰੀ ਸਮਾਂ", "WIT": "ਪੂਰਬੀ ਇੰਡੋਨੇਸ਼ੀਆ ਸਮਾਂ", "CHADT": "ਚੈਥਮ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "AWST": "ਆਸਟ੍ਰੇਲੀਆਈ ਪੱਛਮੀ ਮਿਆਰੀ ਸਮਾਂ", "HADT": "ਹਵਾਈ-ਅਲੇਯੂਸ਼ਿਅਨ ਪ੍ਰਕਾਸ਼ ਸਮਾਂ", "BOT": "ਬੋਲੀਵੀਆ ਸਮਾਂ"},
}
}
diff --git a/pa_Guru_IN/pa_Guru_IN_test.go b/pa_Guru_IN/pa_Guru_IN_test.go
new file mode 100644
index 00000000..2ac60eef
--- /dev/null
+++ b/pa_Guru_IN/pa_Guru_IN_test.go
@@ -0,0 +1,1120 @@
+package pa_Guru_IN
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "pa_Guru_IN"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/pl/pl.go b/pl/pl.go
index dc47fa89..ac19fcab 100644
--- a/pl/pl.go
+++ b/pl/pl.go
@@ -48,7 +48,7 @@ func New() locales.Translator {
locale: "pl",
pluralsCardinal: []locales.PluralRule{2, 4, 5, 6},
pluralsOrdinal: []locales.PluralRule{6},
- pluralsRange: []locales.PluralRule{4, 5, 6, 2},
+ pluralsRange: []locales.PluralRule{6, 2, 4, 5},
decimal: ",",
group: " ",
minus: "-",
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"p.n.e.", "n.e."},
erasNarrow: []string{"", ""},
erasWide: []string{"p.n.e.", "n.e."},
- timezones: map[string]string{"TMST": "Turkmenistan (czas letni)", "MDT": "MDT", "AKDT": "Alaska (czas letni)", "CLT": "Chile (czas standardowy)", "ADT": "Czas atlantycki letni", "HAT": "Nowa Fundlandia (czas letni)", "∅∅∅": "Czas amazoński letni", "UYST": "Urugwaj (czas letni)", "HKT": "Hongkong (czas standardowy)", "GMT": "Czas uniwersalny", "OESZ": "Czas wschodnioeuropejski letni", "LHDT": "Lord Howe (czas letni)", "GYT": "Gujana", "WIT": "Indonezja Wschodnia", "LHST": "Lord Howe (czas standardowy)", "CAT": "Czas środkowoafrykański", "NZDT": "Nowa Zelandia (czas letni)", "CDT": "Czas środkowoamerykański letni", "PST": "Czas pacyficzny standardowy", "WESZ": "Czas zachodnioeuropejski letni", "ECT": "Ekwador", "SGT": "Singapur", "WART": "Argentyna Zachodnia (czas standardowy)", "HNT": "Nowa Fundlandia (czas standardowy)", "MYT": "Malezja", "CHADT": "Chatham (czas letni)", "CLST": "Chile (czas letni)", "COST": "Kolumbia (czas letni)", "SAST": "Czas południowoafrykański", "ACDT": "Czas środkowoaustralijski letni", "ChST": "Czamorro", "ACST": "Czas środkowoaustralijski standardowy", "MST": "MST", "WEZ": "Czas zachodnioeuropejski standardowy", "ACWST": "Czas środkowo-zachodnioaustralijski standardowy", "COT": "Kolumbia (czas standardowy)", "HKST": "Hongkong (czas letni)", "GFT": "Gujana Francuska", "WIB": "Indonezja Zachodnia", "MEZ": "Czas środkowoeuropejski standardowy", "HAST": "Hawaje-Aleuty (czas standardowy)", "WAT": "Czas zachodnioafrykański standardowy", "ARST": "Argentyna (czas letni)", "MESZ": "Czas środkowoeuropejski letni", "SRT": "Surinam", "NZST": "Nowa Zelandia (czas standardowy)", "BT": "Bhutan", "WITA": "Indonezja Środkowa", "OEZ": "Czas wschodnioeuropejski standardowy", "WARST": "Argentyna Zachodnia (czas letni)", "TMT": "Turkmenistan (czas standardowy)", "AST": "Czas standardowy atlantycki", "ACWDT": "Czas środkowo-zachodnioaustralijski letni", "EST": "Czas wschodnioamerykański standardowy", "EAT": "Czas wschodnioafrykański", "JDT": "Japonia (czas letni)", "PDT": "Czas pacyficzny letni", "BOT": "Boliwia", "CST": "Czas środkowoamerykański standardowy", "AEDT": "Czas wschodnioaustraliski letni", "CHAST": "Chatham (czas standardowy)", "VET": "Wenezuela", "AWDT": "Czas zachodnioaustralijski letni", "AKST": "Alaska (czas standardowy)", "ART": "Argentyna (czas standardowy)", "WAST": "Czas zachodnioafrykański letni", "JST": "Japonia (czas standardowy)", "UYT": "Urugwaj (czas standardowy)", "AEST": "Czas standardowy wschodnioaustraliski", "EDT": "Czas wschodnioamerykański letni", "HADT": "Hawaje-Aleuty (czas letni)", "IST": "Czas indyjski", "AWST": "Czas zachodnioaustralijski standardowy"},
+ timezones: map[string]string{"ACDT": "Czas środkowoaustralijski letni", "JST": "Japonia (czas standardowy)", "WAST": "Czas zachodnioafrykański letni", "∅∅∅": "Brasília (czas letni)", "CDT": "Czas środkowoamerykański letni", "PDT": "Czas pacyficzny letni", "TMT": "Turkmenistan (czas standardowy)", "AEDT": "Czas wschodnioaustraliski letni", "CLT": "Chile (czas standardowy)", "WITA": "Indonezja Środkowa", "AKST": "Alaska (czas standardowy)", "EST": "Czas wschodnioamerykański standardowy", "COST": "Kolumbia (czas letni)", "WESZ": "Czas zachodnioeuropejski letni", "HAT": "Nowa Fundlandia (czas letni)", "ChST": "Czamorro", "WIT": "Indonezja Wschodnia", "AKDT": "Alaska (czas letni)", "NZDT": "Nowa Zelandia (czas letni)", "COT": "Kolumbia (czas standardowy)", "MEZ": "Czas środkowoeuropejski standardowy", "BOT": "Boliwia", "SGT": "Singapur", "WIB": "Indonezja Zachodnia", "WARST": "Argentyna Zachodnia (czas letni)", "SRT": "Surinam", "HKT": "Hongkong (czas standardowy)", "ART": "Argentyna (czas standardowy)", "HNT": "Nowa Fundlandia (czas standardowy)", "HADT": "Hawaje-Aleuty (czas letni)", "EDT": "Czas wschodnioamerykański letni", "LHDT": "Lord Howe (czas letni)", "ACST": "Czas środkowoaustralijski standardowy", "CHADT": "Chatham (czas letni)", "HAST": "Hawaje-Aleuty (czas standardowy)", "HKST": "Hongkong (czas letni)", "AWST": "Czas zachodnioaustralijski standardowy", "WAT": "Czas zachodnioafrykański standardowy", "MYT": "Malezja", "JDT": "Japonia (czas letni)", "WEZ": "Czas zachodnioeuropejski standardowy", "GYT": "Gujana", "OEZ": "Czas wschodnioeuropejski standardowy", "OESZ": "Czas wschodnioeuropejski letni", "UYST": "Urugwaj (czas letni)", "LHST": "Lord Howe (czas standardowy)", "CST": "Czas środkowoamerykański standardowy", "AWDT": "Czas zachodnioaustralijski letni", "GMT": "Czas uniwersalny", "CHAST": "Chatham (czas standardowy)", "ACWDT": "Czas środkowo-zachodnioaustralijski letni", "SAST": "Czas południowoafrykański", "IST": "Czas indyjski", "TMST": "Turkmenistan (czas letni)", "MST": "Czas górski standardowy", "WART": "Argentyna Zachodnia (czas standardowy)", "AST": "Czas standardowy atlantycki", "ADT": "Czas atlantycki letni", "AEST": "Czas standardowy wschodnioaustraliski", "PST": "Czas pacyficzny standardowy", "EAT": "Czas wschodnioafrykański", "BT": "Bhutan", "MDT": "Czas górski letni", "NZST": "Nowa Zelandia (czas standardowy)", "GFT": "Gujana Francuska", "ACWST": "Czas środkowo-zachodnioaustralijski standardowy", "MESZ": "Czas środkowoeuropejski letni", "CAT": "Czas środkowoafrykański", "ARST": "Argentyna (czas letni)", "CLST": "Chile (czas letni)", "UYT": "Urugwaj (czas standardowy)", "VET": "Wenezuela", "ECT": "Ekwador"},
}
}
diff --git a/pl/pl_test.go b/pl/pl_test.go
new file mode 100644
index 00000000..b3c0fbff
--- /dev/null
+++ b/pl/pl_test.go
@@ -0,0 +1,1120 @@
+package pl
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "pl"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/pl_PL/pl_PL.go b/pl_PL/pl_PL.go
index 4bea46a9..c52284b9 100644
--- a/pl_PL/pl_PL.go
+++ b/pl_PL/pl_PL.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"p.n.e.", "n.e."},
erasNarrow: []string{"", ""},
erasWide: []string{"p.n.e.", "n.e."},
- timezones: map[string]string{"AEST": "Czas standardowy wschodnioaustraliski", "HAST": "Hawaje-Aleuty (czas standardowy)", "WARST": "Argentyna Zachodnia (czas letni)", "WART": "Argentyna Zachodnia (czas standardowy)", "OESZ": "Czas wschodnioeuropejski letni", "GFT": "Gujana Francuska", "MDT": "MDT", "MEZ": "Czas środkowoeuropejski standardowy", "CLT": "Chile (czas standardowy)", "HKST": "Hongkong (czas letni)", "AKST": "Alaska (czas standardowy)", "ACWDT": "Czas środkowo-zachodnioaustralijski letni", "ECT": "Ekwador", "ADT": "Czas atlantycki letni", "WAST": "Czas zachodnioafrykański letni", "AKDT": "Alaska (czas letni)", "PST": "Czas pacyficzny standardowy", "WESZ": "Czas zachodnioeuropejski letni", "COT": "Kolumbia (czas standardowy)", "GMT": "Czas uniwersalny", "WITA": "Indonezja Środkowa", "TMT": "Turkmenistan (czas standardowy)", "TMST": "Turkmenistan (czas letni)", "CDT": "Czas środkowoamerykański letni", "CHAST": "Chatham (czas standardowy)", "MYT": "Malezja", "CST": "Czas środkowoamerykański standardowy", "NZST": "Nowa Zelandia (czas standardowy)", "NZDT": "Nowa Zelandia (czas letni)", "ChST": "Czamorro", "WAT": "Czas zachodnioafrykański standardowy", "JST": "Japonia (czas standardowy)", "BOT": "Boliwia", "UYT": "Urugwaj (czas standardowy)", "AEDT": "Czas wschodnioaustraliski letni", "COST": "Kolumbia (czas letni)", "AST": "Czas standardowy atlantycki", "WIT": "Indonezja Wschodnia", "GYT": "Gujana", "CHADT": "Chatham (czas letni)", "SAST": "Czas południowoafrykański", "IST": "Czas indyjski", "MST": "MST", "ACDT": "Czas środkowoaustralijski letni", "∅∅∅": "Czas amazoński letni", "LHST": "Lord Howe (czas standardowy)", "MESZ": "Czas środkowoeuropejski letni", "ARST": "Argentyna (czas letni)", "JDT": "Japonia (czas letni)", "BT": "Bhutan", "HNT": "Nowa Fundlandia (czas standardowy)", "ART": "Argentyna (czas standardowy)", "UYST": "Urugwaj (czas letni)", "ACWST": "Czas środkowo-zachodnioaustralijski standardowy", "EST": "Czas wschodnioamerykański standardowy", "ACST": "Czas środkowoaustralijski standardowy", "CAT": "Czas środkowoafrykański", "HKT": "Hongkong (czas standardowy)", "WIB": "Indonezja Zachodnia", "PDT": "Czas pacyficzny letni", "AWDT": "Czas zachodnioaustralijski letni", "SRT": "Surinam", "SGT": "Singapur", "CLST": "Chile (czas letni)", "HADT": "Hawaje-Aleuty (czas letni)", "HAT": "Nowa Fundlandia (czas letni)", "EAT": "Czas wschodnioafrykański", "LHDT": "Lord Howe (czas letni)", "WEZ": "Czas zachodnioeuropejski standardowy", "VET": "Wenezuela", "OEZ": "Czas wschodnioeuropejski standardowy", "AWST": "Czas zachodnioaustralijski standardowy", "EDT": "Czas wschodnioamerykański letni"},
+ timezones: map[string]string{"EST": "Czas wschodnioamerykański standardowy", "WAT": "Czas zachodnioafrykański standardowy", "GMT": "Czas uniwersalny", "ACWST": "Czas środkowo-zachodnioaustralijski standardowy", "IST": "Czas indyjski", "HNT": "Nowa Fundlandia (czas standardowy)", "SGT": "Singapur", "OEZ": "Czas wschodnioeuropejski standardowy", "AEST": "Czas standardowy wschodnioaustraliski", "AST": "Czas standardowy atlantycki", "ADT": "Czas atlantycki letni", "MEZ": "Czas środkowoeuropejski standardowy", "WAST": "Czas zachodnioafrykański letni", "CLT": "Chile (czas standardowy)", "CLST": "Chile (czas letni)", "WARST": "Argentyna Zachodnia (czas letni)", "TMST": "Turkmenistan (czas letni)", "COT": "Kolumbia (czas standardowy)", "AEDT": "Czas wschodnioaustraliski letni", "WIT": "Indonezja Wschodnia", "AKDT": "Alaska (czas letni)", "CDT": "Czas środkowoamerykański letni", "WART": "Argentyna Zachodnia (czas standardowy)", "MDT": "MDT", "JDT": "Japonia (czas letni)", "HAST": "Hawaje-Aleuty (czas standardowy)", "CST": "Czas środkowoamerykański standardowy", "SRT": "Surinam", "MST": "MST", "ART": "Argentyna (czas standardowy)", "WITA": "Indonezja Środkowa", "NZST": "Nowa Zelandia (czas standardowy)", "ACST": "Czas środkowoaustralijski standardowy", "ARST": "Argentyna (czas letni)", "ECT": "Ekwador", "LHST": "Lord Howe (czas standardowy)", "JST": "Japonia (czas standardowy)", "PDT": "Czas pacyficzny letni", "COST": "Kolumbia (czas letni)", "BT": "Bhutan", "VET": "Wenezuela", "ACWDT": "Czas środkowo-zachodnioaustralijski letni", "AWST": "Czas zachodnioaustralijski standardowy", "SAST": "Czas południowoafrykański", "EDT": "Czas wschodnioamerykański letni", "MESZ": "Czas środkowoeuropejski letni", "OESZ": "Czas wschodnioeuropejski letni", "UYST": "Urugwaj (czas letni)", "CHAST": "Chatham (czas standardowy)", "AWDT": "Czas zachodnioaustralijski letni", "PST": "Czas pacyficzny standardowy", "WEZ": "Czas zachodnioeuropejski standardowy", "MYT": "Malezja", "∅∅∅": "Azory (czas letni)", "LHDT": "Lord Howe (czas letni)", "WIB": "Indonezja Zachodnia", "GYT": "Gujana", "EAT": "Czas wschodnioafrykański", "BOT": "Boliwia", "CHADT": "Chatham (czas letni)", "AKST": "Alaska (czas standardowy)", "CAT": "Czas środkowoafrykański", "ACDT": "Czas środkowoaustralijski letni", "HKST": "Hongkong (czas letni)", "NZDT": "Nowa Zelandia (czas letni)", "TMT": "Turkmenistan (czas standardowy)", "WESZ": "Czas zachodnioeuropejski letni", "ChST": "Czamorro", "UYT": "Urugwaj (czas standardowy)", "HKT": "Hongkong (czas standardowy)", "HADT": "Hawaje-Aleuty (czas letni)", "HAT": "Nowa Fundlandia (czas letni)", "GFT": "Gujana Francuska"},
}
}
diff --git a/pl_PL/pl_PL_test.go b/pl_PL/pl_PL_test.go
new file mode 100644
index 00000000..1460e546
--- /dev/null
+++ b/pl_PL/pl_PL_test.go
@@ -0,0 +1,1120 @@
+package pl_PL
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "pl_PL"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/prg/prg.go b/prg/prg.go
index ef72d7c9..6cf95350 100644
--- a/prg/prg.go
+++ b/prg/prg.go
@@ -67,7 +67,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"MYT": "MYT", "CLT": "CLT", "ART": "ART", "GYT": "GYT", "CST": "Centrālas Amērikas zēimas kerdā", "HNT": "HNT", "LHST": "LHST", "JDT": "JDT", "VET": "VET", "ACWDT": "ACWDT", "HKST": "HKST", "TMT": "TMT", "WEZ": "Wakkariskas Eurōpas zēimas kerdā", "AEST": "AEST", "AWST": "AWST", "CDT": "Centrālas Amērikas daggas kerdā", "UYT": "UYT", "WAT": "WAT", "WAST": "WAST", "SRT": "SRT", "AKDT": "AKDT", "PST": "Pacīfiskas Amērikas zēimas kerdā", "JST": "JST", "NZST": "NZST", "OESZ": "Dēiniskas Eurōpas daggas kerdā", "TMST": "TMST", "MEZ": "Centrālas Eurōpas zēimas kerdā", "MESZ": "Centrālas Eurōpas daggas kerdā", "CHADT": "CHADT", "CAT": "CAT", "WART": "WART", "GFT": "GFT", "CLST": "CLST", "SGT": "SGT", "∅∅∅": "∅∅∅", "SAST": "SAST", "WARST": "WARST", "ACST": "ACST", "AKST": "AKST", "UYST": "UYST", "BT": "BT", "BOT": "BOT", "EDT": "Dēiniskas Amērikas daggas kerdā", "AST": "Atlāntiska zēimas kerdā", "EAT": "EAT", "MST": "MST", "NZDT": "NZDT", "WESZ": "Wakkariskas Eurōpas daggas kerdā", "ACWST": "ACWST", "ADT": "Atlāntiska daggas kerdā", "AWDT": "AWDT", "AEDT": "AEDT", "HADT": "HADT", "HKT": "HKT", "HAT": "HAT", "WITA": "WITA", "WIT": "WIT", "EST": "Dēiniskas Amērikas zēimas kerdā", "IST": "IST", "GMT": "Greenwich kerdā", "MDT": "MDT", "ARST": "ARST", "ChST": "ChST", "COST": "COST", "ECT": "ECT", "ACDT": "ACDT", "PDT": "Pacīfiskas Amērikas daggas kerdā", "LHDT": "LHDT", "CHAST": "CHAST", "COT": "COT", "HAST": "HAST", "WIB": "WIB", "OEZ": "Dēiniskas Eurōpas zēimas kerdā"},
+ timezones: map[string]string{"AST": "Atlāntiska zēimas kerdā", "UYT": "UYT", "HKT": "HKT", "CHAST": "CHAST", "GMT": "Greenwich kerdā", "OEZ": "Dēiniskas Eurōpas zēimas kerdā", "BT": "BT", "HKST": "HKST", "COT": "COT", "OESZ": "Dēiniskas Eurōpas daggas kerdā", "ACST": "ACST", "PST": "Pacīfiskas Amērikas zēimas kerdā", "VET": "VET", "MST": "MST", "NZDT": "NZDT", "WAST": "WAST", "SGT": "SGT", "CDT": "Centrālas Amērikas daggas kerdā", "ECT": "ECT", "WIT": "WIT", "WART": "WART", "WARST": "WARST", "WIB": "WIB", "ACDT": "ACDT", "UYST": "UYST", "TMT": "TMT", "EAT": "EAT", "MESZ": "Centrālas Eurōpas daggas kerdā", "AWST": "AWST", "WITA": "WITA", "JST": "JST", "HAT": "HAT", "LHST": "LHST", "CHADT": "CHADT", "ADT": "Atlāntiska daggas kerdā", "EST": "Dēiniskas Amērikas zēimas kerdā", "EDT": "Dēiniskas Amērikas daggas kerdā", "∅∅∅": "∅∅∅", "LHDT": "LHDT", "MYT": "MYT", "MDT": "MDT", "AKDT": "AKDT", "AEDT": "AEDT", "ChST": "ChST", "CST": "Centrālas Amērikas zēimas kerdā", "AKST": "AKST", "CAT": "CAT", "CLT": "CLT", "CLST": "CLST", "GFT": "GFT", "HADT": "HADT", "AWDT": "AWDT", "IST": "IST", "WESZ": "Wakkariskas Eurōpas daggas kerdā", "SRT": "SRT", "ACWST": "ACWST", "HNT": "HNT", "TMST": "TMST", "GYT": "GYT", "NZST": "NZST", "MEZ": "Centrālas Eurōpas zēimas kerdā", "SAST": "SAST", "PDT": "Pacīfiskas Amērikas daggas kerdā", "ART": "ART", "ARST": "ARST", "JDT": "JDT", "HAST": "HAST", "WEZ": "Wakkariskas Eurōpas zēimas kerdā", "ACWDT": "ACWDT", "WAT": "WAT", "COST": "COST", "AEST": "AEST", "BOT": "BOT"},
}
}
diff --git a/prg/prg_test.go b/prg/prg_test.go
new file mode 100644
index 00000000..7d3fa6a8
--- /dev/null
+++ b/prg/prg_test.go
@@ -0,0 +1,1120 @@
+package prg
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "prg"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/prg_001/prg_001.go b/prg_001/prg_001.go
index 4b418ea7..ac9ec739 100644
--- a/prg_001/prg_001.go
+++ b/prg_001/prg_001.go
@@ -67,7 +67,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"CDT": "Centrālas Amērikas daggas kerdā", "CAT": "CAT", "PST": "Pacīfiskas Amērikas zēimas kerdā", "PDT": "Pacīfiskas Amērikas daggas kerdā", "NZST": "NZST", "UYT": "UYT", "BOT": "BOT", "WEZ": "Wakkariskas Eurōpas zēimas kerdā", "SGT": "SGT", "OEZ": "Dēiniskas Eurōpas zēimas kerdā", "GYT": "GYT", "AKDT": "AKDT", "ECT": "ECT", "SAST": "SAST", "WIB": "WIB", "ACST": "ACST", "ART": "ART", "UYST": "UYST", "HADT": "HADT", "BT": "BT", "WARST": "WARST", "GMT": "Greenwich kerdā", "ACDT": "ACDT", "TMT": "TMT", "MEZ": "Centrālas Eurōpas zēimas kerdā", "AEDT": "AEDT", "CHADT": "CHADT", "VET": "VET", "WAT": "WAT", "WITA": "WITA", "ARST": "ARST", "∅∅∅": "∅∅∅", "AKST": "AKST", "WIT": "WIT", "JST": "JST", "ChST": "ChST", "WESZ": "Wakkariskas Eurōpas daggas kerdā", "HNT": "HNT", "GFT": "GFT", "LHDT": "LHDT", "SRT": "SRT", "COT": "COT", "WART": "WART", "IST": "IST", "EAT": "EAT", "ACWST": "ACWST", "AST": "Atlāntiska zēimas kerdā", "AWDT": "AWDT", "JDT": "JDT", "OESZ": "Dēiniskas Eurōpas daggas kerdā", "EST": "Dēiniskas Amērikas zēimas kerdā", "EDT": "Dēiniskas Amērikas daggas kerdā", "HKST": "HKST", "WAST": "WAST", "CHAST": "CHAST", "CLT": "CLT", "ACWDT": "ACWDT", "ADT": "Atlāntiska daggas kerdā", "HKT": "HKT", "MST": "MST", "MDT": "MDT", "AEST": "AEST", "TMST": "TMST", "CST": "Centrālas Amērikas zēimas kerdā", "LHST": "LHST", "MYT": "MYT", "NZDT": "NZDT", "MESZ": "Centrālas Eurōpas daggas kerdā", "CLST": "CLST", "COST": "COST", "HAT": "HAT", "AWST": "AWST", "HAST": "HAST"},
+ timezones: map[string]string{"CLT": "CLT", "WITA": "WITA", "JST": "JST", "NZST": "NZST", "AEST": "AEST", "ChST": "ChST", "NZDT": "NZDT", "TMST": "TMST", "HNT": "HNT", "MYT": "MYT", "HKST": "HKST", "HAT": "HAT", "CLST": "CLST", "CHAST": "CHAST", "ECT": "ECT", "HADT": "HADT", "WAT": "WAT", "EAT": "EAT", "ARST": "ARST", "BOT": "BOT", "∅∅∅": "∅∅∅", "WEZ": "Wakkariskas Eurōpas zēimas kerdā", "BT": "BT", "HKT": "HKT", "TMT": "TMT", "EST": "Dēiniskas Amērikas zēimas kerdā", "GYT": "GYT", "SAST": "SAST", "MEZ": "Centrālas Eurōpas zēimas kerdā", "LHDT": "LHDT", "ACST": "ACST", "EDT": "Dēiniskas Amērikas daggas kerdā", "WIB": "WIB", "SGT": "SGT", "WIT": "WIT", "CST": "Centrālas Amērikas zēimas kerdā", "AWST": "AWST", "CAT": "CAT", "UYST": "UYST", "WARST": "WARST", "OESZ": "Dēiniskas Eurōpas daggas kerdā", "LHST": "LHST", "MST": "MST", "JDT": "JDT", "AST": "Atlāntiska zēimas kerdā", "ACWDT": "ACWDT", "IST": "IST", "CHADT": "CHADT", "WAST": "WAST", "ACDT": "ACDT", "SRT": "SRT", "UYT": "UYT", "WART": "WART", "VET": "VET", "ART": "ART", "PDT": "Pacīfiskas Amērikas daggas kerdā", "COT": "COT", "GMT": "Greenwich kerdā", "ADT": "Atlāntiska daggas kerdā", "WESZ": "Wakkariskas Eurōpas daggas kerdā", "ACWST": "ACWST", "AWDT": "AWDT", "HAST": "HAST", "PST": "Pacīfiskas Amērikas zēimas kerdā", "GFT": "GFT", "OEZ": "Dēiniskas Eurōpas zēimas kerdā", "AEDT": "AEDT", "CDT": "Centrālas Amērikas daggas kerdā", "MDT": "MDT", "AKST": "AKST", "AKDT": "AKDT", "MESZ": "Centrālas Eurōpas daggas kerdā", "COST": "COST"},
}
}
@@ -96,8 +96,8 @@ func (prg *prg_001) CardinalPluralRule(num float64, v uint64) locales.PluralRule
n := math.Abs(num)
f := locales.F(n, v)
- nMod10 := math.Mod(n, 10)
nMod100 := math.Mod(n, 100)
+ nMod10 := math.Mod(n, 10)
fMod100 := f % 100
fMod10 := f % 10
diff --git a/prg_001/prg_001_test.go b/prg_001/prg_001_test.go
new file mode 100644
index 00000000..a45fd505
--- /dev/null
+++ b/prg_001/prg_001_test.go
@@ -0,0 +1,1120 @@
+package prg_001
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "prg_001"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ps/ps.go b/ps/ps.go
index da042793..7325d346 100644
--- a/ps/ps.go
+++ b/ps/ps.go
@@ -62,7 +62,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ق.م.", "م."},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"WIT": "WIT", "OESZ": "OESZ", "HNT": "HNT", "BOT": "BOT", "SAST": "SAST", "HAT": "HAT", "∅∅∅": "∅∅∅", "NZST": "NZST", "AEST": "AEST", "ARST": "ARST", "CST": "CST", "ECT": "ECT", "AKDT": "AKDT", "AWDT": "AWDT", "MEZ": "MEZ", "EAT": "EAT", "ART": "ART", "TMST": "TMST", "AKST": "AKST", "LHST": "LHST", "LHDT": "LHDT", "AST": "AST", "HAST": "HAST", "WAST": "WAST", "ACST": "ACST", "TMT": "TMT", "JST": "JST", "JDT": "JDT", "AWST": "AWST", "ACWST": "ACWST", "EST": "EST", "ADT": "ADT", "HADT": "HADT", "WAT": "WAT", "WART": "WART", "PDT": "PDT", "UYST": "UYST", "ChST": "ChST", "CHADT": "CHADT", "WITA": "WITA", "VET": "VET", "OEZ": "OEZ", "GYT": "GYT", "CDT": "CDT", "ACWDT": "ACWDT", "CHAST": "CHAST", "IST": "IST", "MST": "MST", "CLST": "CLST", "AEDT": "AEDT", "COT": "COT", "GFT": "GFT", "GMT": "گرينويچ وخت", "BT": "BT", "HKT": "HKT", "HKST": "HKST", "MYT": "MYT", "MESZ": "MESZ", "UYT": "UYT", "CLT": "CLT", "WESZ": "∅∅∅", "MDT": "MDT", "ACDT": "ACDT", "NZDT": "NZDT", "EDT": "EDT", "COST": "COST", "WARST": "WARST", "WIB": "WIB", "SRT": "SRT", "PST": "PST", "WEZ": "∅∅∅", "CAT": "CAT", "SGT": "SGT"},
+ timezones: map[string]string{"CDT": "CDT", "VET": "VET", "JST": "JST", "WAST": "WAST", "OEZ": "OEZ", "EAT": "EAT", "CHAST": "CHAST", "AWDT": "AWDT", "NZDT": "NZDT", "EST": "EST", "OESZ": "OESZ", "MYT": "MYT", "GMT": "گرينويچ وخت", "ADT": "ADT", "TMT": "TMT", "CAT": "CAT", "GYT": "GYT", "WART": "WART", "ACWST": "ACWST", "MEZ": "MEZ", "SGT": "SGT", "WIB": "WIB", "AEDT": "AEDT", "CLST": "CLST", "ACST": "ACST", "SRT": "SRT", "HKT": "HKT", "WITA": "WITA", "IST": "IST", "PDT": "PDT", "HAST": "HAST", "UYT": "UYT", "WESZ": "∅∅∅", "ACWDT": "ACWDT", "HADT": "HADT", "COST": "COST", "WAT": "WAT", "AEST": "AEST", "WARST": "WARST", "HKST": "HKST", "AWST": "AWST", "SAST": "SAST", "EDT": "EDT", "ARST": "ARST", "ChST": "ChST", "CLT": "CLT", "WIT": "WIT", "LHDT": "LHDT", "∅∅∅": "∅∅∅", "MDT": "MDT", "CHADT": "CHADT", "WEZ": "∅∅∅", "MESZ": "MESZ", "BT": "BT", "CST": "CST", "ACDT": "ACDT", "MST": "MST", "ART": "ART", "JDT": "JDT", "UYST": "UYST", "ECT": "ECT", "NZST": "NZST", "BOT": "BOT", "LHST": "LHST", "HNT": "HNT", "GFT": "GFT", "AKST": "AKST", "AKDT": "AKDT", "AST": "AST", "PST": "PST", "COT": "COT", "TMST": "TMST", "HAT": "HAT"},
}
}
@@ -115,7 +115,7 @@ func (ps *ps) MonthAbbreviated(month time.Month) string {
// MonthsAbbreviated returns the locales abbreviated months
func (ps *ps) MonthsAbbreviated() []string {
- return ps.monthsAbbreviated[1:]
+ return nil
}
// MonthNarrow returns the locales narrow month given the 'month' provided
@@ -125,7 +125,7 @@ func (ps *ps) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (ps *ps) MonthsNarrow() []string {
- return ps.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/ps/ps_test.go b/ps/ps_test.go
new file mode 100644
index 00000000..25404665
--- /dev/null
+++ b/ps/ps_test.go
@@ -0,0 +1,1120 @@
+package ps
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ps"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ps_AF/ps_AF.go b/ps_AF/ps_AF.go
index 02ce9353..cc31f366 100644
--- a/ps_AF/ps_AF.go
+++ b/ps_AF/ps_AF.go
@@ -62,7 +62,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ق.م.", "م."},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"CLT": "CLT", "EST": "EST", "WAT": "WAT", "MDT": "MDT", "AKDT": "AKDT", "CST": "CST", "NZDT": "NZDT", "AEST": "AEST", "ChST": "ChST", "TMST": "TMST", "PST": "PST", "AWST": "AWST", "UYST": "UYST", "CLST": "CLST", "HAST": "HAST", "ACST": "ACST", "COST": "COST", "SAST": "SAST", "WART": "WART", "WIB": "WIB", "ECT": "ECT", "AST": "AST", "WITA": "WITA", "EDT": "EDT", "GFT": "GFT", "EAT": "EAT", "JDT": "JDT", "UYT": "UYT", "SRT": "SRT", "WESZ": "∅∅∅", "ADT": "ADT", "SGT": "SGT", "HKT": "HKT", "OEZ": "OEZ", "MYT": "MYT", "WARST": "WARST", "ACDT": "ACDT", "AKST": "AKST", "LHST": "LHST", "LHDT": "LHDT", "WEZ": "∅∅∅", "ACWST": "ACWST", "MST": "MST", "JST": "JST", "PDT": "PDT", "MESZ": "MESZ", "WAST": "WAST", "HKST": "HKST", "ACWDT": "ACWDT", "COT": "COT", "OESZ": "OESZ", "AWDT": "AWDT", "MEZ": "MEZ", "CHAST": "CHAST", "ARST": "ARST", "GYT": "GYT", "NZST": "NZST", "BOT": "BOT", "AEDT": "AEDT", "HADT": "HADT", "WIT": "WIT", "IST": "IST", "HAT": "HAT", "CDT": "CDT", "BT": "BT", "GMT": "گرينويچ وخت", "HNT": "HNT", "TMT": "TMT", "VET": "VET", "∅∅∅": "∅∅∅", "ART": "ART", "CHADT": "CHADT", "CAT": "CAT"},
+ timezones: map[string]string{"MDT": "MDT", "CST": "CST", "JDT": "JDT", "TMST": "TMST", "LHST": "LHST", "ChST": "ChST", "ACWDT": "ACWDT", "NZST": "NZST", "WESZ": "∅∅∅", "COST": "COST", "AEST": "AEST", "ARST": "ARST", "JST": "JST", "WIB": "WIB", "MYT": "MYT", "∅∅∅": "∅∅∅", "AST": "AST", "ART": "ART", "PST": "PST", "PDT": "PDT", "HAST": "HAST", "WEZ": "∅∅∅", "CLT": "CLT", "VET": "VET", "WAST": "WAST", "HAT": "HAT", "HKT": "HKT", "EAT": "EAT", "AWDT": "AWDT", "HNT": "HNT", "BT": "BT", "SRT": "SRT", "ECT": "ECT", "COT": "COT", "ACST": "ACST", "ACDT": "ACDT", "ADT": "ADT", "MST": "MST", "UYT": "UYT", "UYST": "UYST", "WIT": "WIT", "CDT": "CDT", "HKST": "HKST", "WAT": "WAT", "SGT": "SGT", "GYT": "GYT", "WART": "WART", "WARST": "WARST", "GFT": "GFT", "AWST": "AWST", "AKST": "AKST", "IST": "IST", "HADT": "HADT", "LHDT": "LHDT", "EST": "EST", "BOT": "BOT", "SAST": "SAST", "OEZ": "OEZ", "CHAST": "CHAST", "ACWST": "ACWST", "MESZ": "MESZ", "NZDT": "NZDT", "CAT": "CAT", "CLST": "CLST", "AEDT": "AEDT", "AKDT": "AKDT", "MEZ": "MEZ", "CHADT": "CHADT", "OESZ": "OESZ", "WITA": "WITA", "EDT": "EDT", "TMT": "TMT", "GMT": "گرينويچ وخت"},
}
}
@@ -115,7 +115,7 @@ func (ps *ps_AF) MonthAbbreviated(month time.Month) string {
// MonthsAbbreviated returns the locales abbreviated months
func (ps *ps_AF) MonthsAbbreviated() []string {
- return ps.monthsAbbreviated[1:]
+ return nil
}
// MonthNarrow returns the locales narrow month given the 'month' provided
@@ -125,7 +125,7 @@ func (ps *ps_AF) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (ps *ps_AF) MonthsNarrow() []string {
- return ps.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/ps_AF/ps_AF_test.go b/ps_AF/ps_AF_test.go
new file mode 100644
index 00000000..c7c36af1
--- /dev/null
+++ b/ps_AF/ps_AF_test.go
@@ -0,0 +1,1120 @@
+package ps_AF
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ps_AF"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/pt/pt.go b/pt/pt.go
index d8b63583..9ccf3cec 100644
--- a/pt/pt.go
+++ b/pt/pt.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a.C.", "d.C."},
erasNarrow: []string{"", ""},
erasWide: []string{"antes de Cristo", "depois de Cristo"},
- timezones: map[string]string{"BT": "Horário do Butão", "GFT": "Horário da Guiana Francesa", "ACST": "Horário Padrão da Austrália Central", "GYT": "Horário da Guiana", "MYT": "Horário da Malásia", "CLST": "Horário de Verão do Chile", "CHADT": "Horário de Verão de Chatham", "EDT": "Horário de Verão Oriental", "AKDT": "Horário de Verão do Alasca", "PDT": "Horário de Verão do Pacífico", "JST": "Horário Padrão do Japão", "WAST": "Horário de Verão da África Ocidental", "WIT": "Horário da Indonésia Oriental", "ART": "Horário Padrão da Argentina", "AKST": "Horário Padrão do Alasca", "PST": "Horário Padrão do Pacífico", "ACWST": "Horário Padrão da Austrália Centro-Ocidental", "WIB": "Horário da Indonésia Ocidental", "WITA": "Horário da Indonésia Central", "∅∅∅": "Horário de Verão do Amazonas", "MEZ": "Horário Padrão da Europa Central", "AEDT": "Horário de Verão da Austrália Oriental", "COT": "Horário Padrão da Colômbia", "IST": "Horário Padrão da Índia", "WAT": "Horário Padrão da África Ocidental", "LHST": "Horário Padrão de Lord Howe", "LHDT": "Horário de Verão de Lord Howe", "BOT": "Horário da Bolívia", "CLT": "Horário Padrão do Chile", "ECT": "Horário do Equador", "ADT": "Horário de Verão do Atlântico", "TMST": "Horário de Verão do Turcomenistão", "UYST": "Horário de Verão do Uruguai", "VET": "Horário da Venezuela", "AEST": "Horário Padrão da Austrália Oriental", "CHAST": "Horário Padrão de Chatham", "SGT": "Horário Padrão de Cingapura", "MST": "Horário Padrão de Macau", "MDT": "Horário de Verão de Macau", "MESZ": "Horário de Verão da Europa Central", "ACWDT": "Horário de Verão da Austrália Centro-Ocidental", "WARST": "Horário de Verão da Argentina Ocidental", "EAT": "Horário da África Oriental", "HKST": "Horário de Verão de Hong Kong", "CAT": "Horário da África Central", "EST": "Horário Padrão Oriental", "HAST": "Horário Padrão do Havaí e Ilhas Aleutas", "ACDT": "Horário de Verão da Austrália Central", "AWDT": "Horário de Verão da Austrália Ocidental", "UYT": "Horário Padrão do Uruguai", "ChST": "Horário de Chamorro", "HAT": "Horário de Verão de Terra Nova", "TMT": "Horário Padrão do Turcomenistão", "SRT": "Horário do Suriname", "OEZ": "Horário Padrão da Europa Oriental", "AWST": "Horário Padrão da Austrália Ocidental", "NZST": "Horário Padrão da Nova Zelândia", "NZDT": "Horário de Verão da Nova Zelândia", "WESZ": "Horário de Verão da Europa Ocidental", "HKT": "Horário Padrão de Hong Kong", "WEZ": "Horário Padrão da Europa Ocidental", "HADT": "Horário de Verão do Havaí e Ilhas Aleutas", "WART": "Horário Padrão da Argentina Ocidental", "JDT": "Horário de Verão do Japão", "SAST": "Horário da África do Sul", "OESZ": "Horário de Verão da Europa Oriental", "GMT": "Horário do Meridiano de Greenwich", "HNT": "Horário Padrão de Terra Nova", "ARST": "Horário de Verão da Argentina", "CST": "Horário Padrão Central", "CDT": "Horário de Verão Central", "COST": "Horário de Verão da Colômbia", "AST": "Horário Padrão do Atlântico"},
+ timezones: map[string]string{"WEZ": "Horário Padrão da Europa Ocidental", "ChST": "Horário de Chamorro", "ACST": "Horário Padrão da Austrália Central", "AKST": "Horário Padrão do Alasca", "NZST": "Horário Padrão da Nova Zelândia", "IST": "Horário Padrão da Índia", "HAT": "Horário de Verão de Terra Nova", "CDT": "Horário de Verão Central", "CHAST": "Horário Padrão de Chatham", "CHADT": "Horário de Verão de Chatham", "∅∅∅": "Horário de Verão do Amazonas", "AEDT": "Horário de Verão da Austrália Oriental", "UYT": "Horário Padrão do Uruguai", "BT": "Horário do Butão", "GFT": "Horário da Guiana Francesa", "CAT": "Horário da África Central", "HKT": "Horário Padrão de Hong Kong", "JDT": "Horário de Verão do Japão", "ECT": "Horário do Equador", "HKST": "Horário de Verão de Hong Kong", "AKDT": "Horário de Verão do Alasca", "HAST": "Horário Padrão do Havaí e Ilhas Aleutas", "COST": "Horário de Verão da Colômbia", "TMST": "Horário de Verão do Turcomenistão", "MYT": "Horário da Malásia", "LHST": "Horário Padrão de Lord Howe", "MEZ": "Horário Padrão da Europa Central", "WIB": "Horário da Indonésia Ocidental", "WAST": "Horário de Verão da África Ocidental", "GYT": "Horário da Guiana", "MDT": "Horário de Verão da Montanha", "SAST": "Horário da África do Sul", "WESZ": "Horário de Verão da Europa Ocidental", "ARST": "Horário de Verão da Argentina", "AST": "Horário Padrão do Atlântico", "WART": "Horário Padrão da Argentina Ocidental", "VET": "Horário da Venezuela", "ART": "Horário Padrão da Argentina", "EST": "Horário Padrão Oriental", "GMT": "Horário do Meridiano de Greenwich", "MST": "Horário Padrão da Montanha", "CLST": "Horário de Verão do Chile", "UYST": "Horário de Verão do Uruguai", "WITA": "Horário da Indonésia Central", "HNT": "Horário Padrão de Terra Nova", "TMT": "Horário Padrão do Turcomenistão", "WARST": "Horário de Verão da Argentina Ocidental", "EDT": "Horário de Verão Oriental", "OEZ": "Horário Padrão da Europa Oriental", "OESZ": "Horário de Verão da Europa Oriental", "WAT": "Horário Padrão da África Ocidental", "CLT": "Horário Padrão do Chile", "JST": "Horário Padrão do Japão", "SRT": "Horário do Suriname", "PDT": "Horário de Verão do Pacífico", "HADT": "Horário de Verão do Havaí e Ilhas Aleutas", "SGT": "Horário Padrão de Cingapura", "COT": "Horário Padrão da Colômbia", "AEST": "Horário Padrão da Austrália Oriental", "WIT": "Horário da Indonésia Oriental", "ADT": "Horário de Verão do Atlântico", "ACWST": "Horário Padrão da Austrália Centro-Ocidental", "ACWDT": "Horário de Verão da Austrália Centro-Ocidental", "MESZ": "Horário de Verão da Europa Central", "NZDT": "Horário de Verão da Nova Zelândia", "BOT": "Horário da Bolívia", "LHDT": "Horário de Verão de Lord Howe", "AWDT": "Horário de Verão da Austrália Ocidental", "EAT": "Horário da África Oriental", "CST": "Horário Padrão Central", "ACDT": "Horário de Verão da Austrália Central", "AWST": "Horário Padrão da Austrália Ocidental", "PST": "Horário Padrão do Pacífico"},
}
}
diff --git a/pt/pt_test.go b/pt/pt_test.go
new file mode 100644
index 00000000..b20c726f
--- /dev/null
+++ b/pt/pt_test.go
@@ -0,0 +1,1120 @@
+package pt
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "pt"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/pt_AO/pt_AO.go b/pt_AO/pt_AO.go
index 4c87b922..696359c8 100644
--- a/pt_AO/pt_AO.go
+++ b/pt_AO/pt_AO.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a.C.", "d.C."},
erasNarrow: []string{"", ""},
erasWide: []string{"antes de Cristo", "depois de Cristo"},
- timezones: map[string]string{"EAT": "Horário da África Oriental", "OESZ": "Horário de Verão da Europa Oriental", "MEZ": "Horário Padrão da Europa Central", "UYST": "Horário de Verão do Uruguai", "ChST": "Horário de Chamorro", "LHST": "Horário Padrão de Lord Howe", "CDT": "Horário de Verão Central", "WIB": "Horário da Indonésia Ocidental", "HAT": "Horário de Verão de Terra Nova", "TMT": "Horário Padrão do Turcomenistão", "SRT": "Horário do Suriname", "AKST": "Horário Padrão do Alasca", "JST": "Horário Padrão do Japão", "CHADT": "Horário de Verão de Chatham", "HKT": "Horário Padrão de Hong Kong", "WART": "Horário Padrão da Argentina Ocidental", "GMT": "Horário do Meridiano de Greenwich", "ART": "Horário Padrão da Argentina", "AWDT": "Horário de Verão da Austrália Ocidental", "HAST": "Horário Padrão do Havaí e Ilhas Aleutas", "WAST": "Horário de Verão da África Ocidental", "TMST": "Horário de Verão do Turcomenistão", "EST": "Horário Padrão Oriental", "OEZ": "Horário Padrão da Europa Oriental", "UYT": "Horário Padrão do Uruguai", "ADT": "Horário de Verão do Atlântico", "SAST": "Horário da África do Sul", "PST": "Horário Padrão do Pacífico", "AWST": "Horário Padrão da Austrália Ocidental", "MESZ": "Horário de Verão da Europa Central", "AEST": "Horário Padrão da Austrália Oriental", "ECT": "Horário do Equador", "HADT": "Horário de Verão do Havaí e Ilhas Aleutas", "MST": "Horário Padrão de Macau", "JDT": "Horário de Verão do Japão", "CLST": "Horário de Verão do Chile", "CAT": "Horário da África Central", "SGT": "Horário Padrão de Cingapura", "WIT": "Horário da Indonésia Oriental", "HNT": "Horário Padrão de Terra Nova", "ACST": "Horário Padrão da Austrália Central", "GYT": "Horário da Guiana", "NZST": "Horário Padrão da Nova Zelândia", "ACWST": "Horário Padrão da Austrália Centro-Ocidental", "WAT": "Horário Padrão da África Ocidental", "WARST": "Horário de Verão da Argentina Ocidental", "WITA": "Horário da Indonésia Central", "MYT": "Horário da Malásia", "CHAST": "Horário Padrão de Chatham", "VET": "Horário da Venezuela", "EDT": "Horário de Verão Oriental", "COT": "Horário Padrão da Colômbia", "LHDT": "Horário de Verão de Lord Howe", "WEZ": "Horário Padrão da Europa Ocidental", "ACWDT": "Horário de Verão da Austrália Centro-Ocidental", "AST": "Horário Padrão do Atlântico", "BT": "Horário do Butão", "HKST": "Horário de Verão de Hong Kong", "IST": "Horário Padrão da Índia", "MDT": "Horário de Verão de Macau", "AKDT": "Horário de Verão do Alasca", "AEDT": "Horário de Verão da Austrália Oriental", "BOT": "Horário da Bolívia", "CLT": "Horário Padrão do Chile", "WESZ": "Horário de Verão da Europa Ocidental", "COST": "Horário de Verão da Colômbia", "ACDT": "Horário de Verão da Austrália Central", "ARST": "Horário de Verão da Argentina", "PDT": "Horário de Verão do Pacífico", "GFT": "Horário da Guiana Francesa", "∅∅∅": "Horário de Verão do Amazonas", "CST": "Horário Padrão Central", "NZDT": "Horário de Verão da Nova Zelândia"},
+ timezones: map[string]string{"TMST": "Horário de Verão do Turcomenistão", "EAT": "Horário da África Oriental", "ADT": "Horário de Verão do Atlântico", "AWST": "Horário Padrão da Austrália Ocidental", "UYT": "Horário Padrão do Uruguai", "HKST": "Horário de Verão de Hong Kong", "AST": "Horário Padrão do Atlântico", "HAST": "Horário Padrão do Havaí e Ilhas Aleutas", "WAT": "Horário Padrão da África Ocidental", "LHDT": "Horário de Verão de Lord Howe", "WESZ": "Horário de Verão da Europa Ocidental", "HKT": "Horário Padrão de Hong Kong", "PDT": "Horário de Verão do Pacífico", "TMT": "Horário Padrão do Turcomenistão", "SRT": "Horário do Suriname", "AKST": "Horário Padrão do Alasca", "AKDT": "Horário de Verão do Alasca", "ACWDT": "Horário de Verão da Austrália Centro-Ocidental", "WITA": "Horário da Indonésia Central", "NZST": "Horário Padrão da Nova Zelândia", "NZDT": "Horário de Verão da Nova Zelândia", "ACST": "Horário Padrão da Austrália Central", "ART": "Horário Padrão da Argentina", "HNT": "Horário Padrão de Terra Nova", "EDT": "Horário de Verão Oriental", "MEZ": "Horário Padrão da Europa Central", "AEDT": "Horário de Verão da Austrália Oriental", "CLST": "Horário de Verão do Chile", "JDT": "Horário de Verão do Japão", "SAST": "Horário da África do Sul", "WEZ": "Horário Padrão da Europa Ocidental", "MST": "Horário Padrão da Montanha", "CLT": "Horário Padrão do Chile", "GMT": "Horário do Meridiano de Greenwich", "LHST": "Horário Padrão de Lord Howe", "ACDT": "Horário de Verão da Austrália Central", "CHADT": "Horário de Verão de Chatham", "BOT": "Horário da Bolívia", "EST": "Horário Padrão Oriental", "∅∅∅": "Horário de Verão do Amazonas", "WARST": "Horário de Verão da Argentina Ocidental", "VET": "Horário da Venezuela", "CAT": "Horário da África Central", "HAT": "Horário de Verão de Terra Nova", "MYT": "Horário da Malásia", "GFT": "Horário da Guiana Francesa", "CHAST": "Horário Padrão de Chatham", "ARST": "Horário de Verão da Argentina", "AEST": "Horário Padrão da Austrália Oriental", "ECT": "Horário do Equador", "JST": "Horário Padrão do Japão", "ACWST": "Horário Padrão da Austrália Centro-Ocidental", "IST": "Horário Padrão da Índia", "HADT": "Horário de Verão do Havaí e Ilhas Aleutas", "WIB": "Horário da Indonésia Ocidental", "OEZ": "Horário Padrão da Europa Oriental", "OESZ": "Horário de Verão da Europa Oriental", "UYST": "Horário de Verão do Uruguai", "WIT": "Horário da Indonésia Oriental", "CST": "Horário Padrão Central", "CDT": "Horário de Verão Central", "PST": "Horário Padrão do Pacífico", "MESZ": "Horário de Verão da Europa Central", "COST": "Horário de Verão da Colômbia", "ChST": "Horário de Chamorro", "GYT": "Horário da Guiana", "BT": "Horário do Butão", "WART": "Horário Padrão da Argentina Ocidental", "WAST": "Horário de Verão da África Ocidental", "SGT": "Horário Padrão de Cingapura", "COT": "Horário Padrão da Colômbia", "MDT": "Horário de Verão da Montanha", "AWDT": "Horário de Verão da Austrália Ocidental"},
}
}
diff --git a/pt_AO/pt_AO_test.go b/pt_AO/pt_AO_test.go
new file mode 100644
index 00000000..1f814f89
--- /dev/null
+++ b/pt_AO/pt_AO_test.go
@@ -0,0 +1,1120 @@
+package pt_AO
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "pt_AO"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/pt_BR/pt_BR.go b/pt_BR/pt_BR.go
index 90cf9d17..6e3a7c1d 100644
--- a/pt_BR/pt_BR.go
+++ b/pt_BR/pt_BR.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a.C.", "d.C."},
erasNarrow: []string{"", ""},
erasWide: []string{"antes de Cristo", "depois de Cristo"},
- timezones: map[string]string{"AEST": "Horário Padrão da Austrália Oriental", "ChST": "Horário de Chamorro", "CHADT": "Horário de Verão de Chatham", "VET": "Horário da Venezuela", "MDT": "Horário de Verão da Montanha", "HAT": "Horário de Verão de Terra Nova", "AWST": "Horário Padrão da Austrália Ocidental", "JDT": "Horário de Verão do Japão", "WAST": "Horário de Verão da África Ocidental", "JST": "Horário Padrão do Japão", "OEZ": "Horário Padrão da Europa Oriental", "ACDT": "Horário de Verão da Austrália Central", "AWDT": "Horário de Verão da Austrália Ocidental", "ECT": "Horário do Equador", "HKT": "Horário Padrão de Hong Kong", "ART": "Horário Padrão da Argentina", "WAT": "Horário Padrão da África Ocidental", "EAT": "Horário da África Oriental", "CST": "Horário Padrão Central", "NZST": "Horário Padrão da Nova Zelândia", "ACWST": "Horário Padrão da Austrália Centro-Ocidental", "CAT": "Horário da África Central", "WITA": "Horário da Indonésia Central", "WIB": "Horário da Indonésia Ocidental", "TMT": "Horário Padrão do Turcomenistão", "AKST": "Horário Padrão do Alasca", "CLT": "Horário Padrão do Chile", "CLST": "Horário de Verão do Chile", "WIT": "Horário da Indonésia Oriental", "AKDT": "Horário de Verão do Alasca", "LHST": "Horário Padrão de Lord Howe", "NZDT": "Horário de Verão da Nova Zelândia", "WEZ": "Horário Padrão da Europa Ocidental", "HNT": "Horário Padrão de Terra Nova", "GYT": "Horário da Guiana", "MYT": "Horário da Malásia", "COST": "Horário de Verão da Colômbia", "SAST": "Horário da África do Sul", "BT": "Horário do Butão", "PST": "Horário Padrão do Pacífico", "LHDT": "Horário de Verão de Lord Howe", "MESZ": "Horário de Verão da Europa Central", "WARST": "Horário de Verão da Argentina Ocidental", "OESZ": "Horário de Verão da Europa Oriental", "ARST": "Horário de Verão da Argentina", "TMST": "Horário de Verão do Turcomenistão", "PDT": "Horário de Verão do Pacífico", "UYT": "Horário Padrão do Uruguai", "AST": "Horário Padrão do Atlântico", "HADT": "Horário de Verão do Havaí e Ilhas Aleutas", "BOT": "Horário da Bolívia", "EST": "Horário Padrão Oriental", "EDT": "Horário de Verão Oriental", "∅∅∅": "Horário de Verão de Brasília", "SGT": "Horário Padrão de Cingapura", "HKST": "Horário de Verão de Hong Kong", "MEZ": "Horário Padrão da Europa Central", "UYST": "Horário de Verão do Uruguai", "MST": "Horário Padrão da Montanha", "ADT": "Horário de Verão do Atlântico", "IST": "Horário Padrão da Índia", "GMT": "Horário do Meridiano de Greenwich", "ACST": "Horário Padrão da Austrália Central", "SRT": "Horário do Suriname", "COT": "Horário Padrão da Colômbia", "HAST": "Horário Padrão do Havaí e Ilhas Aleutas", "WART": "Horário Padrão da Argentina Ocidental", "CDT": "Horário de Verão Central", "WESZ": "Horário de Verão da Europa Ocidental", "ACWDT": "Horário de Verão da Austrália Centro-Ocidental", "AEDT": "Horário de Verão da Austrália Oriental", "CHAST": "Horário Padrão de Chatham", "GFT": "Horário da Guiana Francesa"},
+ timezones: map[string]string{"WARST": "Horário de Verão da Argentina Ocidental", "EST": "Horário Padrão Oriental", "AKST": "Horário Padrão do Alasca", "PST": "Horário Padrão do Pacífico", "HADT": "Horário de Verão do Havaí e Ilhas Aleutas", "PDT": "Horário de Verão do Pacífico", "NZST": "Horário Padrão da Nova Zelândia", "NZDT": "Horário de Verão da Nova Zelândia", "ChST": "Horário de Chamorro", "GYT": "Horário da Guiana", "AEST": "Horário Padrão da Austrália Oriental", "LHDT": "Horário de Verão de Lord Howe", "ADT": "Horário de Verão do Atlântico", "MEZ": "Horário Padrão da Europa Central", "HNT": "Horário Padrão de Terra Nova", "OESZ": "Horário de Verão da Europa Oriental", "MDT": "Horário de Verão de Macau", "ARST": "Horário de Verão da Argentina", "AST": "Horário Padrão do Atlântico", "AKDT": "Horário de Verão do Alasca", "HAST": "Horário Padrão do Havaí e Ilhas Aleutas", "MYT": "Horário da Malásia", "LHST": "Horário Padrão de Lord Howe", "∅∅∅": "Horário de Verão dos Açores", "AWDT": "Horário de Verão da Austrália Ocidental", "JST": "Horário Padrão do Japão", "COT": "Horário Padrão da Colômbia", "UYT": "Horário Padrão do Uruguai", "CDT": "Horário de Verão Central", "CHADT": "Horário de Verão de Chatham", "ACWDT": "Horário de Verão da Austrália Centro-Ocidental", "EDT": "Horário de Verão Oriental", "WEZ": "Horário Padrão da Europa Ocidental", "WIT": "Horário da Indonésia Oriental", "COST": "Horário de Verão da Colômbia", "GMT": "Horário do Meridiano de Greenwich", "CLST": "Horário de Verão do Chile", "WART": "Horário Padrão da Argentina Ocidental", "ACWST": "Horário Padrão da Austrália Centro-Ocidental", "MESZ": "Horário de Verão da Europa Central", "TMST": "Horário de Verão do Turcomenistão", "SRT": "Horário do Suriname", "CHAST": "Horário Padrão de Chatham", "SGT": "Horário Padrão de Cingapura", "CAT": "Horário da África Central", "VET": "Horário da Venezuela", "SAST": "Horário da África do Sul", "HAT": "Horário de Verão de Terra Nova", "WITA": "Horário da Indonésia Central", "JDT": "Horário de Verão do Japão", "BOT": "Horário da Bolívia", "TMT": "Horário Padrão do Turcomenistão", "CST": "Horário Padrão Central", "ACST": "Horário Padrão da Austrália Central", "MST": "Horário Padrão de Macau", "WAT": "Horário Padrão da África Ocidental", "WAST": "Horário de Verão da África Ocidental", "AEDT": "Horário de Verão da Austrália Oriental", "EAT": "Horário da África Oriental", "GFT": "Horário da Guiana Francesa", "AWST": "Horário Padrão da Austrália Ocidental", "IST": "Horário Padrão da Índia", "ART": "Horário Padrão da Argentina", "UYST": "Horário de Verão do Uruguai", "BT": "Horário do Butão", "ECT": "Horário do Equador", "HKT": "Horário Padrão de Hong Kong", "HKST": "Horário de Verão de Hong Kong", "OEZ": "Horário Padrão da Europa Oriental", "CLT": "Horário Padrão do Chile", "ACDT": "Horário de Verão da Austrália Central", "WIB": "Horário da Indonésia Ocidental", "WESZ": "Horário de Verão da Europa Ocidental"},
}
}
diff --git a/pt_BR/pt_BR_test.go b/pt_BR/pt_BR_test.go
new file mode 100644
index 00000000..f132e02c
--- /dev/null
+++ b/pt_BR/pt_BR_test.go
@@ -0,0 +1,1120 @@
+package pt_BR
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "pt_BR"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/pt_CH/pt_CH.go b/pt_CH/pt_CH.go
index 036f2461..90acec4c 100644
--- a/pt_CH/pt_CH.go
+++ b/pt_CH/pt_CH.go
@@ -47,7 +47,7 @@ func New() locales.Translator {
locale: "pt_CH",
pluralsCardinal: []locales.PluralRule{2, 6},
pluralsOrdinal: []locales.PluralRule{6},
- pluralsRange: []locales.PluralRule{2, 6},
+ pluralsRange: []locales.PluralRule{6, 2},
decimal: ",",
group: ".",
minus: "-",
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a.C.", "d.C."},
erasNarrow: []string{"", ""},
erasWide: []string{"antes de Cristo", "depois de Cristo"},
- timezones: map[string]string{"GYT": "Horário da Guiana", "SRT": "Horário do Suriname", "CST": "Horário Padrão Central", "CHAST": "Horário Padrão de Chatham", "WESZ": "Horário de Verão da Europa Ocidental", "WART": "Horário Padrão da Argentina Ocidental", "WITA": "Horário da Indonésia Central", "PST": "Horário Padrão do Pacífico", "EDT": "Horário de Verão Oriental", "HADT": "Horário de Verão do Havaí e Ilhas Aleutas", "HAT": "Horário de Verão de Terra Nova", "AKDT": "Horário de Verão do Alasca", "ECT": "Horário do Equador", "∅∅∅": "Horário de Verão de Brasília", "EAT": "Horário da África Oriental", "NZDT": "Horário de Verão da Nova Zelândia", "CDT": "Horário de Verão Central", "JDT": "Horário de Verão do Japão", "ACWST": "Horário Padrão da Austrália Centro-Ocidental", "HKST": "Horário de Verão de Hong Kong", "GMT": "Horário do Meridiano de Greenwich", "WIT": "Horário da Indonésia Oriental", "AWST": "Horário Padrão da Austrália Ocidental", "LHST": "Horário Padrão de Lord Howe", "ACWDT": "Horário de Verão da Austrália Centro-Ocidental", "WARST": "Horário de Verão da Argentina Ocidental", "GFT": "Horário da Guiana Francesa", "OEZ": "Horário Padrão da Europa Oriental", "COST": "Horário de Verão da Colômbia", "CAT": "Horário da África Central", "ARST": "Horário de Verão da Argentina", "MDT": "Horário de Verão da Montanha", "VET": "Horário da Venezuela", "AKST": "Horário Padrão do Alasca", "ChST": "Horário de Chamorro", "BT": "Horário do Butão", "SAST": "Horário da África do Sul", "AWDT": "Horário de Verão da Austrália Ocidental", "CLT": "Horário Padrão do Chile", "WEZ": "Horário Padrão da Europa Ocidental", "WAST": "Horário de Verão da África Ocidental", "MEZ": "Horário Padrão da Europa Central", "PDT": "Horário de Verão do Pacífico", "ADT": "Horário de Verão do Atlântico", "WIB": "Horário da Indonésia Ocidental", "ACST": "Horário Padrão da Austrália Central", "MYT": "Horário da Malásia", "ART": "Horário Padrão da Argentina", "TMT": "Horário Padrão do Turcomenistão", "TMST": "Horário de Verão do Turcomenistão", "JST": "Horário Padrão do Japão", "AEDT": "Horário de Verão da Austrália Oriental", "COT": "Horário Padrão da Colômbia", "EST": "Horário Padrão Oriental", "HNT": "Horário Padrão de Terra Nova", "LHDT": "Horário de Verão de Lord Howe", "MESZ": "Horário de Verão da Europa Central", "MST": "Horário Padrão da Montanha", "SGT": "Horário Padrão de Cingapura", "AST": "Horário Padrão do Atlântico", "WAT": "Horário Padrão da África Ocidental", "ACDT": "Horário de Verão da Austrália Central", "BOT": "Horário da Bolívia", "UYST": "Horário de Verão do Uruguai", "AEST": "Horário Padrão da Austrália Oriental", "CLST": "Horário de Verão do Chile", "HAST": "Horário Padrão do Havaí e Ilhas Aleutas", "OESZ": "Horário de Verão da Europa Oriental", "UYT": "Horário Padrão do Uruguai", "CHADT": "Horário de Verão de Chatham", "HKT": "Horário Padrão de Hong Kong", "IST": "Horário Padrão da Índia", "NZST": "Horário Padrão da Nova Zelândia"},
+ timezones: map[string]string{"CHAST": "Horário Padrão de Chatham", "IST": "Horário Padrão da Índia", "WAT": "Horário Padrão da África Ocidental", "ChST": "Horário de Chamorro", "SRT": "Horário do Suriname", "ACWST": "Horário Padrão da Austrália Centro-Ocidental", "GFT": "Horário da Guiana Francesa", "ECT": "Horário do Equador", "WIB": "Horário da Indonésia Ocidental", "AEST": "Horário Padrão da Austrália Oriental", "WIT": "Horário da Indonésia Oriental", "EAT": "Horário da África Oriental", "MYT": "Horário da Malásia", "CLT": "Horário Padrão do Chile", "UYST": "Horário de Verão do Uruguai", "WARST": "Horário de Verão da Argentina Ocidental", "ART": "Horário Padrão da Argentina", "AKDT": "Horário de Verão do Alasca", "MESZ": "Horário de Verão da Europa Central", "EDT": "Horário de Verão Oriental", "HKST": "Horário de Verão de Hong Kong", "COST": "Horário de Verão da Colômbia", "WEZ": "Horário Padrão da Europa Ocidental", "WART": "Horário Padrão da Argentina Ocidental", "VET": "Horário da Venezuela", "HNT": "Horário Padrão de Terra Nova", "ARST": "Horário de Verão da Argentina", "HADT": "Horário de Verão do Havaí e Ilhas Aleutas", "EST": "Horário Padrão Oriental", "∅∅∅": "Horário de Verão do Amazonas", "WESZ": "Horário de Verão da Europa Ocidental", "WITA": "Horário da Indonésia Central", "JST": "Horário Padrão do Japão", "AKST": "Horário Padrão do Alasca", "NZDT": "Horário de Verão da Nova Zelândia", "HKT": "Horário Padrão de Hong Kong", "PST": "Horário Padrão do Pacífico", "COT": "Horário Padrão da Colômbia", "OESZ": "Horário de Verão da Europa Oriental", "ACST": "Horário Padrão da Austrália Central", "JDT": "Horário de Verão do Japão", "HAST": "Horário Padrão do Havaí e Ilhas Aleutas", "HAT": "Horário de Verão de Terra Nova", "CDT": "Horário de Verão Central", "ADT": "Horário de Verão do Atlântico", "BOT": "Horário da Bolívia", "TMT": "Horário Padrão do Turcomenistão", "CST": "Horário Padrão Central", "NZST": "Horário Padrão da Nova Zelândia", "SGT": "Horário Padrão de Cingapura", "CLST": "Horário de Verão do Chile", "LHST": "Horário Padrão de Lord Howe", "MST": "Horário Padrão da Montanha", "AST": "Horário Padrão do Atlântico", "ACWDT": "Horário de Verão da Austrália Centro-Ocidental", "AWDT": "Horário de Verão da Austrália Ocidental", "PDT": "Horário de Verão do Pacífico", "LHDT": "Horário de Verão de Lord Howe", "SAST": "Horário da África do Sul", "CAT": "Horário da África Central", "OEZ": "Horário Padrão da Europa Oriental", "AEDT": "Horário de Verão da Austrália Oriental", "MEZ": "Horário Padrão da Europa Central", "WAST": "Horário de Verão da África Ocidental", "MDT": "Horário de Verão da Montanha", "ACDT": "Horário de Verão da Austrália Central", "UYT": "Horário Padrão do Uruguai", "BT": "Horário do Butão", "CHADT": "Horário de Verão de Chatham", "AWST": "Horário Padrão da Austrália Ocidental", "TMST": "Horário de Verão do Turcomenistão", "GYT": "Horário da Guiana", "GMT": "Horário do Meridiano de Greenwich"},
}
}
diff --git a/pt_CH/pt_CH_test.go b/pt_CH/pt_CH_test.go
new file mode 100644
index 00000000..f54eaa48
--- /dev/null
+++ b/pt_CH/pt_CH_test.go
@@ -0,0 +1,1120 @@
+package pt_CH
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "pt_CH"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/pt_CV/pt_CV.go b/pt_CV/pt_CV.go
index 094d0a8a..717664b1 100644
--- a/pt_CV/pt_CV.go
+++ b/pt_CV/pt_CV.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a.C.", "d.C."},
erasNarrow: []string{"", ""},
erasWide: []string{"antes de Cristo", "depois de Cristo"},
- timezones: map[string]string{"WEZ": "Horário Padrão da Europa Ocidental", "COT": "Horário Padrão da Colômbia", "ACST": "Horário Padrão da Austrália Central", "CAT": "Horário da África Central", "MST": "Horário Padrão de Macau", "NZST": "Horário Padrão da Nova Zelândia", "CLST": "Horário de Verão do Chile", "OESZ": "Horário de Verão da Europa Oriental", "GFT": "Horário da Guiana Francesa", "ChST": "Horário de Chamorro", "AST": "Horário Padrão do Atlântico", "WAT": "Horário Padrão da África Ocidental", "JST": "Horário Padrão do Japão", "MESZ": "Horário de Verão da Europa Central", "TMST": "Horário de Verão do Turcomenistão", "OEZ": "Horário Padrão da Europa Oriental", "GMT": "Horário do Meridiano de Greenwich", "CLT": "Horário Padrão do Chile", "CHAST": "Horário Padrão de Chatham", "SGT": "Horário Padrão de Cingapura", "WIB": "Horário da Indonésia Ocidental", "CST": "Horário Padrão Central", "PDT": "Horário de Verão do Pacífico", "CDT": "Horário de Verão Central", "NZDT": "Horário de Verão da Nova Zelândia", "ADT": "Horário de Verão do Atlântico", "EAT": "Horário da África Oriental", "ART": "Horário Padrão da Argentina", "MYT": "Horário da Malásia", "EDT": "Horário de Verão Oriental", "COST": "Horário de Verão da Colômbia", "SAST": "Horário da África do Sul", "WAST": "Horário de Verão da África Ocidental", "HKST": "Horário de Verão de Hong Kong", "AKST": "Horário Padrão do Alasca", "PST": "Horário Padrão do Pacífico", "ACWDT": "Horário de Verão da Austrália Centro-Ocidental", "CHADT": "Horário de Verão de Chatham", "EST": "Horário Padrão Oriental", "HADT": "Horário de Verão do Havaí e Ilhas Aleutas", "ACDT": "Horário de Verão da Austrália Central", "GYT": "Horário da Guiana", "AWDT": "Horário de Verão da Austrália Ocidental", "AEST": "Horário Padrão da Austrália Oriental", "AEDT": "Horário de Verão da Austrália Oriental", "HAT": "Horário de Verão de Terra Nova", "AKDT": "Horário de Verão do Alasca", "SRT": "Horário do Suriname", "ECT": "Horário do Equador", "HAST": "Horário Padrão do Havaí e Ilhas Aleutas", "ARST": "Horário de Verão da Argentina", "TMT": "Horário Padrão do Turcomenistão", "BOT": "Horário da Bolívia", "VET": "Horário da Venezuela", "WARST": "Horário de Verão da Argentina Ocidental", "LHDT": "Horário de Verão de Lord Howe", "MEZ": "Horário Padrão da Europa Central", "LHST": "Horário Padrão de Lord Howe", "UYT": "Horário Padrão do Uruguai", "WESZ": "Horário de Verão da Europa Ocidental", "ACWST": "Horário Padrão da Austrália Centro-Ocidental", "WART": "Horário Padrão da Argentina Ocidental", "WIT": "Horário da Indonésia Oriental", "AWST": "Horário Padrão da Austrália Ocidental", "WITA": "Horário da Indonésia Central", "MDT": "Horário de Verão de Macau", "∅∅∅": "Horário de Verão do Amazonas", "UYST": "Horário de Verão do Uruguai", "BT": "Horário do Butão", "IST": "Horário Padrão da Índia", "HNT": "Horário Padrão de Terra Nova", "JDT": "Horário de Verão do Japão", "HKT": "Horário Padrão de Hong Kong"},
+ timezones: map[string]string{"GFT": "Horário da Guiana Francesa", "PDT": "Horário de Verão do Pacífico", "NZST": "Horário Padrão da Nova Zelândia", "BT": "Horário do Butão", "ARST": "Horário de Verão da Argentina", "HAST": "Horário Padrão do Havaí e Ilhas Aleutas", "WAST": "Horário de Verão da África Ocidental", "CLST": "Horário de Verão do Chile", "VET": "Horário da Venezuela", "BOT": "Horário da Bolívia", "MYT": "Horário da Malásia", "UYST": "Horário de Verão do Uruguai", "SRT": "Horário do Suriname", "CST": "Horário Padrão Central", "WIB": "Horário da Indonésia Ocidental", "TMT": "Horário Padrão do Turcomenistão", "TMST": "Horário de Verão do Turcomenistão", "MDT": "Horário de Verão da Montanha", "CDT": "Horário de Verão Central", "JDT": "Horário de Verão do Japão", "COT": "Horário Padrão da Colômbia", "ACST": "Horário Padrão da Austrália Central", "WARST": "Horário de Verão da Argentina Ocidental", "HKT": "Horário Padrão de Hong Kong", "CAT": "Horário da África Central", "EAT": "Horário da África Oriental", "ACDT": "Horário de Verão da Austrália Central", "WART": "Horário Padrão da Argentina Ocidental", "WEZ": "Horário Padrão da Europa Ocidental", "UYT": "Horário Padrão do Uruguai", "CHADT": "Horário de Verão de Chatham", "AEST": "Horário Padrão da Austrália Oriental", "WIT": "Horário da Indonésia Oriental", "∅∅∅": "Horário de Verão do Peru", "CHAST": "Horário Padrão de Chatham", "ECT": "Horário do Equador", "SAST": "Horário da África do Sul", "CLT": "Horário Padrão do Chile", "MESZ": "Horário de Verão da Europa Central", "OEZ": "Horário Padrão da Europa Oriental", "AEDT": "Horário de Verão da Austrália Oriental", "ChST": "Horário de Chamorro", "AWST": "Horário Padrão da Austrália Ocidental", "AKDT": "Horário de Verão do Alasca", "NZDT": "Horário de Verão da Nova Zelândia", "GMT": "Horário do Meridiano de Greenwich", "AWDT": "Horário de Verão da Austrália Ocidental", "AKST": "Horário Padrão do Alasca", "IST": "Horário Padrão da Índia", "HADT": "Horário de Verão do Havaí e Ilhas Aleutas", "ACWST": "Horário Padrão da Austrália Centro-Ocidental", "OESZ": "Horário de Verão da Europa Oriental", "MST": "Horário Padrão da Montanha", "PST": "Horário Padrão do Pacífico", "MEZ": "Horário Padrão da Europa Central", "GYT": "Horário da Guiana", "HAT": "Horário de Verão de Terra Nova", "LHST": "Horário Padrão de Lord Howe", "LHDT": "Horário de Verão de Lord Howe", "HKST": "Horário de Verão de Hong Kong", "ADT": "Horário de Verão do Atlântico", "ART": "Horário Padrão da Argentina", "JST": "Horário Padrão do Japão", "HNT": "Horário Padrão de Terra Nova", "EDT": "Horário de Verão Oriental", "WESZ": "Horário de Verão da Europa Ocidental", "SGT": "Horário Padrão de Cingapura", "COST": "Horário de Verão da Colômbia", "AST": "Horário Padrão do Atlântico", "ACWDT": "Horário de Verão da Austrália Centro-Ocidental", "WITA": "Horário da Indonésia Central", "EST": "Horário Padrão Oriental", "WAT": "Horário Padrão da África Ocidental"},
}
}
diff --git a/pt_CV/pt_CV_test.go b/pt_CV/pt_CV_test.go
new file mode 100644
index 00000000..7ee953ab
--- /dev/null
+++ b/pt_CV/pt_CV_test.go
@@ -0,0 +1,1120 @@
+package pt_CV
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "pt_CV"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/pt_GQ/pt_GQ.go b/pt_GQ/pt_GQ.go
index 2f949f4d..c39fcf88 100644
--- a/pt_GQ/pt_GQ.go
+++ b/pt_GQ/pt_GQ.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a.C.", "d.C."},
erasNarrow: []string{"", ""},
erasWide: []string{"antes de Cristo", "depois de Cristo"},
- timezones: map[string]string{"MDT": "Horário de Verão de Macau", "PDT": "Horário de Verão do Pacífico", "NZDT": "Horário de Verão da Nova Zelândia", "CAT": "Horário da África Central", "ECT": "Horário do Equador", "OEZ": "Horário Padrão da Europa Oriental", "AKDT": "Horário de Verão do Alasca", "WART": "Horário Padrão da Argentina Ocidental", "HKST": "Horário de Verão de Hong Kong", "MST": "Horário Padrão de Macau", "ARST": "Horário de Verão da Argentina", "TMST": "Horário de Verão do Turcomenistão", "AKST": "Horário Padrão do Alasca", "JST": "Horário Padrão do Japão", "WESZ": "Horário de Verão da Europa Ocidental", "CHAST": "Horário Padrão de Chatham", "WITA": "Horário da Indonésia Central", "WARST": "Horário de Verão da Argentina Ocidental", "CHADT": "Horário de Verão de Chatham", "GFT": "Horário da Guiana Francesa", "OESZ": "Horário de Verão da Europa Oriental", "EAT": "Horário da África Oriental", "CST": "Horário Padrão Central", "WAT": "Horário Padrão da África Ocidental", "WAST": "Horário de Verão da África Ocidental", "HKT": "Horário Padrão de Hong Kong", "IST": "Horário Padrão da Índia", "WEZ": "Horário Padrão da Europa Ocidental", "SAST": "Horário da África do Sul", "∅∅∅": "Horário de Verão do Amazonas", "AWDT": "Horário de Verão da Austrália Ocidental", "GYT": "Horário da Guiana", "MESZ": "Horário de Verão da Europa Central", "UYT": "Horário Padrão do Uruguai", "CLST": "Horário de Verão do Chile", "ACDT": "Horário de Verão da Austrália Central", "ACWST": "Horário Padrão da Austrália Centro-Ocidental", "AST": "Horário Padrão do Atlântico", "TMT": "Horário Padrão do Turcomenistão", "AWST": "Horário Padrão da Austrália Ocidental", "LHDT": "Horário de Verão de Lord Howe", "UYST": "Horário de Verão do Uruguai", "AEDT": "Horário de Verão da Austrália Oriental", "COT": "Horário Padrão da Colômbia", "SGT": "Horário Padrão de Cingapura", "SRT": "Horário do Suriname", "CLT": "Horário Padrão do Chile", "LHST": "Horário Padrão de Lord Howe", "CDT": "Horário de Verão Central", "ACWDT": "Horário de Verão da Austrália Centro-Ocidental", "ChST": "Horário de Chamorro", "COST": "Horário de Verão da Colômbia", "BT": "Horário do Butão", "PST": "Horário Padrão do Pacífico", "MEZ": "Horário Padrão da Europa Central", "BOT": "Horário da Bolívia", "VET": "Horário da Venezuela", "EST": "Horário Padrão Oriental", "ART": "Horário Padrão da Argentina", "WIT": "Horário da Indonésia Oriental", "NZST": "Horário Padrão da Nova Zelândia", "AEST": "Horário Padrão da Austrália Oriental", "EDT": "Horário de Verão Oriental", "HAT": "Horário de Verão de Terra Nova", "GMT": "Horário do Meridiano de Greenwich", "HNT": "Horário Padrão de Terra Nova", "ACST": "Horário Padrão da Austrália Central", "MYT": "Horário da Malásia", "HAST": "Horário Padrão do Havaí e Ilhas Aleutas", "HADT": "Horário de Verão do Havaí e Ilhas Aleutas", "WIB": "Horário da Indonésia Ocidental", "ADT": "Horário de Verão do Atlântico", "JDT": "Horário de Verão do Japão"},
+ timezones: map[string]string{"ARST": "Horário de Verão da Argentina", "AEST": "Horário Padrão da Austrália Oriental", "TMT": "Horário Padrão do Turcomenistão", "∅∅∅": "Horário de Verão dos Açores", "AKST": "Horário Padrão do Alasca", "JDT": "Horário de Verão do Japão", "AST": "Horário Padrão do Atlântico", "GYT": "Horário da Guiana", "WAT": "Horário Padrão da África Ocidental", "HKT": "Horário Padrão de Hong Kong", "CHAST": "Horário Padrão de Chatham", "AKDT": "Horário de Verão do Alasca", "WITA": "Horário da Indonésia Central", "COT": "Horário Padrão da Colômbia", "WART": "Horário Padrão da Argentina Ocidental", "GFT": "Horário da Guiana Francesa", "COST": "Horário de Verão da Colômbia", "EAT": "Horário da África Oriental", "BT": "Horário do Butão", "LHDT": "Horário de Verão de Lord Howe", "WIT": "Horário da Indonésia Oriental", "CDT": "Horário de Verão Central", "ACWST": "Horário Padrão da Austrália Centro-Ocidental", "HADT": "Horário de Verão do Havaí e Ilhas Aleutas", "SGT": "Horário Padrão de Cingapura", "TMST": "Horário de Verão do Turcomenistão", "LHST": "Horário Padrão de Lord Howe", "WAST": "Horário de Verão da África Ocidental", "MYT": "Horário da Malásia", "WARST": "Horário de Verão da Argentina Ocidental", "SRT": "Horário do Suriname", "MST": "Horário Padrão de Macau", "VET": "Horário da Venezuela", "PST": "Horário Padrão do Pacífico", "CAT": "Horário da África Central", "CLT": "Horário Padrão do Chile", "ACWDT": "Horário de Verão da Austrália Centro-Ocidental", "AWST": "Horário Padrão da Austrália Ocidental", "JST": "Horário Padrão do Japão", "BOT": "Horário da Bolívia", "HAT": "Horário de Verão de Terra Nova", "OEZ": "Horário Padrão da Europa Oriental", "ADT": "Horário de Verão do Atlântico", "AWDT": "Horário de Verão da Austrália Ocidental", "MEZ": "Horário Padrão da Europa Central", "MESZ": "Horário de Verão da Europa Central", "WESZ": "Horário de Verão da Europa Ocidental", "ART": "Horário Padrão da Argentina", "HNT": "Horário Padrão de Terra Nova", "OESZ": "Horário de Verão da Europa Oriental", "AEDT": "Horário de Verão da Austrália Oriental", "IST": "Horário Padrão da Índia", "EST": "Horário Padrão Oriental", "UYT": "Horário Padrão do Uruguai", "UYST": "Horário de Verão do Uruguai", "CST": "Horário Padrão Central", "HKST": "Horário de Verão de Hong Kong", "WEZ": "Horário Padrão da Europa Ocidental", "ChST": "Horário de Chamorro", "ACST": "Horário Padrão da Austrália Central", "ACDT": "Horário de Verão da Austrália Central", "NZDT": "Horário de Verão da Nova Zelândia", "HAST": "Horário Padrão do Havaí e Ilhas Aleutas", "NZST": "Horário Padrão da Nova Zelândia", "MDT": "Horário de Verão de Macau", "CHADT": "Horário de Verão de Chatham", "ECT": "Horário do Equador", "SAST": "Horário da África do Sul", "EDT": "Horário de Verão Oriental", "PDT": "Horário de Verão do Pacífico", "WIB": "Horário da Indonésia Ocidental", "GMT": "Horário do Meridiano de Greenwich", "CLST": "Horário de Verão do Chile"},
}
}
diff --git a/pt_GQ/pt_GQ_test.go b/pt_GQ/pt_GQ_test.go
new file mode 100644
index 00000000..487729c0
--- /dev/null
+++ b/pt_GQ/pt_GQ_test.go
@@ -0,0 +1,1120 @@
+package pt_GQ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "pt_GQ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/pt_GW/pt_GW.go b/pt_GW/pt_GW.go
index b9bfd9c3..a19b5a72 100644
--- a/pt_GW/pt_GW.go
+++ b/pt_GW/pt_GW.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a.C.", "d.C."},
erasNarrow: []string{"", ""},
erasWide: []string{"antes de Cristo", "depois de Cristo"},
- timezones: map[string]string{"HAT": "Horário de Verão de Terra Nova", "ART": "Horário Padrão da Argentina", "AWST": "Horário Padrão da Austrália Ocidental", "JST": "Horário Padrão do Japão", "ACWDT": "Horário de Verão da Austrália Centro-Ocidental", "CHADT": "Horário de Verão de Chatham", "COST": "Horário de Verão da Colômbia", "HKST": "Horário de Verão de Hong Kong", "HNT": "Horário Padrão de Terra Nova", "GYT": "Horário da Guiana", "GMT": "Horário do Meridiano de Greenwich", "WITA": "Horário da Indonésia Central", "WIT": "Horário da Indonésia Oriental", "JDT": "Horário de Verão do Japão", "HAST": "Horário Padrão do Havaí e Ilhas Aleutas", "WIB": "Horário da Indonésia Ocidental", "WEZ": "Horário Padrão da Europa Ocidental", "CHAST": "Horário Padrão de Chatham", "CDT": "Horário de Verão Central", "MEZ": "Horário Padrão da Europa Central", "UYT": "Horário Padrão do Uruguai", "VET": "Horário da Venezuela", "ChST": "Horário de Chamorro", "HADT": "Horário de Verão do Havaí e Ilhas Aleutas", "MDT": "Horário de Verão de Macau", "ACDT": "Horário de Verão da Austrália Central", "TMT": "Horário Padrão do Turcomenistão", "MYT": "Horário da Malásia", "NZST": "Horário Padrão da Nova Zelândia", "UYST": "Horário de Verão do Uruguai", "AEDT": "Horário de Verão da Austrália Oriental", "COT": "Horário Padrão da Colômbia", "WAST": "Horário de Verão da África Ocidental", "BT": "Horário do Butão", "WART": "Horário Padrão da Argentina Ocidental", "OESZ": "Horário de Verão da Europa Oriental", "CAT": "Horário da África Central", "WAT": "Horário Padrão da África Ocidental", "GFT": "Horário da Guiana Francesa", "ARST": "Horário de Verão da Argentina", "CST": "Horário Padrão Central", "NZDT": "Horário de Verão da Nova Zelândia", "CLST": "Horário de Verão do Chile", "LHDT": "Horário de Verão de Lord Howe", "SGT": "Horário Padrão de Cingapura", "MST": "Horário Padrão de Macau", "AKST": "Horário Padrão do Alasca", "IST": "Horário Padrão da Índia", "OEZ": "Horário Padrão da Europa Oriental", "BOT": "Horário da Bolívia", "SAST": "Horário da África do Sul", "EAT": "Horário da África Oriental", "∅∅∅": "Horário de Verão do Amazonas", "PST": "Horário Padrão do Pacífico", "WESZ": "Horário de Verão da Europa Ocidental", "ECT": "Horário do Equador", "HKT": "Horário Padrão de Hong Kong", "CLT": "Horário Padrão do Chile", "ADT": "Horário de Verão do Atlântico", "TMST": "Horário de Verão do Turcomenistão", "SRT": "Horário do Suriname", "AKDT": "Horário de Verão do Alasca", "MESZ": "Horário de Verão da Europa Central", "EST": "Horário Padrão Oriental", "EDT": "Horário de Verão Oriental", "WARST": "Horário de Verão da Argentina Ocidental", "ACST": "Horário Padrão da Austrália Central", "PDT": "Horário de Verão do Pacífico", "AWDT": "Horário de Verão da Austrália Ocidental", "LHST": "Horário Padrão de Lord Howe", "ACWST": "Horário Padrão da Austrália Centro-Ocidental", "AEST": "Horário Padrão da Austrália Oriental", "AST": "Horário Padrão do Atlântico"},
+ timezones: map[string]string{"ACDT": "Horário de Verão da Austrália Central", "ARST": "Horário de Verão da Argentina", "HAT": "Horário de Verão de Terra Nova", "OESZ": "Horário de Verão da Europa Oriental", "LHDT": "Horário de Verão de Lord Howe", "CAT": "Horário da África Central", "WARST": "Horário de Verão da Argentina Ocidental", "MESZ": "Horário de Verão da Europa Central", "EDT": "Horário de Verão Oriental", "WIT": "Horário da Indonésia Oriental", "MST": "Horário Padrão da Montanha", "BOT": "Horário da Bolívia", "∅∅∅": "Horário de Verão do Amazonas", "COT": "Horário Padrão da Colômbia", "CHADT": "Horário de Verão de Chatham", "OEZ": "Horário Padrão da Europa Oriental", "UYT": "Horário Padrão do Uruguai", "WAST": "Horário de Verão da África Ocidental", "AEDT": "Horário de Verão da Austrália Oriental", "CLST": "Horário de Verão do Chile", "TMT": "Horário Padrão do Turcomenistão", "TMST": "Horário de Verão do Turcomenistão", "WESZ": "Horário de Verão da Europa Ocidental", "AEST": "Horário Padrão da Austrália Oriental", "JST": "Horário Padrão do Japão", "ADT": "Horário de Verão do Atlântico", "ACWDT": "Horário de Verão da Austrália Centro-Ocidental", "MEZ": "Horário Padrão da Europa Central", "BT": "Horário do Butão", "CST": "Horário Padrão Central", "VET": "Horário da Venezuela", "ART": "Horário Padrão da Argentina", "AST": "Horário Padrão do Atlântico", "AWDT": "Horário de Verão da Austrália Ocidental", "MYT": "Horário da Malásia", "EST": "Horário Padrão Oriental", "WAT": "Horário Padrão da África Ocidental", "UYST": "Horário de Verão do Uruguai", "SRT": "Horário do Suriname", "CHAST": "Horário Padrão de Chatham", "NZST": "Horário Padrão da Nova Zelândia", "HNT": "Horário Padrão de Terra Nova", "MDT": "Horário de Verão da Montanha", "HKT": "Horário Padrão de Hong Kong", "HAST": "Horário Padrão do Havaí e Ilhas Aleutas", "SGT": "Horário Padrão de Cingapura", "COST": "Horário de Verão da Colômbia", "WIB": "Horário da Indonésia Ocidental", "ACST": "Horário Padrão da Austrália Central", "AKST": "Horário Padrão do Alasca", "AKDT": "Horário de Verão do Alasca", "PST": "Horário Padrão do Pacífico", "LHST": "Horário Padrão de Lord Howe", "GMT": "Horário do Meridiano de Greenwich", "WITA": "Horário da Indonésia Central", "AWST": "Horário Padrão da Austrália Ocidental", "HADT": "Horário de Verão do Havaí e Ilhas Aleutas", "NZDT": "Horário de Verão da Nova Zelândia", "ECT": "Horário do Equador", "ACWST": "Horário Padrão da Austrália Centro-Ocidental", "PDT": "Horário de Verão do Pacífico", "ChST": "Horário de Chamorro", "CLT": "Horário Padrão do Chile", "WART": "Horário Padrão da Argentina Ocidental", "GFT": "Horário da Guiana Francesa", "HKST": "Horário de Verão de Hong Kong", "JDT": "Horário de Verão do Japão", "SAST": "Horário da África do Sul", "IST": "Horário Padrão da Índia", "CDT": "Horário de Verão Central", "WEZ": "Horário Padrão da Europa Ocidental", "GYT": "Horário da Guiana", "EAT": "Horário da África Oriental"},
}
}
diff --git a/pt_GW/pt_GW_test.go b/pt_GW/pt_GW_test.go
new file mode 100644
index 00000000..ac3d93a7
--- /dev/null
+++ b/pt_GW/pt_GW_test.go
@@ -0,0 +1,1120 @@
+package pt_GW
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "pt_GW"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/pt_LU/pt_LU.go b/pt_LU/pt_LU.go
index 2e623bc5..40d9a786 100644
--- a/pt_LU/pt_LU.go
+++ b/pt_LU/pt_LU.go
@@ -47,7 +47,7 @@ func New() locales.Translator {
locale: "pt_LU",
pluralsCardinal: []locales.PluralRule{2, 6},
pluralsOrdinal: []locales.PluralRule{6},
- pluralsRange: []locales.PluralRule{6, 2},
+ pluralsRange: []locales.PluralRule{2, 6},
decimal: ",",
group: ".",
minus: "-",
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a.C.", "d.C."},
erasNarrow: []string{"", ""},
erasWide: []string{"antes de Cristo", "depois de Cristo"},
- timezones: map[string]string{"COST": "Horário de Verão da Colômbia", "ECT": "Horário do Equador", "WARST": "Horário de Verão da Argentina Ocidental", "GMT": "Horário do Meridiano de Greenwich", "ACDT": "Horário de Verão da Austrália Central", "MYT": "Horário da Malásia", "JDT": "Horário de Verão do Japão", "AWDT": "Horário de Verão da Austrália Ocidental", "CLT": "Horário Padrão do Chile", "CLST": "Horário de Verão do Chile", "SGT": "Horário Padrão de Cingapura", "BT": "Horário do Butão", "CDT": "Horário de Verão Central", "WART": "Horário Padrão da Argentina Ocidental", "AKST": "Horário Padrão do Alasca", "CST": "Horário Padrão Central", "SRT": "Horário do Suriname", "MDT": "Horário de Verão da Montanha", "COT": "Horário Padrão da Colômbia", "ADT": "Horário de Verão do Atlântico", "ACST": "Horário Padrão da Austrália Central", "HAT": "Horário de Verão de Terra Nova", "EAT": "Horário da África Oriental", "CHAST": "Horário Padrão de Chatham", "∅∅∅": "Horário de Verão de Brasília", "HAST": "Horário Padrão do Havaí e Ilhas Aleutas", "NZST": "Horário Padrão da Nova Zelândia", "NZDT": "Horário de Verão da Nova Zelândia", "ChST": "Horário de Chamorro", "HADT": "Horário de Verão do Havaí e Ilhas Aleutas", "AKDT": "Horário de Verão do Alasca", "MESZ": "Horário de Verão da Europa Central", "GFT": "Horário da Guiana Francesa", "IST": "Horário Padrão da Índia", "ART": "Horário Padrão da Argentina", "PDT": "Horário de Verão do Pacífico", "CHADT": "Horário de Verão de Chatham", "ACWST": "Horário Padrão da Austrália Centro-Ocidental", "AEST": "Horário Padrão da Austrália Oriental", "HKST": "Horário de Verão de Hong Kong", "LHDT": "Horário de Verão de Lord Howe", "BOT": "Horário da Bolívia", "WEZ": "Horário Padrão da Europa Ocidental", "WESZ": "Horário de Verão da Europa Ocidental", "AST": "Horário Padrão do Atlântico", "JST": "Horário Padrão do Japão", "TMST": "Horário de Verão do Turcomenistão", "LHST": "Horário Padrão de Lord Howe", "UYST": "Horário de Verão do Uruguai", "OESZ": "Horário de Verão da Europa Oriental", "TMT": "Horário Padrão do Turcomenistão", "AWST": "Horário Padrão da Austrália Ocidental", "VET": "Horário da Venezuela", "HKT": "Horário Padrão de Hong Kong", "WIT": "Horário da Indonésia Oriental", "OEZ": "Horário Padrão da Europa Oriental", "ARST": "Horário de Verão da Argentina", "MST": "Horário Padrão da Montanha", "AEDT": "Horário de Verão da Austrália Oriental", "EST": "Horário Padrão Oriental", "WAST": "Horário de Verão da África Ocidental", "HNT": "Horário Padrão de Terra Nova", "PST": "Horário Padrão do Pacífico", "UYT": "Horário Padrão do Uruguai", "ACWDT": "Horário de Verão da Austrália Centro-Ocidental", "CAT": "Horário da África Central", "EDT": "Horário de Verão Oriental", "SAST": "Horário da África do Sul", "MEZ": "Horário Padrão da Europa Central", "WAT": "Horário Padrão da África Ocidental", "WITA": "Horário da Indonésia Central", "WIB": "Horário da Indonésia Ocidental", "GYT": "Horário da Guiana"},
+ timezones: map[string]string{"WIB": "Horário da Indonésia Ocidental", "WEZ": "Horário Padrão da Europa Ocidental", "WESZ": "Horário de Verão da Europa Ocidental", "CLST": "Horário de Verão do Chile", "HAST": "Horário Padrão do Havaí e Ilhas Aleutas", "MEZ": "Horário Padrão da Europa Central", "OEZ": "Horário Padrão da Europa Oriental", "AEST": "Horário Padrão da Austrália Oriental", "JDT": "Horário de Verão do Japão", "NZST": "Horário Padrão da Nova Zelândia", "NZDT": "Horário de Verão da Nova Zelândia", "PDT": "Horário de Verão do Pacífico", "HAT": "Horário de Verão de Terra Nova", "ChST": "Horário de Chamorro", "MDT": "Horário de Verão da Montanha", "HNT": "Horário Padrão de Terra Nova", "SGT": "Horário Padrão de Cingapura", "GMT": "Horário do Meridiano de Greenwich", "ECT": "Horário do Equador", "GFT": "Horário da Guiana Francesa", "CHADT": "Horário de Verão de Chatham", "AKDT": "Horário de Verão do Alasca", "ADT": "Horário de Verão do Atlântico", "ACWST": "Horário Padrão da Austrália Centro-Ocidental", "COT": "Horário Padrão da Colômbia", "WART": "Horário Padrão da Argentina Ocidental", "ACWDT": "Horário de Verão da Austrália Centro-Ocidental", "SAST": "Horário da África do Sul", "EST": "Horário Padrão Oriental", "HADT": "Horário de Verão do Havaí e Ilhas Aleutas", "HKST": "Horário de Verão de Hong Kong", "EDT": "Horário de Verão Oriental", "MESZ": "Horário de Verão da Europa Central", "BT": "Horário do Butão", "VET": "Horário da Venezuela", "JST": "Horário Padrão do Japão", "AST": "Horário Padrão do Atlântico", "COST": "Horário de Verão da Colômbia", "OESZ": "Horário de Verão da Europa Oriental", "TMT": "Horário Padrão do Turcomenistão", "MST": "Horário Padrão da Montanha", "CDT": "Horário de Verão Central", "WITA": "Horário da Indonésia Central", "GYT": "Horário da Guiana", "MYT": "Horário da Malásia", "ACDT": "Horário de Verão da Austrália Central", "ART": "Horário Padrão da Argentina", "CAT": "Horário da África Central", "AEDT": "Horário de Verão da Austrália Oriental", "UYT": "Horário Padrão do Uruguai", "AKST": "Horário Padrão do Alasca", "AWDT": "Horário de Verão da Austrália Ocidental", "IST": "Horário Padrão da Índia", "LHST": "Horário Padrão de Lord Howe", "LHDT": "Horário de Verão de Lord Howe", "ACST": "Horário Padrão da Austrália Central", "WARST": "Horário de Verão da Argentina Ocidental", "SRT": "Horário do Suriname", "ARST": "Horário de Verão da Argentina", "UYST": "Horário de Verão do Uruguai", "∅∅∅": "Horário de Verão de Brasília", "CST": "Horário Padrão Central", "AWST": "Horário Padrão da Austrália Ocidental", "BOT": "Horário da Bolívia", "PST": "Horário Padrão do Pacífico", "WIT": "Horário da Indonésia Oriental", "EAT": "Horário da África Oriental", "CLT": "Horário Padrão do Chile", "HKT": "Horário Padrão de Hong Kong", "CHAST": "Horário Padrão de Chatham", "TMST": "Horário de Verão do Turcomenistão", "WAT": "Horário Padrão da África Ocidental", "WAST": "Horário de Verão da África Ocidental"},
}
}
diff --git a/pt_LU/pt_LU_test.go b/pt_LU/pt_LU_test.go
new file mode 100644
index 00000000..9b3dfc45
--- /dev/null
+++ b/pt_LU/pt_LU_test.go
@@ -0,0 +1,1120 @@
+package pt_LU
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "pt_LU"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/pt_MO/pt_MO.go b/pt_MO/pt_MO.go
index cd59eca4..30e696a3 100644
--- a/pt_MO/pt_MO.go
+++ b/pt_MO/pt_MO.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a.C.", "d.C."},
erasNarrow: []string{"", ""},
erasWide: []string{"antes de Cristo", "depois de Cristo"},
- timezones: map[string]string{"WAST": "Horário de Verão da África Ocidental", "LHDT": "Horário de Verão de Lord Howe", "NZDT": "Horário de Verão da Nova Zelândia", "AEST": "Horário Padrão da Austrália Oriental", "CHADT": "Horário de Verão de Chatham", "CLST": "Horário de Verão do Chile", "COT": "Horário Padrão da Colômbia", "∅∅∅": "Horário de Verão do Amazonas", "CAT": "Horário da África Central", "HKST": "Horário de Verão de Hong Kong", "ACDT": "Horário de Verão da Austrália Central", "ART": "Horário Padrão da Argentina", "TMST": "Horário de Verão do Turcomenistão", "PST": "Horário Padrão do Pacífico", "MESZ": "Horário de Verão da Europa Central", "CLT": "Horário Padrão do Chile", "WART": "Horário Padrão da Argentina Ocidental", "WIB": "Horário da Indonésia Ocidental", "ACST": "Horário Padrão da Austrália Central", "UYST": "Horário de Verão do Uruguai", "AEDT": "Horário de Verão da Austrália Oriental", "SAST": "Horário da África do Sul", "BT": "Horário do Butão", "GYT": "Horário da Guiana", "EST": "Horário Padrão Oriental", "WITA": "Horário da Indonésia Central", "ECT": "Horário do Equador", "ADT": "Horário de Verão do Atlântico", "OEZ": "Horário Padrão da Europa Oriental", "ACWDT": "Horário de Verão da Austrália Centro-Ocidental", "AST": "Horário Padrão do Atlântico", "GMT": "Horário do Meridiano de Greenwich", "AWDT": "Horário de Verão da Austrália Ocidental", "ACWST": "Horário Padrão da Austrália Centro-Ocidental", "CHAST": "Horário Padrão de Chatham", "HAST": "Horário Padrão do Havaí e Ilhas Aleutas", "JDT": "Horário de Verão do Japão", "NZST": "Horário Padrão da Nova Zelândia", "BOT": "Horário da Bolívia", "UYT": "Horário Padrão do Uruguai", "HKT": "Horário Padrão de Hong Kong", "ARST": "Horário de Verão da Argentina", "JST": "Horário Padrão do Japão", "PDT": "Horário de Verão do Pacífico", "IST": "Horário Padrão da Índia", "OESZ": "Horário de Verão da Europa Oriental", "HNT": "Horário Padrão de Terra Nova", "WIT": "Horário da Indonésia Oriental", "LHST": "Horário Padrão de Lord Howe", "VET": "Horário da Venezuela", "WARST": "Horário de Verão da Argentina Ocidental", "AKDT": "Horário de Verão do Alasca", "AWST": "Horário Padrão da Austrália Ocidental", "MEZ": "Horário Padrão da Europa Central", "WESZ": "Horário de Verão da Europa Ocidental", "ChST": "Horário de Chamorro", "COST": "Horário de Verão da Colômbia", "MDT": "Horário de Verão de Macau", "MYT": "Horário da Malásia", "CST": "Horário Padrão Central", "EDT": "Horário de Verão Oriental", "GFT": "Horário da Guiana Francesa", "EAT": "Horário da África Oriental", "MST": "Horário Padrão de Macau", "CDT": "Horário de Verão Central", "WEZ": "Horário Padrão da Europa Ocidental", "HADT": "Horário de Verão do Havaí e Ilhas Aleutas", "WAT": "Horário Padrão da África Ocidental", "TMT": "Horário Padrão do Turcomenistão", "AKST": "Horário Padrão do Alasca", "SRT": "Horário do Suriname", "SGT": "Horário Padrão de Cingapura", "HAT": "Horário de Verão de Terra Nova"},
+ timezones: map[string]string{"ECT": "Horário do Equador", "COT": "Horário Padrão da Colômbia", "AEDT": "Horário de Verão da Austrália Oriental", "CHADT": "Horário de Verão de Chatham", "NZST": "Horário Padrão da Nova Zelândia", "SGT": "Horário Padrão de Cingapura", "ChST": "Horário de Chamorro", "MYT": "Horário da Malásia", "CDT": "Horário de Verão Central", "ART": "Horário Padrão da Argentina", "WITA": "Horário da Indonésia Central", "LHST": "Horário Padrão de Lord Howe", "WART": "Horário Padrão da Argentina Ocidental", "ACWDT": "Horário de Verão da Austrália Centro-Ocidental", "CAT": "Horário da África Central", "SRT": "Horário do Suriname", "PDT": "Horário de Verão do Pacífico", "PST": "Horário Padrão do Pacífico", "HAT": "Horário de Verão de Terra Nova", "AEST": "Horário Padrão da Austrália Oriental", "BT": "Horário do Butão", "EST": "Horário Padrão Oriental", "HAST": "Horário Padrão do Havaí e Ilhas Aleutas", "NZDT": "Horário de Verão da Nova Zelândia", "OESZ": "Horário de Verão da Europa Oriental", "WARST": "Horário de Verão da Argentina Ocidental", "IST": "Horário Padrão da Índia", "JDT": "Horário de Verão do Japão", "EDT": "Horário de Verão Oriental", "COST": "Horário de Verão da Colômbia", "VET": "Horário da Venezuela", "MEZ": "Horário Padrão da Europa Central", "TMST": "Horário de Verão do Turcomenistão", "WAT": "Horário Padrão da África Ocidental", "WIB": "Horário da Indonésia Ocidental", "WIT": "Horário da Indonésia Oriental", "CST": "Horário Padrão Central", "AST": "Horário Padrão do Atlântico", "AKDT": "Horário de Verão do Alasca", "ACST": "Horário Padrão da Austrália Central", "HKST": "Horário de Verão de Hong Kong", "ARST": "Horário de Verão da Argentina", "SAST": "Horário da África do Sul", "GMT": "Horário do Meridiano de Greenwich", "ACWST": "Horário Padrão da Austrália Centro-Ocidental", "WEZ": "Horário Padrão da Europa Ocidental", "EAT": "Horário da África Oriental", "ACDT": "Horário de Verão da Austrália Central", "MESZ": "Horário de Verão da Europa Central", "JST": "Horário Padrão do Japão", "BOT": "Horário da Bolívia", "WESZ": "Horário de Verão da Europa Ocidental", "GYT": "Horário da Guiana", "CLT": "Horário Padrão do Chile", "UYT": "Horário Padrão do Uruguai", "MDT": "Horário de Verão de Macau", "AWST": "Horário Padrão da Austrália Ocidental", "OEZ": "Horário Padrão da Europa Oriental", "UYST": "Horário de Verão do Uruguai", "AKST": "Horário Padrão do Alasca", "MST": "Horário Padrão de Macau", "ADT": "Horário de Verão do Atlântico", "TMT": "Horário Padrão do Turcomenistão", "CLST": "Horário de Verão do Chile", "GFT": "Horário da Guiana Francesa", "CHAST": "Horário Padrão de Chatham", "HKT": "Horário Padrão de Hong Kong", "AWDT": "Horário de Verão da Austrália Ocidental", "HADT": "Horário de Verão do Havaí e Ilhas Aleutas", "WAST": "Horário de Verão da África Ocidental", "HNT": "Horário Padrão de Terra Nova", "LHDT": "Horário de Verão de Lord Howe", "∅∅∅": "Horário de Verão dos Açores"},
}
}
diff --git a/pt_MO/pt_MO_test.go b/pt_MO/pt_MO_test.go
new file mode 100644
index 00000000..f1206eb3
--- /dev/null
+++ b/pt_MO/pt_MO_test.go
@@ -0,0 +1,1120 @@
+package pt_MO
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "pt_MO"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/pt_MZ/pt_MZ.go b/pt_MZ/pt_MZ.go
index 980e505f..fc37b072 100644
--- a/pt_MZ/pt_MZ.go
+++ b/pt_MZ/pt_MZ.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a.C.", "d.C."},
erasNarrow: []string{"", ""},
erasWide: []string{"antes de Cristo", "depois de Cristo"},
- timezones: map[string]string{"ACDT": "Horário de Verão da Austrália Central", "MYT": "Horário da Malásia", "JST": "Horário Padrão do Japão", "CLT": "Horário Padrão do Chile", "HADT": "Horário de Verão do Havaí e Ilhas Aleutas", "HKST": "Horário de Verão de Hong Kong", "WIB": "Horário da Indonésia Ocidental", "OESZ": "Horário de Verão da Europa Oriental", "MST": "Horário Padrão de Macau", "JDT": "Horário de Verão do Japão", "CLST": "Horário de Verão do Chile", "COST": "Horário de Verão da Colômbia", "ADT": "Horário de Verão do Atlântico", "BT": "Horário do Butão", "IST": "Horário Padrão da Índia", "GMT": "Horário do Meridiano de Greenwich", "GFT": "Horário da Guiana Francesa", "ACST": "Horário Padrão da Austrália Central", "MDT": "Horário de Verão de Macau", "SRT": "Horário do Suriname", "AKST": "Horário Padrão do Alasca", "HKT": "Horário Padrão de Hong Kong", "WART": "Horário Padrão da Argentina Ocidental", "PDT": "Horário de Verão do Pacífico", "MESZ": "Horário de Verão da Europa Central", "WEZ": "Horário Padrão da Europa Ocidental", "EST": "Horário Padrão Oriental", "WAT": "Horário Padrão da África Ocidental", "UYT": "Horário Padrão do Uruguai", "CAT": "Horário da África Central", "CST": "Horário Padrão Central", "VET": "Horário da Venezuela", "AEDT": "Horário de Verão da Austrália Oriental", "EAT": "Horário da África Oriental", "UYST": "Horário de Verão do Uruguai", "PST": "Horário Padrão do Pacífico", "WESZ": "Horário de Verão da Europa Ocidental", "SAST": "Horário da África do Sul", "LHDT": "Horário de Verão de Lord Howe", "HAT": "Horário de Verão de Terra Nova", "ACWST": "Horário Padrão da Austrália Centro-Ocidental", "TMT": "Horário Padrão do Turcomenistão", "LHST": "Horário Padrão de Lord Howe", "WITA": "Horário da Indonésia Central", "ART": "Horário Padrão da Argentina", "COT": "Horário Padrão da Colômbia", "NZDT": "Horário de Verão da Nova Zelândia", "AEST": "Horário Padrão da Austrália Oriental", "BOT": "Horário da Bolívia", "EDT": "Horário de Verão Oriental", "AST": "Horário Padrão do Atlântico", "WARST": "Horário de Verão da Argentina Ocidental", "AKDT": "Horário de Verão do Alasca", "NZST": "Horário Padrão da Nova Zelândia", "ACWDT": "Horário de Verão da Austrália Centro-Ocidental", "OEZ": "Horário Padrão da Europa Oriental", "ECT": "Horário do Equador", "AWST": "Horário Padrão da Austrália Ocidental", "AWDT": "Horário de Verão da Austrália Ocidental", "CHADT": "Horário de Verão de Chatham", "SGT": "Horário Padrão de Cingapura", "HAST": "Horário Padrão do Havaí e Ilhas Aleutas", "WAST": "Horário de Verão da África Ocidental", "ARST": "Horário de Verão da Argentina", "TMST": "Horário de Verão do Turcomenistão", "ChST": "Horário de Chamorro", "∅∅∅": "Horário de Verão do Amazonas", "GYT": "Horário da Guiana", "CDT": "Horário de Verão Central", "MEZ": "Horário Padrão da Europa Central", "CHAST": "Horário Padrão de Chatham", "HNT": "Horário Padrão de Terra Nova", "WIT": "Horário da Indonésia Oriental"},
+ timezones: map[string]string{"EST": "Horário Padrão Oriental", "GMT": "Horário do Meridiano de Greenwich", "GYT": "Horário da Guiana", "MYT": "Horário da Malásia", "ACWST": "Horário Padrão da Austrália Centro-Ocidental", "EDT": "Horário de Verão Oriental", "OEZ": "Horário Padrão da Europa Oriental", "LHST": "Horário Padrão de Lord Howe", "CHADT": "Horário de Verão de Chatham", "ACWDT": "Horário de Verão da Austrália Centro-Ocidental", "WAT": "Horário Padrão da África Ocidental", "AWDT": "Horário de Verão da Austrália Ocidental", "WEZ": "Horário Padrão da Europa Ocidental", "ECT": "Horário do Equador", "ADT": "Horário de Verão do Atlântico", "WESZ": "Horário de Verão da Europa Ocidental", "MDT": "Horário de Verão da Montanha", "CLT": "Horário Padrão do Chile", "CHAST": "Horário Padrão de Chatham", "ACST": "Horário Padrão da Austrália Central", "WART": "Horário Padrão da Argentina Ocidental", "HKST": "Horário de Verão de Hong Kong", "PST": "Horário Padrão do Pacífico", "MESZ": "Horário de Verão da Europa Central", "TMT": "Horário Padrão do Turcomenistão", "TMST": "Horário de Verão do Turcomenistão", "UYST": "Horário de Verão do Uruguai", "∅∅∅": "Horário de Verão de Brasília", "WITA": "Horário da Indonésia Central", "SGT": "Horário Padrão de Cingapura", "WIB": "Horário da Indonésia Ocidental", "BT": "Horário do Butão", "LHDT": "Horário de Verão de Lord Howe", "MST": "Horário Padrão da Montanha", "GFT": "Horário da Guiana Francesa", "COT": "Horário Padrão da Colômbia", "ACDT": "Horário de Verão da Austrália Central", "HKT": "Horário Padrão de Hong Kong", "AWST": "Horário Padrão da Austrália Ocidental", "ART": "Horário Padrão da Argentina", "ARST": "Horário de Verão da Argentina", "JST": "Horário Padrão do Japão", "COST": "Horário de Verão da Colômbia", "OESZ": "Horário de Verão da Europa Oriental", "ChST": "Horário de Chamorro", "JDT": "Horário de Verão do Japão", "IST": "Horário Padrão da Índia", "WAST": "Horário de Verão da África Ocidental", "AEST": "Horário Padrão da Austrália Oriental", "VET": "Horário da Venezuela", "AKST": "Horário Padrão do Alasca", "AKDT": "Horário de Verão do Alasca", "MEZ": "Horário Padrão da Europa Central", "CLST": "Horário de Verão do Chile", "HAST": "Horário Padrão do Havaí e Ilhas Aleutas", "WIT": "Horário da Indonésia Oriental", "UYT": "Horário Padrão do Uruguai", "SRT": "Horário do Suriname", "BOT": "Horário da Bolívia", "SAST": "Horário da África do Sul", "HADT": "Horário de Verão do Havaí e Ilhas Aleutas", "NZDT": "Horário de Verão da Nova Zelândia", "AEDT": "Horário de Verão da Austrália Oriental", "CST": "Horário Padrão Central", "AST": "Horário Padrão do Atlântico", "NZST": "Horário Padrão da Nova Zelândia", "CAT": "Horário da África Central", "HAT": "Horário de Verão de Terra Nova", "EAT": "Horário da África Oriental", "CDT": "Horário de Verão Central", "WARST": "Horário de Verão da Argentina Ocidental", "PDT": "Horário de Verão do Pacífico", "HNT": "Horário Padrão de Terra Nova"},
}
}
diff --git a/pt_MZ/pt_MZ_test.go b/pt_MZ/pt_MZ_test.go
new file mode 100644
index 00000000..e4cc8195
--- /dev/null
+++ b/pt_MZ/pt_MZ_test.go
@@ -0,0 +1,1120 @@
+package pt_MZ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "pt_MZ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/pt_PT/pt_PT.go b/pt_PT/pt_PT.go
index ec41f76c..881acc30 100644
--- a/pt_PT/pt_PT.go
+++ b/pt_PT/pt_PT.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a.E.C.", "E.C."},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"JST": "Hora padrão do Japão", "WESZ": "Hora de verão da Europa Ocidental", "CAT": "Hora da África Central", "COST": "Hora de verão da Colômbia", "LHST": "Hora padrão de Lord Howe", "SAST": "Hora da África do Sul", "IST": "Hora padrão da Índia", "NZST": "Hora padrão da Nova Zelândia", "WAST": "Hora de verão da África Ocidental", "WIT": "Hora da Indonésia Oriental", "TMST": "Hora de verão do Turquemenistão", "UYT": "Hora padrão do Uruguai", "AST": "Hora padrão do Atlântico", "ACDT": "Hora de verão da Austrália Central", "ACWDT": "Hora de verão da Austrália Central Ocidental", "ChST": "Hora padrão do Chamorro", "COT": "Hora padrão da Colômbia", "ADT": "Hora de verão do Atlântico", "HKT": "Hora padrão de Hong Kong", "HKST": "Hora de verão de Hong Kong", "GYT": "Hora da Guiana", "JDT": "Hora de verão do Japão", "CDT": "Hora de verão Central", "MESZ": "Hora de verão da Europa Central", "SGT": "Hora padrão de Singapura", "WARST": "Hora de verão da Argentina Ocidental", "HNT": "Hora padrão da Terra Nova", "HAT": "Hora de verão da Terra Nova", "LHDT": "Hora de verão de Lord Howe", "MYT": "Hora da Malásia", "EST": "Hora padrão Oriental", "AKDT": "Hora de verão do Alasca", "BOT": "Hora da Bolívia", "ACWST": "Hora padrão da Austrália Central Ocidental", "MST": "Hora padrão de Macau", "AWDT": "Hora de verão da Austrália Ocidental", "HAST": "Hora padrão do Havai e Aleutas", "WART": "Hora padrão da Argentina Ocidental", "OEZ": "Hora padrão da Europa Oriental", "ACST": "Hora padrão da Austrália Central", "WIB": "Hora da Indonésia Ocidental", "GFT": "Hora da Guiana Francesa", "WITA": "Hora da Indonésia Central", "MDT": "Hora de verão de Macau", "UYST": "Hora de verão do Uruguai", "EDT": "Hora de verão Oriental", "AWST": "Hora padrão da Austrália Ocidental", "NZDT": "Hora de verão da Nova Zelândia", "HADT": "Hora de verão do Havai e Aleutas", "BT": "Hora do Butão", "GMT": "Hora de Greenwich", "AKST": "Hora padrão do Alasca", "ARST": "Hora de verão da Argentina", "PDT": "Hora de verão do Pacífico", "VET": "Hora da Venezuela", "ECT": "Hora do Equador", "OESZ": "Hora de verão da Europa Oriental", "ART": "Hora padrão da Argentina", "AEDT": "Hora de verão da Austrália Oriental", "CST": "Hora padrão Central", "CLT": "Hora padrão do Chile", "TMT": "Hora padrão do Turquemenistão", "∅∅∅": "Hora de verão do Amazonas", "SRT": "Hora do Suriname", "PST": "Hora padrão do Pacífico", "MEZ": "Hora padrão da Europa Central", "WEZ": "Hora padrão da Europa Ocidental", "AEST": "Hora padrão da Austrália Oriental", "CHAST": "Hora padrão do Chatham", "EAT": "Hora da África Oriental", "CLST": "Hora de verão do Chile", "WAT": "Hora padrão da África Ocidental", "CHADT": "Hora de verão do Chatham"},
+ timezones: map[string]string{"AWST": "Hora padrão da Austrália Ocidental", "MESZ": "Hora de verão da Europa Central", "WIT": "Hora da Indonésia Oriental", "MYT": "Hora da Malásia", "ACST": "Hora padrão da Austrália Central", "WARST": "Hora de verão da Argentina Ocidental", "SRT": "Hora do Suriname", "COT": "Hora padrão da Colômbia", "HAST": "Hora padrão do Havai e Aleutas", "WIB": "Hora da Indonésia Ocidental", "WAT": "Hora padrão da África Ocidental", "OEZ": "Hora padrão da Europa Oriental", "TMT": "Hora padrão do Turquemenistão", "WEZ": "Hora padrão da Europa Ocidental", "ChST": "Hora padrão do Chamorro", "LHST": "Hora padrão de Lord Howe", "HKST": "Hora de verão de Hong Kong", "ACWST": "Hora padrão da Austrália Central Ocidental", "NZST": "Hora padrão da Nova Zelândia", "EST": "Hora padrão Oriental", "CHAST": "Hora padrão do Chatham", "IST": "Hora padrão da Índia", "EAT": "Hora da África Oriental", "UYT": "Hora padrão do Uruguai", "ACDT": "Hora de verão da Austrália Central", "ADT": "Hora de verão do Atlântico", "NZDT": "Hora de verão da Nova Zelândia", "TMST": "Hora de verão do Turquemenistão", "AKDT": "Hora de verão do Alasca", "SAST": "Hora da África do Sul", "SGT": "Hora padrão de Singapura", "COST": "Hora de verão da Colômbia", "BT": "Hora do Butão", "LHDT": "Hora de verão de Lord Howe", "∅∅∅": "Hora de verão dos Açores", "JDT": "Hora de verão do Japão", "BOT": "Hora da Bolívia", "PST": "Hora padrão do Pacífico", "ACWDT": "Hora de verão da Austrália Central Ocidental", "HNT": "Hora padrão da Terra Nova", "AEDT": "Hora de verão da Austrália Oriental", "CDT": "Hora de verão Central", "ART": "Hora padrão da Argentina", "JST": "Hora padrão do Japão", "MEZ": "Hora padrão da Europa Central", "VET": "Hora da Venezuela", "AST": "Hora padrão do Atlântico", "CAT": "Hora da África Central", "WESZ": "Hora de verão da Europa Ocidental", "HAT": "Hora de verão da Terra Nova", "WART": "Hora padrão da Argentina Ocidental", "MDT": "Hora de verão de Macau", "CHADT": "Hora de verão do Chatham", "WITA": "Hora da Indonésia Central", "OESZ": "Hora de verão da Europa Oriental", "CLT": "Hora padrão do Chile", "CST": "Hora padrão Central", "MST": "Hora padrão de Macau", "PDT": "Hora de verão do Pacífico", "WAST": "Hora de verão da África Ocidental", "AEST": "Hora padrão da Austrália Oriental", "UYST": "Hora de verão do Uruguai", "ECT": "Hora do Equador", "ARST": "Hora de verão da Argentina", "AWDT": "Hora de verão da Austrália Ocidental", "HADT": "Hora de verão do Havai e Aleutas", "AKST": "Hora padrão do Alasca", "CLST": "Hora de verão do Chile", "GMT": "Hora de Greenwich", "GFT": "Hora da Guiana Francesa", "HKT": "Hora padrão de Hong Kong", "EDT": "Hora de verão Oriental", "GYT": "Hora da Guiana"},
}
}
diff --git a/pt_PT/pt_PT_test.go b/pt_PT/pt_PT_test.go
new file mode 100644
index 00000000..e2e057d8
--- /dev/null
+++ b/pt_PT/pt_PT_test.go
@@ -0,0 +1,1120 @@
+package pt_PT
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "pt_PT"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/pt_ST/pt_ST.go b/pt_ST/pt_ST.go
index 8c557687..599751d0 100644
--- a/pt_ST/pt_ST.go
+++ b/pt_ST/pt_ST.go
@@ -47,7 +47,7 @@ func New() locales.Translator {
locale: "pt_ST",
pluralsCardinal: []locales.PluralRule{2, 6},
pluralsOrdinal: []locales.PluralRule{6},
- pluralsRange: []locales.PluralRule{6, 2},
+ pluralsRange: []locales.PluralRule{2, 6},
decimal: ",",
group: ".",
minus: "-",
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a.C.", "d.C."},
erasNarrow: []string{"", ""},
erasWide: []string{"antes de Cristo", "depois de Cristo"},
- timezones: map[string]string{"TMST": "Horário de Verão do Turcomenistão", "BOT": "Horário da Bolívia", "UYT": "Horário Padrão do Uruguai", "VET": "Horário da Venezuela", "ChST": "Horário de Chamorro", "OESZ": "Horário de Verão da Europa Oriental", "HKST": "Horário de Verão de Hong Kong", "IST": "Horário Padrão da Índia", "HNT": "Horário Padrão de Terra Nova", "MDT": "Horário de Verão de Macau", "ACST": "Horário Padrão da Austrália Central", "MYT": "Horário da Malásia", "MESZ": "Horário de Verão da Europa Central", "∅∅∅": "Horário de Verão do Acre", "ACWST": "Horário Padrão da Austrália Centro-Ocidental", "CAT": "Horário da África Central", "ECT": "Horário do Equador", "WESZ": "Horário de Verão da Europa Ocidental", "HKT": "Horário Padrão de Hong Kong", "LHDT": "Horário de Verão de Lord Howe", "AST": "Horário Padrão do Atlântico", "MST": "Horário Padrão de Macau", "AWDT": "Horário de Verão da Austrália Ocidental", "CLT": "Horário Padrão do Chile", "WITA": "Horário da Indonésia Central", "OEZ": "Horário Padrão da Europa Oriental", "JST": "Horário Padrão do Japão", "NZDT": "Horário de Verão da Nova Zelândia", "ACWDT": "Horário de Verão da Austrália Centro-Ocidental", "AEST": "Horário Padrão da Austrália Oriental", "EDT": "Horário de Verão Oriental", "COT": "Horário Padrão da Colômbia", "WIB": "Horário da Indonésia Ocidental", "ART": "Horário Padrão da Argentina", "PST": "Horário Padrão do Pacífico", "WIT": "Horário da Indonésia Oriental", "LHST": "Horário Padrão de Lord Howe", "ARST": "Horário de Verão da Argentina", "TMT": "Horário Padrão do Turcomenistão", "CHAST": "Horário Padrão de Chatham", "COST": "Horário de Verão da Colômbia", "GMT": "Horário do Meridiano de Greenwich", "SAST": "Horário da África do Sul", "WARST": "Horário de Verão da Argentina Ocidental", "GFT": "Horário da Guiana Francesa", "ACDT": "Horário de Verão da Austrália Central", "SRT": "Horário do Suriname", "CDT": "Horário de Verão Central", "AEDT": "Horário de Verão da Austrália Oriental", "HADT": "Horário de Verão do Havaí e Ilhas Aleutas", "HAST": "Horário Padrão do Havaí e Ilhas Aleutas", "CST": "Horário Padrão Central", "CHADT": "Horário de Verão de Chatham", "ADT": "Horário de Verão do Atlântico", "WAST": "Horário de Verão da África Ocidental", "NZST": "Horário Padrão da Nova Zelândia", "SGT": "Horário Padrão de Cingapura", "JDT": "Horário de Verão do Japão", "MEZ": "Horário Padrão da Europa Central", "CLST": "Horário de Verão do Chile", "EST": "Horário Padrão Oriental", "WAT": "Horário Padrão da África Ocidental", "EAT": "Horário da África Oriental", "PDT": "Horário de Verão do Pacífico", "AWST": "Horário Padrão da Austrália Ocidental", "HAT": "Horário de Verão de Terra Nova", "WEZ": "Horário Padrão da Europa Ocidental", "UYST": "Horário de Verão do Uruguai", "AKST": "Horário Padrão do Alasca", "WART": "Horário Padrão da Argentina Ocidental", "AKDT": "Horário de Verão do Alasca", "GYT": "Horário da Guiana", "BT": "Horário do Butão"},
+ timezones: map[string]string{"ACWST": "Horário Padrão da Austrália Centro-Ocidental", "AWDT": "Horário de Verão da Austrália Ocidental", "ACDT": "Horário de Verão da Austrália Central", "WARST": "Horário de Verão da Argentina Ocidental", "HKST": "Horário de Verão de Hong Kong", "WITA": "Horário da Indonésia Central", "TMST": "Horário de Verão do Turcomenistão", "WAST": "Horário de Verão da África Ocidental", "HNT": "Horário Padrão de Terra Nova", "GMT": "Horário do Meridiano de Greenwich", "AEST": "Horário Padrão da Austrália Oriental", "WART": "Horário Padrão da Argentina Ocidental", "SRT": "Horário do Suriname", "JST": "Horário Padrão do Japão", "EDT": "Horário de Verão Oriental", "WIT": "Horário da Indonésia Oriental", "ECT": "Horário do Equador", "VET": "Horário da Venezuela", "ARST": "Horário de Verão da Argentina", "NZST": "Horário Padrão da Nova Zelândia", "SAST": "Horário da África do Sul", "PST": "Horário Padrão do Pacífico", "WIB": "Horário da Indonésia Ocidental", "WEZ": "Horário Padrão da Europa Ocidental", "COST": "Horário de Verão da Colômbia", "ACST": "Horário Padrão da Austrália Central", "PDT": "Horário de Verão do Pacífico", "COT": "Horário Padrão da Colômbia", "GYT": "Horário da Guiana", "MST": "Horário Padrão da Montanha", "OESZ": "Horário de Verão da Europa Oriental", "UYST": "Horário de Verão do Uruguai", "AST": "Horário Padrão do Atlântico", "ADT": "Horário de Verão do Atlântico", "ART": "Horário Padrão da Argentina", "∅∅∅": "Horário de Verão do Amazonas", "CST": "Horário Padrão Central", "AKDT": "Horário de Verão do Alasca", "HAT": "Horário de Verão de Terra Nova", "LHDT": "Horário de Verão de Lord Howe", "AKST": "Horário Padrão do Alasca", "OEZ": "Horário Padrão da Europa Oriental", "AEDT": "Horário de Verão da Austrália Oriental", "BT": "Horário do Butão", "MDT": "Horário de Verão da Montanha", "CDT": "Horário de Verão Central", "GFT": "Horário da Guiana Francesa", "CHAST": "Horário Padrão de Chatham", "MEZ": "Horário Padrão da Europa Central", "ChST": "Horário de Chamorro", "CLST": "Horário de Verão do Chile", "CHADT": "Horário de Verão de Chatham", "MESZ": "Horário de Verão da Europa Central", "WAT": "Horário Padrão da África Ocidental", "ACWDT": "Horário de Verão da Austrália Centro-Ocidental", "IST": "Horário Padrão da Índia", "HAST": "Horário Padrão do Havaí e Ilhas Aleutas", "TMT": "Horário Padrão do Turcomenistão", "MYT": "Horário da Malásia", "CLT": "Horário Padrão do Chile", "JDT": "Horário de Verão do Japão", "AWST": "Horário Padrão da Austrália Ocidental", "BOT": "Horário da Bolívia", "WESZ": "Horário de Verão da Europa Ocidental", "LHST": "Horário Padrão de Lord Howe", "HKT": "Horário Padrão de Hong Kong", "NZDT": "Horário de Verão da Nova Zelândia", "SGT": "Horário Padrão de Cingapura", "UYT": "Horário Padrão do Uruguai", "EAT": "Horário da África Oriental", "EST": "Horário Padrão Oriental", "HADT": "Horário de Verão do Havaí e Ilhas Aleutas", "CAT": "Horário da África Central"},
}
}
diff --git a/pt_ST/pt_ST_test.go b/pt_ST/pt_ST_test.go
new file mode 100644
index 00000000..6952690c
--- /dev/null
+++ b/pt_ST/pt_ST_test.go
@@ -0,0 +1,1120 @@
+package pt_ST
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "pt_ST"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/pt_TL/pt_TL.go b/pt_TL/pt_TL.go
index ce19e085..c513fa5a 100644
--- a/pt_TL/pt_TL.go
+++ b/pt_TL/pt_TL.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"a.C.", "d.C."},
erasNarrow: []string{"", ""},
erasWide: []string{"antes de Cristo", "depois de Cristo"},
- timezones: map[string]string{"PDT": "Horário de Verão do Pacífico", "MYT": "Horário da Malásia", "AKST": "Horário Padrão do Alasca", "MEZ": "Horário Padrão da Europa Central", "ACWST": "Horário Padrão da Austrália Centro-Ocidental", "ChST": "Horário de Chamorro", "CHAST": "Horário Padrão de Chatham", "WIT": "Horário da Indonésia Oriental", "EAT": "Horário da África Oriental", "SRT": "Horário do Suriname", "WAT": "Horário Padrão da África Ocidental", "WART": "Horário Padrão da Argentina Ocidental", "ACST": "Horário Padrão da Austrália Central", "∅∅∅": "Horário de Verão do Amazonas", "AKDT": "Horário de Verão do Alasca", "UYT": "Horário Padrão do Uruguai", "CHADT": "Horário de Verão de Chatham", "WEZ": "Horário Padrão da Europa Ocidental", "GMT": "Horário do Meridiano de Greenwich", "AWST": "Horário Padrão da Austrália Ocidental", "NZST": "Horário Padrão da Nova Zelândia", "WESZ": "Horário de Verão da Europa Ocidental", "HADT": "Horário de Verão do Havaí e Ilhas Aleutas", "HKT": "Horário Padrão de Hong Kong", "WARST": "Horário de Verão da Argentina Ocidental", "MST": "Horário Padrão de Macau", "VET": "Horário da Venezuela", "SGT": "Horário Padrão de Cingapura", "TMST": "Horário de Verão do Turcomenistão", "JDT": "Horário de Verão do Japão", "AEDT": "Horário de Verão da Austrália Oriental", "CLT": "Horário Padrão do Chile", "HAST": "Horário Padrão do Havaí e Ilhas Aleutas", "ACDT": "Horário de Verão da Austrália Central", "AWDT": "Horário de Verão da Austrália Ocidental", "LHDT": "Horário de Verão de Lord Howe", "NZDT": "Horário de Verão da Nova Zelândia", "CST": "Horário Padrão Central", "CAT": "Horário da África Central", "HKST": "Horário de Verão de Hong Kong", "OESZ": "Horário de Verão da Europa Oriental", "JST": "Horário Padrão do Japão", "CLST": "Horário de Verão do Chile", "AST": "Horário Padrão do Atlântico", "GYT": "Horário da Guiana", "IST": "Horário Padrão da Índia", "COT": "Horário Padrão da Colômbia", "COST": "Horário de Verão da Colômbia", "ECT": "Horário do Equador", "OEZ": "Horário Padrão da Europa Oriental", "EST": "Horário Padrão Oriental", "ACWDT": "Horário de Verão da Austrália Centro-Ocidental", "LHST": "Horário Padrão de Lord Howe", "WIB": "Horário da Indonésia Ocidental", "BOT": "Horário da Bolívia", "AEST": "Horário Padrão da Austrália Oriental", "BT": "Horário do Butão", "WITA": "Horário da Indonésia Central", "TMT": "Horário Padrão do Turcomenistão", "PST": "Horário Padrão do Pacífico", "EDT": "Horário de Verão Oriental", "SAST": "Horário da África do Sul", "GFT": "Horário da Guiana Francesa", "MDT": "Horário de Verão de Macau", "UYST": "Horário de Verão do Uruguai", "CDT": "Horário de Verão Central", "HAT": "Horário de Verão de Terra Nova", "ADT": "Horário de Verão do Atlântico", "MESZ": "Horário de Verão da Europa Central", "ART": "Horário Padrão da Argentina", "ARST": "Horário de Verão da Argentina", "WAST": "Horário de Verão da África Ocidental", "HNT": "Horário Padrão de Terra Nova"},
+ timezones: map[string]string{"GMT": "Horário do Meridiano de Greenwich", "BT": "Horário do Butão", "CST": "Horário Padrão Central", "HKT": "Horário Padrão de Hong Kong", "CHAST": "Horário Padrão de Chatham", "COST": "Horário de Verão da Colômbia", "HAT": "Horário de Verão de Terra Nova", "GYT": "Horário da Guiana", "MST": "Horário Padrão da Montanha", "JDT": "Horário de Verão do Japão", "WAT": "Horário Padrão da África Ocidental", "OEZ": "Horário Padrão da Europa Oriental", "ADT": "Horário de Verão do Atlântico", "∅∅∅": "Horário de Verão do Amazonas", "MYT": "Horário da Malásia", "UYST": "Horário de Verão do Uruguai", "WESZ": "Horário de Verão da Europa Ocidental", "ACDT": "Horário de Verão da Austrália Central", "WITA": "Horário da Indonésia Central", "AWST": "Horário Padrão da Austrália Ocidental", "SGT": "Horário Padrão de Cingapura", "CAT": "Horário da África Central", "NZDT": "Horário de Verão da Nova Zelândia", "HAST": "Horário Padrão do Havaí e Ilhas Aleutas", "EDT": "Horário de Verão Oriental", "WIB": "Horário da Indonésia Ocidental", "OESZ": "Horário de Verão da Europa Oriental", "CLST": "Horário de Verão do Chile", "UYT": "Horário Padrão do Uruguai", "LHST": "Horário Padrão de Lord Howe", "MDT": "Horário de Verão da Montanha", "AKDT": "Horário de Verão do Alasca", "HADT": "Horário de Verão do Havaí e Ilhas Aleutas", "PST": "Horário Padrão do Pacífico", "TMST": "Horário de Verão do Turcomenistão", "AEST": "Horário Padrão da Austrália Oriental", "CHADT": "Horário de Verão de Chatham", "ART": "Horário Padrão da Argentina", "AST": "Horário Padrão do Atlântico", "IST": "Horário Padrão da Índia", "WEZ": "Horário Padrão da Europa Ocidental", "ACWDT": "Horário de Verão da Austrália Centro-Ocidental", "TMT": "Horário Padrão do Turcomenistão", "CDT": "Horário de Verão Central", "WART": "Horário Padrão da Argentina Ocidental", "COT": "Horário Padrão da Colômbia", "HNT": "Horário Padrão de Terra Nova", "ChST": "Horário de Chamorro", "WIT": "Horário da Indonésia Oriental", "CLT": "Horário Padrão do Chile", "LHDT": "Horário de Verão de Lord Howe", "GFT": "Horário da Guiana Francesa", "ECT": "Horário do Equador", "ARST": "Horário de Verão da Argentina", "AWDT": "Horário de Verão da Austrália Ocidental", "MEZ": "Horário Padrão da Europa Central", "AEDT": "Horário de Verão da Austrália Oriental", "AKST": "Horário Padrão do Alasca", "NZST": "Horário Padrão da Nova Zelândia", "SAST": "Horário da África do Sul", "WARST": "Horário de Verão da Argentina Ocidental", "VET": "Horário da Venezuela", "HKST": "Horário de Verão de Hong Kong", "EST": "Horário Padrão Oriental", "PDT": "Horário de Verão do Pacífico", "WAST": "Horário de Verão da África Ocidental", "EAT": "Horário da África Oriental", "JST": "Horário Padrão do Japão", "BOT": "Horário da Bolívia", "ACST": "Horário Padrão da Austrália Central", "SRT": "Horário do Suriname", "ACWST": "Horário Padrão da Austrália Centro-Ocidental", "MESZ": "Horário de Verão da Europa Central"},
}
}
diff --git a/pt_TL/pt_TL_test.go b/pt_TL/pt_TL_test.go
new file mode 100644
index 00000000..b8e1cde8
--- /dev/null
+++ b/pt_TL/pt_TL_test.go
@@ -0,0 +1,1120 @@
+package pt_TL
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "pt_TL"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/qu/qu.go b/qu/qu.go
index 4f7db221..addc17e4 100644
--- a/qu/qu.go
+++ b/qu/qu.go
@@ -70,7 +70,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"", ""},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"HAT": "HAT", "UYST": "UYST", "CAT": "CAT", "COT": "COT", "ADT": "ADT", "HKT": "HKT", "OESZ": "OESZ", "CHADT": "CHADT", "SGT": "SGT", "IST": "IST", "JST": "JST", "ChST": "ChST", "COST": "COST", "WAT": "WAT", "HKST": "HKST", "AEDT": "AEDT", "CLT": "CLT", "EAT": "EAT", "ACDT": "ACDT", "ECT": "ECT", "CDT": "CDT", "CHAST": "CHAST", "WAST": "WAST", "AWST": "AWST", "∅∅∅": "∅∅∅", "ACWST": "ACWST", "MDT": "MDT", "WIT": "WIT", "ART": "ART", "AKST": "AKST", "HADT": "HADT", "BT": "BT", "HNT": "HNT", "NZDT": "NZDT", "OEZ": "OEZ", "WIB": "WIB", "TMT": "TMT", "PDT": "PDT", "SRT": "SRT", "MESZ": "MESZ", "VET": "VET", "LHDT": "LHDT", "MYT": "MYT", "MEZ": "MEZ", "WESZ": "WESZ", "HAST": "HAST", "WART": "WART", "ACST": "ACST", "JDT": "JDT", "NZST": "NZST", "WEZ": "WEZ", "MST": "MST", "CLST": "CLST", "WITA": "WITA", "PST": "PST", "LHST": "LHST", "GMT": "GMT", "GFT": "GFT", "TMST": "TMST", "ARST": "ARST", "AWDT": "AWDT", "GYT": "GYT", "CST": "CST", "ACWDT": "ACWDT", "SAST": "SAST", "WARST": "WARST", "AKDT": "AKDT", "BOT": "BOT", "EDT": "EDT", "AST": "AST", "UYT": "UYT", "AEST": "AEST", "EST": "EST"},
+ timezones: map[string]string{"HAST": "HAST", "AEDT": "AEDT", "CLT": "CLT", "MDT": "MDT", "JDT": "JDT", "ECT": "ECT", "EDT": "EDT", "COST": "COST", "GMT": "GMT", "AEST": "AEST", "SRT": "SRT", "VET": "VET", "JST": "JST", "∅∅∅": "∅∅∅", "ChST": "ChST", "WAST": "WAST", "HNT": "HNT", "GYT": "GYT", "SAST": "SAST", "PDT": "PDT", "BOT": "BOT", "PST": "PST", "WESZ": "WESZ", "HAT": "HAT", "WARST": "WARST", "MST": "MST", "ART": "ART", "MEZ": "MEZ", "MESZ": "MESZ", "HADT": "HADT", "EST": "EST", "MYT": "MYT", "UYT": "UYT", "ACWST": "ACWST", "ACWDT": "ACWDT", "BT": "BT", "NZST": "NZST", "WIB": "WIB", "AKDT": "AKDT", "AST": "AST", "WIT": "WIT", "LHDT": "LHDT", "CDT": "CDT", "ACST": "ACST", "GFT": "GFT", "CHADT": "CHADT", "ACDT": "ACDT", "COT": "COT", "AKST": "AKST", "SGT": "SGT", "WART": "WART", "WAT": "WAT", "AWDT": "AWDT", "OEZ": "OEZ", "CLST": "CLST", "UYST": "UYST", "HKST": "HKST", "ARST": "ARST", "WEZ": "WEZ", "OESZ": "OESZ", "CST": "CST", "HKT": "HKT", "NZDT": "NZDT", "TMT": "TMT", "TMST": "TMST", "LHST": "LHST", "AWST": "AWST", "IST": "IST", "ADT": "ADT", "CAT": "CAT", "EAT": "EAT", "CHAST": "CHAST", "WITA": "WITA"},
}
}
@@ -126,7 +126,7 @@ func (qu *qu) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (qu *qu) MonthsNarrow() []string {
- return qu.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/qu/qu_test.go b/qu/qu_test.go
new file mode 100644
index 00000000..5a7f5f12
--- /dev/null
+++ b/qu/qu_test.go
@@ -0,0 +1,1120 @@
+package qu
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "qu"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/qu_BO/qu_BO.go b/qu_BO/qu_BO.go
index c7a26203..6302903f 100644
--- a/qu_BO/qu_BO.go
+++ b/qu_BO/qu_BO.go
@@ -70,7 +70,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"", ""},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"ACDT": "ACDT", "BOT": "BOT", "ACWDT": "ACWDT", "WIB": "WIB", "GFT": "GFT", "JST": "JST", "SRT": "SRT", "AWDT": "AWDT", "AEST": "AEST", "MDT": "MDT", "NZDT": "NZDT", "EDT": "EDT", "HNT": "HNT", "AKST": "AKST", "CDT": "CDT", "MEZ": "MEZ", "MESZ": "MESZ", "CLST": "CLST", "CHAST": "CHAST", "COST": "COST", "UYST": "UYST", "HAST": "HAST", "WAT": "WAT", "OEZ": "OEZ", "ACST": "ACST", "PDT": "PDT", "EST": "EST", "IST": "IST", "WESZ": "WESZ", "WAST": "WAST", "HKT": "HKT", "OESZ": "OESZ", "EAT": "EAT", "ART": "ART", "ARST": "ARST", "TMT": "TMT", "MYT": "MYT", "UYT": "UYT", "AEDT": "AEDT", "ChST": "ChST", "ADT": "ADT", "SAST": "SAST", "AWST": "AWST", "BT": "BT", "GMT": "GMT", "AKDT": "AKDT", "GYT": "GYT", "CST": "CST", "VET": "VET", "SGT": "SGT", "HAT": "HAT", "TMST": "TMST", "NZST": "NZST", "HKST": "HKST", "WART": "WART", "WARST": "WARST", "WIT": "WIT", "MST": "MST", "HADT": "HADT", "WITA": "WITA", "JDT": "JDT", "PST": "PST", "CAT": "CAT", "COT": "COT", "ECT": "ECT", "LHDT": "LHDT", "AST": "AST", "∅∅∅": "∅∅∅", "LHST": "LHST", "WEZ": "WEZ", "ACWST": "ACWST", "CHADT": "CHADT", "CLT": "CLT"},
+ timezones: map[string]string{"CST": "CST", "WART": "WART", "WARST": "WARST", "AWDT": "AWDT", "ADT": "ADT", "PST": "PST", "MDT": "MDT", "SRT": "SRT", "WITA": "WITA", "EDT": "EDT", "AEST": "AEST", "CHADT": "CHADT", "JDT": "JDT", "TMST": "TMST", "MST": "MST", "ACST": "ACST", "ECT": "ECT", "CAT": "CAT", "AEDT": "AEDT", "UYST": "UYST", "WESZ": "WESZ", "MYT": "MYT", "CLT": "CLT", "ChST": "ChST", "LHST": "LHST", "CHAST": "CHAST", "MESZ": "MESZ", "HAST": "HAST", "HNT": "HNT", "HADT": "HADT", "SGT": "SGT", "COT": "COT", "WIB": "WIB", "TMT": "TMT", "WEZ": "WEZ", "UYT": "UYT", "HKST": "HKST", "ARST": "ARST", "AKDT": "AKDT", "SAST": "SAST", "JST": "JST", "WAT": "WAT", "LHDT": "LHDT", "COST": "COST", "OESZ": "OESZ", "GFT": "GFT", "VET": "VET", "AWST": "AWST", "ACWST": "ACWST", "ACWDT": "ACWDT", "GMT": "GMT", "ACDT": "ACDT", "AST": "AST", "NZDT": "NZDT", "∅∅∅": "∅∅∅", "BT": "BT", "CDT": "CDT", "HKT": "HKT", "MEZ": "MEZ", "WAST": "WAST", "CLST": "CLST", "EST": "EST", "HAT": "HAT", "OEZ": "OEZ", "ART": "ART", "AKST": "AKST", "IST": "IST", "GYT": "GYT", "PDT": "PDT", "NZST": "NZST", "BOT": "BOT", "WIT": "WIT", "EAT": "EAT"},
}
}
@@ -126,7 +126,7 @@ func (qu *qu_BO) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (qu *qu_BO) MonthsNarrow() []string {
- return qu.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/qu_BO/qu_BO_test.go b/qu_BO/qu_BO_test.go
new file mode 100644
index 00000000..f2fc59f5
--- /dev/null
+++ b/qu_BO/qu_BO_test.go
@@ -0,0 +1,1120 @@
+package qu_BO
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "qu_BO"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/qu_EC/qu_EC.go b/qu_EC/qu_EC.go
index 69043939..40c2eab4 100644
--- a/qu_EC/qu_EC.go
+++ b/qu_EC/qu_EC.go
@@ -70,7 +70,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"", ""},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"NZDT": "NZDT", "CAT": "CAT", "ADT": "ADT", "WAST": "WAST", "JST": "JST", "IST": "IST", "OESZ": "OESZ", "WART": "WART", "CLT": "CLT", "CLST": "CLST", "MDT": "MDT", "MYT": "MYT", "ACWST": "ACWST", "WITA": "WITA", "TMT": "TMT", "LHDT": "LHDT", "AKST": "AKST", "PDT": "PDT", "GYT": "GYT", "JDT": "JDT", "ChST": "ChST", "CHADT": "CHADT", "OEZ": "OEZ", "SRT": "SRT", "CHAST": "CHAST", "EST": "EST", "COST": "COST", "AST": "AST", "WEZ": "WEZ", "CDT": "CDT", "UYT": "UYT", "WESZ": "WESZ", "AEST": "AEST", "COT": "COT", "HNT": "HNT", "HAT": "HAT", "∅∅∅": "∅∅∅", "TMST": "TMST", "PST": "PST", "LHST": "LHST", "MST": "MST", "WIB": "WIB", "AKDT": "AKDT", "VET": "VET", "ECT": "ECT", "HKT": "HKT", "ARST": "ARST", "AWST": "AWST", "GMT": "GMT", "MESZ": "MESZ", "MEZ": "MEZ", "ACWDT": "ACWDT", "HADT": "HADT", "HKST": "HKST", "ART": "ART", "CST": "CST", "NZST": "NZST", "AWDT": "AWDT", "SGT": "SGT", "WAT": "WAT", "EAT": "EAT", "AEDT": "AEDT", "SAST": "SAST", "BT": "BT", "WIT": "WIT", "ACST": "ACST", "EDT": "EDT", "UYST": "UYST", "HAST": "HAST", "ACDT": "ACDT", "BOT": "BOT", "GFT": "GFT", "WARST": "WARST"},
+ timezones: map[string]string{"CLT": "CLT", "CLST": "CLST", "EAT": "EAT", "AKST": "AKST", "AKDT": "AKDT", "CDT": "CDT", "ECT": "ECT", "WITA": "WITA", "EDT": "EDT", "OESZ": "OESZ", "AEDT": "AEDT", "CHAST": "CHAST", "VET": "VET", "ARST": "ARST", "COT": "COT", "LHST": "LHST", "MST": "MST", "HKST": "HKST", "JDT": "JDT", "ACWST": "ACWST", "BOT": "BOT", "MEZ": "MEZ", "HADT": "HADT", "SGT": "SGT", "WARST": "WARST", "AWDT": "AWDT", "WESZ": "WESZ", "UYST": "UYST", "CHADT": "CHADT", "WAT": "WAT", "AEST": "AEST", "∅∅∅": "∅∅∅", "NZDT": "NZDT", "WEZ": "WEZ", "UYT": "UYT", "ACST": "ACST", "ADT": "ADT", "IST": "IST", "GMT": "GMT", "ACDT": "ACDT", "ART": "ART", "SAST": "SAST", "WAST": "WAST", "HNT": "HNT", "OEZ": "OEZ", "LHDT": "LHDT", "GFT": "GFT", "ACWDT": "ACWDT", "HAST": "HAST", "TMT": "TMT", "WIT": "WIT", "MDT": "MDT", "MYT": "MYT", "JST": "JST", "WIB": "WIB", "GYT": "GYT", "CST": "CST", "EST": "EST", "PDT": "PDT", "CAT": "CAT", "COST": "COST", "ChST": "ChST", "BT": "BT", "WART": "WART", "HKT": "HKT", "MESZ": "MESZ", "HAT": "HAT", "AST": "AST", "AWST": "AWST", "NZST": "NZST", "PST": "PST", "SRT": "SRT", "TMST": "TMST"},
}
}
@@ -126,7 +126,7 @@ func (qu *qu_EC) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (qu *qu_EC) MonthsNarrow() []string {
- return qu.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/qu_EC/qu_EC_test.go b/qu_EC/qu_EC_test.go
new file mode 100644
index 00000000..3017fbf8
--- /dev/null
+++ b/qu_EC/qu_EC_test.go
@@ -0,0 +1,1120 @@
+package qu_EC
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "qu_EC"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/qu_PE/qu_PE.go b/qu_PE/qu_PE.go
index 71ee1872..c1b446bc 100644
--- a/qu_PE/qu_PE.go
+++ b/qu_PE/qu_PE.go
@@ -70,7 +70,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"", ""},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"ChST": "ChST", "WIB": "WIB", "NZST": "NZST", "MESZ": "MESZ", "VET": "VET", "HAST": "HAST", "WAST": "WAST", "HKST": "HKST", "WIT": "WIT", "UYT": "UYT", "GYT": "GYT", "ACWDT": "ACWDT", "WARST": "WARST", "TMT": "TMT", "ART": "ART", "EAT": "EAT", "CLT": "CLT", "GFT": "GFT", "GMT": "GMT", "WAT": "WAT", "ARST": "ARST", "SRT": "SRT", "AKDT": "AKDT", "EDT": "EDT", "HADT": "HADT", "SAST": "SAST", "OEZ": "OEZ", "MDT": "MDT", "LHDT": "LHDT", "CDT": "CDT", "AEST": "AEST", "ADT": "ADT", "ACST": "ACST", "JDT": "JDT", "EST": "EST", "CST": "CST", "BOT": "BOT", "NZDT": "NZDT", "CAT": "CAT", "JST": "JST", "UYST": "UYST", "TMST": "TMST", "MST": "MST", "LHST": "LHST", "MEZ": "MEZ", "CHAST": "CHAST", "CLST": "CLST", "WEZ": "WEZ", "OESZ": "OESZ", "∅∅∅": "∅∅∅", "HKT": "HKT", "AEDT": "AEDT", "COT": "COT", "PST": "PST", "PDT": "PDT", "ECT": "ECT", "AST": "AST", "IST": "IST", "AKST": "AKST", "MYT": "MYT", "AWDT": "AWDT", "WESZ": "WESZ", "COST": "COST", "BT": "BT", "WITA": "WITA", "ACDT": "ACDT", "SGT": "SGT", "WART": "WART", "HNT": "HNT", "HAT": "HAT", "ACWST": "ACWST", "AWST": "AWST", "CHADT": "CHADT"},
+ timezones: map[string]string{"ChST": "ChST", "∅∅∅": "∅∅∅", "HKST": "HKST", "CHADT": "CHADT", "ADT": "ADT", "EST": "EST", "COT": "COT", "TMST": "TMST", "WART": "WART", "MST": "MST", "WITA": "WITA", "MEZ": "MEZ", "SAST": "SAST", "BT": "BT", "CLT": "CLT", "AST": "AST", "AWDT": "AWDT", "ARST": "ARST", "BOT": "BOT", "WAT": "WAT", "ACST": "ACST", "GFT": "GFT", "ECT": "ECT", "EDT": "EDT", "GMT": "GMT", "AEST": "AEST", "CLST": "CLST", "MDT": "MDT", "WIB": "WIB", "CAT": "CAT", "NZDT": "NZDT", "HNT": "HNT", "TMT": "TMT", "GYT": "GYT", "WARST": "WARST", "CST": "CST", "ART": "ART", "AKST": "AKST", "IST": "IST", "MYT": "MYT", "UYST": "UYST", "AWST": "AWST", "NZST": "NZST", "WESZ": "WESZ", "COST": "COST", "ACWDT": "ACWDT", "SRT": "SRT", "ACWST": "ACWST", "PST": "PST", "PDT": "PDT", "AEDT": "AEDT", "OEZ": "OEZ", "LHDT": "LHDT", "MESZ": "MESZ", "LHST": "LHST", "UYT": "UYT", "ACDT": "ACDT", "HKT": "HKT", "HAST": "HAST", "HADT": "HADT", "WAST": "WAST", "WEZ": "WEZ", "HAT": "HAT", "EAT": "EAT", "CHAST": "CHAST", "CDT": "CDT", "AKDT": "AKDT", "SGT": "SGT", "OESZ": "OESZ", "WIT": "WIT", "VET": "VET", "JST": "JST", "JDT": "JDT"},
}
}
@@ -126,7 +126,7 @@ func (qu *qu_PE) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (qu *qu_PE) MonthsNarrow() []string {
- return qu.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/qu_PE/qu_PE_test.go b/qu_PE/qu_PE_test.go
new file mode 100644
index 00000000..fa203dae
--- /dev/null
+++ b/qu_PE/qu_PE_test.go
@@ -0,0 +1,1120 @@
+package qu_PE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "qu_PE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/rm/rm.go b/rm/rm.go
index d8eabbd6..76347ad1 100644
--- a/rm/rm.go
+++ b/rm/rm.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. Cr.", "s. Cr."},
erasNarrow: []string{"", ""},
erasWide: []string{"avant Cristus", "suenter Cristus"},
- timezones: map[string]string{"SGT": "SGT", "WIT": "WIT", "MEZ": "MEZ", "VET": "VET", "PST": "PST", "MESZ": "MESZ", "ADT": "ADT", "NZDT": "NZDT", "WESZ": "WESZ", "CHAST": "CHAST", "HKT": "HKT", "SAST": "SAST", "GMT": "GMT", "MDT": "MDT", "EDT": "EDT", "AST": "AST", "HAT": "HAT", "CHADT": "CHADT", "CLST": "CLST", "∅∅∅": "∅∅∅", "TMT": "TMT", "TMST": "TMST", "SRT": "SRT", "UYT": "UYT", "GFT": "GFT", "WIB": "WIB", "ARST": "ARST", "MST": "MST", "EAT": "EAT", "BOT": "BOT", "ChST": "ChST", "COST": "COST", "MYT": "MYT", "JDT": "JDT", "AKDT": "AKDT", "CLT": "CLT", "WART": "WART", "WARST": "WARST", "WAT": "WAT", "IST": "IST", "WEZ": "WEZ", "ACWDT": "ACWDT", "WAST": "WAST", "WITA": "WITA", "CST": "CST", "AKST": "AKST", "AEDT": "AEDT", "HAST": "HAST", "BT": "BT", "OEZ": "OEZ", "OESZ": "OESZ", "LHST": "LHST", "GYT": "GYT", "JST": "JST", "CAT": "CAT", "HADT": "HADT", "HNT": "HNT", "ACST": "ACST", "AWST": "AWST", "ACDT": "ACDT", "LHDT": "LHDT", "PDT": "PDT", "CDT": "CDT", "ACWST": "ACWST", "ART": "ART", "AWDT": "AWDT", "NZST": "NZST", "ECT": "ECT", "EST": "EST", "HKST": "HKST", "UYST": "UYST", "AEST": "AEST", "COT": "COT"},
+ timezones: map[string]string{"WART": "WART", "HAT": "HAT", "AEST": "AEST", "JDT": "JDT", "WESZ": "WESZ", "ChST": "ChST", "GYT": "GYT", "HKT": "HKT", "MESZ": "MESZ", "NZDT": "NZDT", "SAST": "SAST", "SGT": "SGT", "ECT": "ECT", "MST": "MST", "BT": "BT", "CST": "CST", "GFT": "GFT", "HKST": "HKST", "EST": "EST", "AEDT": "AEDT", "MYT": "MYT", "HAST": "HAST", "ACDT": "ACDT", "CHAST": "CHAST", "CHADT": "CHADT", "ADT": "ADT", "ACWDT": "ACWDT", "ARST": "ARST", "AKST": "AKST", "HNT": "HNT", "TMT": "TMT", "PDT": "PDT", "HADT": "HADT", "TMST": "TMST", "SRT": "SRT", "NZST": "NZST", "OEZ": "OEZ", "EAT": "EAT", "LHST": "LHST", "MDT": "MDT", "WITA": "WITA", "JST": "JST", "EDT": "EDT", "WAST": "WAST", "COST": "COST", "CAT": "CAT", "LHDT": "LHDT", "CLST": "CLST", "UYST": "UYST", "WIT": "WIT", "WARST": "WARST", "ACWST": "ACWST", "AKDT": "AKDT", "UYT": "UYT", "AWST": "AWST", "AWDT": "AWDT", "PST": "PST", "WEZ": "WEZ", "∅∅∅": "∅∅∅", "AST": "AST", "WIB": "WIB", "IST": "IST", "BOT": "BOT", "WAT": "WAT", "COT": "COT", "OESZ": "OESZ", "ACST": "ACST", "CDT": "CDT", "CLT": "CLT", "VET": "VET", "ART": "ART", "MEZ": "MEZ", "GMT": "GMT"},
}
}
diff --git a/rm/rm_test.go b/rm/rm_test.go
new file mode 100644
index 00000000..1321e760
--- /dev/null
+++ b/rm/rm_test.go
@@ -0,0 +1,1120 @@
+package rm
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "rm"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/rm_CH/rm_CH.go b/rm_CH/rm_CH.go
index b47abf54..d38088ba 100644
--- a/rm_CH/rm_CH.go
+++ b/rm_CH/rm_CH.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"av. Cr.", "s. Cr."},
erasNarrow: []string{"", ""},
erasWide: []string{"avant Cristus", "suenter Cristus"},
- timezones: map[string]string{"AKST": "AKST", "MYT": "MYT", "ARST": "ARST", "ChST": "ChST", "COT": "COT", "HNT": "HNT", "ACWDT": "ACWDT", "COST": "COST", "ECT": "ECT", "CAT": "CAT", "WAST": "WAST", "CDT": "CDT", "AEST": "AEST", "WARST": "WARST", "UYST": "UYST", "MDT": "MDT", "HKT": "HKT", "OEZ": "OEZ", "GMT": "GMT", "ACDT": "ACDT", "PST": "PST", "SRT": "SRT", "MESZ": "MESZ", "BOT": "BOT", "HADT": "HADT", "NZST": "NZST", "VET": "VET", "∅∅∅": "∅∅∅", "AST": "AST", "ADT": "ADT", "BT": "BT", "HKST": "HKST", "IST": "IST", "EAT": "EAT", "CHADT": "CHADT", "WEZ": "WEZ", "OESZ": "OESZ", "GYT": "GYT", "CST": "CST", "WAT": "WAT", "HAT": "HAT", "GFT": "GFT", "TMST": "TMST", "LHST": "LHST", "ACWST": "ACWST", "MST": "MST", "EDT": "EDT", "WART": "WART", "LHDT": "LHDT", "JST": "JST", "AEDT": "AEDT", "CLT": "CLT", "HAST": "HAST", "WIT": "WIT", "ACST": "ACST", "NZDT": "NZDT", "WESZ": "WESZ", "EST": "EST", "SGT": "SGT", "WIB": "WIB", "TMT": "TMT", "JDT": "JDT", "UYT": "UYT", "CLST": "CLST", "SAST": "SAST", "WITA": "WITA", "AWST": "AWST", "AWDT": "AWDT", "CHAST": "CHAST", "ART": "ART", "PDT": "PDT", "AKDT": "AKDT", "MEZ": "MEZ"},
+ timezones: map[string]string{"NZST": "NZST", "EAT": "EAT", "JST": "JST", "MEZ": "MEZ", "UYT": "UYT", "AEST": "AEST", "OEZ": "OEZ", "GMT": "GMT", "AWDT": "AWDT", "HAST": "HAST", "WARST": "WARST", "ECT": "ECT", "VET": "VET", "COST": "COST", "WIB": "WIB", "MYT": "MYT", "CST": "CST", "AKDT": "AKDT", "EST": "EST", "JDT": "JDT", "NZDT": "NZDT", "HAT": "HAT", "LHDT": "LHDT", "UYST": "UYST", "MST": "MST", "MDT": "MDT", "WESZ": "WESZ", "BT": "BT", "CDT": "CDT", "AST": "AST", "PDT": "PDT", "BOT": "BOT", "AWST": "AWST", "AKST": "AKST", "TMST": "TMST", "WIT": "WIT", "ACST": "ACST", "ART": "ART", "ARST": "ARST", "EDT": "EDT", "CAT": "CAT", "WAT": "WAT", "ACDT": "ACDT", "CHADT": "CHADT", "HKT": "HKT", "HKST": "HKST", "ADT": "ADT", "HNT": "HNT", "COT": "COT", "ACWDT": "ACWDT", "∅∅∅": "∅∅∅", "AEDT": "AEDT", "GYT": "GYT", "WART": "WART", "GFT": "GFT", "PST": "PST", "WAST": "WAST", "TMT": "TMT", "CLST": "CLST", "SRT": "SRT", "WITA": "WITA", "WEZ": "WEZ", "IST": "IST", "ChST": "ChST", "OESZ": "OESZ", "CLT": "CLT", "ACWST": "ACWST", "MESZ": "MESZ", "SAST": "SAST", "SGT": "SGT", "LHST": "LHST", "CHAST": "CHAST", "HADT": "HADT"},
}
}
diff --git a/rm_CH/rm_CH_test.go b/rm_CH/rm_CH_test.go
new file mode 100644
index 00000000..4f19d7ae
--- /dev/null
+++ b/rm_CH/rm_CH_test.go
@@ -0,0 +1,1120 @@
+package rm_CH
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "rm_CH"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/rn/rn.go b/rn/rn.go
index 9bb091c4..c3dddfdb 100644
--- a/rn/rn.go
+++ b/rn/rn.go
@@ -61,7 +61,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"Mb.Y.", "Ny.Y"},
erasNarrow: []string{"", ""},
erasWide: []string{"Mbere ya Yezu", "Nyuma ya Yezu"},
- timezones: map[string]string{"VET": "VET", "OEZ": "OEZ", "HAT": "HAT", "GFT": "GFT", "CDT": "CDT", "OESZ": "OESZ", "ART": "ART", "PST": "PST", "MYT": "MYT", "WEZ": "WEZ", "ECT": "ECT", "TMST": "TMST", "UYT": "UYT", "AEST": "AEST", "MDT": "MDT", "HKT": "HKT", "WARST": "WARST", "ACST": "ACST", "JST": "JST", "EST": "EST", "WAST": "WAST", "JDT": "JDT", "MEZ": "MEZ", "EDT": "EDT", "∅∅∅": "∅∅∅", "ADT": "ADT", "HAST": "HAST", "ARST": "ARST", "MESZ": "MESZ", "BT": "BT", "HKST": "HKST", "HNT": "HNT", "BOT": "BOT", "CHADT": "CHADT", "COT": "COT", "WAT": "WAT", "TMT": "TMT", "AEDT": "AEDT", "CLT": "CLT", "CLST": "CLST", "PDT": "PDT", "LHDT": "LHDT", "SAST": "SAST", "GMT": "GMT", "WITA": "WITA", "AKDT": "AKDT", "GYT": "GYT", "CHAST": "CHAST", "CAT": "CAT", "AST": "AST", "LHST": "LHST", "WESZ": "WESZ", "WIB": "WIB", "AWST": "AWST", "ACWDT": "ACWDT", "ChST": "ChST", "MST": "MST", "WART": "WART", "NZDT": "NZDT", "UYST": "UYST", "NZST": "NZST", "ACWST": "ACWST", "COST": "COST", "IST": "IST", "SRT": "SRT", "AKST": "AKST", "AWDT": "AWDT", "CST": "CST", "EAT": "EAT", "ACDT": "ACDT", "HADT": "HADT", "SGT": "SGT", "WIT": "WIT"},
+ timezones: map[string]string{"PDT": "PDT", "UYT": "UYT", "AKST": "AKST", "MEZ": "MEZ", "VET": "VET", "ECT": "ECT", "EST": "EST", "NZST": "NZST", "HNT": "HNT", "CDT": "CDT", "WITA": "WITA", "COT": "COT", "AEDT": "AEDT", "CLST": "CLST", "ADT": "ADT", "CHAST": "CHAST", "WAT": "WAT", "ACDT": "ACDT", "ACWDT": "ACWDT", "SAST": "SAST", "TMT": "TMT", "UYST": "UYST", "EAT": "EAT", "ACST": "ACST", "ACWST": "ACWST", "CHADT": "CHADT", "WARST": "WARST", "GFT": "GFT", "WESZ": "WESZ", "ChST": "ChST", "OESZ": "OESZ", "LHST": "LHST", "WART": "WART", "NZDT": "NZDT", "WEZ": "WEZ", "CLT": "CLT", "JDT": "JDT", "AKDT": "AKDT", "COST": "COST", "AWST": "AWST", "GYT": "GYT", "WIT": "WIT", "∅∅∅": "∅∅∅", "ART": "ART", "MESZ": "MESZ", "HAST": "HAST", "WAST": "WAST", "HAT": "HAT", "WIB": "WIB", "GMT": "GMT", "HKST": "HKST", "EDT": "EDT", "BOT": "BOT", "SGT": "SGT", "OEZ": "OEZ", "AST": "AST", "CST": "CST", "PST": "PST", "CAT": "CAT", "LHDT": "LHDT", "SRT": "SRT", "MDT": "MDT", "ARST": "ARST", "IST": "IST", "HADT": "HADT", "TMST": "TMST", "AEST": "AEST", "HKT": "HKT", "AWDT": "AWDT", "JST": "JST", "BT": "BT", "MYT": "MYT", "MST": "MST"},
}
}
@@ -117,7 +117,7 @@ func (rn *rn) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (rn *rn) MonthsNarrow() []string {
- return rn.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/rn/rn_test.go b/rn/rn_test.go
new file mode 100644
index 00000000..f722624b
--- /dev/null
+++ b/rn/rn_test.go
@@ -0,0 +1,1120 @@
+package rn
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "rn"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/rn_BI/rn_BI.go b/rn_BI/rn_BI.go
index b64fac85..16340b86 100644
--- a/rn_BI/rn_BI.go
+++ b/rn_BI/rn_BI.go
@@ -61,7 +61,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"Mb.Y.", "Ny.Y"},
erasNarrow: []string{"", ""},
erasWide: []string{"Mbere ya Yezu", "Nyuma ya Yezu"},
- timezones: map[string]string{"MDT": "MDT", "LHST": "LHST", "LHDT": "LHDT", "JDT": "JDT", "HKST": "HKST", "HAT": "HAT", "GFT": "GFT", "OESZ": "OESZ", "AWST": "AWST", "NZDT": "NZDT", "CST": "CST", "WEZ": "WEZ", "SAST": "SAST", "HNT": "HNT", "MST": "MST", "HAST": "HAST", "WIB": "WIB", "JST": "JST", "UYST": "UYST", "UYT": "UYT", "AKST": "AKST", "AKDT": "AKDT", "WIT": "WIT", "ChST": "ChST", "∅∅∅": "∅∅∅", "BT": "BT", "ART": "ART", "WESZ": "WESZ", "COST": "COST", "WARST": "WARST", "ACDT": "ACDT", "GYT": "GYT", "BOT": "BOT", "CLST": "CLST", "HADT": "HADT", "AWDT": "AWDT", "WITA": "WITA", "ARST": "ARST", "MYT": "MYT", "CLT": "CLT", "SGT": "SGT", "WAST": "WAST", "TMST": "TMST", "AEST": "AEST", "WAT": "WAT", "TMT": "TMT", "ACWDT": "ACWDT", "ECT": "ECT", "WART": "WART", "ACST": "ACST", "CHAST": "CHAST", "ACWST": "ACWST", "COT": "COT", "PDT": "PDT", "AEDT": "AEDT", "IST": "IST", "OEZ": "OEZ", "EAT": "EAT", "MEZ": "MEZ", "EST": "EST", "AST": "AST", "ADT": "ADT", "CDT": "CDT", "MESZ": "MESZ", "HKT": "HKT", "PST": "PST", "NZST": "NZST", "CHADT": "CHADT", "VET": "VET", "GMT": "GMT", "SRT": "SRT", "CAT": "CAT", "EDT": "EDT"},
+ timezones: map[string]string{"CLST": "CLST", "LHST": "LHST", "MDT": "MDT", "HKT": "HKT", "IST": "IST", "WEZ": "WEZ", "OEZ": "OEZ", "GMT": "GMT", "WARST": "WARST", "ECT": "ECT", "JDT": "JDT", "SAST": "SAST", "WIT": "WIT", "AST": "AST", "CDT": "CDT", "COT": "COT", "GYT": "GYT", "WART": "WART", "HAST": "HAST", "EDT": "EDT", "HNT": "HNT", "BT": "BT", "GFT": "GFT", "PST": "PST", "WIB": "WIB", "COST": "COST", "ACST": "ACST", "ACDT": "ACDT", "SRT": "SRT", "CHAST": "CHAST", "EAT": "EAT", "BOT": "BOT", "SGT": "SGT", "AKST": "AKST", "ACWDT": "ACWDT", "TMST": "TMST", "AEDT": "AEDT", "WAST": "WAST", "HAT": "HAT", "CHADT": "CHADT", "WITA": "WITA", "AEST": "AEST", "MESZ": "MESZ", "ChST": "ChST", "VET": "VET", "HKST": "HKST", "AWST": "AWST", "AWDT": "AWDT", "ADT": "ADT", "CAT": "CAT", "WAT": "WAT", "CLT": "CLT", "UYT": "UYT", "MST": "MST", "JST": "JST", "LHDT": "LHDT", "CST": "CST", "MEZ": "MEZ", "TMT": "TMT", "NZST": "NZST", "NZDT": "NZDT", "WESZ": "WESZ", "OESZ": "OESZ", "UYST": "UYST", "∅∅∅": "∅∅∅", "ACWST": "ACWST", "HADT": "HADT", "EST": "EST", "PDT": "PDT", "MYT": "MYT", "ART": "ART", "ARST": "ARST", "AKDT": "AKDT"},
}
}
@@ -117,7 +117,7 @@ func (rn *rn_BI) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (rn *rn_BI) MonthsNarrow() []string {
- return rn.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/rn_BI/rn_BI_test.go b/rn_BI/rn_BI_test.go
new file mode 100644
index 00000000..d7ca1bc3
--- /dev/null
+++ b/rn_BI/rn_BI_test.go
@@ -0,0 +1,1120 @@
+package rn_BI
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "rn_BI"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ro/ro.go b/ro/ro.go
index 138b0a13..17c6476b 100644
--- a/ro/ro.go
+++ b/ro/ro.go
@@ -49,7 +49,7 @@ func New() locales.Translator {
locale: "ro",
pluralsCardinal: []locales.PluralRule{2, 4, 6},
pluralsOrdinal: []locales.PluralRule{2, 6},
- pluralsRange: []locales.PluralRule{6, 4},
+ pluralsRange: []locales.PluralRule{4, 6},
decimal: ",",
group: ".",
minus: "-",
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"î.Hr.", "d.Hr."},
erasNarrow: []string{"", ""},
erasWide: []string{"înainte de Hristos", "după Hristos"},
- timezones: map[string]string{"WAST": "Ora de vară a Africii Occidentale", "∅∅∅": "Ora de vară a Amazonului", "AWDT": "Ora de vară a Australiei Occidentale", "MYT": "Ora din Malaysia", "MEZ": "Ora standard a Europei Centrale", "WESZ": "Ora de vară a Europei de Vest", "ECT": "Ora Ecuadorului", "ACDT": "Ora de vară a Australiei Centrale", "TMST": "Ora de vară din Turkmenistan", "CDT": "Ora de vară centrală nord-americană", "CLT": "Ora standard din Chile", "COT": "Ora standard a Columbiei", "MST": "MST", "PST": "Ora standard în zona Pacific nord-americană", "HADT": "Ora de vară din Hawaii-Aleutine", "WIT": "Ora Indoneziei de Est", "ART": "Ora standard a Argentinei", "UYST": "Ora de vară a Uruguayului", "EST": "Ora standard orientală nord-americană", "OESZ": "Ora de vară a Europei de Est", "JDT": "Ora de vară a Japoniei", "WARST": "Ora de vară a Argentinei Occidentale", "WAT": "Ora standard a Africii Occidentale", "OEZ": "Ora standard a Europei de Est", "MDT": "MDT", "ARST": "Ora de vară a Argentinei", "TMT": "Ora standard din Turkmenistan", "LHST": "Ora standard din Lord Howe", "NZST": "Ora standard a Noii Zeelande", "BOT": "Ora Boliviei", "ChST": "Ora din Chamorro", "EAT": "Ora Africii Orientale", "AKST": "Ora standard din Alaska", "VET": "Ora Venezuelei", "EDT": "Ora de vară orientală nord-americană", "WIB": "Ora Indoneziei de Vest", "WEZ": "Ora standard a Europei de Vest", "AEST": "Ora standard a Australiei Orientale", "CLST": "Ora de vară din Chile", "GFT": "Ora Guianei Franceze", "AKDT": "Ora de vară din Alaska", "LHDT": "Ora de vară din Lord Howe", "SRT": "Ora Surinamului", "ACWDT": "Ora de vară a Australiei Central Occidentale", "WART": "Ora standard a Argentinei Occidentale", "IST": "Ora Indiei", "AWST": "Ora standard a Australiei Occidentale", "CAT": "Ora Africii Centrale", "SGT": "Ora din Singapore", "HKT": "Ora standard din Hong Kong", "HKST": "Ora de vară din Hong Kong", "JST": "Ora standard a Japoniei", "ACWST": "Ora standard a Australiei Central Occidentale", "AEDT": "Ora de vară a Australiei Orientale", "HAT": "Ora de vară din Newfoundland", "MESZ": "Ora de vară a Europei Centrale", "CHAST": "Ora standard din Chatham", "COST": "Ora de vară a Columbiei", "ADT": "Ora de vară în zona Atlantic nord-americană", "BT": "Ora Bhutanului", "GMT": "Ora de Greenwhich", "WITA": "Ora Indoneziei Centrale", "ACST": "Ora standard a Australiei Centrale", "GYT": "Ora din Guyana", "CST": "Ora standard centrală nord-americană", "NZDT": "Ora de vară a Noii Zeelande", "AST": "Ora standard în zona Atlantic nord-americană", "HAST": "Ora standard din Hawaii-Aleutine", "UYT": "Ora standard a Uruguayului", "SAST": "Ora Africii Meridionale", "HNT": "Ora standard din Newfoundland", "PDT": "Ora de vară în zona Pacific nord-americană", "CHADT": "Ora de vară din Chatham"},
+ timezones: map[string]string{"CHADT": "Ora de vară din Chatham", "ACWST": "Ora standard a Australiei Central Occidentale", "WITA": "Ora Indoneziei Centrale", "ChST": "Ora din Chamorro", "MYT": "Ora din Malaysia", "CLT": "Ora standard din Chile", "SRT": "Ora Surinamului", "JDT": "Ora de vară a Japoniei", "ADT": "Ora de vară în zona Atlantic nord-americană", "HAST": "Ora standard din Hawaii-Aleutine", "NZST": "Ora standard a Noii Zeelande", "CLST": "Ora de vară din Chile", "WIT": "Ora Indoneziei de Est", "WARST": "Ora de vară a Argentinei Occidentale", "CHAST": "Ora standard din Chatham", "GFT": "Ora Guianei Franceze", "AWDT": "Ora de vară a Australiei Occidentale", "WART": "Ora standard a Argentinei Occidentale", "ACWDT": "Ora de vară a Australiei Central Occidentale", "ARST": "Ora de vară a Argentinei", "CAT": "Ora Africii Centrale", "SAST": "Ora Africii Meridionale", "WAST": "Ora de vară a Africii Occidentale", "GMT": "Ora de Greenwhich", "JST": "Ora standard a Japoniei", "ART": "Ora standard a Argentinei", "MESZ": "Ora de vară a Europei Centrale", "HADT": "Ora de vară din Hawaii-Aleutine", "TMST": "Ora de vară din Turkmenistan", "AEST": "Ora standard a Australiei Orientale", "GYT": "Ora din Guyana", "OEZ": "Ora standard a Europei de Est", "HKST": "Ora de vară din Hong Kong", "ACDT": "Ora de vară a Australiei Centrale", "ECT": "Ora Ecuadorului", "HKT": "Ora standard din Hong Kong", "COT": "Ora standard a Columbiei", "WIB": "Ora Indoneziei de Vest", "VET": "Ora Venezuelei", "AKDT": "Ora de vară din Alaska", "AST": "Ora standard în zona Atlantic nord-americană", "SGT": "Ora din Singapore", "EAT": "Ora Africii Orientale", "EST": "Ora standard orientală nord-americană", "TMT": "Ora standard din Turkmenistan", "LHST": "Ora standard din Lord Howe", "MDT": "Ora de vară în zona montană nord-americană", "UYST": "Ora de vară a Uruguayului", "AKST": "Ora standard din Alaska", "CDT": "Ora de vară centrală nord-americană", "LHDT": "Ora de vară din Lord Howe", "HNT": "Ora standard din Newfoundland", "WAT": "Ora standard a Africii Occidentale", "WEZ": "Ora standard a Europei de Vest", "OESZ": "Ora de vară a Europei de Est", "∅∅∅": "Ora de vară a Brasiliei", "AWST": "Ora standard a Australiei Occidentale", "EDT": "Ora de vară orientală nord-americană", "WESZ": "Ora de vară a Europei de Vest", "HAT": "Ora de vară din Newfoundland", "CST": "Ora standard centrală nord-americană", "NZDT": "Ora de vară a Noii Zeelande", "BOT": "Ora Boliviei", "IST": "Ora Indiei", "ACST": "Ora standard a Australiei Centrale", "PST": "Ora standard în zona Pacific nord-americană", "PDT": "Ora de vară în zona Pacific nord-americană", "MEZ": "Ora standard a Europei Centrale", "AEDT": "Ora de vară a Australiei Orientale", "MST": "Ora standard în zona montană nord-americană", "UYT": "Ora standard a Uruguayului", "BT": "Ora Bhutanului", "COST": "Ora de vară a Columbiei"},
}
}
diff --git a/ro/ro_test.go b/ro/ro_test.go
new file mode 100644
index 00000000..658f82a7
--- /dev/null
+++ b/ro/ro_test.go
@@ -0,0 +1,1120 @@
+package ro
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ro"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ro_MD/ro_MD.go b/ro_MD/ro_MD.go
index bef2293f..e4e282d4 100644
--- a/ro_MD/ro_MD.go
+++ b/ro_MD/ro_MD.go
@@ -49,7 +49,7 @@ func New() locales.Translator {
locale: "ro_MD",
pluralsCardinal: []locales.PluralRule{2, 4, 6},
pluralsOrdinal: []locales.PluralRule{2, 6},
- pluralsRange: []locales.PluralRule{6, 4},
+ pluralsRange: []locales.PluralRule{4, 6},
decimal: ",",
group: ".",
minus: "-",
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"", ""},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"NZDT": "Ora de vară a Noii Zeelande", "HKST": "Ora de vară din Hong Kong", "OEZ": "Ora standard a Europei de Est", "CLT": "Ora standard din Chile", "UYST": "Ora de vară a Uruguayului", "HAST": "Ora standard din Hawaii-Aleutine", "HADT": "Ora de vară din Hawaii-Aleutine", "WART": "Ora standard a Argentinei Occidentale", "HAT": "Ora de vară din Newfoundland", "PST": "Ora standard în zona Pacific nord-americană", "LHDT": "Ora de vară din Lord Howe", "OESZ": "Ora de vară a Europei de Est", "GYT": "Ora din Guyana", "MST": "Ora standard în zona montană nord-americană", "MDT": "Ora de vară în zona montană nord-americană", "COT": "Ora standard a Columbiei", "COST": "Ora de vară a Columbiei", "BT": "Ora Bhutanului", "WESZ": "Ora de vară a Europei de Vest", "CLST": "Ora de vară din Chile", "WAT": "Ora standard a Africii Occidentale", "TMT": "Ora standard din Turkmenistan", "LHST": "Ora standard din Lord Howe", "MYT": "Ora din Malaysia", "JDT": "Ora de vară a Japoniei", "MEZ": "Ora standard a Europei Centrale", "ACWST": "Ora standard a Australiei Central Occidentale", "AEDT": "Ora de vară a Australiei Orientale", "EDT": "Ora de vară orientală nord-americană", "AWDT": "Ora de vară a Australiei Occidentale", "BOT": "Ora Boliviei", "UYT": "Ora standard a Uruguayului", "ART": "Ora standard a Argentinei", "AKDT": "Ora de vară din Alaska", "AWST": "Ora standard a Australiei Occidentale", "SAST": "Ora Africii Meridionale", "GMT": "Ora de Greenwhich", "GFT": "Ora Guianei Franceze", "WITA": "Ora Indoneziei Centrale", "ACDT": "Ora de vară a Australiei Centrale", "SRT": "Ora Surinamului", "ECT": "Ora Ecuadorului", "WAST": "Ora de vară a Africii Occidentale", "NZST": "Ora standard a Noii Zeelande", "VET": "Ora Venezuelei", "CHADT": "Ora de vară din Chatham", "EST": "Ora standard orientală nord-americană", "HNT": "Ora standard din Newfoundland", "CHAST": "Ora standard din Chatham", "ADT": "Ora de vară în zona Atlantic nord-americană", "WARST": "Ora de vară a Argentinei Occidentale", "ARST": "Ora de vară a Argentinei", "MESZ": "Ora de vară a Europei Centrale", "ChST": "Ora din Chamorro", "CAT": "Ora Africii Centrale", "WIB": "Ora Indoneziei de Vest", "IST": "Ora Indiei", "WIT": "Ora Indoneziei de Est", "EAT": "Ora Africii Orientale", "AKST": "Ora standard din Alaska", "PDT": "Ora de vară în zona Pacific nord-americană", "WEZ": "Ora standard a Europei de Vest", "ACWDT": "Ora de vară a Australiei Central Occidentale", "SGT": "Ora din Singapore", "ACST": "Ora standard a Australiei Centrale", "TMST": "Ora de vară din Turkmenistan", "JST": "Ora standard a Japoniei", "∅∅∅": "Ora de vară din Azore", "CST": "Ora standard centrală nord-americană", "CDT": "Ora de vară centrală nord-americană", "AEST": "Ora standard a Australiei Orientale", "AST": "Ora standard în zona Atlantic nord-americană", "HKT": "Ora standard din Hong Kong"},
+ timezones: map[string]string{"ARST": "Ora de vară a Argentinei", "WEZ": "Ora standard a Europei de Vest", "AEST": "Ora standard a Australiei Orientale", "UYT": "Ora standard a Uruguayului", "JDT": "Ora de vară a Japoniei", "EST": "Ora standard orientală nord-americană", "AEDT": "Ora de vară a Australiei Orientale", "LHDT": "Ora de vară din Lord Howe", "CHAST": "Ora standard din Chatham", "CHADT": "Ora de vară din Chatham", "GYT": "Ora din Guyana", "WARST": "Ora de vară a Argentinei Occidentale", "MESZ": "Ora de vară a Europei Centrale", "WAST": "Ora de vară a Africii Occidentale", "WESZ": "Ora de vară a Europei de Vest", "HAST": "Ora standard din Hawaii-Aleutine", "HADT": "Ora de vară din Hawaii-Aleutine", "MDT": "Ora de vară în zona montană nord-americană", "MYT": "Ora din Malaysia", "∅∅∅": "Ora de vară a Brasiliei", "CST": "Ora standard centrală nord-americană", "ECT": "Ora Ecuadorului", "ACWST": "Ora standard a Australiei Central Occidentale", "CAT": "Ora Africii Centrale", "WAT": "Ora standard a Africii Occidentale", "UYST": "Ora de vară a Uruguayului", "ACST": "Ora standard a Australiei Centrale", "AKST": "Ora standard din Alaska", "PST": "Ora standard în zona Pacific nord-americană", "OEZ": "Ora standard a Europei de Est", "MST": "Ora standard în zona montană nord-americană", "CLT": "Ora standard din Chile", "WITA": "Ora Indoneziei Centrale", "SAST": "Ora Africii Meridionale", "COST": "Ora de vară a Columbiei", "GMT": "Ora de Greenwhich", "AWDT": "Ora de vară a Australiei Occidentale", "NZST": "Ora standard a Noii Zeelande", "WIB": "Ora Indoneziei de Vest", "TMT": "Ora standard din Turkmenistan", "AWST": "Ora standard a Australiei Occidentale", "PDT": "Ora de vară în zona Pacific nord-americană", "TMST": "Ora de vară din Turkmenistan", "ChST": "Ora din Chamorro", "WIT": "Ora Indoneziei de Est", "LHST": "Ora standard din Lord Howe", "SRT": "Ora Surinamului", "ADT": "Ora de vară în zona Atlantic nord-americană", "ART": "Ora standard a Argentinei", "MEZ": "Ora standard a Europei Centrale", "WART": "Ora standard a Argentinei Occidentale", "JST": "Ora standard a Japoniei", "NZDT": "Ora de vară a Noii Zeelande", "HAT": "Ora de vară din Newfoundland", "SGT": "Ora din Singapore", "BT": "Ora Bhutanului", "GFT": "Ora Guianei Franceze", "HKST": "Ora de vară din Hong Kong", "HNT": "Ora standard din Newfoundland", "ACWDT": "Ora de vară a Australiei Central Occidentale", "EDT": "Ora de vară orientală nord-americană", "IST": "Ora Indiei", "EAT": "Ora Africii Orientale", "CLST": "Ora de vară din Chile", "ACDT": "Ora de vară a Australiei Centrale", "HKT": "Ora standard din Hong Kong", "AKDT": "Ora de vară din Alaska", "BOT": "Ora Boliviei", "COT": "Ora standard a Columbiei", "OESZ": "Ora de vară a Europei de Est", "CDT": "Ora de vară centrală nord-americană", "VET": "Ora Venezuelei", "AST": "Ora standard în zona Atlantic nord-americană"},
}
}
diff --git a/ro_MD/ro_MD_test.go b/ro_MD/ro_MD_test.go
new file mode 100644
index 00000000..40b766f8
--- /dev/null
+++ b/ro_MD/ro_MD_test.go
@@ -0,0 +1,1120 @@
+package ro_MD
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ro_MD"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ro_RO/ro_RO.go b/ro_RO/ro_RO.go
index e3ea8918..51342520 100644
--- a/ro_RO/ro_RO.go
+++ b/ro_RO/ro_RO.go
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"î.Hr.", "d.Hr."},
erasNarrow: []string{"", ""},
erasWide: []string{"înainte de Hristos", "după Hristos"},
- timezones: map[string]string{"COST": "Ora de vară a Columbiei", "WITA": "Ora Indoneziei Centrale", "WIB": "Ora Indoneziei de Vest", "GFT": "Ora Guianei Franceze", "AWST": "Ora standard a Australiei Occidentale", "ACWDT": "Ora de vară a Australiei Central Occidentale", "BT": "Ora Bhutanului", "ACDT": "Ora de vară a Australiei Centrale", "JDT": "Ora de vară a Japoniei", "SRT": "Ora Surinamului", "ChST": "Ora din Chamorro", "MEZ": "Ora standard a Europei Centrale", "BOT": "Ora Boliviei", "VET": "Ora Venezuelei", "TMST": "Ora de vară din Turkmenistan", "NZDT": "Ora de vară a Noii Zeelande", "∅∅∅": "Ora de vară din Peru", "EDT": "Ora de vară orientală nord-americană", "CAT": "Ora Africii Centrale", "HKT": "Ora standard din Hong Kong", "WARST": "Ora de vară a Argentinei Occidentale", "GMT": "Ora de Greenwhich", "CHADT": "Ora de vară din Chatham", "AEDT": "Ora de vară a Australiei Orientale", "ACWST": "Ora standard a Australiei Central Occidentale", "AST": "Ora standard în zona Atlantic nord-americană", "SGT": "Ora din Singapore", "MST": "MST", "ACST": "Ora standard a Australiei Centrale", "PST": "Ora standard în zona Pacific nord-americană", "WAT": "Ora standard a Africii Occidentale", "WAST": "Ora de vară a Africii Occidentale", "HKST": "Ora de vară din Hong Kong", "AKST": "Ora standard din Alaska", "CST": "Ora standard centrală nord-americană", "CDT": "Ora de vară centrală nord-americană", "AEST": "Ora standard a Australiei Orientale", "HAST": "Ora standard din Hawaii-Aleutine", "WIT": "Ora Indoneziei de Est", "EAT": "Ora Africii Orientale", "MYT": "Ora din Malaysia", "CHAST": "Ora standard din Chatham", "LHDT": "Ora de vară din Lord Howe", "GYT": "Ora din Guyana", "CLST": "Ora de vară din Chile", "ADT": "Ora de vară în zona Atlantic nord-americană", "IST": "Ora Indiei", "MDT": "MDT", "ART": "Ora standard a Argentinei", "ARST": "Ora de vară a Argentinei", "EST": "Ora standard orientală nord-americană", "WART": "Ora standard a Argentinei Occidentale", "OEZ": "Ora standard a Europei de Est", "HNT": "Ora standard din Newfoundland", "LHST": "Ora standard din Lord Howe", "CLT": "Ora standard din Chile", "SAST": "Ora Africii Meridionale", "OESZ": "Ora de vară a Europei de Est", "AKDT": "Ora de vară din Alaska", "AWDT": "Ora de vară a Australiei Occidentale", "WEZ": "Ora standard a Europei de Vest", "HADT": "Ora de vară din Hawaii-Aleutine", "PDT": "Ora de vară în zona Pacific nord-americană", "UYST": "Ora de vară a Uruguayului", "COT": "Ora standard a Columbiei", "WESZ": "Ora de vară a Europei de Vest", "TMT": "Ora standard din Turkmenistan", "JST": "Ora standard a Japoniei", "MESZ": "Ora de vară a Europei Centrale", "NZST": "Ora standard a Noii Zeelande", "UYT": "Ora standard a Uruguayului", "HAT": "Ora de vară din Newfoundland", "ECT": "Ora Ecuadorului"},
+ timezones: map[string]string{"WART": "Ora standard a Argentinei Occidentale", "GFT": "Ora Guianei Franceze", "EDT": "Ora de vară orientală nord-americană", "COT": "Ora standard a Columbiei", "TMST": "Ora de vară din Turkmenistan", "WIT": "Ora Indoneziei de Est", "LHDT": "Ora de vară din Lord Howe", "∅∅∅": "Ora de vară a Amazonului", "WIB": "Ora Indoneziei de Vest", "MYT": "Ora din Malaysia", "AKDT": "Ora de vară din Alaska", "TMT": "Ora standard din Turkmenistan", "CLST": "Ora de vară din Chile", "EAT": "Ora Africii Orientale", "ACWDT": "Ora de vară a Australiei Central Occidentale", "ACWST": "Ora standard a Australiei Central Occidentale", "BOT": "Ora Boliviei", "OEZ": "Ora standard a Europei de Est", "ChST": "Ora din Chamorro", "BT": "Ora Bhutanului", "ACST": "Ora standard a Australiei Centrale", "EST": "Ora standard orientală nord-americană", "HNT": "Ora standard din Newfoundland", "AST": "Ora standard în zona Atlantic nord-americană", "AWST": "Ora standard a Australiei Occidentale", "CHADT": "Ora de vară din Chatham", "JST": "Ora standard a Japoniei", "HAST": "Ora standard din Hawaii-Aleutine", "PST": "Ora standard în zona Pacific nord-americană", "WESZ": "Ora de vară a Europei de Vest", "WARST": "Ora de vară a Argentinei Occidentale", "HKT": "Ora standard din Hong Kong", "COST": "Ora de vară a Columbiei", "WAT": "Ora standard a Africii Occidentale", "CDT": "Ora de vară centrală nord-americană", "VET": "Ora Venezuelei", "AKST": "Ora standard din Alaska", "HADT": "Ora de vară din Hawaii-Aleutine", "HAT": "Ora de vară din Newfoundland", "AEST": "Ora standard a Australiei Orientale", "GYT": "Ora din Guyana", "JDT": "Ora de vară a Japoniei", "SGT": "Ora din Singapore", "UYT": "Ora standard a Uruguayului", "LHST": "Ora standard din Lord Howe", "MST": "Ora standard în zona montană nord-americană", "ARST": "Ora de vară a Argentinei", "MESZ": "Ora de vară a Europei Centrale", "CHAST": "Ora standard din Chatham", "PDT": "Ora de vară în zona Pacific nord-americană", "CAT": "Ora Africii Centrale", "ECT": "Ora Ecuadorului", "WITA": "Ora Indoneziei Centrale", "ADT": "Ora de vară în zona Atlantic nord-americană", "WAST": "Ora de vară a Africii Occidentale", "CLT": "Ora standard din Chile", "IST": "Ora Indiei", "CST": "Ora standard centrală nord-americană", "ART": "Ora standard a Argentinei", "MDT": "Ora de vară în zona montană nord-americană", "ACDT": "Ora de vară a Australiei Centrale", "SRT": "Ora Surinamului", "NZST": "Ora standard a Noii Zeelande", "SAST": "Ora Africii Meridionale", "MEZ": "Ora standard a Europei Centrale", "AEDT": "Ora de vară a Australiei Orientale", "UYST": "Ora de vară a Uruguayului", "AWDT": "Ora de vară a Australiei Occidentale", "NZDT": "Ora de vară a Noii Zeelande", "WEZ": "Ora standard a Europei de Vest", "OESZ": "Ora de vară a Europei de Est", "GMT": "Ora de Greenwhich", "HKST": "Ora de vară din Hong Kong"},
}
}
diff --git a/ro_RO/ro_RO_test.go b/ro_RO/ro_RO_test.go
new file mode 100644
index 00000000..a914c7ab
--- /dev/null
+++ b/ro_RO/ro_RO_test.go
@@ -0,0 +1,1120 @@
+package ro_RO
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ro_RO"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/rof/rof.go b/rof/rof.go
index 6313d183..83f7733d 100644
--- a/rof/rof.go
+++ b/rof/rof.go
@@ -59,7 +59,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"KM", "BM"},
erasNarrow: []string{"", ""},
erasWide: []string{"Kabla ya Mayesu", "Baada ya Mayesu"},
- timezones: map[string]string{"ACDT": "ACDT", "ART": "ART", "TMST": "TMST", "PDT": "PDT", "AWST": "AWST", "HKST": "HKST", "WIB": "WIB", "HNT": "HNT", "ACST": "ACST", "WEZ": "WEZ", "TMT": "TMT", "LHST": "LHST", "UYST": "UYST", "CLST": "CLST", "WESZ": "WESZ", "PST": "PST", "MESZ": "MESZ", "SAST": "SAST", "ARST": "ARST", "SRT": "SRT", "AKST": "AKST", "CST": "CST", "CDT": "CDT", "AST": "AST", "WAST": "WAST", "OEZ": "OEZ", "∅∅∅": "∅∅∅", "ChST": "ChST", "EST": "EST", "COT": "COT", "WIT": "WIT", "IST": "IST", "JST": "JST", "COST": "COST", "HAT": "HAT", "GFT": "GFT", "WITA": "WITA", "MST": "MST", "MDT": "MDT", "JDT": "JDT", "HKT": "HKT", "OESZ": "OESZ", "MEZ": "MEZ", "UYT": "UYT", "CHADT": "CHADT", "ECT": "ECT", "AKDT": "AKDT", "GYT": "GYT", "MYT": "MYT", "VET": "VET", "ACWDT": "ACWDT", "AEST": "AEST", "SGT": "SGT", "EAT": "EAT", "NZDT": "NZDT", "ACWST": "ACWST", "HAST": "HAST", "WAT": "WAT", "WARST": "WARST", "GMT": "GMT", "CLT": "CLT", "WART": "WART", "AWDT": "AWDT", "NZST": "NZST", "CHAST": "CHAST", "HADT": "HADT", "BOT": "BOT", "BT": "BT", "LHDT": "LHDT", "AEDT": "AEDT", "CAT": "CAT", "EDT": "EDT", "ADT": "ADT"},
+ timezones: map[string]string{"HKST": "HKST", "UYT": "UYT", "ACST": "ACST", "SRT": "SRT", "WITA": "WITA", "SAST": "SAST", "PDT": "PDT", "WAT": "WAT", "WESZ": "WESZ", "HAT": "HAT", "CST": "CST", "GFT": "GFT", "AST": "AST", "AWST": "AWST", "BOT": "BOT", "BT": "BT", "LHDT": "LHDT", "CLST": "CLST", "AKST": "AKST", "HNT": "HNT", "HADT": "HADT", "OEZ": "OEZ", "∅∅∅": "∅∅∅", "CHAST": "CHAST", "ECT": "ECT", "ARST": "ARST", "PST": "PST", "WAST": "WAST", "COST": "COST", "TMT": "TMT", "WIT": "WIT", "JST": "JST", "MESZ": "MESZ", "ACWST": "ACWST", "COT": "COT", "TMST": "TMST", "AEDT": "AEDT", "CDT": "CDT", "ADT": "ADT", "ART": "ART", "JDT": "JDT", "WIB": "WIB", "OESZ": "OESZ", "ChST": "ChST", "HKT": "HKT", "EST": "EST", "HAST": "HAST", "NZST": "NZST", "CAT": "CAT", "MDT": "MDT", "VET": "VET", "AWDT": "AWDT", "WART": "WART", "MEZ": "MEZ", "ACWDT": "ACWDT", "EDT": "EDT", "GYT": "GYT", "EAT": "EAT", "CLT": "CLT", "NZDT": "NZDT", "SGT": "SGT", "GMT": "GMT", "UYST": "UYST", "WARST": "WARST", "MST": "MST", "WEZ": "WEZ", "AEST": "AEST", "LHST": "LHST", "ACDT": "ACDT", "CHADT": "CHADT", "AKDT": "AKDT", "IST": "IST", "MYT": "MYT"},
}
}
diff --git a/rof/rof_test.go b/rof/rof_test.go
new file mode 100644
index 00000000..2dbf16d2
--- /dev/null
+++ b/rof/rof_test.go
@@ -0,0 +1,1120 @@
+package rof
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "rof"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/rof_TZ/rof_TZ.go b/rof_TZ/rof_TZ.go
index 2eb3f28e..5fb12598 100644
--- a/rof_TZ/rof_TZ.go
+++ b/rof_TZ/rof_TZ.go
@@ -59,7 +59,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"KM", "BM"},
erasNarrow: []string{"", ""},
erasWide: []string{"Kabla ya Mayesu", "Baada ya Mayesu"},
- timezones: map[string]string{"WAT": "WAT", "HNT": "HNT", "MST": "MST", "PST": "PST", "PDT": "PDT", "CDT": "CDT", "NZST": "NZST", "ACWDT": "ACWDT", "CHAST": "CHAST", "WITA": "WITA", "CHADT": "CHADT", "ADT": "ADT", "HKT": "HKT", "GYT": "GYT", "MYT": "MYT", "WESZ": "WESZ", "TMT": "TMT", "SRT": "SRT", "AKDT": "AKDT", "AEDT": "AEDT", "ChST": "ChST", "AWST": "AWST", "NZDT": "NZDT", "ECT": "ECT", "CAT": "CAT", "HADT": "HADT", "SGT": "SGT", "WAST": "WAST", "WIT": "WIT", "TMST": "TMST", "SAST": "SAST", "GMT": "GMT", "HAT": "HAT", "EAT": "EAT", "MESZ": "MESZ", "WEZ": "WEZ", "ARST": "ARST", "AEST": "AEST", "COST": "COST", "BT": "BT", "OEZ": "OEZ", "OESZ": "OESZ", "GFT": "GFT", "MDT": "MDT", "JST": "JST", "BOT": "BOT", "UYST": "UYST", "WIB": "WIB", "IST": "IST", "AKST": "AKST", "AWDT": "AWDT", "LHDT": "LHDT", "MEZ": "MEZ", "CLST": "CLST", "WART": "WART", "ART": "ART", "EST": "EST", "COT": "COT", "AST": "AST", "HKST": "HKST", "JDT": "JDT", "LHST": "LHST", "∅∅∅": "∅∅∅", "ACDT": "ACDT", "ACWST": "ACWST", "HAST": "HAST", "CST": "CST", "UYT": "UYT", "VET": "VET", "EDT": "EDT", "WARST": "WARST", "ACST": "ACST", "CLT": "CLT"},
+ timezones: map[string]string{"VET": "VET", "IST": "IST", "EST": "EST", "OESZ": "OESZ", "ACST": "ACST", "SRT": "SRT", "AKST": "AKST", "OEZ": "OEZ", "LHST": "LHST", "JST": "JST", "PDT": "PDT", "MESZ": "MESZ", "TMST": "TMST", "NZDT": "NZDT", "SAST": "SAST", "WESZ": "WESZ", "GMT": "GMT", "BT": "BT", "MST": "MST", "WARST": "WARST", "ADT": "ADT", "ACWST": "ACWST", "GFT": "GFT", "MEZ": "MEZ", "WEZ": "WEZ", "UYST": "UYST", "EAT": "EAT", "ACDT": "ACDT", "HKT": "HKT", "HKST": "HKST", "WIT": "WIT", "BOT": "BOT", "WAST": "WAST", "ChST": "ChST", "UYT": "UYT", "CHADT": "CHADT", "COT": "COT", "TMT": "TMT", "SGT": "SGT", "LHDT": "LHDT", "JDT": "JDT", "AKDT": "AKDT", "ARST": "ARST", "HAST": "HAST", "WIB": "WIB", "∅∅∅": "∅∅∅", "WITA": "WITA", "AST": "AST", "AWDT": "AWDT", "ART": "ART", "HAT": "HAT", "AEST": "AEST", "CHAST": "CHAST", "HADT": "HADT", "NZST": "NZST", "MDT": "MDT", "CST": "CST", "CDT": "CDT", "AWST": "AWST", "CLST": "CLST", "PST": "PST", "WAT": "WAT", "GYT": "GYT", "WART": "WART", "ACWDT": "ACWDT", "COST": "COST", "CAT": "CAT", "AEDT": "AEDT", "CLT": "CLT", "MYT": "MYT", "ECT": "ECT", "EDT": "EDT", "HNT": "HNT"},
}
}
diff --git a/rof_TZ/rof_TZ_test.go b/rof_TZ/rof_TZ_test.go
new file mode 100644
index 00000000..9e52d50c
--- /dev/null
+++ b/rof_TZ/rof_TZ_test.go
@@ -0,0 +1,1120 @@
+package rof_TZ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "rof_TZ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/root/root.go b/root/root.go
index b98e46ae..8f20a7b2 100644
--- a/root/root.go
+++ b/root/root.go
@@ -58,7 +58,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BCE", "CE"},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"GFT": "GFT", "∅∅∅": "∅∅∅", "PDT": "PDT", "LHST": "LHST", "JDT": "JDT", "MEZ": "MEZ", "WAST": "WAST", "ACST": "ACST", "AKDT": "AKDT", "PST": "PST", "LHDT": "LHDT", "GYT": "GYT", "HKT": "HKT", "HNT": "HNT", "MST": "MST", "CAT": "CAT", "SGT": "SGT", "BOT": "BOT", "WAT": "WAT", "HKST": "HKST", "WARST": "WARST", "WITA": "WITA", "AKST": "AKST", "MYT": "MYT", "ART": "ART", "TMST": "TMST", "JST": "JST", "SRT": "SRT", "ACWDT": "ACWDT", "CLST": "CLST", "OEZ": "OEZ", "GMT": "GMT", "NZDT": "NZDT", "ACWST": "ACWST", "AEDT": "AEDT", "WIB": "WIB", "AEST": "AEST", "CLT": "CLT", "EST": "EST", "OESZ": "OESZ", "TMT": "TMT", "HAST": "HAST", "AWST": "AWST", "CST": "CST", "COST": "COST", "AST": "AST", "ADT": "ADT", "IST": "IST", "ACDT": "ACDT", "ARST": "ARST", "AWDT": "AWDT", "UYST": "UYST", "EAT": "EAT", "CDT": "CDT", "WESZ": "WESZ", "CHADT": "CHADT", "MDT": "MDT", "UYT": "UYT", "WART": "WART", "VET": "VET", "HADT": "HADT", "SAST": "SAST", "WIT": "WIT", "EDT": "EDT", "COT": "COT", "BT": "BT", "MESZ": "MESZ", "ChST": "ChST", "CHAST": "CHAST", "HAT": "HAT", "NZST": "NZST", "WEZ": "WEZ", "ECT": "ECT"},
+ timezones: map[string]string{"OEZ": "OEZ", "COT": "COT", "MYT": "MYT", "LHST": "LHST", "ADT": "ADT", "PDT": "PDT", "CDT": "CDT", "HKST": "HKST", "MDT": "MDT", "HKT": "HKT", "WITA": "WITA", "BOT": "BOT", "IST": "IST", "SGT": "SGT", "BT": "BT", "LHDT": "LHDT", "ACST": "ACST", "EST": "EST", "HADT": "HADT", "WIT": "WIT", "SRT": "SRT", "NZDT": "NZDT", "SAST": "SAST", "WEZ": "WEZ", "HAT": "HAT", "ACDT": "ACDT", "ARST": "ARST", "ECT": "ECT", "HNT": "HNT", "AWDT": "AWDT", "MEZ": "MEZ", "ART": "ART", "JST": "JST", "CST": "CST", "WARST": "WARST", "CHAST": "CHAST", "AKST": "AKST", "COST": "COST", "AEDT": "AEDT", "EAT": "EAT", "NZST": "NZST", "WAT": "WAT", "MST": "MST", "HAST": "HAST", "VET": "VET", "PST": "PST", "WAST": "WAST", "OESZ": "OESZ", "GFT": "GFT", "TMST": "TMST", "ChST": "ChST", "AST": "AST", "∅∅∅": "∅∅∅", "WART": "WART", "CHADT": "CHADT", "GYT": "GYT", "UYST": "UYST", "CLST": "CLST", "UYT": "UYT", "ACWDT": "ACWDT", "MESZ": "MESZ", "EDT": "EDT", "CAT": "CAT", "GMT": "GMT", "CLT": "CLT", "AKDT": "AKDT", "ACWST": "ACWST", "AWST": "AWST", "WIB": "WIB", "TMT": "TMT", "WESZ": "WESZ", "AEST": "AEST", "JDT": "JDT"},
}
}
@@ -104,7 +104,7 @@ func (root *root) MonthAbbreviated(month time.Month) string {
// MonthsAbbreviated returns the locales abbreviated months
func (root *root) MonthsAbbreviated() []string {
- return root.monthsAbbreviated[1:]
+ return nil
}
// MonthNarrow returns the locales narrow month given the 'month' provided
diff --git a/root/root_test.go b/root/root_test.go
new file mode 100644
index 00000000..f4d0429d
--- /dev/null
+++ b/root/root_test.go
@@ -0,0 +1,1120 @@
+package root
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "root"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ru/ru.go b/ru/ru.go
index 8d03e636..2592e128 100644
--- a/ru/ru.go
+++ b/ru/ru.go
@@ -48,7 +48,7 @@ func New() locales.Translator {
locale: "ru",
pluralsCardinal: []locales.PluralRule{2, 4, 5, 6},
pluralsOrdinal: []locales.PluralRule{6},
- pluralsRange: []locales.PluralRule{6, 2, 4, 5},
+ pluralsRange: []locales.PluralRule{2, 4, 5, 6},
decimal: ",",
group: " ",
minus: "-",
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"до н. э.", "н. э."},
erasNarrow: []string{"до н.э.", "н.э."},
erasWide: []string{"до Рождества Христова", "от Рождества Христова"},
- timezones: map[string]string{"COST": "Колумбия, летнее время", "HAST": "Гавайско-алеутское стандартное время", "MYT": "Малайзия", "AWDT": "Западная Австралия, летнее время", "CLT": "Чили, стандартное время", "CAT": "Центральная Африка", "JST": "Япония, стандартное время", "PDT": "Тихоокеанское летнее время", "EAT": "Восточная Африка", "ACST": "Центральная Австралия, стандартное время", "NZST": "Новая Зеландия, стандартное время", "IST": "Индия", "CHADT": "Чатем, летнее время", "OEZ": "Восточная Европа, стандартное время", "AST": "Атлантическое стандартное время", "HADT": "Гавайско-алеутское летнее время", "WART": "Западная Аргентина, стандартное время", "HKST": "Гонконг, летнее время", "CDT": "Центральная Америка, летнее время", "VET": "Венесуэла", "AEST": "Восточная Австралия, стандартное время", "ECT": "Эквадор", "WIT": "Восточная Индонезия", "TMST": "Туркмения, летнее время", "MST": "Макао, стандартное время", "ART": "Аргентина, стандартное время", "EDT": "Восточная Америка, летнее время", "OESZ": "Восточная Европа, летнее время", "TMT": "Туркмения, стандартное время", "SRT": "Суринам", "WITA": "Центральная Индонезия", "WIB": "Западная Индонезия", "MEZ": "Центральная Европа, стандартное время", "ACWST": "Центральная Австралия, западное стандартное время", "AEDT": "Восточная Австралия, летнее время", "GFT": "Французская Гвиана", "ACDT": "Центральная Австралия, летнее время", "CST": "Центральная Америка, стандартное время", "WEZ": "Западная Европа, стандартное время", "ACWDT": "Центральная Австралия, западное летнее время", "COT": "Колумбия, стандартное время", "WARST": "Западная Аргентина, летнее время", "∅∅∅": "Амазонка, летнее время", "AKDT": "Аляска, летнее время", "PST": "Тихоокеанское стандартное время", "LHDT": "Лорд-Хау, летнее время", "HAT": "Ньюфаундленд, летнее время", "JDT": "Япония, летнее время", "AKST": "Аляска, стандартное время", "UYT": "Уругвай, стандартное время", "BOT": "Боливия", "ADT": "Атлантическое летнее время", "SGT": "Сингапур", "MESZ": "Центральная Европа, летнее время", "SAST": "Южная Африка", "BT": "Бутан", "HKT": "Гонконг, стандартное время", "MDT": "Макао, летнее время", "AWST": "Западная Австралия, стандартное время", "LHST": "Лорд-Хау, стандартное время", "WESZ": "Западная Европа, летнее время", "WAST": "Западная Африка, летнее время", "GMT": "Среднее время по Гринвичу", "HNT": "Ньюфаундленд, стандартное время", "GYT": "Гайана", "UYST": "Уругвай, летнее время", "NZDT": "Новая Зеландия, летнее время", "CHAST": "Чатем, стандартное время", "WAT": "Западная Африка, стандартное время", "ARST": "Аргентина, летнее время", "CLST": "Чили, летнее время", "ChST": "Чаморро", "EST": "Восточная Америка, стандартное время"},
+ timezones: map[string]string{"IST": "Индия", "MESZ": "Центральная Европа, летнее время", "HAST": "Гавайско-алеутское стандартное время", "COT": "Колумбия, стандартное время", "AEDT": "Восточная Австралия, летнее время", "MYT": "Малайзия", "AST": "Атлантическое стандартное время", "WAT": "Западная Африка, стандартное время", "WAST": "Западная Африка, летнее время", "WIT": "Восточная Индонезия", "ACDT": "Центральная Австралия, летнее время", "ECT": "Эквадор", "AWDT": "Западная Австралия, летнее время", "SGT": "Сингапур", "OEZ": "Восточная Европа, стандартное время", "EDT": "Восточная Америка, летнее время", "LHST": "Лорд-Хау, стандартное время", "CLST": "Чили, летнее время", "UYST": "Уругвай, летнее время", "CDT": "Центральная Америка, летнее время", "JDT": "Япония, летнее время", "OESZ": "Восточная Европа, летнее время", "AEST": "Восточная Австралия, стандартное время", "UYT": "Уругвай, стандартное время", "ACST": "Центральная Австралия, стандартное время", "ARST": "Аргентина, летнее время", "WEZ": "Западная Европа, стандартное время", "NZDT": "Новая Зеландия, летнее время", "WARST": "Западная Аргентина, летнее время", "SRT": "Суринам", "CHADT": "Чатем, летнее время", "WESZ": "Западная Европа, летнее время", "WIB": "Западная Индонезия", "ChST": "Чаморро", "LHDT": "Лорд-Хау, летнее время", "BOT": "Боливия", "PST": "Тихоокеанское стандартное время", "MEZ": "Центральная Европа, стандартное время", "TMT": "Туркмения, стандартное время", "CLT": "Чили, стандартное время", "CHAST": "Чатем, стандартное время", "SAST": "Южная Африка", "EST": "Восточная Америка, стандартное время", "HADT": "Гавайско-алеутское летнее время", "∅∅∅": "Амазонка, летнее время", "TMST": "Туркмения, летнее время", "MDT": "Горное летнее время (США)", "VET": "Венесуэла", "WITA": "Центральная Индонезия", "PDT": "Тихоокеанское летнее время", "NZST": "Новая Зеландия, стандартное время", "EAT": "Восточная Африка", "GFT": "Французская Гвиана", "ACWST": "Центральная Австралия, западное стандартное время", "AWST": "Западная Австралия, стандартное время", "MST": "Горное стандартное время (США)", "HKT": "Гонконг, стандартное время", "AKST": "Аляска, стандартное время", "ADT": "Атлантическое летнее время", "ACWDT": "Центральная Австралия, западное летнее время", "HNT": "Ньюфаундленд, стандартное время", "HAT": "Ньюфаундленд, летнее время", "COST": "Колумбия, летнее время", "CST": "Центральная Америка, стандартное время", "AKDT": "Аляска, летнее время", "CAT": "Центральная Африка", "WART": "Западная Аргентина, стандартное время", "ART": "Аргентина, стандартное время", "GMT": "Среднее время по Гринвичу", "GYT": "Гайана", "BT": "Бутан", "HKST": "Гонконг, летнее время", "JST": "Япония, стандартное время"},
}
}
diff --git a/ru/ru_test.go b/ru/ru_test.go
new file mode 100644
index 00000000..eb866345
--- /dev/null
+++ b/ru/ru_test.go
@@ -0,0 +1,1120 @@
+package ru
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ru"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ru_BY/ru_BY.go b/ru_BY/ru_BY.go
index 14009348..16ddbd67 100644
--- a/ru_BY/ru_BY.go
+++ b/ru_BY/ru_BY.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"до н. э.", "н. э."},
erasNarrow: []string{"до н.э.", "н.э."},
erasWide: []string{"до Рождества Христова", "от Рождества Христова"},
- timezones: map[string]string{"ACST": "Центральная Австралия, стандартное время", "CDT": "Центральная Америка, летнее время", "MEZ": "Центральная Европа, стандартное время", "ACWST": "Центральная Австралия, западное стандартное время", "AEST": "Восточная Австралия, стандартное время", "GFT": "Французская Гвиана", "EAT": "Восточная Африка", "LHDT": "Лорд-Хау, летнее время", "CHADT": "Чатем, летнее время", "CLST": "Чили, летнее время", "WART": "Западная Аргентина, стандартное время", "AWST": "Западная Австралия, стандартное время", "MST": "Горное стандартное время (США)", "OESZ": "Восточная Европа, летнее время", "HAT": "Ньюфаундленд, летнее время", "JDT": "Япония, летнее время", "∅∅∅": "Азорские о-ва, летнее время", "WESZ": "Западная Европа, летнее время", "COST": "Колумбия, летнее время", "HAST": "Гавайско-алеутское стандартное время", "HADT": "Гавайско-алеутское летнее время", "AKST": "Аляска, стандартное время", "AKDT": "Аляска, летнее время", "AEDT": "Восточная Австралия, летнее время", "CLT": "Чили, стандартное время", "WARST": "Западная Аргентина, летнее время", "PDT": "Тихоокеанское летнее время", "JST": "Япония, стандартное время", "CAT": "Центральная Африка", "SGT": "Сингапур", "EST": "Восточная Америка, стандартное время", "EDT": "Восточная Америка, летнее время", "HNT": "Ньюфаундленд, стандартное время", "TMST": "Туркмения, летнее время", "UYT": "Уругвай, стандартное время", "CHAST": "Чатем, стандартное время", "ADT": "Атлантическое летнее время", "OEZ": "Восточная Европа, стандартное время", "ACDT": "Центральная Австралия, летнее время", "TMT": "Туркмения, стандартное время", "AWDT": "Западная Австралия, летнее время", "LHST": "Лорд-Хау, стандартное время", "GYT": "Гайана", "SRT": "Суринам", "CST": "Центральная Америка, стандартное время", "UYST": "Уругвай, летнее время", "NZST": "Новая Зеландия, стандартное время", "WEZ": "Западная Европа, стандартное время", "ACWDT": "Центральная Австралия, западное летнее время", "COT": "Колумбия, стандартное время", "WIB": "Западная Индонезия", "ARST": "Аргентина, летнее время", "IST": "Индия", "GMT": "Среднее время по Гринвичу", "WITA": "Центральная Индонезия", "ART": "Аргентина, стандартное время", "PST": "Тихоокеанское стандартное время", "MYT": "Малайзия", "VET": "Венесуэла", "MESZ": "Центральная Европа, летнее время", "AST": "Атлантическое стандартное время", "WAT": "Западная Африка, стандартное время", "ECT": "Эквадор", "HKST": "Гонконг, летнее время", "WIT": "Восточная Индонезия", "BT": "Бутан", "HKT": "Гонконг, стандартное время", "NZDT": "Новая Зеландия, летнее время", "BOT": "Боливия", "ChST": "Чаморро", "MDT": "Горное летнее время (США)", "SAST": "Южная Африка", "WAST": "Западная Африка, летнее время"},
+ timezones: map[string]string{"TMST": "Туркмения, летнее время", "CLST": "Чили, летнее время", "HKST": "Гонконг, летнее время", "CHAST": "Чатем, стандартное время", "JST": "Япония, стандартное время", "OEZ": "Восточная Европа, стандартное время", "WIT": "Восточная Индонезия", "GYT": "Гайана", "HAST": "Гавайско-алеутское стандартное время", "COST": "Колумбия, летнее время", "AEST": "Восточная Австралия, стандартное время", "AEDT": "Восточная Австралия, летнее время", "MST": "Горное стандартное время (США)", "ACWST": "Центральная Австралия, западное стандартное время", "EAT": "Восточная Африка", "WARST": "Западная Аргентина, летнее время", "AST": "Атлантическое стандартное время", "AWST": "Западная Австралия, стандартное время", "NZST": "Новая Зеландия, стандартное время", "UYT": "Уругвай, стандартное время", "ACDT": "Центральная Австралия, летнее время", "EST": "Восточная Америка, стандартное время", "∅∅∅": "Амазонка, летнее время", "UYST": "Уругвай, летнее время", "ACST": "Центральная Австралия, стандартное время", "SRT": "Суринам", "JDT": "Япония, летнее время", "PDT": "Тихоокеанское летнее время", "BT": "Бутан", "GFT": "Французская Гвиана", "AKST": "Аляска, стандартное время", "MEZ": "Центральная Европа, стандартное время", "LHST": "Лорд-Хау, стандартное время", "MDT": "Горное летнее время (США)", "VET": "Венесуэла", "ADT": "Атлантическое летнее время", "ACWDT": "Центральная Австралия, западное летнее время", "AWDT": "Западная Австралия, летнее время", "ARST": "Аргентина, летнее время", "MESZ": "Центральная Европа, летнее время", "TMT": "Туркмения, стандартное время", "WAT": "Западная Африка, стандартное время", "CDT": "Центральная Америка, летнее время", "BOT": "Боливия", "EDT": "Восточная Америка, летнее время", "PST": "Тихоокеанское стандартное время", "SGT": "Сингапур", "ChST": "Чаморро", "ECT": "Эквадор", "ART": "Аргентина, стандартное время", "OESZ": "Восточная Европа, летнее время", "CST": "Центральная Америка, стандартное время", "WART": "Западная Аргентина, стандартное время", "CHADT": "Чатем, летнее время", "NZDT": "Новая Зеландия, летнее время", "HAT": "Ньюфаундленд, летнее время", "HKT": "Гонконг, стандартное время", "SAST": "Южная Африка", "WESZ": "Западная Европа, летнее время", "GMT": "Среднее время по Гринвичу", "MYT": "Малайзия", "WITA": "Центральная Индонезия", "IST": "Индия", "HADT": "Гавайско-алеутское летнее время", "WIB": "Западная Индонезия", "CAT": "Центральная Африка", "COT": "Колумбия, стандартное время", "WAST": "Западная Африка, летнее время", "WEZ": "Западная Европа, стандартное время", "HNT": "Ньюфаундленд, стандартное время", "LHDT": "Лорд-Хау, летнее время", "CLT": "Чили, стандартное время", "AKDT": "Аляска, летнее время"},
}
}
@@ -102,8 +102,8 @@ func (ru *ru_BY) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
n := math.Abs(num)
i := int64(n)
- iMod10 := i % 10
iMod100 := i % 100
+ iMod10 := i % 10
if v == 0 && iMod10 == 1 && iMod100 != 11 {
return locales.PluralRuleOne
diff --git a/ru_BY/ru_BY_test.go b/ru_BY/ru_BY_test.go
new file mode 100644
index 00000000..42f42d57
--- /dev/null
+++ b/ru_BY/ru_BY_test.go
@@ -0,0 +1,1120 @@
+package ru_BY
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ru_BY"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ru_KG/ru_KG.go b/ru_KG/ru_KG.go
index 8b63e524..297fe76a 100644
--- a/ru_KG/ru_KG.go
+++ b/ru_KG/ru_KG.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"до н. э.", "н. э."},
erasNarrow: []string{"до н.э.", "н.э."},
erasWide: []string{"до Рождества Христова", "от Рождества Христова"},
- timezones: map[string]string{"TMST": "Туркмения, летнее время", "EDT": "Восточная Америка, летнее время", "ARST": "Аргентина, летнее время", "TMT": "Туркмения, стандартное время", "MEZ": "Центральная Европа, стандартное время", "COT": "Колумбия, стандартное время", "HKST": "Гонконг, летнее время", "HAT": "Ньюфаундленд, летнее время", "MST": "Макао, стандартное время", "PDT": "Тихоокеанское летнее время", "CST": "Центральная Америка, стандартное время", "BOT": "Боливия", "WAST": "Западная Африка, летнее время", "GMT": "Среднее время по Гринвичу", "GFT": "Французская Гвиана", "WITA": "Центральная Индонезия", "SAST": "Южная Африка", "WAT": "Западная Африка, стандартное время", "BT": "Бутан", "HKT": "Гонконг, стандартное время", "ART": "Аргентина, стандартное время", "∅∅∅": "Амазонка, летнее время", "AKDT": "Аляска, летнее время", "MYT": "Малайзия", "CDT": "Центральная Америка, летнее время", "NZST": "Новая Зеландия, стандартное время", "CLST": "Чили, летнее время", "CHADT": "Чатем, летнее время", "ADT": "Атлантическое летнее время", "WIT": "Восточная Индонезия", "PST": "Тихоокеанское стандартное время", "UYT": "Уругвай, стандартное время", "HAST": "Гавайско-алеутское стандартное время", "IST": "Индия", "LHDT": "Лорд-Хау, летнее время", "GYT": "Гайана", "SGT": "Сингапур", "ACDT": "Центральная Австралия, летнее время", "AEDT": "Восточная Австралия, летнее время", "ECT": "Эквадор", "OEZ": "Восточная Европа, стандартное время", "SRT": "Суринам", "AWDT": "Западная Австралия, летнее время", "NZDT": "Новая Зеландия, летнее время", "UYST": "Уругвай, летнее время", "WEZ": "Западная Европа, стандартное время", "CAT": "Центральная Африка", "ChST": "Чаморро", "COST": "Колумбия, летнее время", "OESZ": "Восточная Европа, летнее время", "MDT": "Макао, летнее время", "CLT": "Чили, стандартное время", "ACWDT": "Центральная Австралия, западное летнее время", "EST": "Восточная Америка, стандартное время", "WARST": "Западная Аргентина, летнее время", "WIB": "Западная Индонезия", "HNT": "Ньюфаундленд, стандартное время", "AWST": "Западная Австралия, стандартное время", "ACWST": "Центральная Австралия, западное стандартное время", "CHAST": "Чатем, стандартное время", "ACST": "Центральная Австралия, стандартное время", "JST": "Япония, стандартное время", "MESZ": "Центральная Европа, летнее время", "WESZ": "Западная Европа, летнее время", "LHST": "Лорд-Хау, стандартное время", "AST": "Атлантическое стандартное время", "HADT": "Гавайско-алеутское летнее время", "WART": "Западная Аргентина, стандартное время", "EAT": "Восточная Африка", "JDT": "Япония, летнее время", "AKST": "Аляска, стандартное время", "VET": "Венесуэла", "AEST": "Восточная Австралия, стандартное время"},
+ timezones: map[string]string{"OESZ": "Восточная Европа, летнее время", "AKST": "Аляска, стандартное время", "AKDT": "Аляска, летнее время", "COST": "Колумбия, летнее время", "HNT": "Ньюфаундленд, стандартное время", "ChST": "Чаморро", "HAST": "Гавайско-алеутское стандартное время", "HADT": "Гавайско-алеутское летнее время", "SAST": "Южная Африка", "CLT": "Чили, стандартное время", "CLST": "Чили, летнее время", "COT": "Колумбия, стандартное время", "TMST": "Туркмения, летнее время", "WAST": "Западная Африка, летнее время", "CST": "Центральная Америка, стандартное время", "AWDT": "Западная Австралия, летнее время", "ART": "Аргентина, стандартное время", "BOT": "Боливия", "PST": "Тихоокеанское стандартное время", "∅∅∅": "Амазонка, летнее время", "GMT": "Среднее время по Гринвичу", "ADT": "Атлантическое летнее время", "HKST": "Гонконг, летнее время", "CHAST": "Чатем, стандартное время", "EAT": "Восточная Африка", "CHADT": "Чатем, летнее время", "AWST": "Западная Австралия, стандартное время", "AEST": "Восточная Австралия, стандартное время", "AEDT": "Восточная Австралия, летнее время", "WART": "Западная Аргентина, стандартное время", "VET": "Венесуэла", "JST": "Япония, стандартное время", "EDT": "Восточная Америка, летнее время", "PDT": "Тихоокеанское летнее время", "LHDT": "Лорд-Хау, летнее время", "MST": "Горное стандартное время (США)", "CDT": "Центральная Америка, летнее время", "JDT": "Япония, летнее время", "NZDT": "Новая Зеландия, летнее время", "TMT": "Туркмения, стандартное время", "ACST": "Центральная Австралия, стандартное время", "ACWDT": "Центральная Австралия, западное летнее время", "MESZ": "Центральная Европа, летнее время", "GYT": "Гайана", "UYST": "Уругвай, летнее время", "WIT": "Восточная Индонезия", "MDT": "Горное летнее время (США)", "ARST": "Аргентина, летнее время", "IST": "Индия", "WIB": "Западная Индонезия", "ACDT": "Центральная Австралия, летнее время", "SRT": "Суринам", "ECT": "Эквадор", "MEZ": "Центральная Европа, стандартное время", "UYT": "Уругвай, стандартное время", "LHST": "Лорд-Хау, стандартное время", "GFT": "Французская Гвиана", "AST": "Атлантическое стандартное время", "MYT": "Малайзия", "HKT": "Гонконг, стандартное время", "WITA": "Центральная Индонезия", "EST": "Восточная Америка, стандартное время", "WESZ": "Западная Европа, летнее время", "SGT": "Сингапур", "OEZ": "Восточная Европа, стандартное время", "BT": "Бутан", "ACWST": "Центральная Австралия, западное стандартное время", "NZST": "Новая Зеландия, стандартное время", "CAT": "Центральная Африка", "WAT": "Западная Африка, стандартное время", "WEZ": "Западная Европа, стандартное время", "HAT": "Ньюфаундленд, летнее время", "WARST": "Западная Аргентина, летнее время"},
}
}
@@ -102,8 +102,8 @@ func (ru *ru_KG) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
n := math.Abs(num)
i := int64(n)
- iMod100 := i % 100
iMod10 := i % 10
+ iMod100 := i % 100
if v == 0 && iMod10 == 1 && iMod100 != 11 {
return locales.PluralRuleOne
diff --git a/ru_KG/ru_KG_test.go b/ru_KG/ru_KG_test.go
new file mode 100644
index 00000000..ec991858
--- /dev/null
+++ b/ru_KG/ru_KG_test.go
@@ -0,0 +1,1120 @@
+package ru_KG
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ru_KG"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ru_KZ/ru_KZ.go b/ru_KZ/ru_KZ.go
index 9b07fe62..347150d2 100644
--- a/ru_KZ/ru_KZ.go
+++ b/ru_KZ/ru_KZ.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"до н. э.", "н. э."},
erasNarrow: []string{"до н.э.", "н.э."},
erasWide: []string{"до Рождества Христова", "от Рождества Христова"},
- timezones: map[string]string{"IST": "Индия", "AWDT": "Западная Австралия, летнее время", "BT": "Бутан", "UYT": "Уругвай, стандартное время", "NZDT": "Новая Зеландия, летнее время", "CHAST": "Чатем, стандартное время", "CLST": "Чили, летнее время", "ART": "Аргентина, стандартное время", "ARST": "Аргентина, летнее время", "JST": "Япония, стандартное время", "AWST": "Западная Австралия, стандартное время", "ACWST": "Центральная Австралия, западное стандартное время", "CAT": "Центральная Африка", "MST": "Макао, стандартное время", "MDT": "Макао, летнее время", "NZST": "Новая Зеландия, стандартное время", "BOT": "Боливия", "OEZ": "Восточная Европа, стандартное время", "ACWDT": "Центральная Австралия, западное летнее время", "∅∅∅": "Амазонка, летнее время", "JDT": "Япония, летнее время", "MEZ": "Центральная Европа, стандартное время", "MESZ": "Центральная Европа, летнее время", "SAST": "Южная Африка", "GFT": "Французская Гвиана", "ACST": "Центральная Австралия, стандартное время", "UYST": "Уругвай, летнее время", "CDT": "Центральная Америка, летнее время", "HAST": "Гавайско-алеутское стандартное время", "SGT": "Сингапур", "OESZ": "Восточная Европа, летнее время", "TMST": "Туркмения, летнее время", "CST": "Центральная Америка, стандартное время", "COST": "Колумбия, летнее время", "AKDT": "Аляска, летнее время", "LHST": "Лорд-Хау, стандартное время", "ChST": "Чаморро", "PST": "Тихоокеанское стандартное время", "AST": "Атлантическое стандартное время", "HADT": "Гавайско-алеутское летнее время", "HKT": "Гонконг, стандартное время", "HAT": "Ньюфаундленд, летнее время", "TMT": "Туркмения, стандартное время", "HKST": "Гонконг, летнее время", "MYT": "Малайзия", "EST": "Восточная Америка, стандартное время", "COT": "Колумбия, стандартное время", "WARST": "Западная Аргентина, летнее время", "ACDT": "Центральная Австралия, летнее время", "LHDT": "Лорд-Хау, летнее время", "CLT": "Чили, стандартное время", "AEST": "Восточная Австралия, стандартное время", "ADT": "Атлантическое летнее время", "HNT": "Ньюфаундленд, стандартное время", "EAT": "Восточная Африка", "GYT": "Гайана", "EDT": "Восточная Америка, летнее время", "AEDT": "Восточная Австралия, летнее время", "WART": "Западная Аргентина, стандартное время", "WAST": "Западная Африка, летнее время", "WIT": "Восточная Индонезия", "WIB": "Западная Индонезия", "SRT": "Суринам", "CHADT": "Чатем, летнее время", "WAT": "Западная Африка, стандартное время", "GMT": "Среднее время по Гринвичу", "AKST": "Аляска, стандартное время", "PDT": "Тихоокеанское летнее время", "ECT": "Эквадор", "WITA": "Центральная Индонезия", "VET": "Венесуэла", "WEZ": "Западная Европа, стандартное время", "WESZ": "Западная Европа, летнее время"},
+ timezones: map[string]string{"MYT": "Малайзия", "MESZ": "Центральная Европа, летнее время", "ChST": "Чаморро", "UYST": "Уругвай, летнее время", "BT": "Бутан", "EDT": "Восточная Америка, летнее время", "ACWDT": "Центральная Австралия, западное летнее время", "HADT": "Гавайско-алеутское летнее время", "TMT": "Туркмения, стандартное время", "TMST": "Туркмения, летнее время", "HAT": "Ньюфаундленд, летнее время", "MST": "Горное стандартное время (США)", "AWST": "Западная Австралия, стандартное время", "WITA": "Центральная Индонезия", "PST": "Тихоокеанское стандартное время", "COST": "Колумбия, летнее время", "OESZ": "Восточная Европа, летнее время", "EAT": "Восточная Африка", "HKST": "Гонконг, летнее время", "JST": "Япония, стандартное время", "JDT": "Япония, летнее время", "EST": "Восточная Америка, стандартное время", "HAST": "Гавайско-алеутское стандартное время", "GMT": "Среднее время по Гринвичу", "ACST": "Центральная Австралия, стандартное время", "VET": "Венесуэла", "ADT": "Атлантическое летнее время", "NZDT": "Новая Зеландия, летнее время", "BOT": "Боливия", "AEST": "Восточная Австралия, стандартное время", "LHDT": "Лорд-Хау, летнее время", "SRT": "Суринам", "NZST": "Новая Зеландия, стандартное время", "WIB": "Западная Индонезия", "WAT": "Западная Африка, стандартное время", "OEZ": "Восточная Европа, стандартное время", "∅∅∅": "Бразилия, летнее время", "WART": "Западная Аргентина, стандартное время", "GFT": "Французская Гвиана", "COT": "Колумбия, стандартное время", "UYT": "Уругвай, стандартное время", "HNT": "Ньюфаундленд, стандартное время", "WEZ": "Западная Европа, стандартное время", "CHAST": "Чатем, стандартное время", "AST": "Атлантическое стандартное время", "ACWST": "Центральная Австралия, западное стандартное время", "IST": "Индия", "PDT": "Тихоокеанское летнее время", "MEZ": "Центральная Европа, стандартное время", "WIT": "Восточная Индонезия", "LHST": "Лорд-Хау, стандартное время", "MDT": "Горное летнее время (США)", "CDT": "Центральная Америка, летнее время", "ACDT": "Центральная Австралия, летнее время", "AWDT": "Западная Австралия, летнее время", "WESZ": "Западная Европа, летнее время", "GYT": "Гайана", "WARST": "Западная Аргентина, летнее время", "AKST": "Аляска, стандартное время", "ART": "Аргентина, стандартное время", "CAT": "Центральная Африка", "WAST": "Западная Африка, летнее время", "SGT": "Сингапур", "CLT": "Чили, стандартное время", "CHADT": "Чатем, летнее время", "SAST": "Южная Африка", "CST": "Центральная Америка, стандартное время", "AEDT": "Восточная Австралия, летнее время", "CLST": "Чили, летнее время", "HKT": "Гонконг, стандартное время", "ECT": "Эквадор", "AKDT": "Аляска, летнее время", "ARST": "Аргентина, летнее время"},
}
}
diff --git a/ru_KZ/ru_KZ_test.go b/ru_KZ/ru_KZ_test.go
new file mode 100644
index 00000000..4883fb0a
--- /dev/null
+++ b/ru_KZ/ru_KZ_test.go
@@ -0,0 +1,1120 @@
+package ru_KZ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ru_KZ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ru_MD/ru_MD.go b/ru_MD/ru_MD.go
index 511f90df..acb4ca48 100644
--- a/ru_MD/ru_MD.go
+++ b/ru_MD/ru_MD.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"до н. э.", "н. э."},
erasNarrow: []string{"до н.э.", "н.э."},
erasWide: []string{"до Рождества Христова", "от Рождества Христова"},
- timezones: map[string]string{"MDT": "Макао, летнее время", "WESZ": "Западная Европа, летнее время", "AEDT": "Восточная Австралия, летнее время", "BT": "Бутан", "OESZ": "Восточная Европа, летнее время", "BOT": "Боливия", "WITA": "Центральная Индонезия", "JST": "Япония, стандартное время", "JDT": "Япония, летнее время", "AKDT": "Аляска, летнее время", "LHDT": "Лорд-Хау, летнее время", "MESZ": "Центральная Европа, летнее время", "HADT": "Гавайско-алеутское летнее время", "HKST": "Гонконг, летнее время", "ARST": "Аргентина, летнее время", "CHADT": "Чатем, летнее время", "SAST": "Южная Африка", "WIB": "Западная Индонезия", "ACST": "Центральная Австралия, стандартное время", "ACDT": "Центральная Австралия, летнее время", "EDT": "Восточная Америка, летнее время", "OEZ": "Восточная Европа, стандартное время", "GMT": "Среднее время по Гринвичу", "GFT": "Французская Гвиана", "PDT": "Тихоокеанское летнее время", "UYST": "Уругвай, летнее время", "AEST": "Восточная Австралия, стандартное время", "ChST": "Чаморро", "COST": "Колумбия, летнее время", "SGT": "Сингапур", "WAT": "Западная Африка, стандартное время", "AWST": "Западная Австралия, стандартное время", "CHAST": "Чатем, стандартное время", "AST": "Атлантическое стандартное время", "ART": "Аргентина, стандартное время", "PST": "Тихоокеанское стандартное время", "LHST": "Лорд-Хау, стандартное время", "CLST": "Чили, летнее время", "EST": "Восточная Америка, стандартное время", "COT": "Колумбия, стандартное время", "∅∅∅": "Амазонка, летнее время", "AWDT": "Западная Австралия, летнее время", "CST": "Центральная Америка, стандартное время", "CDT": "Центральная Америка, летнее время", "MEZ": "Центральная Европа, стандартное время", "ACWDT": "Центральная Австралия, западное летнее время", "WAST": "Западная Африка, летнее время", "HAT": "Ньюфаундленд, летнее время", "HKT": "Гонконг, стандартное время", "AKST": "Аляска, стандартное время", "WART": "Западная Аргентина, стандартное время", "UYT": "Уругвай, стандартное время", "VET": "Венесуэла", "ECT": "Эквадор", "ADT": "Атлантическое летнее время", "WARST": "Западная Аргентина, летнее время", "IST": "Индия", "MYT": "Малайзия", "NZST": "Новая Зеландия, стандартное время", "EAT": "Восточная Африка", "TMT": "Туркмения, стандартное время", "TMST": "Туркмения, летнее время", "SRT": "Суринам", "GYT": "Гайана", "CLT": "Чили, стандартное время", "HNT": "Ньюфаундленд, стандартное время", "MST": "Макао, стандартное время", "NZDT": "Новая Зеландия, летнее время", "WEZ": "Западная Европа, стандартное время", "ACWST": "Центральная Австралия, западное стандартное время", "CAT": "Центральная Африка", "HAST": "Гавайско-алеутское стандартное время", "WIT": "Восточная Индонезия"},
+ timezones: map[string]string{"MEZ": "Центральная Европа, стандартное время", "HKST": "Гонконг, летнее время", "CHAST": "Чатем, стандартное время", "ECT": "Эквадор", "ART": "Аргентина, стандартное время", "PST": "Тихоокеанское стандартное время", "GMT": "Среднее время по Гринвичу", "ChST": "Чаморро", "WIT": "Восточная Индонезия", "SRT": "Суринам", "CDT": "Центральная Америка, летнее время", "JST": "Япония, стандартное время", "JDT": "Япония, летнее время", "SGT": "Сингапур", "AKST": "Аляска, стандартное время", "WIB": "Западная Индонезия", "MDT": "Горное летнее время (США)", "ACST": "Центральная Австралия, стандартное время", "HKT": "Гонконг, стандартное время", "ACWST": "Центральная Австралия, западное стандартное время", "AKDT": "Аляска, летнее время", "BOT": "Боливия", "LHST": "Лорд-Хау, стандартное время", "PDT": "Тихоокеанское летнее время", "NZDT": "Новая Зеландия, летнее время", "WESZ": "Западная Европа, летнее время", "OESZ": "Восточная Европа, летнее время", "LHDT": "Лорд-Хау, летнее время", "CLST": "Чили, летнее время", "CHADT": "Чатем, летнее время", "AWDT": "Западная Австралия, летнее время", "NZST": "Новая Зеландия, стандартное время", "ARST": "Аргентина, летнее время", "MST": "Горное стандартное время (США)", "EAT": "Восточная Африка", "GFT": "Французская Гвиана", "VET": "Венесуэла", "IST": "Индия", "MESZ": "Центральная Европа, летнее время", "WEZ": "Западная Европа, стандартное время", "BT": "Бутан", "UYST": "Уругвай, летнее время", "WARST": "Западная Аргентина, летнее время", "WITA": "Центральная Индонезия", "EDT": "Восточная Америка, летнее время", "HNT": "Ньюфаундленд, стандартное время", "CAT": "Центральная Африка", "OEZ": "Восточная Европа, стандартное время", "WAST": "Западная Африка, летнее время", "HAT": "Ньюфаундленд, летнее время", "TMT": "Туркмения, стандартное время", "ADT": "Атлантическое летнее время", "WAT": "Западная Африка, стандартное время", "AEDT": "Восточная Австралия, летнее время", "AEST": "Восточная Австралия, стандартное время", "CLT": "Чили, стандартное время", "AWST": "Западная Австралия, стандартное время", "MYT": "Малайзия", "AST": "Атлантическое стандартное время", "UYT": "Уругвай, стандартное время", "HAST": "Гавайско-алеутское стандартное время", "CST": "Центральная Америка, стандартное время", "EST": "Восточная Америка, стандартное время", "COST": "Колумбия, летнее время", "COT": "Колумбия, стандартное время", "TMST": "Туркмения, летнее время", "GYT": "Гайана", "ACDT": "Центральная Австралия, летнее время", "HADT": "Гавайско-алеутское летнее время", "∅∅∅": "Амазонка, летнее время", "WART": "Западная Аргентина, стандартное время", "ACWDT": "Центральная Австралия, западное летнее время", "SAST": "Южная Африка"},
}
}
diff --git a/ru_MD/ru_MD_test.go b/ru_MD/ru_MD_test.go
new file mode 100644
index 00000000..2a97711e
--- /dev/null
+++ b/ru_MD/ru_MD_test.go
@@ -0,0 +1,1120 @@
+package ru_MD
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ru_MD"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ru_RU/ru_RU.go b/ru_RU/ru_RU.go
index eabbc3d0..20ef7998 100644
--- a/ru_RU/ru_RU.go
+++ b/ru_RU/ru_RU.go
@@ -48,7 +48,7 @@ func New() locales.Translator {
locale: "ru_RU",
pluralsCardinal: []locales.PluralRule{2, 4, 5, 6},
pluralsOrdinal: []locales.PluralRule{6},
- pluralsRange: []locales.PluralRule{5, 6, 2, 4},
+ pluralsRange: []locales.PluralRule{2, 4, 5, 6},
decimal: ",",
group: " ",
minus: "-",
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"до н. э.", "н. э."},
erasNarrow: []string{"до н.э.", "н.э."},
erasWide: []string{"до Рождества Христова", "от Рождества Христова"},
- timezones: map[string]string{"ACST": "Центральная Австралия, стандартное время", "COST": "Колумбия, летнее время", "JST": "Япония, стандартное время", "SAST": "Южная Африка", "GMT": "Среднее время по Гринвичу", "TMT": "Туркмения, стандартное время", "MST": "Макао, стандартное время", "ACDT": "Центральная Австралия, летнее время", "CHAST": "Чатем, стандартное время", "AEDT": "Восточная Австралия, летнее время", "OESZ": "Восточная Европа, летнее время", "BOT": "Боливия", "UYT": "Уругвай, стандартное время", "NZDT": "Новая Зеландия, летнее время", "HAT": "Ньюфаундленд, летнее время", "MESZ": "Центральная Европа, летнее время", "SGT": "Сингапур", "HNT": "Ньюфаундленд, стандартное время", "NZST": "Новая Зеландия, стандартное время", "ECT": "Эквадор", "COT": "Колумбия, стандартное время", "HADT": "Гавайско-алеутское летнее время", "WAT": "Западная Африка, стандартное время", "JDT": "Япония, летнее время", "PST": "Тихоокеанское стандартное время", "UYST": "Уругвай, летнее время", "BT": "Бутан", "WART": "Западная Аргентина, стандартное время", "ART": "Аргентина, стандартное время", "∅∅∅": "Амазонка, летнее время", "WEZ": "Западная Европа, стандартное время", "WAST": "Западная Африка, летнее время", "IST": "Индия", "LHST": "Лорд-Хау, стандартное время", "MEZ": "Центральная Европа, стандартное время", "WESZ": "Западная Европа, летнее время", "ADT": "Атлантическое летнее время", "HAST": "Гавайско-алеутское стандартное время", "CST": "Центральная Америка, стандартное время", "ChST": "Чаморро", "AST": "Атлантическое стандартное время", "MYT": "Малайзия", "ACWDT": "Центральная Австралия, западное летнее время", "EST": "Восточная Америка, стандартное время", "EDT": "Восточная Америка, летнее время", "SRT": "Суринам", "AKST": "Аляска, стандартное время", "AWST": "Западная Австралия, стандартное время", "HKT": "Гонконг, стандартное время", "WARST": "Западная Аргентина, летнее время", "PDT": "Тихоокеанское летнее время", "ACWST": "Центральная Австралия, западное стандартное время", "CAT": "Центральная Африка", "HKST": "Гонконг, летнее время", "EAT": "Восточная Африка", "MDT": "Макао, летнее время", "AWDT": "Западная Австралия, летнее время", "CHADT": "Чатем, летнее время", "WIT": "Восточная Индонезия", "OEZ": "Восточная Европа, стандартное время", "CDT": "Центральная Америка, летнее время", "CLST": "Чили, летнее время", "VET": "Венесуэла", "AEST": "Восточная Австралия, стандартное время", "WITA": "Центральная Индонезия", "TMST": "Туркмения, летнее время", "LHDT": "Лорд-Хау, летнее время", "AKDT": "Аляска, летнее время", "ARST": "Аргентина, летнее время", "GFT": "Французская Гвиана", "GYT": "Гайана", "CLT": "Чили, стандартное время", "WIB": "Западная Индонезия"},
+ timezones: map[string]string{"ACDT": "Центральная Австралия, летнее время", "HKT": "Гонконг, стандартное время", "ADT": "Атлантическое летнее время", "HKST": "Гонконг, летнее время", "HADT": "Гавайско-алеутское летнее время", "PST": "Тихоокеанское стандартное время", "WAST": "Западная Африка, летнее время", "GMT": "Среднее время по Гринвичу", "CST": "Центральная Америка, стандартное время", "HAST": "Гавайско-алеутское стандартное время", "TMT": "Туркмения, стандартное время", "WESZ": "Западная Европа, летнее время", "CDT": "Центральная Америка, летнее время", "WARST": "Западная Аргентина, летнее время", "ARST": "Аргентина, летнее время", "HAT": "Ньюфаундленд, летнее время", "SGT": "Сингапур", "ChST": "Чаморро", "GYT": "Гайана", "CHAST": "Чатем, стандартное время", "CLST": "Чили, летнее время", "WIT": "Восточная Индонезия", "LHDT": "Лорд-Хау, летнее время", "NZST": "Новая Зеландия, стандартное время", "MEZ": "Центральная Европа, стандартное время", "COT": "Колумбия, стандартное время", "CAT": "Центральная Африка", "OESZ": "Восточная Европа, летнее время", "MDT": "Горное летнее время (США)", "WAT": "Западная Африка, стандартное время", "CLT": "Чили, стандартное время", "SAST": "Южная Африка", "UYST": "Уругвай, летнее время", "BT": "Бутан", "OEZ": "Восточная Европа, стандартное время", "LHST": "Лорд-Хау, стандартное время", "AWST": "Западная Австралия, стандартное время", "BOT": "Боливия", "WIB": "Западная Индонезия", "TMST": "Туркмения, летнее время", "MST": "Горное стандартное время (США)", "JST": "Япония, стандартное время", "PDT": "Тихоокеанское летнее время", "WEZ": "Западная Европа, стандартное время", "AEST": "Восточная Австралия, стандартное время", "ACST": "Центральная Австралия, стандартное время", "ACWDT": "Центральная Австралия, западное летнее время", "IST": "Индия", "AEDT": "Восточная Австралия, летнее время", "SRT": "Суринам", "GFT": "Французская Гвиана", "ART": "Аргентина, стандартное время", "NZDT": "Новая Зеландия, летнее время", "EST": "Восточная Америка, стандартное время", "VET": "Венесуэла", "WITA": "Центральная Индонезия", "AST": "Атлантическое стандартное время", "MESZ": "Центральная Европа, летнее время", "COST": "Колумбия, летнее время", "UYT": "Уругвай, стандартное время", "EAT": "Восточная Африка", "WART": "Западная Аргентина, стандартное время", "ACWST": "Центральная Австралия, западное стандартное время", "AWDT": "Западная Австралия, летнее время", "∅∅∅": "Амазонка, летнее время", "MYT": "Малайзия", "CHADT": "Чатем, летнее время", "AKST": "Аляска, стандартное время", "AKDT": "Аляска, летнее время", "EDT": "Восточная Америка, летнее время", "HNT": "Ньюфаундленд, стандартное время", "ECT": "Эквадор", "JDT": "Япония, летнее время"},
}
}
diff --git a/ru_RU/ru_RU_test.go b/ru_RU/ru_RU_test.go
new file mode 100644
index 00000000..1dec12c9
--- /dev/null
+++ b/ru_RU/ru_RU_test.go
@@ -0,0 +1,1120 @@
+package ru_RU
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ru_RU"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ru_UA/ru_UA.go b/ru_UA/ru_UA.go
index 462579ca..da5db31a 100644
--- a/ru_UA/ru_UA.go
+++ b/ru_UA/ru_UA.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"до н. э.", "н. э."},
erasNarrow: []string{"до н.э.", "н.э."},
erasWide: []string{"до Рождества Христова", "от Рождества Христова"},
- timezones: map[string]string{"SAST": "Южная Африка", "CAT": "Центральная Африка", "NZST": "Новая Зеландия, стандартное время", "ACWST": "Центральная Австралия, западное стандартное время", "EDT": "Восточная Америка, летнее время", "COT": "Колумбия, стандартное время", "HKST": "Гонконг, летнее время", "MDT": "Макао, летнее время", "ACDT": "Центральная Австралия, летнее время", "VET": "Венесуэла", "ECT": "Эквадор", "HKT": "Гонконг, стандартное время", "LHDT": "Лорд-Хау, летнее время", "CDT": "Центральная Америка, летнее время", "HADT": "Гавайско-алеутское летнее время", "HAT": "Ньюфаундленд, летнее время", "EST": "Восточная Америка, стандартное время", "HAST": "Гавайско-алеутское стандартное время", "OEZ": "Восточная Европа, стандартное время", "CLT": "Чили, стандартное время", "COST": "Колумбия, летнее время", "ADT": "Атлантическое летнее время", "WART": "Западная Аргентина, стандартное время", "IST": "Индия", "AWDT": "Западная Австралия, летнее время", "JDT": "Япония, летнее время", "PDT": "Тихоокеанское летнее время", "AKDT": "Аляска, летнее время", "CST": "Центральная Америка, стандартное время", "MEZ": "Центральная Европа, стандартное время", "WEZ": "Западная Европа, стандартное время", "AEDT": "Восточная Австралия, летнее время", "WIT": "Восточная Индонезия", "ACST": "Центральная Австралия, стандартное время", "AKST": "Аляска, стандартное время", "ARST": "Аргентина, летнее время", "UYST": "Уругвай, летнее время", "CLST": "Чили, летнее время", "TMT": "Туркмения, стандартное время", "LHST": "Лорд-Хау, стандартное время", "PST": "Тихоокеанское стандартное время", "WAT": "Западная Африка, стандартное время", "BT": "Бутан", "HNT": "Ньюфаундленд, стандартное время", "NZDT": "Новая Зеландия, летнее время", "ChST": "Чаморро", "WESZ": "Западная Европа, летнее время", "SGT": "Сингапур", "WITA": "Центральная Индонезия", "ART": "Аргентина, стандартное время", "TMST": "Туркмения, летнее время", "ACWDT": "Центральная Австралия, западное летнее время", "∅∅∅": "Амазонка, летнее время", "MST": "Макао, стандартное время", "MYT": "Малайзия", "WARST": "Западная Аргентина, летнее время", "GMT": "Среднее время по Гринвичу", "CHAST": "Чатем, стандартное время", "GYT": "Гайана", "JST": "Япония, стандартное время", "SRT": "Суринам", "UYT": "Уругвай, стандартное время", "MESZ": "Центральная Европа, летнее время", "GFT": "Французская Гвиана", "OESZ": "Восточная Европа, летнее время", "EAT": "Восточная Африка", "CHADT": "Чатем, летнее время", "BOT": "Боливия", "AEST": "Восточная Австралия, стандартное время", "AST": "Атлантическое стандартное время", "WAST": "Западная Африка, летнее время", "WIB": "Западная Индонезия", "AWST": "Западная Австралия, стандартное время"},
+ timezones: map[string]string{"JDT": "Япония, летнее время", "AST": "Атлантическое стандартное время", "CDT": "Центральная Америка, летнее время", "OESZ": "Восточная Европа, летнее время", "LHDT": "Лорд-Хау, летнее время", "UYT": "Уругвай, стандартное время", "WITA": "Центральная Индонезия", "MEZ": "Центральная Европа, стандартное время", "IST": "Индия", "OEZ": "Восточная Европа, стандартное время", "AWDT": "Западная Австралия, летнее время", "GYT": "Гайана", "EAT": "Восточная Африка", "ADT": "Атлантическое летнее время", "PDT": "Тихоокеанское летнее время", "LHST": "Лорд-Хау, стандартное время", "WIT": "Восточная Индонезия", "VET": "Венесуэла", "ACWST": "Центральная Австралия, западное стандартное время", "HNT": "Ньюфаундленд, стандартное время", "TMST": "Туркмения, летнее время", "CLST": "Чили, летнее время", "COT": "Колумбия, стандартное время", "WAST": "Западная Африка, летнее время", "CHADT": "Чатем, летнее время", "WARST": "Западная Аргентина, летнее время", "CST": "Центральная Америка, стандартное время", "AWST": "Западная Австралия, стандартное время", "ChST": "Чаморро", "MDT": "Горное летнее время (США)", "UYST": "Уругвай, летнее время", "HAT": "Ньюфаундленд, летнее время", "SGT": "Сингапур", "SRT": "Суринам", "ART": "Аргентина, стандартное время", "AKST": "Аляска, стандартное время", "NZDT": "Новая Зеландия, летнее время", "SAST": "Южная Африка", "HKT": "Гонконг, стандартное время", "HAST": "Гавайско-алеутское стандартное время", "BOT": "Боливия", "∅∅∅": "Акри летнее время", "WEZ": "Западная Европа, стандартное время", "ACST": "Центральная Австралия, стандартное время", "JST": "Япония, стандартное время", "AKDT": "Аляска, летнее время", "HADT": "Гавайско-алеутское летнее время", "CLT": "Чили, стандартное время", "TMT": "Туркмения, стандартное время", "BT": "Бутан", "WART": "Западная Аргентина, стандартное время", "ECT": "Эквадор", "MESZ": "Центральная Европа, летнее время", "CAT": "Центральная Африка", "AEDT": "Восточная Австралия, летнее время", "ACWDT": "Центральная Австралия, западное летнее время", "ARST": "Аргентина, летнее время", "EDT": "Восточная Америка, летнее время", "PST": "Тихоокеанское стандартное время", "HKST": "Гонконг, летнее время", "NZST": "Новая Зеландия, стандартное время", "COST": "Колумбия, летнее время", "WIB": "Западная Индонезия", "GFT": "Французская Гвиана", "EST": "Восточная Америка, стандартное время", "WESZ": "Западная Европа, летнее время", "WAT": "Западная Африка, стандартное время", "AEST": "Восточная Австралия, стандартное время", "GMT": "Среднее время по Гринвичу", "ACDT": "Центральная Австралия, летнее время", "CHAST": "Чатем, стандартное время", "MST": "Горное стандартное время (США)", "MYT": "Малайзия"},
}
}
@@ -102,8 +102,8 @@ func (ru *ru_UA) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
n := math.Abs(num)
i := int64(n)
- iMod100 := i % 100
iMod10 := i % 10
+ iMod100 := i % 100
if v == 0 && iMod10 == 1 && iMod100 != 11 {
return locales.PluralRuleOne
diff --git a/ru_UA/ru_UA_test.go b/ru_UA/ru_UA_test.go
new file mode 100644
index 00000000..1c4c07eb
--- /dev/null
+++ b/ru_UA/ru_UA_test.go
@@ -0,0 +1,1120 @@
+package ru_UA
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ru_UA"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/rw/rw.go b/rw/rw.go
index cef119c9..66f8363f 100644
--- a/rw/rw.go
+++ b/rw/rw.go
@@ -62,7 +62,7 @@ func New() locales.Translator {
monthsWide: []string{"", "Mutarama", "Gashyantare", "Werurwe", "Mata", "Gicuransi", "Kamena", "Nyakanga", "Kanama", "Nzeli", "Ukwakira", "Ugushyingo", "Ukuboza"},
daysAbbreviated: []string{"cyu.", "mbe.", "kab.", "gtu.", "kan.", "gnu.", "gnd."},
daysWide: []string{"Ku cyumweru", "Kuwa mbere", "Kuwa kabiri", "Kuwa gatatu", "Kuwa kane", "Kuwa gatanu", "Kuwa gatandatu"},
- timezones: map[string]string{"ARST": "ARST", "EAT": "EAT", "PST": "PST", "WEZ": "WEZ", "COST": "COST", "CDT": "CDT", "EDT": "EDT", "GFT": "GFT", "WART": "WART", "CAT": "CAT", "WITA": "WITA", "BOT": "BOT", "MEZ": "MEZ", "AEDT": "AEDT", "WARST": "WARST", "OESZ": "OESZ", "SRT": "SRT", "AKDT": "AKDT", "CST": "CST", "IST": "IST", "MYT": "MYT", "NZST": "NZST", "VET": "VET", "HAT": "HAT", "WIB": "WIB", "PDT": "PDT", "UYST": "UYST", "MST": "MST", "LHDT": "LHDT", "JST": "JST", "WIT": "WIT", "HAST": "HAST", "NZDT": "NZDT", "ECT": "ECT", "COT": "COT", "GYT": "GYT", "EST": "EST", "HKT": "HKT", "WAST": "WAST", "BT": "BT", "TMST": "TMST", "AST": "AST", "ADT": "ADT", "HADT": "HADT", "UYT": "UYT", "ChST": "ChST", "CLT": "CLT", "TMT": "TMT", "ACST": "ACST", "AKST": "AKST", "AWST": "AWST", "∅∅∅": "∅∅∅", "ACWST": "ACWST", "ACWDT": "ACWDT", "AEST": "AEST", "HNT": "HNT", "ART": "ART", "MDT": "MDT", "CHAST": "CHAST", "CLST": "CLST", "MESZ": "MESZ", "WESZ": "WESZ", "HKST": "HKST", "LHST": "LHST", "JDT": "JDT", "AWDT": "AWDT", "OEZ": "OEZ", "ACDT": "ACDT", "SGT": "SGT", "SAST": "SAST", "WAT": "WAT", "CHADT": "CHADT", "GMT": "GMT"},
+ timezones: map[string]string{"ChST": "ChST", "AKDT": "AKDT", "JST": "JST", "SAST": "SAST", "PST": "PST", "WAT": "WAT", "AEDT": "AEDT", "LHDT": "LHDT", "MDT": "MDT", "WIT": "WIT", "CDT": "CDT", "SRT": "SRT", "AWDT": "AWDT", "IST": "IST", "MEZ": "MEZ", "NZST": "NZST", "GYT": "GYT", "∅∅∅": "∅∅∅", "WARST": "WARST", "HKT": "HKT", "ECT": "ECT", "JDT": "JDT", "HADT": "HADT", "WEZ": "WEZ", "HAT": "HAT", "SGT": "SGT", "GMT": "GMT", "CHADT": "CHADT", "PDT": "PDT", "TMST": "TMST", "MST": "MST", "CLT": "CLT", "HKST": "HKST", "VET": "VET", "EDT": "EDT", "WESZ": "WESZ", "COST": "COST", "WIB": "WIB", "EST": "EST", "ACWDT": "ACWDT", "ART": "ART", "BOT": "BOT", "WAST": "WAST", "HNT": "HNT", "UYST": "UYST", "ARST": "ARST", "CLST": "CLST", "ACST": "ACST", "LHST": "LHST", "WART": "WART", "ADT": "ADT", "WITA": "WITA", "MESZ": "MESZ", "MYT": "MYT", "UYT": "UYT", "CHAST": "CHAST", "ACWST": "ACWST", "AWST": "AWST", "NZDT": "NZDT", "AEST": "AEST", "BT": "BT", "CAT": "CAT", "COT": "COT", "TMT": "TMT", "CST": "CST", "AKST": "AKST", "AST": "AST", "HAST": "HAST", "OEZ": "OEZ", "EAT": "EAT", "GFT": "GFT", "OESZ": "OESZ", "ACDT": "ACDT"},
}
}
@@ -118,7 +118,7 @@ func (rw *rw) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (rw *rw) MonthsNarrow() []string {
- return rw.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/rw/rw_test.go b/rw/rw_test.go
new file mode 100644
index 00000000..4dae61cb
--- /dev/null
+++ b/rw/rw_test.go
@@ -0,0 +1,1120 @@
+package rw
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "rw"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/rw_RW/rw_RW.go b/rw_RW/rw_RW.go
index 6838ce21..3319e04d 100644
--- a/rw_RW/rw_RW.go
+++ b/rw_RW/rw_RW.go
@@ -62,7 +62,7 @@ func New() locales.Translator {
monthsWide: []string{"", "Mutarama", "Gashyantare", "Werurwe", "Mata", "Gicuransi", "Kamena", "Nyakanga", "Kanama", "Nzeli", "Ukwakira", "Ugushyingo", "Ukuboza"},
daysAbbreviated: []string{"cyu.", "mbe.", "kab.", "gtu.", "kan.", "gnu.", "gnd."},
daysWide: []string{"Ku cyumweru", "Kuwa mbere", "Kuwa kabiri", "Kuwa gatatu", "Kuwa kane", "Kuwa gatanu", "Kuwa gatandatu"},
- timezones: map[string]string{"AWST": "AWST", "WARST": "WARST", "GYT": "GYT", "ECT": "ECT", "EST": "EST", "WART": "WART", "WIT": "WIT", "IST": "IST", "EAT": "EAT", "WEZ": "WEZ", "ADT": "ADT", "SAST": "SAST", "HAST": "HAST", "HKST": "HKST", "WIB": "WIB", "ART": "ART", "UYT": "UYT", "CHADT": "CHADT", "ACWDT": "ACWDT", "HAT": "HAT", "MYT": "MYT", "MEZ": "MEZ", "SGT": "SGT", "GMT": "GMT", "SRT": "SRT", "NZDT": "NZDT", "MESZ": "MESZ", "COT": "COT", "HADT": "HADT", "HKT": "HKT", "OEZ": "OEZ", "BOT": "BOT", "CST": "CST", "AEDT": "AEDT", "CHAST": "CHAST", "UYST": "UYST", "WESZ": "WESZ", "CAT": "CAT", "AST": "AST", "TMT": "TMT", "TMST": "TMST", "LHDT": "LHDT", "JDT": "JDT", "ACDT": "ACDT", "PST": "PST", "NZST": "NZST", "BT": "BT", "HNT": "HNT", "GFT": "GFT", "MST": "MST", "JST": "JST", "AEST": "AEST", "CLT": "CLT", "∅∅∅": "∅∅∅", "PDT": "PDT", "ChST": "ChST", "WAT": "WAT", "WAST": "WAST", "OESZ": "OESZ", "ACWST": "ACWST", "ARST": "ARST", "AWDT": "AWDT", "CLST": "CLST", "VET": "VET", "MDT": "MDT", "AKST": "AKST", "EDT": "EDT", "COST": "COST", "WITA": "WITA", "ACST": "ACST", "LHST": "LHST", "AKDT": "AKDT", "CDT": "CDT"},
+ timezones: map[string]string{"LHST": "LHST", "ACST": "ACST", "AWDT": "AWDT", "HKT": "HKT", "MEZ": "MEZ", "EST": "EST", "HNT": "HNT", "WIT": "WIT", "CST": "CST", "GYT": "GYT", "WARST": "WARST", "HAST": "HAST", "TMST": "TMST", "UYST": "UYST", "∅∅∅": "∅∅∅", "SGT": "SGT", "AEST": "AEST", "MYT": "MYT", "GFT": "GFT", "JDT": "JDT", "AKST": "AKST", "ChST": "ChST", "CLST": "CLST", "EAT": "EAT", "AEDT": "AEDT", "CLT": "CLT", "PDT": "PDT", "IST": "IST", "COT": "COT", "CAT": "CAT", "WAST": "WAST", "VET": "VET", "CHADT": "CHADT", "OESZ": "OESZ", "ACDT": "ACDT", "WEZ": "WEZ", "UYT": "UYT", "ECT": "ECT", "ARST": "ARST", "ADT": "ADT", "COST": "COST", "TMT": "TMT", "WAT": "WAT", "PST": "PST", "NZST": "NZST", "HKST": "HKST", "MESZ": "MESZ", "NZDT": "NZDT", "ACWST": "ACWST", "EDT": "EDT", "WIB": "WIB", "GMT": "GMT", "MDT": "MDT", "OEZ": "OEZ", "ART": "ART", "HADT": "HADT", "SRT": "SRT", "CDT": "CDT", "WART": "WART", "CHAST": "CHAST", "AWST": "AWST", "WESZ": "WESZ", "MST": "MST", "LHDT": "LHDT", "BOT": "BOT", "HAT": "HAT", "BT": "BT", "AST": "AST", "ACWDT": "ACWDT", "SAST": "SAST", "WITA": "WITA", "JST": "JST", "AKDT": "AKDT"},
}
}
@@ -118,7 +118,7 @@ func (rw *rw_RW) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (rw *rw_RW) MonthsNarrow() []string {
- return rw.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/rw_RW/rw_RW_test.go b/rw_RW/rw_RW_test.go
new file mode 100644
index 00000000..5556fab3
--- /dev/null
+++ b/rw_RW/rw_RW_test.go
@@ -0,0 +1,1120 @@
+package rw_RW
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "rw_RW"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/rwk/rwk.go b/rwk/rwk.go
index 53c5c622..40f3fcb9 100644
--- a/rwk/rwk.go
+++ b/rwk/rwk.go
@@ -59,7 +59,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"KK", "BK"},
erasNarrow: []string{"", ""},
erasWide: []string{"Kabla ya Kristu", "Baada ya Kristu"},
- timezones: map[string]string{"HNT": "HNT", "UYT": "UYT", "NZDT": "NZDT", "HAT": "HAT", "UYST": "UYST", "HADT": "HADT", "MST": "MST", "PST": "PST", "BOT": "BOT", "HKST": "HKST", "GMT": "GMT", "LHST": "LHST", "CLST": "CLST", "EDT": "EDT", "ACST": "ACST", "AKDT": "AKDT", "AEDT": "AEDT", "ChST": "ChST", "CHADT": "CHADT", "AEST": "AEST", "WAST": "WAST", "GYT": "GYT", "AKST": "AKST", "LHDT": "LHDT", "CST": "CST", "HAST": "HAST", "IST": "IST", "JDT": "JDT", "WESZ": "WESZ", "ACWST": "ACWST", "MDT": "MDT", "NZST": "NZST", "WAT": "WAT", "MYT": "MYT", "AWDT": "AWDT", "CLT": "CLT", "ECT": "ECT", "OEZ": "OEZ", "TMT": "TMT", "TMST": "TMST", "ACDT": "ACDT", "AST": "AST", "WIT": "WIT", "COT": "COT", "GFT": "GFT", "WIB": "WIB", "∅∅∅": "∅∅∅", "MEZ": "MEZ", "HKT": "HKT", "OESZ": "OESZ", "PDT": "PDT", "MESZ": "MESZ", "WART": "WART", "EST": "EST", "ADT": "ADT", "EAT": "EAT", "AWST": "AWST", "CDT": "CDT", "CHAST": "CHAST", "WITA": "WITA", "SAST": "SAST", "SGT": "SGT", "WARST": "WARST", "ART": "ART", "WEZ": "WEZ", "ACWDT": "ACWDT", "CAT": "CAT", "COST": "COST", "BT": "BT", "ARST": "ARST", "JST": "JST", "SRT": "SRT", "VET": "VET"},
+ timezones: map[string]string{"AEDT": "AEDT", "OESZ": "OESZ", "SRT": "SRT", "HKT": "HKT", "ARST": "ARST", "HADT": "HADT", "COT": "COT", "TMT": "TMT", "IST": "IST", "NZST": "NZST", "TMST": "TMST", "WIT": "WIT", "ECT": "ECT", "MESZ": "MESZ", "LHST": "LHST", "MST": "MST", "WAST": "WAST", "AKDT": "AKDT", "CLST": "CLST", "ACWDT": "ACWDT", "WITA": "WITA", "PST": "PST", "MEZ": "MEZ", "NZDT": "NZDT", "WAT": "WAT", "MDT": "MDT", "MYT": "MYT", "UYT": "UYT", "ART": "ART", "WEZ": "WEZ", "HAT": "HAT", "GFT": "GFT", "AST": "AST", "EDT": "EDT", "BOT": "BOT", "SGT": "SGT", "AEST": "AEST", "CHADT": "CHADT", "AWDT": "AWDT", "JST": "JST", "HNT": "HNT", "UYST": "UYST", "VET": "VET", "CAT": "CAT", "WARST": "WARST", "WART": "WART", "EST": "EST", "GMT": "GMT", "∅∅∅": "∅∅∅", "CST": "CST", "CDT": "CDT", "ChST": "ChST", "GYT": "GYT", "CLT": "CLT", "EAT": "EAT", "AWST": "AWST", "HAST": "HAST", "OEZ": "OEZ", "LHDT": "LHDT", "JDT": "JDT", "AKST": "AKST", "PDT": "PDT", "BT": "BT", "ACDT": "ACDT", "ACWST": "ACWST", "COST": "COST", "WIB": "WIB", "CHAST": "CHAST", "HKST": "HKST", "ADT": "ADT", "SAST": "SAST", "WESZ": "WESZ", "ACST": "ACST"},
}
}
diff --git a/rwk/rwk_test.go b/rwk/rwk_test.go
new file mode 100644
index 00000000..f84387f7
--- /dev/null
+++ b/rwk/rwk_test.go
@@ -0,0 +1,1120 @@
+package rwk
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "rwk"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/rwk_TZ/rwk_TZ.go b/rwk_TZ/rwk_TZ.go
index 8d3f1d34..69bcb00e 100644
--- a/rwk_TZ/rwk_TZ.go
+++ b/rwk_TZ/rwk_TZ.go
@@ -59,7 +59,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"KK", "BK"},
erasNarrow: []string{"", ""},
erasWide: []string{"Kabla ya Kristu", "Baada ya Kristu"},
- timezones: map[string]string{"CAT": "CAT", "HADT": "HADT", "MESZ": "MESZ", "JDT": "JDT", "AKST": "AKST", "AWST": "AWST", "COST": "COST", "WAST": "WAST", "IST": "IST", "OEZ": "OEZ", "MYT": "MYT", "UYT": "UYT", "CDT": "CDT", "WEZ": "WEZ", "UYST": "UYST", "TMST": "TMST", "AKDT": "AKDT", "PST": "PST", "CLST": "CLST", "EST": "EST", "ACDT": "ACDT", "ChST": "ChST", "WARST": "WARST", "BT": "BT", "WAT": "WAT", "OESZ": "OESZ", "ART": "ART", "NZST": "NZST", "ACWST": "ACWST", "JST": "JST", "MEZ": "MEZ", "HAT": "HAT", "WITA": "WITA", "LHDT": "LHDT", "PDT": "PDT", "AWDT": "AWDT", "ADT": "ADT", "MST": "MST", "VET": "VET", "ACWDT": "ACWDT", "∅∅∅": "∅∅∅", "COT": "COT", "CHADT": "CHADT", "ECT": "ECT", "HKST": "HKST", "ACST": "ACST", "CLT": "CLT", "AEST": "AEST", "WIT": "WIT", "ARST": "ARST", "CHAST": "CHAST", "WART": "WART", "GMT": "GMT", "LHST": "LHST", "EAT": "EAT", "GYT": "GYT", "WESZ": "WESZ", "HAST": "HAST", "HKT": "HKT", "GFT": "GFT", "WIB": "WIB", "TMT": "TMT", "SRT": "SRT", "BOT": "BOT", "MDT": "MDT", "AEDT": "AEDT", "EDT": "EDT", "SGT": "SGT", "HNT": "HNT", "AST": "AST", "SAST": "SAST", "CST": "CST", "NZDT": "NZDT"},
+ timezones: map[string]string{"WESZ": "WESZ", "OEZ": "OEZ", "GMT": "GMT", "WIT": "WIT", "CHADT": "CHADT", "SAST": "SAST", "TMT": "TMT", "AEST": "AEST", "EAT": "EAT", "HKST": "HKST", "ADT": "ADT", "AKDT": "AKDT", "HADT": "HADT", "HAT": "HAT", "MST": "MST", "MYT": "MYT", "ECT": "ECT", "AST": "AST", "MESZ": "MESZ", "∅∅∅": "∅∅∅", "WAST": "WAST", "HNT": "HNT", "OESZ": "OESZ", "NZST": "NZST", "HKT": "HKT", "CHAST": "CHAST", "ACWDT": "ACWDT", "PST": "PST", "MEZ": "MEZ", "CLST": "CLST", "AWST": "AWST", "COST": "COST", "LHDT": "LHDT", "WITA": "WITA", "WIB": "WIB", "TMST": "TMST", "AEDT": "AEDT", "WART": "WART", "VET": "VET", "GYT": "GYT", "WARST": "WARST", "ARST": "ARST", "JDT": "JDT", "HAST": "HAST", "WEZ": "WEZ", "SGT": "SGT", "ChST": "ChST", "ACWST": "ACWST", "AWDT": "AWDT", "EDT": "EDT", "BOT": "BOT", "CDT": "CDT", "ACST": "ACST", "NZDT": "NZDT", "MDT": "MDT", "UYST": "UYST", "ACDT": "ACDT", "COT": "COT", "AKST": "AKST", "SRT": "SRT", "UYT": "UYT", "JST": "JST", "IST": "IST", "PDT": "PDT", "CAT": "CAT", "WAT": "WAT", "LHST": "LHST", "ART": "ART", "EST": "EST", "BT": "BT", "CLT": "CLT", "CST": "CST", "GFT": "GFT"},
}
}
diff --git a/rwk_TZ/rwk_TZ_test.go b/rwk_TZ/rwk_TZ_test.go
new file mode 100644
index 00000000..ec161074
--- /dev/null
+++ b/rwk_TZ/rwk_TZ_test.go
@@ -0,0 +1,1120 @@
+package rwk_TZ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "rwk_TZ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/sah/sah.go b/sah/sah.go
index 1ec3958d..298e8475 100644
--- a/sah/sah.go
+++ b/sah/sah.go
@@ -69,7 +69,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"б. э. и.", "б. э"},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"ACDT": "ACDT", "TMT": "TMT", "MESZ": "MESZ", "VET": "VET", "ADT": "ADT", "GMT": "GMT", "ACST": "ACST", "NZST": "NZST", "AEDT": "AEDT", "ECT": "ECT", "HKT": "HKT", "OEZ": "OEZ", "HNT": "HNT", "GFT": "GFT", "GYT": "GYT", "EST": "EST", "EDT": "EDT", "COT": "COT", "COST": "COST", "BT": "BT", "ARST": "ARST", "SGT": "SGT", "TMST": "TMST", "PST": "PST", "MST": "MST", "MEZ": "MEZ", "HKST": "HKST", "HAT": "HAT", "SRT": "SRT", "AEST": "AEST", "CLT": "CLT", "HAST": "HAST", "CDT": "CDT", "WAST": "WAST", "ACWDT": "ACWDT", "WIT": "WIT", "IST": "IST", "ChST": "ChST", "SAST": "SAST", "CST": "CST", "NZDT": "NZDT", "BOT": "BOT", "CHAST": "CHAST", "CLST": "CLST", "WAT": "WAT", "WITA": "WITA", "AKDT": "AKDT", "LHDT": "LHDT", "JDT": "JDT", "UYT": "UYT", "WEZ": "WEZ", "ACWST": "ACWST", "HADT": "HADT", "WIB": "WIB", "∅∅∅": "∅∅∅", "CAT": "CAT", "AST": "AST", "CHADT": "CHADT", "AKST": "AKST", "LHST": "LHST", "OESZ": "OESZ", "ART": "ART", "PDT": "PDT", "AWDT": "AWDT", "MYT": "MYT", "UYST": "UYST", "WESZ": "WESZ", "WART": "WART", "MDT": "MDT", "AWST": "AWST", "JST": "JST", "WARST": "WARST", "EAT": "EAT"},
+ timezones: map[string]string{"∅∅∅": "∅∅∅", "HAT": "HAT", "COT": "COT", "AEST": "AEST", "WARST": "WARST", "CAT": "CAT", "LHST": "LHST", "HKST": "HKST", "ACWST": "ACWST", "AWDT": "AWDT", "JDT": "JDT", "BOT": "BOT", "SGT": "SGT", "BT": "BT", "CST": "CST", "AST": "AST", "ADT": "ADT", "EAT": "EAT", "MEZ": "MEZ", "TMT": "TMT", "GMT": "GMT", "MYT": "MYT", "CHADT": "CHADT", "VET": "VET", "MDT": "MDT", "HAST": "HAST", "ChST": "ChST", "OESZ": "OESZ", "UYST": "UYST", "CDT": "CDT", "AWST": "AWST", "EDT": "EDT", "MESZ": "MESZ", "NZST": "NZST", "WAT": "WAT", "WEZ": "WEZ", "HADT": "HADT", "ACWDT": "ACWDT", "WAST": "WAST", "WIT": "WIT", "WART": "WART", "ECT": "ECT", "WITA": "WITA", "JST": "JST", "TMST": "TMST", "OEZ": "OEZ", "CLT": "CLT", "EST": "EST", "SAST": "SAST", "COST": "COST", "CLST": "CLST", "ACDT": "ACDT", "HKT": "HKT", "AKST": "AKST", "AKDT": "AKDT", "WIB": "WIB", "AEDT": "AEDT", "LHDT": "LHDT", "PST": "PST", "CHAST": "CHAST", "MST": "MST", "PDT": "PDT", "WESZ": "WESZ", "HNT": "HNT", "ART": "ART", "ARST": "ARST", "ACST": "ACST", "SRT": "SRT", "GFT": "GFT", "IST": "IST", "NZDT": "NZDT", "GYT": "GYT", "UYT": "UYT"},
}
}
diff --git a/sah/sah_test.go b/sah/sah_test.go
new file mode 100644
index 00000000..75f65b05
--- /dev/null
+++ b/sah/sah_test.go
@@ -0,0 +1,1120 @@
+package sah
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "sah"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/sah_RU/sah_RU.go b/sah_RU/sah_RU.go
index 29c74390..85ed3dda 100644
--- a/sah_RU/sah_RU.go
+++ b/sah_RU/sah_RU.go
@@ -69,7 +69,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"б. э. и.", "б. э"},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"AKST": "AKST", "AKDT": "AKDT", "JST": "JST", "WESZ": "WESZ", "HAST": "HAST", "IST": "IST", "ART": "ART", "GYT": "GYT", "MESZ": "MESZ", "ADT": "ADT", "GFT": "GFT", "AWDT": "AWDT", "MEZ": "MEZ", "UYT": "UYT", "WIT": "WIT", "∅∅∅": "∅∅∅", "WART": "WART", "HNT": "HNT", "WEZ": "WEZ", "HKST": "HKST", "WAT": "WAT", "MDT": "MDT", "ARST": "ARST", "AWST": "AWST", "JDT": "JDT", "SRT": "SRT", "BOT": "BOT", "CAT": "CAT", "LHDT": "LHDT", "UYST": "UYST", "ACWDT": "ACWDT", "EST": "EST", "AST": "AST", "HADT": "HADT", "SGT": "SGT", "GMT": "GMT", "MST": "MST", "TMT": "TMT", "CHAST": "CHAST", "OESZ": "OESZ", "HAT": "HAT", "MYT": "MYT", "AEST": "AEST", "WAST": "WAST", "PDT": "PDT", "TMST": "TMST", "LHST": "LHST", "CHADT": "CHADT", "ECT": "ECT", "SAST": "SAST", "BT": "BT", "EAT": "EAT", "NZST": "NZST", "CLT": "CLT", "COT": "COT", "COST": "COST", "PST": "PST", "AEDT": "AEDT", "VET": "VET", "EDT": "EDT", "WITA": "WITA", "CST": "CST", "ACWST": "ACWST", "WARST": "WARST", "ACST": "ACST", "ACDT": "ACDT", "CDT": "CDT", "NZDT": "NZDT", "ChST": "ChST", "CLST": "CLST", "HKT": "HKT", "OEZ": "OEZ", "WIB": "WIB"},
+ timezones: map[string]string{"GYT": "GYT", "CLST": "CLST", "ACDT": "ACDT", "ECT": "ECT", "IST": "IST", "EST": "EST", "CAT": "CAT", "WEZ": "WEZ", "EDT": "EDT", "WAT": "WAT", "AEDT": "AEDT", "MEZ": "MEZ", "GFT": "GFT", "JST": "JST", "HAST": "HAST", "SAST": "SAST", "PDT": "PDT", "BT": "BT", "MST": "MST", "HKT": "HKT", "JDT": "JDT", "ACWST": "ACWST", "MESZ": "MESZ", "LHST": "LHST", "∅∅∅": "∅∅∅", "VET": "VET", "ARST": "ARST", "AWST": "AWST", "AWDT": "AWDT", "WAST": "WAST", "MYT": "MYT", "ACWDT": "ACWDT", "UYST": "UYST", "HKST": "HKST", "CHADT": "CHADT", "ART": "ART", "AKST": "AKST", "PST": "PST", "ACST": "ACST", "WART": "WART", "AST": "AST", "NZDT": "NZDT", "UYT": "UYT", "AKDT": "AKDT", "AEST": "AEST", "CLT": "CLT", "LHDT": "LHDT", "CST": "CST", "ADT": "ADT", "HADT": "HADT", "COST": "COST", "WESZ": "WESZ", "NZST": "NZST", "WIT": "WIT", "WARST": "WARST", "WITA": "WITA", "SGT": "SGT", "HAT": "HAT", "CHAST": "CHAST", "TMST": "TMST", "OESZ": "OESZ", "GMT": "GMT", "SRT": "SRT", "HNT": "HNT", "OEZ": "OEZ", "ChST": "ChST", "EAT": "EAT", "BOT": "BOT", "COT": "COT", "WIB": "WIB", "CDT": "CDT", "TMT": "TMT", "MDT": "MDT"},
}
}
diff --git a/sah_RU/sah_RU_test.go b/sah_RU/sah_RU_test.go
new file mode 100644
index 00000000..bc71db3f
--- /dev/null
+++ b/sah_RU/sah_RU_test.go
@@ -0,0 +1,1120 @@
+package sah_RU
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "sah_RU"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/saq/saq.go b/saq/saq.go
index c728d522..e22ea7f6 100644
--- a/saq/saq.go
+++ b/saq/saq.go
@@ -63,7 +63,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"KK", "BK"},
erasNarrow: []string{"", ""},
erasWide: []string{"Kabla ya Christo", "Baada ya Christo"},
- timezones: map[string]string{"GMT": "GMT", "ART": "ART", "TMT": "TMT", "ACST": "ACST", "JST": "JST", "ECT": "ECT", "SGT": "SGT", "GFT": "GFT", "BOT": "BOT", "CLST": "CLST", "WEZ": "WEZ", "COST": "COST", "CST": "CST", "SRT": "SRT", "∅∅∅": "∅∅∅", "WARST": "WARST", "HNT": "HNT", "WAST": "WAST", "BT": "BT", "OESZ": "OESZ", "VET": "VET", "COT": "COT", "SAST": "SAST", "IST": "IST", "ADT": "ADT", "UYST": "UYST", "NZDT": "NZDT", "ACWST": "ACWST", "HAST": "HAST", "HKT": "HKT", "PST": "PST", "JDT": "JDT", "EDT": "EDT", "AST": "AST", "OEZ": "OEZ", "CAT": "CAT", "WITA": "WITA", "WESZ": "WESZ", "AEST": "AEST", "MYT": "MYT", "MESZ": "MESZ", "ChST": "ChST", "LHDT": "LHDT", "AWST": "AWST", "WAT": "WAT", "HAT": "HAT", "LHST": "LHST", "TMST": "TMST", "NZST": "NZST", "AEDT": "AEDT", "MDT": "MDT", "ACDT": "ACDT", "HADT": "HADT", "HKST": "HKST", "WIB": "WIB", "PDT": "PDT", "CHADT": "CHADT", "ACWDT": "ACWDT", "ARST": "ARST", "MST": "MST", "AKST": "AKST", "GYT": "GYT", "AWDT": "AWDT", "CDT": "CDT", "MEZ": "MEZ", "CHAST": "CHAST", "EST": "EST", "WIT": "WIT", "EAT": "EAT", "CLT": "CLT", "WART": "WART", "AKDT": "AKDT", "UYT": "UYT"},
+ timezones: map[string]string{"GMT": "GMT", "BT": "BT", "ACWDT": "ACWDT", "AWDT": "AWDT", "MESZ": "MESZ", "WESZ": "WESZ", "SGT": "SGT", "AEST": "AEST", "WIT": "WIT", "AWST": "AWST", "HNT": "HNT", "EAT": "EAT", "UYST": "UYST", "ARST": "ARST", "EDT": "EDT", "PDT": "PDT", "MST": "MST", "MDT": "MDT", "SRT": "SRT", "HKST": "HKST", "JDT": "JDT", "IST": "IST", "WARST": "WARST", "EST": "EST", "WAST": "WAST", "WEZ": "WEZ", "OEZ": "OEZ", "CST": "CST", "SAST": "SAST", "TMST": "TMST", "CAT": "CAT", "MYT": "MYT", "CLT": "CLT", "WITA": "WITA", "MEZ": "MEZ", "HAT": "HAT", "COST": "COST", "LHST": "LHST", "HKT": "HKT", "AKST": "AKST", "NZDT": "NZDT", "WAT": "WAT", "AEDT": "AEDT", "ChST": "ChST", "CHADT": "CHADT", "AST": "AST", "HADT": "HADT", "ACDT": "ACDT", "ADT": "ADT", "ART": "ART", "COT": "COT", "CLST": "CLST", "∅∅∅": "∅∅∅", "WART": "WART", "ACWST": "ACWST", "JST": "JST", "LHDT": "LHDT", "UYT": "UYT", "CDT": "CDT", "VET": "VET", "BOT": "BOT", "ACST": "ACST", "GFT": "GFT", "ECT": "ECT", "AKDT": "AKDT", "HAST": "HAST", "TMT": "TMT", "WIB": "WIB", "OESZ": "OESZ", "GYT": "GYT", "CHAST": "CHAST", "PST": "PST", "NZST": "NZST"},
}
}
diff --git a/saq/saq_test.go b/saq/saq_test.go
new file mode 100644
index 00000000..8b056b4a
--- /dev/null
+++ b/saq/saq_test.go
@@ -0,0 +1,1120 @@
+package saq
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "saq"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/saq_KE/saq_KE.go b/saq_KE/saq_KE.go
index fec697bf..eaec3cb6 100644
--- a/saq_KE/saq_KE.go
+++ b/saq_KE/saq_KE.go
@@ -63,7 +63,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"KK", "BK"},
erasNarrow: []string{"", ""},
erasWide: []string{"Kabla ya Christo", "Baada ya Christo"},
- timezones: map[string]string{"CHADT": "CHADT", "HKT": "HKT", "OESZ": "OESZ", "EAT": "EAT", "PDT": "PDT", "NZST": "NZST", "COT": "COT", "AST": "AST", "NZDT": "NZDT", "MDT": "MDT", "ACWST": "ACWST", "AEDT": "AEDT", "ADT": "ADT", "HKST": "HKST", "JDT": "JDT", "LHST": "LHST", "TMT": "TMT", "ART": "ART", "MEZ": "MEZ", "ACWDT": "ACWDT", "AKDT": "AKDT", "UYT": "UYT", "CHAST": "CHAST", "ECT": "ECT", "OEZ": "OEZ", "UYST": "UYST", "MST": "MST", "BT": "BT", "HAT": "HAT", "LHDT": "LHDT", "WEZ": "WEZ", "ACST": "ACST", "PST": "PST", "EST": "EST", "WIT": "WIT", "TMST": "TMST", "MYT": "MYT", "WITA": "WITA", "CDT": "CDT", "WESZ": "WESZ", "CAT": "CAT", "WIB": "WIB", "GYT": "GYT", "AWST": "AWST", "HNT": "HNT", "AEST": "AEST", "WAT": "WAT", "WART": "WART", "SAST": "SAST", "GFT": "GFT", "IST": "IST", "GMT": "GMT", "MESZ": "MESZ", "BOT": "BOT", "WARST": "WARST", "WAST": "WAST", "CST": "CST", "VET": "VET", "ARST": "ARST", "JST": "JST", "AWDT": "AWDT", "SGT": "SGT", "ACDT": "ACDT", "COST": "COST", "CLT": "CLT", "CLST": "CLST", "∅∅∅": "∅∅∅", "ChST": "ChST", "EDT": "EDT", "HAST": "HAST", "HADT": "HADT", "SRT": "SRT", "AKST": "AKST"},
+ timezones: map[string]string{"EDT": "EDT", "AEST": "AEST", "TMT": "TMT", "GMT": "GMT", "EAT": "EAT", "GFT": "GFT", "VET": "VET", "AKST": "AKST", "MEZ": "MEZ", "WIB": "WIB", "BOT": "BOT", "HAST": "HAST", "MESZ": "MESZ", "SGT": "SGT", "HAT": "HAT", "ACWST": "ACWST", "PST": "PST", "HADT": "HADT", "SAST": "SAST", "WESZ": "WESZ", "COST": "COST", "UYT": "UYT", "WIT": "WIT", "ADT": "ADT", "ART": "ART", "EST": "EST", "HNT": "HNT", "OEZ": "OEZ", "∅∅∅": "∅∅∅", "ACST": "ACST", "HKT": "HKT", "CAT": "CAT", "WARST": "WARST", "CST": "CST", "AST": "AST", "LHST": "LHST", "TMST": "TMST", "ChST": "ChST", "NZST": "NZST", "WAST": "WAST", "CDT": "CDT", "SRT": "SRT", "ACDT": "ACDT", "HKST": "HKST", "CHAST": "CHAST", "ARST": "ARST", "PDT": "PDT", "CLST": "CLST", "AEDT": "AEDT", "UYST": "UYST", "WEZ": "WEZ", "WART": "WART", "ACWDT": "ACWDT", "AKDT": "AKDT", "CLT": "CLT", "BT": "BT", "MYT": "MYT", "ECT": "ECT", "AWDT": "AWDT", "COT": "COT", "LHDT": "LHDT", "MDT": "MDT", "WITA": "WITA", "IST": "IST", "GYT": "GYT", "MST": "MST", "CHADT": "CHADT", "AWST": "AWST", "OESZ": "OESZ", "JST": "JST", "JDT": "JDT", "NZDT": "NZDT", "WAT": "WAT"},
}
}
diff --git a/saq_KE/saq_KE_test.go b/saq_KE/saq_KE_test.go
new file mode 100644
index 00000000..aa3e08d4
--- /dev/null
+++ b/saq_KE/saq_KE_test.go
@@ -0,0 +1,1120 @@
+package saq_KE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "saq_KE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/sbp/sbp.go b/sbp/sbp.go
index b6fd9ae8..f8cc777c 100644
--- a/sbp/sbp.go
+++ b/sbp/sbp.go
@@ -60,7 +60,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"AK", "PK"},
erasNarrow: []string{"", ""},
erasWide: []string{"Ashanali uKilisito", "Pamwandi ya Kilisto"},
- timezones: map[string]string{"HNT": "HNT", "ACDT": "ACDT", "ARST": "ARST", "IST": "IST", "ACST": "ACST", "AEST": "AEST", "SAST": "SAST", "HKST": "HKST", "MDT": "MDT", "NZST": "NZST", "UYT": "UYT", "CHAST": "CHAST", "OESZ": "OESZ", "MYT": "MYT", "MEZ": "MEZ", "BOT": "BOT", "HADT": "HADT", "HAST": "HAST", "GFT": "GFT", "MST": "MST", "TMT": "TMT", "ACWST": "ACWST", "CAT": "CAT", "AST": "AST", "WIB": "WIB", "ART": "ART", "CLT": "CLT", "CST": "CST", "WESZ": "WESZ", "ChST": "ChST", "WAT": "WAT", "AKST": "AKST", "CLST": "CLST", "WARST": "WARST", "AWST": "AWST", "CDT": "CDT", "VET": "VET", "COST": "COST", "BT": "BT", "HAT": "HAT", "AKDT": "AKDT", "PST": "PST", "MESZ": "MESZ", "EST": "EST", "GYT": "GYT", "WEZ": "WEZ", "GMT": "GMT", "WITA": "WITA", "∅∅∅": "∅∅∅", "TMST": "TMST", "AWDT": "AWDT", "LHST": "LHST", "EDT": "EDT", "HKT": "HKT", "EAT": "EAT", "AEDT": "AEDT", "ADT": "ADT", "WIT": "WIT", "JDT": "JDT", "LHDT": "LHDT", "ACWDT": "ACWDT", "ECT": "ECT", "SGT": "SGT", "WART": "WART", "CHADT": "CHADT", "COT": "COT", "OEZ": "OEZ", "SRT": "SRT", "NZDT": "NZDT", "UYST": "UYST", "WAST": "WAST", "JST": "JST", "PDT": "PDT"},
+ timezones: map[string]string{"CHAST": "CHAST", "ART": "ART", "ARST": "ARST", "EST": "EST", "PDT": "PDT", "HAST": "HAST", "WAST": "WAST", "WIB": "WIB", "CLST": "CLST", "CST": "CST", "AKST": "AKST", "AWST": "AWST", "JDT": "JDT", "UYST": "UYST", "VET": "VET", "COT": "COT", "WIT": "WIT", "CDT": "CDT", "WART": "WART", "CHADT": "CHADT", "AKDT": "AKDT", "BOT": "BOT", "HNT": "HNT", "AEDT": "AEDT", "MST": "MST", "ACWST": "ACWST", "HKST": "HKST", "∅∅∅": "∅∅∅", "WAT": "WAT", "GMT": "GMT", "GYT": "GYT", "MDT": "MDT", "ACWDT": "ACWDT", "WESZ": "WESZ", "LHDT": "LHDT", "ACDT": "ACDT", "COST": "COST", "OESZ": "OESZ", "ACST": "ACST", "GFT": "GFT", "AWDT": "AWDT", "IST": "IST", "WARST": "WARST", "EDT": "EDT", "MESZ": "MESZ", "AST": "AST", "SAST": "SAST", "PST": "PST", "NZDT": "NZDT", "CAT": "CAT", "EAT": "EAT", "SRT": "SRT", "TMST": "TMST", "ChST": "ChST", "ADT": "ADT", "WITA": "WITA", "HADT": "HADT", "HAT": "HAT", "TMT": "TMT", "OEZ": "OEZ", "AEST": "AEST", "UYT": "UYT", "ECT": "ECT", "WEZ": "WEZ", "SGT": "SGT", "MYT": "MYT", "HKT": "HKT", "JST": "JST", "MEZ": "MEZ", "NZST": "NZST", "BT": "BT", "LHST": "LHST", "CLT": "CLT"},
}
}
@@ -116,7 +116,7 @@ func (sbp *sbp) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (sbp *sbp) MonthsNarrow() []string {
- return sbp.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/sbp/sbp_test.go b/sbp/sbp_test.go
new file mode 100644
index 00000000..ffd3ca62
--- /dev/null
+++ b/sbp/sbp_test.go
@@ -0,0 +1,1120 @@
+package sbp
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "sbp"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/sbp_TZ/sbp_TZ.go b/sbp_TZ/sbp_TZ.go
index 21d97e28..d50e1e3b 100644
--- a/sbp_TZ/sbp_TZ.go
+++ b/sbp_TZ/sbp_TZ.go
@@ -60,7 +60,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"AK", "PK"},
erasNarrow: []string{"", ""},
erasWide: []string{"Ashanali uKilisito", "Pamwandi ya Kilisto"},
- timezones: map[string]string{"OEZ": "OEZ", "ARST": "ARST", "PDT": "PDT", "ECT": "ECT", "ADT": "ADT", "WART": "WART", "AWDT": "AWDT", "UYST": "UYST", "EST": "EST", "ACWDT": "ACWDT", "COT": "COT", "GMT": "GMT", "TMT": "TMT", "MST": "MST", "CLT": "CLT", "WESZ": "WESZ", "BT": "BT", "PST": "PST", "UYT": "UYT", "CHAST": "CHAST", "AST": "AST", "HAT": "HAT", "WIT": "WIT", "∅∅∅": "∅∅∅", "MESZ": "MESZ", "AEST": "AEST", "WARST": "WARST", "SAST": "SAST", "TMST": "TMST", "ACDT": "ACDT", "LHDT": "LHDT", "ChST": "ChST", "ACWST": "ACWST", "EDT": "EDT", "WAST": "WAST", "HNT": "HNT", "GFT": "GFT", "ACST": "ACST", "CDT": "CDT", "WITA": "WITA", "OESZ": "OESZ", "MEZ": "MEZ", "HKT": "HKT", "GYT": "GYT", "WEZ": "WEZ", "MYT": "MYT", "SRT": "SRT", "NZST": "NZST", "COST": "COST", "CST": "CST", "WAT": "WAT", "WIB": "WIB", "MDT": "MDT", "SGT": "SGT", "EAT": "EAT", "LHST": "LHST", "AKDT": "AKDT", "AWST": "AWST", "BOT": "BOT", "NZDT": "NZDT", "HKST": "HKST", "IST": "IST", "ART": "ART", "JDT": "JDT", "AKST": "AKST", "VET": "VET", "AEDT": "AEDT", "CAT": "CAT", "HAST": "HAST", "CLST": "CLST", "HADT": "HADT", "JST": "JST", "CHADT": "CHADT"},
+ timezones: map[string]string{"JST": "JST", "MEZ": "MEZ", "MYT": "MYT", "ACST": "ACST", "NZST": "NZST", "GFT": "GFT", "ART": "ART", "MESZ": "MESZ", "WAST": "WAST", "GMT": "GMT", "LHST": "LHST", "EAT": "EAT", "UYT": "UYT", "SRT": "SRT", "AWST": "AWST", "ARST": "ARST", "CLST": "CLST", "MST": "MST", "OESZ": "OESZ", "CST": "CST", "ACWST": "ACWST", "IST": "IST", "BOT": "BOT", "CAT": "CAT", "TMT": "TMT", "GYT": "GYT", "ECT": "ECT", "HNT": "HNT", "COT": "COT", "MDT": "MDT", "AST": "AST", "WITA": "WITA", "WEZ": "WEZ", "WIB": "WIB", "AEDT": "AEDT", "LHDT": "LHDT", "CDT": "CDT", "WARST": "WARST", "TMST": "TMST", "AEST": "AEST", "HKT": "HKT", "VET": "VET", "AWDT": "AWDT", "EDT": "EDT", "PST": "PST", "HADT": "HADT", "WESZ": "WESZ", "ChST": "ChST", "WIT": "WIT", "AKDT": "AKDT", "ADT": "ADT", "EST": "EST", "COST": "COST", "OEZ": "OEZ", "CLT": "CLT", "ACDT": "ACDT", "AKST": "AKST", "SAST": "SAST", "PDT": "PDT", "NZDT": "NZDT", "∅∅∅": "∅∅∅", "HKST": "HKST", "CHAST": "CHAST", "CHADT": "CHADT", "JDT": "JDT", "HAST": "HAST", "WAT": "WAT", "SGT": "SGT", "BT": "BT", "WART": "WART", "ACWDT": "ACWDT", "HAT": "HAT", "UYST": "UYST"},
}
}
@@ -116,7 +116,7 @@ func (sbp *sbp_TZ) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (sbp *sbp_TZ) MonthsNarrow() []string {
- return sbp.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/sbp_TZ/sbp_TZ_test.go b/sbp_TZ/sbp_TZ_test.go
new file mode 100644
index 00000000..f7fe2c08
--- /dev/null
+++ b/sbp_TZ/sbp_TZ_test.go
@@ -0,0 +1,1120 @@
+package sbp_TZ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "sbp_TZ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/se/se.go b/se/se.go
index fabbfa84..3499c8a3 100644
--- a/se/se.go
+++ b/se/se.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"o.Kr.", "m.Kr."},
erasNarrow: []string{"", ""},
erasWide: []string{"ovdal Kristtusa", "maŋŋel Kristtusa"},
- timezones: map[string]string{"OESZ": "nuorti-Eurohpá geassiáigi", "CDT": "CDT", "WIT": "WIT", "AWST": "AWST", "LHST": "LHST", "NZDT": "NZDT", "CLT": "CLT", "EAT": "EAT", "ARST": "ARST", "PST": "PST", "PDT": "PDT", "VET": "VET", "ACWDT": "ACWDT", "EST": "EST", "COST": "COST", "WART": "WART", "HNT": "HNT", "WITA": "WITA", "TMT": "TMT", "JDT": "JDT", "JST": "JST", "MYT": "MYT", "WEZ": "oarje-Eurohpá dábálašáigi", "HKT": "HKT", "MEZ": "gaska-Eurohpá dábálašáigi", "BT": "BT", "IST": "IST", "ACDT": "ACDT", "CST": "CST", "AEDT": "AEDT", "TMST": "TMST", "NZST": "NZST", "AEST": "AEST", "CAT": "CAT", "EDT": "EDT", "GFT": "GFT", "MDT": "MDT", "WESZ": "oarje-Eurohpá geassiáigi", "CHAST": "CHAST", "GMT": "Greenwich gaskka áigi", "HAT": "HAT", "AKST": "AKST", "ChST": "ChST", "ECT": "ECT", "ADT": "ADT", "WAT": "WAT", "WAST": "WAST", "WARST": "WARST", "AWDT": "AWDT", "MESZ": "gaska-Eurohpá geassiáigi", "OEZ": "nuorti-Eurohpá dábálašáigi", "ART": "ART", "AKDT": "AKDT", "ACWST": "ACWST", "CHADT": "CHADT", "SAST": "SAST", "HKST": "HKST", "∅∅∅": "∅∅∅", "SRT": "SRT", "GYT": "GYT", "COT": "COT", "SGT": "SGT", "MST": "MST", "LHDT": "LHDT", "BOT": "BOT", "HAST": "HAST", "WIB": "WIB", "ACST": "ACST", "AST": "AST", "HADT": "HADT", "UYT": "UYT", "UYST": "UYST", "CLST": "CLST"},
+ timezones: map[string]string{"IST": "IST", "EDT": "EDT", "MEZ": "gaska-Eurohpá dábálašáigi", "UYT": "UYT", "JST": "JST", "WIB": "WIB", "GYT": "GYT", "OESZ": "nuorti-Eurohpá geassiáigi", "BT": "BT", "EAT": "EAT", "WAT": "WAT", "AKDT": "AKDT", "PST": "PST", "NZDT": "NZDT", "ChST": "ChST", "LHST": "LHST", "SRT": "SRT", "ECT": "ECT", "ACWST": "ACWST", "JDT": "JDT", "HADT": "HADT", "UYST": "UYST", "PDT": "PDT", "AKST": "AKST", "∅∅∅": "∅∅∅", "COT": "COT", "MYT": "MYT", "WARST": "WARST", "AST": "AST", "GFT": "GFT", "HKT": "HKT", "AWDT": "AWDT", "TMT": "TMT", "OEZ": "nuorti-Eurohpá dábálašáigi", "CLT": "CLT", "WIT": "WIT", "CHADT": "CHADT", "SAST": "SAST", "CST": "CST", "WEZ": "oarje-Eurohpá dábálašáigi", "HNT": "HNT", "HAT": "HAT", "ADT": "ADT", "GMT": "Greenwich gaskka áigi", "ACDT": "ACDT", "ART": "ART", "WAST": "WAST", "LHDT": "LHDT", "HKST": "HKST", "BOT": "BOT", "MESZ": "gaska-Eurohpá geassiáigi", "AEDT": "AEDT", "MDT": "MDT", "ACST": "ACST", "WART": "WART", "CDT": "CDT", "AWST": "AWST", "WESZ": "oarje-Eurohpá geassiáigi", "COST": "COST", "CAT": "CAT", "HAST": "HAST", "EST": "EST", "SGT": "SGT", "AEST": "AEST", "CLST": "CLST", "ACWDT": "ACWDT", "WITA": "WITA", "NZST": "NZST", "TMST": "TMST", "MST": "MST", "CHAST": "CHAST", "VET": "VET", "ARST": "ARST"},
}
}
diff --git a/se/se_test.go b/se/se_test.go
new file mode 100644
index 00000000..504c8cc4
--- /dev/null
+++ b/se/se_test.go
@@ -0,0 +1,1120 @@
+package se
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "se"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/se_FI/se_FI.go b/se_FI/se_FI.go
index f7086b6e..eb1eae29 100644
--- a/se_FI/se_FI.go
+++ b/se_FI/se_FI.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"o.Kr.", "m.Kr."},
erasNarrow: []string{"", ""},
erasWide: []string{"ovdal Kristtusa", "maŋŋel Kristtusa"},
- timezones: map[string]string{"EDT": "EDT", "COT": "COT", "WARST": "WARST", "HNT": "HNT", "ACDT": "ACDT", "UYT": "UYT", "PDT": "PDT", "GMT": "Greenwich gaskka áigi", "ACST": "ACST", "JDT": "JDT", "TMST": "TMST", "UYST": "UYST", "HKST": "HKST", "WESZ": "oarje-Eurohpá geassiáigi", "CAT": "CAT", "WAT": "WAT", "NZDT": "NZDT", "ACWST": "ACWST", "ACWDT": "ACWDT", "SAST": "SAST", "WIB": "WIB", "∅∅∅": "∅∅∅", "GYT": "GYT", "IST": "IST", "HAST": "HAST", "SGT": "SGT", "ECT": "ECT", "EST": "EST", "OEZ": "nuorti-Eurohpá dábálašáigi", "CDT": "CDT", "CHAST": "CHAST", "LHDT": "LHDT", "AKDT": "AKDT", "CST": "CST", "CLT": "CLT", "WART": "WART", "GFT": "GFT", "WITA": "WITA", "WIT": "WIT", "PST": "PST", "BOT": "BOT", "WAST": "WAST", "AKST": "AKST", "WEZ": "oarje-Eurohpá dábálašáigi", "ARST": "ARST", "MYT": "MYT", "SRT": "SRT", "COST": "COST", "HADT": "HADT", "HKT": "HKT", "EAT": "EAT", "MST": "MST", "ChST": "ChST", "CLST": "CLST", "ADT": "ADT", "BT": "BT", "HAT": "HAT", "OESZ": "nuorti-Eurohpá geassiáigi", "LHST": "LHST", "AST": "AST", "JST": "JST", "CHADT": "CHADT", "VET": "VET", "TMT": "TMT", "NZST": "NZST", "AWST": "AWST", "AEST": "AEST", "AEDT": "AEDT", "MEZ": "gaska-Eurohpá dábálašáigi", "MESZ": "gaska-Eurohpá geassiáigi", "ART": "ART", "MDT": "MDT", "AWDT": "AWDT"},
+ timezones: map[string]string{"CHAST": "CHAST", "GMT": "Greenwich gaskka áigi", "CLT": "CLT", "AKDT": "AKDT", "ACWDT": "ACWDT", "WITA": "WITA", "EAT": "EAT", "LHDT": "LHDT", "CDT": "CDT", "AWST": "AWST", "SAST": "SAST", "HADT": "HADT", "WIB": "WIB", "MDT": "MDT", "AST": "AST", "AWDT": "AWDT", "WIT": "WIT", "ART": "ART", "BOT": "BOT", "EDT": "EDT", "TMST": "TMST", "ACDT": "ACDT", "CHADT": "CHADT", "ECT": "ECT", "ARST": "ARST", "JST": "JST", "JDT": "JDT", "WEZ": "oarje-Eurohpá dábálašáigi", "HNT": "HNT", "UYT": "UYT", "SRT": "SRT", "HKT": "HKT", "HKST": "HKST", "AKST": "AKST", "IST": "IST", "HAT": "HAT", "ChST": "ChST", "MST": "MST", "CLST": "CLST", "WARST": "WARST", "NZDT": "NZDT", "CAT": "CAT", "AEST": "AEST", "ADT": "ADT", "WESZ": "oarje-Eurohpá geassiáigi", "COST": "COST", "WART": "WART", "PDT": "PDT", "ACST": "ACST", "WAT": "WAT", "WAST": "WAST", "AEDT": "AEDT", "GYT": "GYT", "BT": "BT", "∅∅∅": "∅∅∅", "CST": "CST", "GFT": "GFT", "ACWST": "ACWST", "EST": "EST", "MYT": "MYT", "PST": "PST", "MEZ": "gaska-Eurohpá dábálašáigi", "NZST": "NZST", "LHST": "LHST", "UYST": "UYST", "COT": "COT", "OESZ": "nuorti-Eurohpá geassiáigi", "VET": "VET", "HAST": "HAST", "OEZ": "nuorti-Eurohpá dábálašáigi", "TMT": "TMT", "SGT": "SGT", "MESZ": "gaska-Eurohpá geassiáigi"},
}
}
diff --git a/se_FI/se_FI_test.go b/se_FI/se_FI_test.go
new file mode 100644
index 00000000..10f4e154
--- /dev/null
+++ b/se_FI/se_FI_test.go
@@ -0,0 +1,1120 @@
+package se_FI
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "se_FI"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/se_NO/se_NO.go b/se_NO/se_NO.go
index caae7b6a..cee2275e 100644
--- a/se_NO/se_NO.go
+++ b/se_NO/se_NO.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"o.Kr.", "m.Kr."},
erasNarrow: []string{"", ""},
erasWide: []string{"ovdal Kristtusa", "maŋŋel Kristtusa"},
- timezones: map[string]string{"HKST": "HKST", "SRT": "SRT", "ECT": "ECT", "ADT": "ADT", "OESZ": "nuorti-Eurohpá geassiáigi", "MYT": "MYT", "LHDT": "LHDT", "EDT": "EDT", "JDT": "JDT", "AKST": "AKST", "CHAST": "CHAST", "WEZ": "oarje-Eurohpá dábálašáigi", "WAT": "WAT", "EAT": "EAT", "ChST": "ChST", "AST": "AST", "JST": "JST", "AWST": "AWST", "AEST": "AEST", "HNT": "HNT", "ACDT": "ACDT", "CHADT": "CHADT", "OEZ": "nuorti-Eurohpá dábálašáigi", "NZDT": "NZDT", "CAT": "CAT", "WARST": "WARST", "HAT": "HAT", "MST": "MST", "HKT": "HKT", "GYT": "GYT", "WITA": "WITA", "AKDT": "AKDT", "CLT": "CLT", "MEZ": "gaska-Eurohpá dábálašáigi", "BOT": "BOT", "COT": "COT", "COST": "COST", "TMST": "TMST", "ART": "ART", "ARST": "ARST", "AWDT": "AWDT", "HAST": "HAST", "HADT": "HADT", "SGT": "SGT", "NZST": "NZST", "EST": "EST", "GFT": "GFT", "TMT": "TMT", "UYST": "UYST", "CDT": "CDT", "ACWST": "ACWST", "AEDT": "AEDT", "SAST": "SAST", "WIT": "WIT", "GMT": "Greenwich gaskka áigi", "VET": "VET", "ACST": "ACST", "MESZ": "gaska-Eurohpá geassiáigi", "WESZ": "oarje-Eurohpá geassiáigi", "BT": "BT", "WIB": "WIB", "∅∅∅": "∅∅∅", "MDT": "MDT", "WART": "WART", "LHST": "LHST", "CST": "CST", "CLST": "CLST", "UYT": "UYT", "ACWDT": "ACWDT", "WAST": "WAST", "IST": "IST", "PST": "PST", "PDT": "PDT"},
+ timezones: map[string]string{"HKST": "HKST", "ACWDT": "ACWDT", "BOT": "BOT", "LHDT": "LHDT", "MYT": "MYT", "HAST": "HAST", "HADT": "HADT", "PDT": "PDT", "GFT": "GFT", "AKDT": "AKDT", "AWDT": "AWDT", "ARST": "ARST", "EST": "EST", "EDT": "EDT", "MEZ": "gaska-Eurohpá dábálašáigi", "∅∅∅": "∅∅∅", "UYST": "UYST", "WIT": "WIT", "ChST": "ChST", "GYT": "GYT", "CLT": "CLT", "MDT": "MDT", "VET": "VET", "AKST": "AKST", "AST": "AST", "COST": "COST", "CDT": "CDT", "MST": "MST", "MESZ": "gaska-Eurohpá geassiáigi", "AEST": "AEST", "AEDT": "AEDT", "BT": "BT", "IST": "IST", "COT": "COT", "SGT": "SGT", "OEZ": "nuorti-Eurohpá dábálašáigi", "EAT": "EAT", "ACDT": "ACDT", "WARST": "WARST", "HKT": "HKT", "JST": "JST", "AWST": "AWST", "WIB": "WIB", "WESZ": "oarje-Eurohpá geassiáigi", "HAT": "HAT", "OESZ": "nuorti-Eurohpá geassiáigi", "CLST": "CLST", "ECT": "ECT", "WITA": "WITA", "JDT": "JDT", "ART": "ART", "SAST": "SAST", "CST": "CST", "ADT": "ADT", "PST": "PST", "UYT": "UYT", "ACST": "ACST", "NZST": "NZST", "WEZ": "oarje-Eurohpá dábálašáigi", "GMT": "Greenwich gaskka áigi", "CHADT": "CHADT", "CHAST": "CHAST", "SRT": "SRT", "TMT": "TMT", "CAT": "CAT", "WAT": "WAT", "WAST": "WAST", "WART": "WART", "ACWST": "ACWST", "NZDT": "NZDT", "TMST": "TMST", "HNT": "HNT", "LHST": "LHST"},
}
}
diff --git a/se_NO/se_NO_test.go b/se_NO/se_NO_test.go
new file mode 100644
index 00000000..a952fe43
--- /dev/null
+++ b/se_NO/se_NO_test.go
@@ -0,0 +1,1120 @@
+package se_NO
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "se_NO"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/se_SE/se_SE.go b/se_SE/se_SE.go
index ea7eb4b4..be3ad9c4 100644
--- a/se_SE/se_SE.go
+++ b/se_SE/se_SE.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"o.Kr.", "m.Kr."},
erasNarrow: []string{"", ""},
erasWide: []string{"ovdal Kristtusa", "maŋŋel Kristtusa"},
- timezones: map[string]string{"WARST": "WARST", "PST": "PST", "IST": "IST", "OEZ": "nuorti-Eurohpá dábálašáigi", "CHAST": "CHAST", "EST": "EST", "ART": "ART", "TMST": "TMST", "AEST": "AEST", "WITA": "WITA", "EAT": "EAT", "PDT": "PDT", "ChST": "ChST", "HKT": "HKT", "HKST": "HKST", "WART": "WART", "AKST": "AKST", "ACWST": "ACWST", "ECT": "ECT", "COT": "COT", "GMT": "Greenwich gaskka áigi", "AKDT": "AKDT", "VET": "VET", "MDT": "MDT", "GYT": "GYT", "CHADT": "CHADT", "WESZ": "oarje-Eurohpá geassiáigi", "CAT": "CAT", "ADT": "ADT", "OESZ": "nuorti-Eurohpá geassiáigi", "ACDT": "ACDT", "BOT": "BOT", "CST": "CST", "MESZ": "gaska-Eurohpá geassiáigi", "ACWDT": "ACWDT", "AST": "AST", "ACST": "ACST", "LHDT": "LHDT", "AWST": "AWST", "WEZ": "oarje-Eurohpá dábálašáigi", "AEDT": "AEDT", "ARST": "ARST", "AWDT": "AWDT", "UYT": "UYT", "JST": "JST", "JDT": "JDT", "UYST": "UYST", "CLT": "CLT", "COST": "COST", "WAST": "WAST", "∅∅∅": "∅∅∅", "MYT": "MYT", "SGT": "SGT", "MEZ": "gaska-Eurohpá dábálašáigi", "WAT": "WAT", "HNT": "HNT", "CDT": "CDT", "BT": "BT", "HAT": "HAT", "LHST": "LHST", "SRT": "SRT", "CLST": "CLST", "EDT": "EDT", "HAST": "HAST", "SAST": "SAST", "WIB": "WIB", "TMT": "TMT", "WIT": "WIT", "HADT": "HADT", "NZDT": "NZDT", "GFT": "GFT", "MST": "MST", "NZST": "NZST"},
+ timezones: map[string]string{"OESZ": "nuorti-Eurohpá geassiáigi", "UYST": "UYST", "SRT": "SRT", "WESZ": "oarje-Eurohpá geassiáigi", "GYT": "GYT", "CLST": "CLST", "WART": "WART", "WARST": "WARST", "AST": "AST", "ACWST": "ACWST", "WITA": "WITA", "TMT": "TMT", "TMST": "TMST", "AKDT": "AKDT", "HADT": "HADT", "WAST": "WAST", "AEST": "AEST", "MDT": "MDT", "CDT": "CDT", "ACWDT": "ACWDT", "AWST": "AWST", "SAST": "SAST", "AEDT": "AEDT", "CHAST": "CHAST", "BOT": "BOT", "HAST": "HAST", "WIB": "WIB", "HNT": "HNT", "MYT": "MYT", "JDT": "JDT", "NZST": "NZST", "MESZ": "gaska-Eurohpá geassiáigi", "WEZ": "oarje-Eurohpá dábálašáigi", "ChST": "ChST", "WIT": "WIT", "LHST": "LHST", "WAT": "WAT", "HAT": "HAT", "GMT": "Greenwich gaskka áigi", "ACST": "ACST", "AWDT": "AWDT", "PST": "PST", "MST": "MST", "ACDT": "ACDT", "BT": "BT", "CHADT": "CHADT", "ECT": "ECT", "ADT": "ADT", "EDT": "EDT", "EAT": "EAT", "SGT": "SGT", "GFT": "GFT", "HKT": "HKT", "PDT": "PDT", "CAT": "CAT", "OEZ": "nuorti-Eurohpá dábálašáigi", "∅∅∅": "∅∅∅", "JST": "JST", "AKST": "AKST", "IST": "IST", "MEZ": "gaska-Eurohpá dábálašáigi", "UYT": "UYT", "LHDT": "LHDT", "CLT": "CLT", "EST": "EST", "COT": "COT", "CST": "CST", "VET": "VET", "ART": "ART", "NZDT": "NZDT", "HKST": "HKST", "ARST": "ARST", "COST": "COST"},
}
}
diff --git a/se_SE/se_SE_test.go b/se_SE/se_SE_test.go
new file mode 100644
index 00000000..ed385b52
--- /dev/null
+++ b/se_SE/se_SE_test.go
@@ -0,0 +1,1120 @@
+package se_SE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "se_SE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/seh/seh.go b/seh/seh.go
index 98d3c91c..2e1061a4 100644
--- a/seh/seh.go
+++ b/seh/seh.go
@@ -59,7 +59,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"AC", "AD"},
erasNarrow: []string{"", ""},
erasWide: []string{"Antes de Cristo", "Anno Domini"},
- timezones: map[string]string{"GMT": "GMT", "UYST": "UYST", "AEST": "AEST", "SAST": "SAST", "BT": "BT", "GFT": "GFT", "WIB": "WIB", "WITA": "WITA", "HNT": "HNT", "LHST": "LHST", "CLST": "CLST", "WART": "WART", "ACWST": "ACWST", "ACWDT": "ACWDT", "EDT": "EDT", "AWDT": "AWDT", "NZDT": "NZDT", "AST": "AST", "SGT": "SGT", "MST": "MST", "JDT": "JDT", "ART": "ART", "COT": "COT", "ACST": "ACST", "IST": "IST", "OEZ": "OEZ", "∅∅∅": "∅∅∅", "TMST": "TMST", "HKST": "HKST", "EAT": "EAT", "PDT": "PDT", "CLT": "CLT", "HKT": "HKT", "ACDT": "ACDT", "AKST": "AKST", "PST": "PST", "WAT": "WAT", "WAST": "WAST", "MESZ": "MESZ", "WEZ": "WEZ", "GYT": "GYT", "NZST": "NZST", "VET": "VET", "WESZ": "WESZ", "AKDT": "AKDT", "UYT": "UYT", "CST": "CST", "BOT": "BOT", "WIT": "WIT", "MDT": "MDT", "ARST": "ARST", "JST": "JST", "CAT": "CAT", "TMT": "TMT", "MEZ": "MEZ", "CHAST": "CHAST", "AWST": "AWST", "LHDT": "LHDT", "CHADT": "CHADT", "ChST": "ChST", "WARST": "WARST", "HAT": "HAT", "MYT": "MYT", "SRT": "SRT", "COST": "COST", "ECT": "ECT", "ADT": "ADT", "HAST": "HAST", "OESZ": "OESZ", "CDT": "CDT", "AEDT": "AEDT", "EST": "EST", "HADT": "HADT"},
+ timezones: map[string]string{"UYT": "UYT", "CHADT": "CHADT", "WAST": "WAST", "AEDT": "AEDT", "WIT": "WIT", "WITA": "WITA", "JDT": "JDT", "ACWDT": "ACWDT", "NZDT": "NZDT", "WEZ": "WEZ", "CLST": "CLST", "ACDT": "ACDT", "OEZ": "OEZ", "UYST": "UYST", "ACST": "ACST", "WAT": "WAT", "LHST": "LHST", "HKT": "HKT", "VET": "VET", "AKDT": "AKDT", "IST": "IST", "EST": "EST", "WESZ": "WESZ", "COT": "COT", "MDT": "MDT", "SAST": "SAST", "WIB": "WIB", "ART": "ART", "BOT": "BOT", "AEST": "AEST", "MYT": "MYT", "WART": "WART", "SRT": "SRT", "AWST": "AWST", "EAT": "EAT", "WARST": "WARST", "ADT": "ADT", "ARST": "ARST", "PST": "PST", "MESZ": "MESZ", "HAT": "HAT", "GFT": "GFT", "ECT": "ECT", "CST": "CST", "JST": "JST", "AKST": "AKST", "TMT": "TMT", "GMT": "GMT", "GYT": "GYT", "BT": "BT", "LHDT": "LHDT", "MST": "MST", "HKST": "HKST", "CHAST": "CHAST", "ACWST": "ACWST", "HNT": "HNT", "CAT": "CAT", "COST": "COST", "CLT": "CLT", "∅∅∅": "∅∅∅", "AWDT": "AWDT", "PDT": "PDT", "MEZ": "MEZ", "HADT": "HADT", "TMST": "TMST", "ChST": "ChST", "CDT": "CDT", "AST": "AST", "NZST": "NZST", "EDT": "EDT", "HAST": "HAST", "SGT": "SGT", "OESZ": "OESZ"},
}
}
diff --git a/seh/seh_test.go b/seh/seh_test.go
new file mode 100644
index 00000000..0b532703
--- /dev/null
+++ b/seh/seh_test.go
@@ -0,0 +1,1120 @@
+package seh
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "seh"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/seh_MZ/seh_MZ.go b/seh_MZ/seh_MZ.go
index ecd1fd8c..a5d78e30 100644
--- a/seh_MZ/seh_MZ.go
+++ b/seh_MZ/seh_MZ.go
@@ -59,7 +59,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"AC", "AD"},
erasNarrow: []string{"", ""},
erasWide: []string{"Antes de Cristo", "Anno Domini"},
- timezones: map[string]string{"COT": "COT", "PST": "PST", "ACWDT": "ACWDT", "MYT": "MYT", "JDT": "JDT", "PDT": "PDT", "NZDT": "NZDT", "UYT": "UYT", "MEZ": "MEZ", "WITA": "WITA", "WIT": "WIT", "WESZ": "WESZ", "UYST": "UYST", "CLT": "CLT", "CLST": "CLST", "COST": "COST", "MST": "MST", "AKDT": "AKDT", "ACWST": "ACWST", "ADT": "ADT", "HADT": "HADT", "LHST": "LHST", "EDT": "EDT", "AST": "AST", "HKT": "HKT", "HAT": "HAT", "AWDT": "AWDT", "VET": "VET", "HAST": "HAST", "WARST": "WARST", "ARST": "ARST", "NZST": "NZST", "ChST": "ChST", "WART": "WART", "OESZ": "OESZ", "CHADT": "CHADT", "IST": "IST", "AKST": "AKST", "WIB": "WIB", "SRT": "SRT", "CDT": "CDT", "AEST": "AEST", "∅∅∅": "∅∅∅", "SAST": "SAST", "CST": "CST", "EST": "EST", "WAST": "WAST", "AWST": "AWST", "OEZ": "OEZ", "ACST": "ACST", "TMT": "TMT", "LHDT": "LHDT", "SGT": "SGT", "HKST": "HKST", "JST": "JST", "AEDT": "AEDT", "GMT": "GMT", "EAT": "EAT", "MDT": "MDT", "GYT": "GYT", "BOT": "BOT", "MESZ": "MESZ", "CHAST": "CHAST", "WEZ": "WEZ", "HNT": "HNT", "ACDT": "ACDT", "CAT": "CAT", "GFT": "GFT", "ART": "ART", "TMST": "TMST", "ECT": "ECT", "BT": "BT", "WAT": "WAT"},
+ timezones: map[string]string{"CAT": "CAT", "WEZ": "WEZ", "ChST": "ChST", "WART": "WART", "CHAST": "CHAST", "ADT": "ADT", "PDT": "PDT", "HAT": "HAT", "OEZ": "OEZ", "LHST": "LHST", "WARST": "WARST", "JDT": "JDT", "AKST": "AKST", "WIB": "WIB", "AWST": "AWST", "AKDT": "AKDT", "HNT": "HNT", "WAST": "WAST", "AEDT": "AEDT", "BT": "BT", "ACDT": "ACDT", "GFT": "GFT", "HKST": "HKST", "HAST": "HAST", "MDT": "MDT", "CLT": "CLT", "HKT": "HKT", "MEZ": "MEZ", "COT": "COT", "ARST": "ARST", "ACWST": "ACWST", "ACWDT": "ACWDT", "SAST": "SAST", "OESZ": "OESZ", "UYT": "UYT", "CDT": "CDT", "GYT": "GYT", "AEST": "AEST", "MYT": "MYT", "WIT": "WIT", "AWDT": "AWDT", "WITA": "WITA", "WESZ": "WESZ", "ART": "ART", "MESZ": "MESZ", "IST": "IST", "EST": "EST", "VET": "VET", "AST": "AST", "GMT": "GMT", "MST": "MST", "JST": "JST", "COST": "COST", "UYST": "UYST", "TMT": "TMT", "LHDT": "LHDT", "EDT": "EDT", "TMST": "TMST", "SGT": "SGT", "WAT": "WAT", "CST": "CST", "ACST": "ACST", "PST": "PST", "HADT": "HADT", "NZDT": "NZDT", "CLST": "CLST", "∅∅∅": "∅∅∅", "SRT": "SRT", "ECT": "ECT", "EAT": "EAT", "CHADT": "CHADT", "NZST": "NZST", "BOT": "BOT"},
}
}
diff --git a/seh_MZ/seh_MZ_test.go b/seh_MZ/seh_MZ_test.go
new file mode 100644
index 00000000..d04e8ddd
--- /dev/null
+++ b/seh_MZ/seh_MZ_test.go
@@ -0,0 +1,1120 @@
+package seh_MZ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "seh_MZ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ses/ses.go b/ses/ses.go
index 6f529b38..75a3b389 100644
--- a/ses/ses.go
+++ b/ses/ses.go
@@ -60,7 +60,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"IJ", "IZ"},
erasNarrow: []string{"", ""},
erasWide: []string{"Isaa jine", "Isaa zamanoo"},
- timezones: map[string]string{"HAT": "HAT", "UYT": "UYT", "MESZ": "MESZ", "VET": "VET", "EAT": "EAT", "AWST": "AWST", "LHST": "LHST", "AKDT": "AKDT", "CLST": "CLST", "ACWST": "ACWST", "WITA": "WITA", "ARST": "ARST", "JDT": "JDT", "ChST": "ChST", "WEZ": "WEZ", "HKT": "HKT", "WART": "WART", "BOT": "BOT", "CHAST": "CHAST", "HAST": "HAST", "HADT": "HADT", "HKST": "HKST", "WARST": "WARST", "MYT": "MYT", "CLT": "CLT", "ADT": "ADT", "BT": "BT", "HNT": "HNT", "CHADT": "CHADT", "CAT": "CAT", "ACST": "ACST", "GYT": "GYT", "AKST": "AKST", "PDT": "PDT", "ECT": "ECT", "OESZ": "OESZ", "ACDT": "ACDT", "AWDT": "AWDT", "AEST": "AEST", "COST": "COST", "EST": "EST", "TMST": "TMST", "MST": "MST", "MEZ": "MEZ", "COT": "COT", "AEDT": "AEDT", "WIT": "WIT", "OEZ": "OEZ", "LHDT": "LHDT", "NZDT": "NZDT", "WAT": "WAT", "GFT": "GFT", "SRT": "SRT", "CST": "CST", "WESZ": "WESZ", "EDT": "EDT", "AST": "AST", "IST": "IST", "ART": "ART", "NZST": "NZST", "UYST": "UYST", "TMT": "TMT", "JST": "JST", "PST": "PST", "MDT": "MDT", "CDT": "CDT", "WAST": "WAST", "GMT": "GMT", "WIB": "WIB", "ACWDT": "ACWDT", "SAST": "SAST", "∅∅∅": "∅∅∅", "SGT": "SGT"},
+ timezones: map[string]string{"ARST": "ARST", "JDT": "JDT", "ADT": "ADT", "AWST": "AWST", "IST": "IST", "WAT": "WAT", "WIT": "WIT", "LHST": "LHST", "HAT": "HAT", "HKT": "HKT", "HKST": "HKST", "WITA": "WITA", "AWDT": "AWDT", "COST": "COST", "WESZ": "WESZ", "CLT": "CLT", "∅∅∅": "∅∅∅", "VET": "VET", "AST": "AST", "ACWST": "ACWST", "PST": "PST", "CAT": "CAT", "ACST": "ACST", "GFT": "GFT", "SRT": "SRT", "ART": "ART", "SAST": "SAST", "EDT": "EDT", "SGT": "SGT", "TMST": "TMST", "EAT": "EAT", "WART": "WART", "AEDT": "AEDT", "JST": "JST", "TMT": "TMT", "LHDT": "LHDT", "MDT": "MDT", "GMT": "GMT", "AKDT": "AKDT", "WAST": "WAST", "AEST": "AEST", "MST": "MST", "CHADT": "CHADT", "AKST": "AKST", "MYT": "MYT", "ECT": "ECT", "GYT": "GYT", "WIB": "WIB", "WEZ": "WEZ", "HNT": "HNT", "CLST": "CLST", "COT": "COT", "MESZ": "MESZ", "HAST": "HAST", "NZDT": "NZDT", "BOT": "BOT", "OEZ": "OEZ", "ACWDT": "ACWDT", "MEZ": "MEZ", "HADT": "HADT", "EST": "EST", "ACDT": "ACDT", "CHAST": "CHAST", "NZST": "NZST", "PDT": "PDT", "ChST": "ChST", "BT": "BT", "WARST": "WARST", "CST": "CST", "CDT": "CDT", "OESZ": "OESZ", "UYT": "UYT", "UYST": "UYST"},
}
}
diff --git a/ses/ses_test.go b/ses/ses_test.go
new file mode 100644
index 00000000..3fdbd5b5
--- /dev/null
+++ b/ses/ses_test.go
@@ -0,0 +1,1120 @@
+package ses
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ses"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ses_ML/ses_ML.go b/ses_ML/ses_ML.go
index ac369e12..f8ecd3d0 100644
--- a/ses_ML/ses_ML.go
+++ b/ses_ML/ses_ML.go
@@ -60,7 +60,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"IJ", "IZ"},
erasNarrow: []string{"", ""},
erasWide: []string{"Isaa jine", "Isaa zamanoo"},
- timezones: map[string]string{"WAST": "WAST", "HKST": "HKST", "AWST": "AWST", "NZST": "NZST", "UYT": "UYT", "UYST": "UYST", "MDT": "MDT", "AST": "AST", "WIT": "WIT", "CDT": "CDT", "WARST": "WARST", "LHST": "LHST", "GYT": "GYT", "WESZ": "WESZ", "EDT": "EDT", "ADT": "ADT", "OESZ": "OESZ", "PDT": "PDT", "MYT": "MYT", "CHADT": "CHADT", "MEZ": "MEZ", "ACDT": "ACDT", "MESZ": "MESZ", "TMST": "TMST", "JDT": "JDT", "AKDT": "AKDT", "COT": "COT", "SGT": "SGT", "OEZ": "OEZ", "LHDT": "LHDT", "NZDT": "NZDT", "AKST": "AKST", "CLST": "CLST", "AEDT": "AEDT", "ChST": "ChST", "ECT": "ECT", "WART": "WART", "ACST": "ACST", "CLT": "CLT", "ACWDT": "ACWDT", "ARST": "ARST", "WITA": "WITA", "BOT": "BOT", "ACWST": "ACWST", "AEST": "AEST", "EST": "EST", "∅∅∅": "∅∅∅", "HKT": "HKT", "HNT": "HNT", "WIB": "WIB", "JST": "JST", "PST": "PST", "AWDT": "AWDT", "GFT": "GFT", "TMT": "TMT", "WEZ": "WEZ", "CAT": "CAT", "SAST": "SAST", "BT": "BT", "GMT": "GMT", "HAT": "HAT", "SRT": "SRT", "VET": "VET", "COST": "COST", "WAT": "WAT", "IST": "IST", "EAT": "EAT", "ART": "ART", "MST": "MST", "CHAST": "CHAST", "HADT": "HADT", "HAST": "HAST", "CST": "CST"},
+ timezones: map[string]string{"AWST": "AWST", "GMT": "GMT", "BT": "BT", "WARST": "WARST", "WESZ": "WESZ", "EAT": "EAT", "ACDT": "ACDT", "WART": "WART", "VET": "VET", "NZDT": "NZDT", "AEDT": "AEDT", "ChST": "ChST", "CLT": "CLT", "CST": "CST", "CHADT": "CHADT", "AKST": "AKST", "ACWDT": "ACWDT", "ARST": "ARST", "TMT": "TMT", "TMST": "TMST", "OEZ": "OEZ", "UYT": "UYT", "HAST": "HAST", "CAT": "CAT", "ART": "ART", "WITA": "WITA", "EST": "EST", "PST": "PST", "MEZ": "MEZ", "WEZ": "WEZ", "CHAST": "CHAST", "ADT": "ADT", "AWDT": "AWDT", "HNT": "HNT", "COT": "COT", "MYT": "MYT", "ECT": "ECT", "AKDT": "AKDT", "WIT": "WIT", "LHST": "LHST", "CDT": "CDT", "LHDT": "LHDT", "MST": "MST", "UYST": "UYST", "AST": "AST", "BOT": "BOT", "AEST": "AEST", "IST": "IST", "GFT": "GFT", "HADT": "HADT", "SRT": "SRT", "PDT": "PDT", "NZST": "NZST", "SGT": "SGT", "COST": "COST", "OESZ": "OESZ", "MDT": "MDT", "HKST": "HKST", "HKT": "HKT", "ACWST": "ACWST", "JST": "JST", "∅∅∅": "∅∅∅", "WAT": "WAT", "WAST": "WAST", "WIB": "WIB", "GYT": "GYT", "JDT": "JDT", "SAST": "SAST", "EDT": "EDT", "MESZ": "MESZ", "HAT": "HAT", "CLST": "CLST", "ACST": "ACST"},
}
}
diff --git a/ses_ML/ses_ML_test.go b/ses_ML/ses_ML_test.go
new file mode 100644
index 00000000..533c8244
--- /dev/null
+++ b/ses_ML/ses_ML_test.go
@@ -0,0 +1,1120 @@
+package ses_ML
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ses_ML"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/sg/sg.go b/sg/sg.go
index bb7e48f6..4b4ae3d3 100644
--- a/sg/sg.go
+++ b/sg/sg.go
@@ -61,7 +61,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"KnK", "NpK"},
erasNarrow: []string{"", ""},
erasWide: []string{"Kôzo na Krîstu", "Na pekô tî Krîstu"},
- timezones: map[string]string{"JST": "JST", "WESZ": "WESZ", "EST": "EST", "AST": "AST", "WARST": "WARST", "AWDT": "AWDT", "ECT": "ECT", "MYT": "MYT", "SRT": "SRT", "∅∅∅": "∅∅∅", "GFT": "GFT", "ACST": "ACST", "CST": "CST", "WIT": "WIT", "LHST": "LHST", "LHDT": "LHDT", "PST": "PST", "EDT": "EDT", "HKST": "HKST", "SAST": "SAST", "CHAST": "CHAST", "COT": "COT", "HAST": "HAST", "AKST": "AKST", "VET": "VET", "CDT": "CDT", "ChST": "ChST", "ADT": "ADT", "BT": "BT", "EAT": "EAT", "JDT": "JDT", "AEST": "AEST", "AEDT": "AEDT", "WART": "WART", "ACDT": "ACDT", "AWST": "AWST", "PDT": "PDT", "CLST": "CLST", "WAST": "WAST", "GMT": "GMT", "HAT": "HAT", "WIB": "WIB", "CLT": "CLT", "CAT": "CAT", "WAT": "WAT", "WITA": "WITA", "ARST": "ARST", "MEZ": "MEZ", "CHADT": "CHADT", "WEZ": "WEZ", "OEZ": "OEZ", "OESZ": "OESZ", "NZDT": "NZDT", "MESZ": "MESZ", "MST": "MST", "MDT": "MDT", "NZST": "NZST", "ACWST": "ACWST", "HNT": "HNT", "IST": "IST", "ART": "ART", "TMT": "TMT", "UYST": "UYST", "ACWDT": "ACWDT", "SGT": "SGT", "HKT": "HKT", "TMST": "TMST", "GYT": "GYT", "COST": "COST", "HADT": "HADT", "AKDT": "AKDT", "BOT": "BOT", "UYT": "UYT"},
+ timezones: map[string]string{"WESZ": "WESZ", "ChST": "ChST", "OESZ": "OESZ", "CLT": "CLT", "BT": "BT", "CDT": "CDT", "ADT": "ADT", "CAT": "CAT", "AEDT": "AEDT", "CST": "CST", "WART": "WART", "GMT": "GMT", "EST": "EST", "EAT": "EAT", "MST": "MST", "WITA": "WITA", "MESZ": "MESZ", "EDT": "EDT", "COST": "COST", "TMT": "TMT", "TMST": "TMST", "HKT": "HKT", "CHAST": "CHAST", "AWDT": "AWDT", "MEZ": "MEZ", "SAST": "SAST", "LHST": "LHST", "WAST": "WAST", "ACDT": "ACDT", "∅∅∅": "∅∅∅", "IST": "IST", "SGT": "SGT", "COT": "COT", "HKST": "HKST", "ACWST": "ACWST", "NZDT": "NZDT", "WIB": "WIB", "MDT": "MDT", "ARST": "ARST", "HAST": "HAST", "VET": "VET", "HNT": "HNT", "WIT": "WIT", "JDT": "JDT", "AST": "AST", "UYST": "UYST", "BOT": "BOT", "HAT": "HAT", "WAT": "WAT", "LHDT": "LHDT", "ACST": "ACST", "ART": "ART", "HADT": "HADT", "PST": "PST", "MYT": "MYT", "CLST": "CLST", "UYT": "UYT", "WARST": "WARST", "JST": "JST", "AKST": "AKST", "NZST": "NZST", "SRT": "SRT", "CHADT": "CHADT", "ACWDT": "ACWDT", "WEZ": "WEZ", "OEZ": "OEZ", "AEST": "AEST", "GFT": "GFT", "AKDT": "AKDT", "PDT": "PDT", "ECT": "ECT", "AWST": "AWST", "GYT": "GYT"},
}
}
diff --git a/sg/sg_test.go b/sg/sg_test.go
new file mode 100644
index 00000000..85aaeb48
--- /dev/null
+++ b/sg/sg_test.go
@@ -0,0 +1,1120 @@
+package sg
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "sg"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/sg_CF/sg_CF.go b/sg_CF/sg_CF.go
index 8d7af4d0..ce824e5b 100644
--- a/sg_CF/sg_CF.go
+++ b/sg_CF/sg_CF.go
@@ -61,7 +61,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"KnK", "NpK"},
erasNarrow: []string{"", ""},
erasWide: []string{"Kôzo na Krîstu", "Na pekô tî Krîstu"},
- timezones: map[string]string{"VET": "VET", "BT": "BT", "HNT": "HNT", "SRT": "SRT", "AKST": "AKST", "CST": "CST", "MST": "MST", "EAT": "EAT", "PDT": "PDT", "CDT": "CDT", "NZDT": "NZDT", "AEST": "AEST", "ECT": "ECT", "∅∅∅": "∅∅∅", "HKT": "HKT", "HKST": "HKST", "GMT": "GMT", "TMT": "TMT", "EST": "EST", "SAST": "SAST", "WAST": "WAST", "ACWST": "ACWST", "AEDT": "AEDT", "WAT": "WAT", "IST": "IST", "WITA": "WITA", "JST": "JST", "AWDT": "AWDT", "CHAST": "CHAST", "AST": "AST", "HADT": "HADT", "LHST": "LHST", "WESZ": "WESZ", "MDT": "MDT", "ACST": "ACST", "PST": "PST", "AWST": "AWST", "MESZ": "MESZ", "UYT": "UYT", "SGT": "SGT", "OESZ": "OESZ", "TMST": "TMST", "UYST": "UYST", "WEZ": "WEZ", "COT": "COT", "WART": "WART", "NZST": "NZST", "LHDT": "LHDT", "ART": "ART", "COST": "COST", "WIB": "WIB", "HAT": "HAT", "ACWDT": "ACWDT", "GFT": "GFT", "ACDT": "ACDT", "ARST": "ARST", "MYT": "MYT", "BOT": "BOT", "CLST": "CLST", "CAT": "CAT", "ADT": "ADT", "HAST": "HAST", "AKDT": "AKDT", "MEZ": "MEZ", "OEZ": "OEZ", "JDT": "JDT", "GYT": "GYT", "CLT": "CLT", "ChST": "ChST", "CHADT": "CHADT", "EDT": "EDT", "WARST": "WARST", "WIT": "WIT"},
+ timezones: map[string]string{"NZST": "NZST", "∅∅∅": "∅∅∅", "WEZ": "WEZ", "AEDT": "AEDT", "EDT": "EDT", "OESZ": "OESZ", "AWDT": "AWDT", "WARST": "WARST", "SRT": "SRT", "ECT": "ECT", "HNT": "HNT", "TMT": "TMT", "GMT": "GMT", "BT": "BT", "LHDT": "LHDT", "UYST": "UYST", "WAT": "WAT", "WESZ": "WESZ", "CLT": "CLT", "ACWST": "ACWST", "PST": "PST", "PDT": "PDT", "AEST": "AEST", "GYT": "GYT", "MDT": "MDT", "ADT": "ADT", "WAST": "WAST", "WIB": "WIB", "OEZ": "OEZ", "CDT": "CDT", "WART": "WART", "CHADT": "CHADT", "TMST": "TMST", "HKST": "HKST", "AKST": "AKST", "ACWDT": "ACWDT", "ARST": "ARST", "LHST": "LHST", "MYT": "MYT", "AST": "AST", "ART": "ART", "SAST": "SAST", "HADT": "HADT", "MST": "MST", "JDT": "JDT", "EAT": "EAT", "UYT": "UYT", "ACST": "ACST", "ACDT": "ACDT", "MESZ": "MESZ", "COST": "COST", "ChST": "ChST", "CLST": "CLST", "EST": "EST", "HAST": "HAST", "NZDT": "NZDT", "CST": "CST", "GFT": "GFT", "CHAST": "CHAST", "AWST": "AWST", "WITA": "WITA", "IST": "IST", "SGT": "SGT", "WIT": "WIT", "HKT": "HKT", "JST": "JST", "AKDT": "AKDT", "MEZ": "MEZ", "BOT": "BOT", "CAT": "CAT", "HAT": "HAT", "COT": "COT", "VET": "VET"},
}
}
diff --git a/sg_CF/sg_CF_test.go b/sg_CF/sg_CF_test.go
new file mode 100644
index 00000000..8db0efb2
--- /dev/null
+++ b/sg_CF/sg_CF_test.go
@@ -0,0 +1,1120 @@
+package sg_CF
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "sg_CF"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/shi/shi.go b/shi/shi.go
index 327ed8d9..daac8de5 100644
--- a/shi/shi.go
+++ b/shi/shi.go
@@ -60,7 +60,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ⴷⴰⵄ", "ⴷⴼⵄ"},
erasNarrow: []string{"", ""},
erasWide: []string{"ⴷⴰⵜ ⵏ ⵄⵉⵙⴰ", "ⴷⴼⴼⵉⵔ ⵏ ⵄⵉⵙⴰ"},
- timezones: map[string]string{"ACDT": "ACDT", "ART": "ART", "EAT": "EAT", "MYT": "MYT", "CLT": "CLT", "WEZ": "WEZ", "MEZ": "MEZ", "PST": "PST", "WITA": "WITA", "WIB": "WIB", "ECT": "ECT", "WAST": "WAST", "WIT": "WIT", "ARST": "ARST", "GYT": "GYT", "JST": "JST", "WESZ": "WESZ", "MST": "MST", "ACWST": "ACWST", "ADT": "ADT", "OEZ": "OEZ", "CAT": "CAT", "COT": "COT", "HKT": "HKT", "IST": "IST", "GFT": "GFT", "OESZ": "OESZ", "LHST": "LHST", "CHADT": "CHADT", "AEST": "AEST", "HADT": "HADT", "AKDT": "AKDT", "LHDT": "LHDT", "WAT": "WAT", "MDT": "MDT", "SAST": "SAST", "HKST": "HKST", "AKST": "AKST", "AWST": "AWST", "CDT": "CDT", "EDT": "EDT", "VET": "VET", "AEDT": "AEDT", "EST": "EST", "AST": "AST", "∅∅∅": "∅∅∅", "TMST": "TMST", "PDT": "PDT", "CLST": "CLST", "HAT": "HAT", "ACWDT": "ACWDT", "SGT": "SGT", "WARST": "WARST", "ACST": "ACST", "SRT": "SRT", "UYT": "UYT", "CST": "CST", "WART": "WART", "BT": "BT", "GMT": "GMT", "HNT": "HNT", "AWDT": "AWDT", "NZDT": "NZDT", "BOT": "BOT", "ChST": "ChST", "NZST": "NZST", "CHAST": "CHAST", "COST": "COST", "HAST": "HAST", "TMT": "TMT", "JDT": "JDT", "UYST": "UYST", "MESZ": "MESZ"},
+ timezones: map[string]string{"IST": "IST", "WESZ": "WESZ", "WAT": "WAT", "ACDT": "ACDT", "HKST": "HKST", "PDT": "PDT", "MESZ": "MESZ", "HKT": "HKT", "AST": "AST", "∅∅∅": "∅∅∅", "CLT": "CLT", "WIT": "WIT", "VET": "VET", "SRT": "SRT", "ARST": "ARST", "JDT": "JDT", "AEDT": "AEDT", "LHST": "LHST", "EAT": "EAT", "WITA": "WITA", "ADT": "ADT", "COT": "COT", "MDT": "MDT", "UYST": "UYST", "CHAST": "CHAST", "TMT": "TMT", "AEST": "AEST", "GFT": "GFT", "HNT": "HNT", "GYT": "GYT", "WEZ": "WEZ", "HAT": "HAT", "WIB": "WIB", "WAST": "WAST", "ART": "ART", "JST": "JST", "EDT": "EDT", "HAST": "HAST", "AKST": "AKST", "CDT": "CDT", "AKDT": "AKDT", "SGT": "SGT", "OEZ": "OEZ", "MST": "MST", "WARST": "WARST", "NZST": "NZST", "NZDT": "NZDT", "TMST": "TMST", "CAT": "CAT", "ChST": "ChST", "CLST": "CLST", "WART": "WART", "ACST": "ACST", "HADT": "HADT", "BOT": "BOT", "AWST": "AWST", "AWDT": "AWDT", "ACWDT": "ACWDT", "BT": "BT", "EST": "EST", "MEZ": "MEZ", "CST": "CST", "CHADT": "CHADT", "SAST": "SAST", "LHDT": "LHDT", "OESZ": "OESZ", "GMT": "GMT", "MYT": "MYT", "PST": "PST", "COST": "COST", "ACWST": "ACWST", "UYT": "UYT", "ECT": "ECT"},
}
}
diff --git a/shi/shi_test.go b/shi/shi_test.go
new file mode 100644
index 00000000..1f0560f0
--- /dev/null
+++ b/shi/shi_test.go
@@ -0,0 +1,1120 @@
+package shi
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "shi"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/shi_Latn/shi_Latn.go b/shi_Latn/shi_Latn.go
index 7765f2c7..84376065 100644
--- a/shi_Latn/shi_Latn.go
+++ b/shi_Latn/shi_Latn.go
@@ -60,7 +60,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"daɛ", "dfɛ"},
erasNarrow: []string{"", ""},
erasWide: []string{"dat n ɛisa", "dffir n ɛisa"},
- timezones: map[string]string{"AEDT": "AEDT", "ChST": "ChST", "MST": "MST", "AST": "AST", "ADT": "ADT", "SRT": "SRT", "CST": "CST", "CLT": "CLT", "BT": "BT", "ART": "ART", "AWDT": "AWDT", "MYT": "MYT", "EDT": "EDT", "COST": "COST", "ECT": "ECT", "HAST": "HAST", "WAT": "WAT", "SGT": "SGT", "SAST": "SAST", "MEZ": "MEZ", "HKT": "HKT", "GMT": "GMT", "GFT": "GFT", "LHST": "LHST", "AEST": "AEST", "CAT": "CAT", "PST": "PST", "JDT": "JDT", "UYST": "UYST", "WART": "WART", "WARST": "WARST", "CHAST": "CHAST", "ACST": "ACST", "TMST": "TMST", "AWST": "AWST", "JST": "JST", "IST": "IST", "HNT": "HNT", "HAT": "HAT", "ACDT": "ACDT", "AKST": "AKST", "WEZ": "WEZ", "ACWST": "ACWST", "CHADT": "CHADT", "∅∅∅": "∅∅∅", "ARST": "ARST", "BOT": "BOT", "EST": "EST", "HKST": "HKST", "WITA": "WITA", "LHDT": "LHDT", "NZST": "NZST", "AKDT": "AKDT", "GYT": "GYT", "WESZ": "WESZ", "OEZ": "OEZ", "OESZ": "OESZ", "TMT": "TMT", "MESZ": "MESZ", "VET": "VET", "COT": "COT", "HADT": "HADT", "WAST": "WAST", "NZDT": "NZDT", "ACWDT": "ACWDT", "PDT": "PDT", "CDT": "CDT", "MDT": "MDT", "CLST": "CLST", "WIT": "WIT", "WIB": "WIB", "EAT": "EAT", "UYT": "UYT"},
+ timezones: map[string]string{"MDT": "MDT", "EST": "EST", "MEZ": "MEZ", "MESZ": "MESZ", "WAT": "WAT", "WESZ": "WESZ", "CDT": "CDT", "∅∅∅": "∅∅∅", "CAT": "CAT", "EDT": "EDT", "HADT": "HADT", "GFT": "GFT", "HKT": "HKT", "JDT": "JDT", "AWDT": "AWDT", "NZST": "NZST", "SAST": "SAST", "ACDT": "ACDT", "WART": "WART", "MST": "MST", "NZDT": "NZDT", "WIB": "WIB", "WEZ": "WEZ", "CLT": "CLT", "CST": "CST", "JST": "JST", "HNT": "HNT", "COT": "COT", "ChST": "ChST", "EAT": "EAT", "CLST": "CLST", "ECT": "ECT", "AWST": "AWST", "PST": "PST", "HAT": "HAT", "GYT": "GYT", "AKDT": "AKDT", "ACWDT": "ACWDT", "SGT": "SGT", "ADT": "ADT", "WAST": "WAST", "OEZ": "OEZ", "GMT": "GMT", "LHST": "LHST", "ACST": "ACST", "AST": "AST", "ACWST": "ACWST", "AEST": "AEST", "UYST": "UYST", "MYT": "MYT", "WARST": "WARST", "HKST": "HKST", "AKST": "AKST", "PDT": "PDT", "WIT": "WIT", "BT": "BT", "ART": "ART", "WITA": "WITA", "COST": "COST", "CHAST": "CHAST", "BOT": "BOT", "HAST": "HAST", "UYT": "UYT", "VET": "VET", "ARST": "ARST", "IST": "IST", "CHADT": "CHADT", "TMT": "TMT", "LHDT": "LHDT", "TMST": "TMST", "OESZ": "OESZ", "AEDT": "AEDT", "SRT": "SRT"},
}
}
diff --git a/shi_Latn/shi_Latn_test.go b/shi_Latn/shi_Latn_test.go
new file mode 100644
index 00000000..aa7f2963
--- /dev/null
+++ b/shi_Latn/shi_Latn_test.go
@@ -0,0 +1,1120 @@
+package shi_Latn
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "shi_Latn"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/shi_Latn_MA/shi_Latn_MA.go b/shi_Latn_MA/shi_Latn_MA.go
index 44d9fc8d..553f0306 100644
--- a/shi_Latn_MA/shi_Latn_MA.go
+++ b/shi_Latn_MA/shi_Latn_MA.go
@@ -60,7 +60,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ⴷⴰⵄ", "ⴷⴼⵄ"},
erasNarrow: []string{"", ""},
erasWide: []string{"ⴷⴰⵜ ⵏ ⵄⵉⵙⴰ", "ⴷⴼⴼⵉⵔ ⵏ ⵄⵉⵙⴰ"},
- timezones: map[string]string{"ACDT": "ACDT", "ARST": "ARST", "JST": "JST", "ECT": "ECT", "AKST": "AKST", "UYST": "UYST", "AEST": "AEST", "ChST": "ChST", "∅∅∅": "∅∅∅", "ADT": "ADT", "SRT": "SRT", "WARST": "WARST", "AWST": "AWST", "CDT": "CDT", "WEZ": "WEZ", "MDT": "MDT", "EST": "EST", "SGT": "SGT", "WAT": "WAT", "IST": "IST", "GYT": "GYT", "MEZ": "MEZ", "EDT": "EDT", "WART": "WART", "PST": "PST", "WIB": "WIB", "MYT": "MYT", "BOT": "BOT", "WESZ": "WESZ", "OEZ": "OEZ", "WIT": "WIT", "ACWDT": "ACWDT", "CLST": "CLST", "HADT": "HADT", "WAST": "WAST", "OESZ": "OESZ", "GFT": "GFT", "AKDT": "AKDT", "CST": "CST", "CLT": "CLT", "COST": "COST", "GMT": "GMT", "HAT": "HAT", "JDT": "JDT", "CHAST": "CHAST", "SAST": "SAST", "EAT": "EAT", "LHDT": "LHDT", "MESZ": "MESZ", "MST": "MST", "HKT": "HKT", "HNT": "HNT", "NZDT": "NZDT", "AEDT": "AEDT", "ACST": "ACST", "TMT": "TMT", "TMST": "TMST", "PDT": "PDT", "AWDT": "AWDT", "UYT": "UYT", "ART": "ART", "LHST": "LHST", "CHADT": "CHADT", "VET": "VET", "CAT": "CAT", "AST": "AST", "HAST": "HAST", "BT": "BT", "HKST": "HKST", "WITA": "WITA", "NZST": "NZST", "ACWST": "ACWST", "COT": "COT"},
+ timezones: map[string]string{"EAT": "EAT", "AST": "AST", "WAST": "WAST", "AEST": "AEST", "BT": "BT", "LHST": "LHST", "MYT": "MYT", "JST": "JST", "AKDT": "AKDT", "PDT": "PDT", "TMST": "TMST", "HKST": "HKST", "ACWST": "ACWST", "PST": "PST", "WIB": "WIB", "MDT": "MDT", "CLST": "CLST", "ECT": "ECT", "OEZ": "OEZ", "WARST": "WARST", "AKST": "AKST", "SAST": "SAST", "WESZ": "WESZ", "TMT": "TMT", "OESZ": "OESZ", "UYST": "UYST", "CHAST": "CHAST", "ACWDT": "ACWDT", "IST": "IST", "WEZ": "WEZ", "COT": "COT", "MEZ": "MEZ", "HAST": "HAST", "WITA": "WITA", "HNT": "HNT", "HKT": "HKT", "HAT": "HAT", "GMT": "GMT", "WAT": "WAT", "SGT": "SGT", "GYT": "GYT", "LHDT": "LHDT", "UYT": "UYT", "GFT": "GFT", "ARST": "ARST", "EDT": "EDT", "BOT": "BOT", "MST": "MST", "WART": "WART", "CST": "CST", "CDT": "CDT", "AWDT": "AWDT", "NZST": "NZST", "CLT": "CLT", "ACST": "ACST", "ACDT": "ACDT", "VET": "VET", "ADT": "ADT", "ART": "ART", "MESZ": "MESZ", "AEDT": "AEDT", "WIT": "WIT", "EST": "EST", "COST": "COST", "∅∅∅": "∅∅∅", "AWST": "AWST", "HADT": "HADT", "NZDT": "NZDT", "CAT": "CAT", "ChST": "ChST", "SRT": "SRT", "CHADT": "CHADT", "JDT": "JDT"},
}
}
diff --git a/shi_Latn_MA/shi_Latn_MA_test.go b/shi_Latn_MA/shi_Latn_MA_test.go
new file mode 100644
index 00000000..440eb37f
--- /dev/null
+++ b/shi_Latn_MA/shi_Latn_MA_test.go
@@ -0,0 +1,1120 @@
+package shi_Latn_MA
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "shi_Latn_MA"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/shi_Tfng/shi_Tfng.go b/shi_Tfng/shi_Tfng.go
index 6d2dc9dc..09524672 100644
--- a/shi_Tfng/shi_Tfng.go
+++ b/shi_Tfng/shi_Tfng.go
@@ -60,7 +60,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ⴷⴰⵄ", "ⴷⴼⵄ"},
erasNarrow: []string{"", ""},
erasWide: []string{"ⴷⴰⵜ ⵏ ⵄⵉⵙⴰ", "ⴷⴼⴼⵉⵔ ⵏ ⵄⵉⵙⴰ"},
- timezones: map[string]string{"NZST": "NZST", "AEDT": "AEDT", "AKDT": "AKDT", "LHDT": "LHDT", "COT": "COT", "AST": "AST", "IST": "IST", "BT": "BT", "CDT": "CDT", "WAST": "WAST", "ACST": "ACST", "PDT": "PDT", "NZDT": "NZDT", "UYT": "UYT", "UYST": "UYST", "AEST": "AEST", "SGT": "SGT", "GMT": "GMT", "AWDT": "AWDT", "WESZ": "WESZ", "EST": "EST", "ARST": "ARST", "WARST": "WARST", "HAT": "HAT", "ACDT": "ACDT", "PST": "PST", "CST": "CST", "WEZ": "WEZ", "HKT": "HKT", "AWST": "AWST", "HADT": "HADT", "WIT": "WIT", "JDT": "JDT", "CHAST": "CHAST", "JST": "JST", "ART": "ART", "MYT": "MYT", "MESZ": "MESZ", "BOT": "BOT", "CLST": "CLST", "CAT": "CAT", "ADT": "ADT", "HNT": "HNT", "HAST": "HAST", "MEZ": "MEZ", "VET": "VET", "EAT": "EAT", "MST": "MST", "SRT": "SRT", "ACWDT": "ACWDT", "EDT": "EDT", "SAST": "SAST", "OESZ": "OESZ", "TMT": "TMT", "HKST": "HKST", "WIB": "WIB", "MDT": "MDT", "∅∅∅": "∅∅∅", "ChST": "ChST", "ECT": "ECT", "WAT": "WAT", "GFT": "GFT", "TMST": "TMST", "GYT": "GYT", "ACWST": "ACWST", "CLT": "CLT", "OEZ": "OEZ", "WITA": "WITA", "AKST": "AKST", "LHST": "LHST", "CHADT": "CHADT", "COST": "COST", "WART": "WART"},
+ timezones: map[string]string{"ACDT": "ACDT", "ART": "ART", "JST": "JST", "ACWDT": "ACWDT", "IST": "IST", "TMT": "TMT", "LHDT": "LHDT", "CDT": "CDT", "WAST": "WAST", "MDT": "MDT", "ACST": "ACST", "EST": "EST", "WESZ": "WESZ", "AEST": "AEST", "ChST": "ChST", "OEZ": "OEZ", "MYT": "MYT", "CHADT": "CHADT", "ADT": "ADT", "PST": "PST", "COT": "COT", "EAT": "EAT", "HKT": "HKT", "∅∅∅": "∅∅∅", "WARST": "WARST", "AKST": "AKST", "HAST": "HAST", "HADT": "HADT", "EDT": "EDT", "CLST": "CLST", "MST": "MST", "BOT": "BOT", "CHAST": "CHAST", "JDT": "JDT", "AST": "AST", "PDT": "PDT", "CST": "CST", "WART": "WART", "VET": "VET", "MEZ": "MEZ", "NZST": "NZST", "OESZ": "OESZ", "LHST": "LHST", "AWST": "AWST", "SAST": "SAST", "COST": "COST", "WIB": "WIB", "BT": "BT", "HKST": "HKST", "NZDT": "NZDT", "CAT": "CAT", "WAT": "WAT", "HAT": "HAT", "WIT": "WIT", "ECT": "ECT", "SRT": "SRT", "WEZ": "WEZ", "GYT": "GYT", "UYST": "UYST", "CLT": "CLT", "GFT": "GFT", "TMST": "TMST", "SGT": "SGT", "HNT": "HNT", "AEDT": "AEDT", "ACWST": "ACWST", "WITA": "WITA", "GMT": "GMT", "UYT": "UYT", "AWDT": "AWDT", "MESZ": "MESZ", "ARST": "ARST", "AKDT": "AKDT"},
}
}
diff --git a/shi_Tfng/shi_Tfng_test.go b/shi_Tfng/shi_Tfng_test.go
new file mode 100644
index 00000000..c303ddee
--- /dev/null
+++ b/shi_Tfng/shi_Tfng_test.go
@@ -0,0 +1,1120 @@
+package shi_Tfng
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "shi_Tfng"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/shi_Tfng_MA/shi_Tfng_MA.go b/shi_Tfng_MA/shi_Tfng_MA.go
index fed8b6bd..5f82a59e 100644
--- a/shi_Tfng_MA/shi_Tfng_MA.go
+++ b/shi_Tfng_MA/shi_Tfng_MA.go
@@ -60,7 +60,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ⴷⴰⵄ", "ⴷⴼⵄ"},
erasNarrow: []string{"", ""},
erasWide: []string{"ⴷⴰⵜ ⵏ ⵄⵉⵙⴰ", "ⴷⴼⴼⵉⵔ ⵏ ⵄⵉⵙⴰ"},
- timezones: map[string]string{"AEST": "AEST", "COST": "COST", "ACDT": "ACDT", "MDT": "MDT", "TMT": "TMT", "ARST": "ARST", "MYT": "MYT", "GYT": "GYT", "CLST": "CLST", "WART": "WART", "WIB": "WIB", "PDT": "PDT", "AWST": "AWST", "MESZ": "MESZ", "ChST": "ChST", "MST": "MST", "WAST": "WAST", "OESZ": "OESZ", "SRT": "SRT", "WIT": "WIT", "BT": "BT", "WITA": "WITA", "GFT": "GFT", "WAT": "WAT", "HKT": "HKT", "NZST": "NZST", "LHST": "LHST", "CDT": "CDT", "HKST": "HKST", "WARST": "WARST", "TMST": "TMST", "ART": "ART", "AWDT": "AWDT", "VET": "VET", "ACWST": "ACWST", "JDT": "JDT", "AKDT": "AKDT", "PST": "PST", "∅∅∅": "∅∅∅", "HAST": "HAST", "IST": "IST", "HNT": "HNT", "HAT": "HAT", "LHDT": "LHDT", "BOT": "BOT", "CHADT": "CHADT", "HADT": "HADT", "SAST": "SAST", "GMT": "GMT", "JST": "JST", "WEZ": "WEZ", "EST": "EST", "SGT": "SGT", "CST": "CST", "NZDT": "NZDT", "WESZ": "WESZ", "AEDT": "AEDT", "COT": "COT", "AST": "AST", "CHAST": "CHAST", "ACWDT": "ACWDT", "ADT": "ADT", "UYST": "UYST", "ACST": "ACST", "AKST": "AKST", "MEZ": "MEZ", "CLT": "CLT", "CAT": "CAT", "EDT": "EDT", "OEZ": "OEZ", "EAT": "EAT", "UYT": "UYT", "ECT": "ECT"},
+ timezones: map[string]string{"GYT": "GYT", "HKT": "HKT", "MEZ": "MEZ", "TMST": "TMST", "AST": "AST", "AWST": "AWST", "WITA": "WITA", "EST": "EST", "MESZ": "MESZ", "WIT": "WIT", "CAT": "CAT", "LHDT": "LHDT", "MDT": "MDT", "CST": "CST", "HKST": "HKST", "HAST": "HAST", "HAT": "HAT", "CLST": "CLST", "ACST": "ACST", "ACWDT": "ACWDT", "OESZ": "OESZ", "ART": "ART", "AKST": "AKST", "BOT": "BOT", "VET": "VET", "UYST": "UYST", "ACDT": "ACDT", "WART": "WART", "ARST": "ARST", "AKDT": "AKDT", "HADT": "HADT", "SGT": "SGT", "WIB": "WIB", "AEDT": "AEDT", "ECT": "ECT", "HNT": "HNT", "WAST": "WAST", "COST": "COST", "∅∅∅": "∅∅∅", "ACWST": "ACWST", "PDT": "PDT", "WAT": "WAT", "MST": "MST", "SRT": "SRT", "CHADT": "CHADT", "JDT": "JDT", "IST": "IST", "WESZ": "WESZ", "MYT": "MYT", "ADT": "ADT", "JST": "JST", "NZDT": "NZDT", "COT": "COT", "CDT": "CDT", "ChST": "ChST", "UYT": "UYT", "EDT": "EDT", "PST": "PST", "GMT": "GMT", "EAT": "EAT", "WARST": "WARST", "GFT": "GFT", "CHAST": "CHAST", "AWDT": "AWDT", "SAST": "SAST", "CLT": "CLT", "LHST": "LHST", "WEZ": "WEZ", "NZST": "NZST", "AEST": "AEST", "OEZ": "OEZ", "BT": "BT", "TMT": "TMT"},
}
}
diff --git a/shi_Tfng_MA/shi_Tfng_MA_test.go b/shi_Tfng_MA/shi_Tfng_MA_test.go
new file mode 100644
index 00000000..8817815e
--- /dev/null
+++ b/shi_Tfng_MA/shi_Tfng_MA_test.go
@@ -0,0 +1,1120 @@
+package shi_Tfng_MA
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "shi_Tfng_MA"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/si/si.go b/si/si.go
index dad799e1..20461e71 100644
--- a/si/si.go
+++ b/si/si.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ක්\u200dරි.පූ.", "ක්\u200dරි.ව."},
erasNarrow: []string{"", ""},
erasWide: []string{"ක්\u200dරිස්තු පූර්ව", "ක්\u200dරිස්තු වර්ෂ"},
- timezones: map[string]string{"HNT": "නිව්ෆවුන්ලන්ත සම්මත වේලාව", "MST": "MST", "LHST": "ලෝර්ඩ් හෝව් සම්මත වේලාව", "SRT": "සුරිනාම වේලාව", "ACWST": "මධ්\u200dයම බටහිර ඔස්ට්\u200dරේලියානු සම්මත වේලාව", "ECT": "ඉක්වදෝර් වේලාව", "WART": "බටහිර ආර්ජන්ටිනා සම්මත වේලාව", "GMT": "ග්\u200dරිනිච් මධ්\u200dයම වේලාව", "CST": "උතුරු ඇමරිකානු මධ්\u200dයම සම්මත වේලාව", "ACST": "ඕස්ට්\u200dරේලියානු සම්මත වේලාව", "ACDT": "මධ්\u200dයම ඔස්ට්\u200dරේලියානු දහවල් වේලාව", "MESZ": "මධ්\u200dයම යුරෝපීය ග්\u200dරීෂ්ම වේලාව", "CLT": "චිලී සම්මත වේලාව", "WAT": "බටහිර අප්\u200dරිකානු සම්මත වේලාව", "NZDT": "නවසීලන්ත දිවා වේලාව", "WESZ": "බටහිර යුරෝපීය ග්\u200dරීෂ්ම වේලාව", "ACWDT": "මධ්\u200dයම බටහිර ඔස්ට්\u200dරේලියානු දහවල් වේලාව", "AEDT": "නැඟෙනහිර ඕස්ට්\u200dරේලියානු දහවල් වේලාව", "PST": "උතුරු ඇමරිකානු පැසිෆික් සම්මත වේලාව", "HADT": "හවායි-අලෙයුතියාන් දිවාආලෝක වේලාව", "WAST": "බටහිර අප්\u200dරිකානු ග්\u200dරීෂ්ම කාලය", "PDT": "උතුරු ඇමරිකානු පැසිෆික් දිවාආලෝක වේලාව", "LHDT": "ලෝර්ඩ් හෝව් දිවා වේලාව", "CLST": "චිලී ග්\u200dරීෂ්ම කාලය", "BT": "භුතාන වේලාව", "MEZ": "මධ්\u200dයම යුරෝපීය සම්මත වේලාව", "HAST": "හවායි-අලෙයුතියාන් සම්මත වේලාව", "AWDT": "බටහිර ඔස්ට්\u200dරේලියානු දහවල් වේලාව", "MYT": "මැලේසියානු වේලාව", "SAST": "දකුණු අප්\u200dරිකානු වේලාව", "WARST": "බටහිර ආර්ජන්ටිනා ග්\u200dරීෂ්ම කාලය", "CDT": "උතුරු ඇමරිකානු මධ්\u200dයම දිවාආලෝක වේලාව", "CAT": "මධ්\u200dයම අප්\u200dරිකානු වේලාව", "COT": "කොලොම්බියා සම්මත වේලාව", "COST": "කොලොම්බියා ග්\u200dරීෂ්ම කාලය", "HKT": "හොංකොං සම්මත වේලාව", "OESZ": "නැගෙනහිර යුරෝපීය ග්\u200dරීෂ්ම වේලාව", "ART": "ආර්ජන්ටිනා සම්මත වේලාව", "AWST": "බටහිර ඕස්ට්\u200dරේලියානු සම්මත වේලාව", "NZST": "නවසීලන්ත සම්මත වේලාව", "VET": "වෙනිසියුලා වේලාව", "HKST": "හොංකොං ග්\u200dරීෂ්ම වේලාව", "MDT": "MDT", "∅∅∅": "ඇමර්සන් ග්\u200dරීෂ්ම කාලය", "WEZ": "බටහිර යුරෝපීය සම්මත වේලාව", "ARST": "ආර්ජන්ටිනා ග්\u200dරීෂ්ම කාලය", "UYT": "උරුගුවේ සම්මත වේලාව", "CHAST": "චැතම් සම්මත වේලාව", "HAT": "නිව්ෆවුන්ලන්ත දිවාආලෝක වේලාව", "TMT": "ටර්ක්මෙනිස්තාන සම්මත වේලාව", "JST": "ජපාන සම්මත වේලාව", "AEST": "නැගෙනහිර ඕස්ට්\u200dරේලියානු සම්මත වේලාව", "CHADT": "චැතම් දිවා වේලාව", "ADT": "අත්ලාන්තික් දිවාආලෝක වේලාව", "TMST": "ටර්ක්මෙනිස්තාන ග්\u200dරීෂ්ම වේලාව", "AKDT": "ඇලස්කා දිවාආලෝක වේලාව", "GYT": "ගයනා වේලාව", "JDT": "ජපාන දහවල් වේලාව", "UYST": "උරුගුවේ ග්\u200dරීෂ්ම කාලය", "AST": "අත්ලාන්තික් සම්මත වේලාව", "SGT": "සිංගප්පුරු වේලාව", "IST": "ඉන්දියානු වේලාව", "OEZ": "නැගෙනහිර යුරෝපීය සම්මත වේලාව", "WITA": "මධ්\u200dයම ඉන්දුනීසියානු වේලාව", "BOT": "බොලිවියා වේලාව", "ChST": "චමොරෝ වේලාව", "EST": "උතුරු ඇමරිකානු නැගෙනහිර සම්මත වේලාව", "GFT": "ප්\u200dරංශ ගයනා වේලාව", "WIT": "නැගෙනහිර ඉන්දුනීසියානු වේලාව", "WIB": "බටහිර ඉන්දුනීසියානු වේලාව", "EAT": "නැගෙනහිර අප්\u200dරිකානු වේලාව", "AKST": "ඇලස්කා සම්මත වේලාව", "EDT": "උතුරු ඇමරිකානු නැගෙනහිර දිවාආලෝක වේලාව"},
+ timezones: map[string]string{"SRT": "සුරිනාම වේලාව", "IST": "ඉන්දියානු වේලාව", "OEZ": "නැගෙනහිර යුරෝපීය සම්මත වේලාව", "WIT": "නැගෙනහිර ඉන්දුනීසියානු වේලාව", "ACDT": "මධ්\u200dයම ඔස්ට්\u200dරේලියානු දහවල් වේලාව", "AEST": "නැගෙනහිර ඕස්ට්\u200dරේලියානු සම්මත වේලාව", "LHST": "ලෝර්ඩ් හෝව් සම්මත වේලාව", "MESZ": "මධ්\u200dයම යුරෝපීය ග්\u200dරීෂ්ම වේලාව", "HADT": "හවායි-අලෙයුතියාන් දිවාආලෝක වේලාව", "BOT": "බොලිවියා වේලාව", "WIB": "බටහිර ඉන්දුනීසියානු වේලාව", "HKST": "හොංකොං ග්\u200dරීෂ්ම වේලාව", "ACWST": "මධ්\u200dයම බටහිර ඔස්ට්\u200dරේලියානු සම්මත වේලාව", "CLST": "චිලී ග්\u200dරීෂ්ම කාලය", "ChST": "චමොරෝ වේලාව", "CLT": "චිලී සම්මත වේලාව", "EAT": "නැගෙනහිර අප්\u200dරිකානු වේලාව", "CST": "උතුරු ඇමරිකානු මධ්\u200dයම සම්මත වේලාව", "HKT": "හොංකොං සම්මත වේලාව", "∅∅∅": "ඇමර්සන් ග්\u200dරීෂ්ම කාලය", "OESZ": "නැගෙනහිර යුරෝපීය ග්\u200dරීෂ්ම වේලාව", "AEDT": "නැඟෙනහිර ඕස්ට්\u200dරේලියානු දහවල් වේලාව", "AKDT": "ඇලස්කා දිවාආලෝක වේලාව", "AWDT": "බටහිර ඔස්ට්\u200dරේලියානු දහවල් වේලාව", "PST": "උතුරු ඇමරිකානු පැසිෆික් සම්මත වේලාව", "WESZ": "බටහිර යුරෝපීය ග්\u200dරීෂ්ම වේලාව", "COT": "කොලොම්බියා සම්මත වේලාව", "TMST": "ටර්ක්මෙනිස්තාන ග්\u200dරීෂ්ම වේලාව", "GYT": "ගයනා වේලාව", "CDT": "උතුරු ඇමරිකානු මධ්\u200dයම දිවාආලෝක වේලාව", "ART": "ආර්ජන්ටිනා සම්මත වේලාව", "ARST": "ආර්ජන්ටිනා ග්\u200dරීෂ්ම කාලය", "AKST": "ඇලස්කා සම්මත වේලාව", "AST": "අත්ලාන්තික් සම්මත වේලාව", "WARST": "බටහිර ආර්ජන්ටිනා ග්\u200dරීෂ්ම කාලය", "MST": "MST", "ECT": "ඉක්වදෝර් වේලාව", "SAST": "දකුණු අප්\u200dරිකානු වේලාව", "UYT": "උරුගුවේ සම්මත වේලාව", "MDT": "MDT", "ADT": "අත්ලාන්තික් දිවාආලෝක වේලාව", "HAST": "හවායි-අලෙයුතියාන් සම්මත වේලාව", "EST": "උතුරු ඇමරිකානු නැගෙනහිර සම්මත වේලාව", "NZST": "නවසීලන්ත සම්මත වේලාව", "WAT": "බටහිර අප්\u200dරිකානු සම්මත වේලාව", "UYST": "උරුගුවේ ග්\u200dරීෂ්ම කාලය", "EDT": "උතුරු ඇමරිකානු නැගෙනහිර දිවාආලෝක වේලාව", "PDT": "උතුරු ඇමරිකානු පැසිෆික් දිවාආලෝක වේලාව", "HAT": "නිව්ෆවුන්ලන්ත දිවාආලෝක වේලාව", "LHDT": "ලෝර්ඩ් හෝව් දිවා වේලාව", "CHAST": "චැතම් සම්මත වේලාව", "ACWDT": "මධ්\u200dයම බටහිර ඔස්ට්\u200dරේලියානු දහවල් වේලාව", "AWST": "බටහිර ඕස්ට්\u200dරේලියානු සම්මත වේලාව", "NZDT": "නවසීලන්ත දිවා වේලාව", "GFT": "ප්\u200dරංශ ගයනා වේලාව", "CHADT": "චැතම් දිවා වේලාව", "COST": "කොලොම්බියා ග්\u200dරීෂ්ම කාලය", "TMT": "ටර්ක්මෙනිස්තාන සම්මත වේලාව", "VET": "වෙනිසියුලා වේලාව", "JST": "ජපාන සම්මත වේලාව", "MEZ": "මධ්\u200dයම යුරෝපීය සම්මත වේලාව", "CAT": "මධ්\u200dයම අප්\u200dරිකානු වේලාව", "WAST": "බටහිර අප්\u200dරිකානු ග්\u200dරීෂ්ම කාලය", "GMT": "ග්\u200dරිනිච් මධ්\u200dයම වේලාව", "WITA": "මධ්\u200dයම ඉන්දුනීසියානු වේලාව", "HNT": "නිව්ෆවුන්ලන්ත සම්මත වේලාව", "MYT": "මැලේසියානු වේලාව", "JDT": "ජපාන දහවල් වේලාව", "SGT": "සිංගප්පුරු වේලාව", "WART": "බටහිර ආර්ජන්ටිනා සම්මත වේලාව", "WEZ": "බටහිර යුරෝපීය සම්මත වේලාව", "BT": "භුතාන වේලාව", "ACST": "ඕස්ට්\u200dරේලියානු සම්මත වේලාව"},
}
}
diff --git a/si/si_test.go b/si/si_test.go
new file mode 100644
index 00000000..7582ea63
--- /dev/null
+++ b/si/si_test.go
@@ -0,0 +1,1120 @@
+package si
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "si"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/si_LK/si_LK.go b/si_LK/si_LK.go
index d6a0d5f9..2bf8202c 100644
--- a/si_LK/si_LK.go
+++ b/si_LK/si_LK.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ක්\u200dරි.පූ.", "ක්\u200dරි.ව."},
erasNarrow: []string{"", ""},
erasWide: []string{"ක්\u200dරිස්තු පූර්ව", "ක්\u200dරිස්තු වර්ෂ"},
- timezones: map[string]string{"WAST": "බටහිර අප්\u200dරිකානු ග්\u200dරීෂ්ම කාලය", "WART": "බටහිර ආර්ජන්ටිනා සම්මත වේලාව", "AWDT": "බටහිර ඔස්ට්\u200dරේලියානු දහවල් වේලාව", "AKST": "ඇලස්කා සම්මත වේලාව", "CHADT": "චැතම් දිවා වේලාව", "AEST": "නැගෙනහිර ඕස්ට්\u200dරේලියානු සම්මත වේලාව", "ECT": "ඉක්වදෝර් වේලාව", "HAST": "හවායි-අලෙයුතියාන් සම්මත වේලාව", "AST": "අත්ලාන්තික් සම්මත වේලාව", "EAT": "නැගෙනහිර අප්\u200dරිකානු වේලාව", "ACWDT": "මධ්\u200dයම බටහිර ඔස්ට්\u200dරේලියානු දහවල් වේලාව", "CLT": "චිලී සම්මත වේලාව", "WESZ": "බටහිර යුරෝපීය ග්\u200dරීෂ්ම වේලාව", "WARST": "බටහිර ආර්ජන්ටිනා ග්\u200dරීෂ්ම කාලය", "HAT": "නිව්ෆවුන්ලන්ත දිවාආලෝක වේලාව", "UYT": "උරුගුවේ සම්මත වේලාව", "NZST": "නවසීලන්ත සම්මත වේලාව", "EST": "උතුරු ඇමරිකානු නැගෙනහිර සම්මත වේලාව", "COST": "කොලොම්බියා ග්\u200dරීෂ්ම කාලය", "HKT": "හොංකොං සම්මත වේලාව", "GFT": "ප්\u200dරංශ ගයනා වේලාව", "IST": "ඉන්දියානු වේලාව", "JDT": "ජපාන දහවල් වේලාව", "MESZ": "මධ්\u200dයම යුරෝපීය ග්\u200dරීෂ්ම වේලාව", "BT": "භුතාන වේලාව", "HKST": "හොංකොං ග්\u200dරීෂ්ම වේලාව", "GYT": "ගයනා වේලාව", "MST": "උතුරු ඇමරිකානු කඳුකර සම්මත වේලාව", "SAST": "දකුණු අප්\u200dරිකානු වේලාව", "ART": "ආර්ජන්ටිනා සම්මත වේලාව", "SRT": "සුරිනාම වේලාව", "AKDT": "ඇලස්කා දිවාආලෝක වේලාව", "HADT": "හවායි-අලෙයුතියාන් දිවාආලෝක වේලාව", "CLST": "චිලී ග්\u200dරීෂ්ම කාලය", "WEZ": "බටහිර යුරෝපීය සම්මත වේලාව", "ChST": "චමොරෝ වේලාව", "PST": "උතුරු ඇමරිකානු පැසිෆික් සම්මත වේලාව", "AEDT": "නැඟෙනහිර ඕස්ට්\u200dරේලියානු දහවල් වේලාව", "CHAST": "චැතම් සම්මත වේලාව", "CAT": "මධ්\u200dයම අප්\u200dරිකානු වේලාව", "SGT": "සිංගප්පුරු වේලාව", "WAT": "බටහිර අප්\u200dරිකානු සම්මත වේලාව", "ACDT": "මධ්\u200dයම ඔස්ට්\u200dරේලියානු දහවල් වේලාව", "TMT": "ටර්ක්මෙනිස්තාන සම්මත වේලාව", "MDT": "උතුරු ඇමරිකානු කඳුකර දිවාආලෝක වේලාව", "ACST": "ඕස්ට්\u200dරේලියානු සම්මත වේලාව", "HNT": "නිව්ෆවුන්ලන්ත සම්මත වේලාව", "ADT": "අත්ලාන්තික් දිවාආලෝක වේලාව", "COT": "කොලොම්බියා සම්මත වේලාව", "LHDT": "ලෝර්ඩ් හෝව් දිවා වේලාව", "MYT": "මැලේසියානු වේලාව", "CST": "උතුරු ඇමරිකානු මධ්\u200dයම සම්මත වේලාව", "EDT": "උතුරු ඇමරිකානු නැගෙනහිර දිවාආලෝක වේලාව", "OEZ": "නැගෙනහිර යුරෝපීය සම්මත වේලාව", "OESZ": "නැගෙනහිර යුරෝපීය ග්\u200dරීෂ්ම වේලාව", "WITA": "මධ්\u200dයම ඉන්දුනීසියානු වේලාව", "PDT": "උතුරු ඇමරිකානු පැසිෆික් දිවාආලෝක වේලාව", "JST": "ජපාන සම්මත වේලාව", "CDT": "උතුරු ඇමරිකානු මධ්\u200dයම දිවාආලෝක වේලාව", "WIB": "බටහිර ඉන්දුනීසියානු වේලාව", "GMT": "ග්\u200dරිනිච් මධ්\u200dයම වේලාව", "UYST": "උරුගුවේ ග්\u200dරීෂ්ම කාලය", "ARST": "ආර්ජන්ටිනා ග්\u200dරීෂ්ම කාලය", "LHST": "ලෝර්ඩ් හෝව් සම්මත වේලාව", "MEZ": "මධ්\u200dයම යුරෝපීය සම්මත වේලාව", "BOT": "බොලිවියා වේලාව", "ACWST": "මධ්\u200dයම බටහිර ඔස්ට්\u200dරේලියානු සම්මත වේලාව", "VET": "වෙනිසියුලා වේලාව", "∅∅∅": "බ්\u200dරසීල ග්\u200dරීෂ්ම කාලය", "WIT": "නැගෙනහිර ඉන්දුනීසියානු වේලාව", "TMST": "ටර්ක්මෙනිස්තාන ග්\u200dරීෂ්ම වේලාව", "AWST": "බටහිර ඕස්ට්\u200dරේලියානු සම්මත වේලාව", "NZDT": "නවසීලන්ත දිවා වේලාව"},
+ timezones: map[string]string{"ARST": "ආර්ජන්ටිනා ග්\u200dරීෂ්ම කාලය", "HADT": "හවායි-අලෙයුතියාන් දිවාආලෝක වේලාව", "∅∅∅": "ඇමර්සන් ග්\u200dරීෂ්ම කාලය", "COT": "කොලොම්බියා සම්මත වේලාව", "AEDT": "නැඟෙනහිර ඕස්ට්\u200dරේලියානු දහවල් වේලාව", "CLT": "චිලී සම්මත වේලාව", "UYT": "උරුගුවේ සම්මත වේලාව", "AST": "අත්ලාන්තික් සම්මත වේලාව", "ACWDT": "මධ්\u200dයම බටහිර ඔස්ට්\u200dරේලියානු දහවල් වේලාව", "WAT": "බටහිර අප්\u200dරිකානු සම්මත වේලාව", "HKT": "හොංකොං සම්මත වේලාව", "CAT": "මධ්\u200dයම අප්\u200dරිකානු වේලාව", "TMST": "ටර්ක්මෙනිස්තාන ග්\u200dරීෂ්ම වේලාව", "OEZ": "නැගෙනහිර යුරෝපීය සම්මත වේලාව", "JST": "ජපාන සම්මත වේලාව", "PST": "උතුරු ඇමරිකානු පැසිෆික් සම්මත වේලාව", "WAST": "බටහිර අප්\u200dරිකානු ග්\u200dරීෂ්ම කාලය", "CHADT": "චැතම් දිවා වේලාව", "WESZ": "බටහිර යුරෝපීය ග්\u200dරීෂ්ම වේලාව", "WIB": "බටහිර ඉන්දුනීසියානු වේලාව", "ChST": "චමොරෝ වේලාව", "MDT": "MDT", "ART": "ආර්ජන්ටිනා සම්මත වේලාව", "EST": "උතුරු ඇමරිකානු නැගෙනහිර සම්මත වේලාව", "NZST": "නවසීලන්ත සම්මත වේලාව", "WIT": "නැගෙනහිර ඉන්දුනීසියානු වේලාව", "CST": "උතුරු ඇමරිකානු මධ්\u200dයම සම්මත වේලාව", "CDT": "උතුරු ඇමරිකානු මධ්\u200dයම දිවාආලෝක වේලාව", "MST": "MST", "HKST": "හොංකොං ග්\u200dරීෂ්ම වේලාව", "ECT": "ඉක්වදෝර් වේලාව", "WITA": "මධ්\u200dයම ඉන්දුනීසියානු වේලාව", "EDT": "උතුරු ඇමරිකානු නැගෙනහිර දිවාආලෝක වේලාව", "OESZ": "නැගෙනහිර යුරෝපීය ග්\u200dරීෂ්ම වේලාව", "CLST": "චිලී ග්\u200dරීෂ්ම කාලය", "WEZ": "බටහිර යුරෝපීය සම්මත වේලාව", "AEST": "නැගෙනහිර ඕස්ට්\u200dරේලියානු සම්මත වේලාව", "LHDT": "ලෝර්ඩ් හෝව් දිවා වේලාව", "ACDT": "මධ්\u200dයම ඔස්ට්\u200dරේලියානු දහවල් වේලාව", "GFT": "ප්\u200dරංශ ගයනා වේලාව", "PDT": "උතුරු ඇමරිකානු පැසිෆික් දිවාආලෝක වේලාව", "HAST": "හවායි-අලෙයුතියාන් සම්මත වේලාව", "MYT": "මැලේසියානු වේලාව", "AKST": "ඇලස්කා සම්මත වේලාව", "ACWST": "මධ්\u200dයම බටහිර ඔස්ට්\u200dරේලියානු සම්මත වේලාව", "AWDT": "බටහිර ඔස්ට්\u200dරේලියානු දහවල් වේලාව", "BOT": "බොලිවියා වේලාව", "EAT": "නැගෙනහිර අප්\u200dරිකානු වේලාව", "WART": "බටහිර ආර්ජන්ටිනා සම්මත වේලාව", "AWST": "බටහිර ඕස්ට්\u200dරේලියානු සම්මත වේලාව", "SAST": "දකුණු අප්\u200dරිකානු වේලාව", "SGT": "සිංගප්පුරු වේලාව", "BT": "භුතාන වේලාව", "WARST": "බටහිර ආර්ජන්ටිනා ග්\u200dරීෂ්ම කාලය", "AKDT": "ඇලස්කා දිවාආලෝක වේලාව", "ADT": "අත්ලාන්තික් දිවාආලෝක වේලාව", "NZDT": "නවසීලන්ත දිවා වේලාව", "HNT": "නිව්ෆවුන්ලන්ත සම්මත වේලාව", "CHAST": "චැතම් සම්මත වේලාව", "VET": "වෙනිසියුලා වේලාව", "JDT": "ජපාන දහවල් වේලාව", "IST": "ඉන්දියානු වේලාව", "COST": "කොලොම්බියා ග්\u200dරීෂ්ම කාලය", "GMT": "ග්\u200dරිනිච් මධ්\u200dයම වේලාව", "GYT": "ගයනා වේලාව", "UYST": "උරුගුවේ ග්\u200dරීෂ්ම කාලය", "ACST": "ඕස්ට්\u200dරේලියානු සම්මත වේලාව", "SRT": "සුරිනාම වේලාව", "MEZ": "මධ්\u200dයම යුරෝපීය සම්මත වේලාව", "MESZ": "මධ්\u200dයම යුරෝපීය ග්\u200dරීෂ්ම වේලාව", "HAT": "නිව්ෆවුන්ලන්ත දිවාආලෝක වේලාව", "TMT": "ටර්ක්මෙනිස්තාන සම්මත වේලාව", "LHST": "ලෝර්ඩ් හෝව් සම්මත වේලාව"},
}
}
diff --git a/si_LK/si_LK_test.go b/si_LK/si_LK_test.go
new file mode 100644
index 00000000..eb4f33bd
--- /dev/null
+++ b/si_LK/si_LK_test.go
@@ -0,0 +1,1120 @@
+package si_LK
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "si_LK"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/sk/sk.go b/sk/sk.go
index ace74b34..fae9d667 100644
--- a/sk/sk.go
+++ b/sk/sk.go
@@ -49,7 +49,7 @@ func New() locales.Translator {
locale: "sk",
pluralsCardinal: []locales.PluralRule{2, 4, 5, 6},
pluralsOrdinal: []locales.PluralRule{6},
- pluralsRange: []locales.PluralRule{2, 4, 5, 6},
+ pluralsRange: []locales.PluralRule{4, 5, 6, 2},
decimal: ",",
group: " ",
minus: "-",
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"pred Kr.", "po Kr."},
erasNarrow: []string{"", ""},
erasWide: []string{"pred Kristom", "po Kristovi"},
- timezones: map[string]string{"AEST": "východoaustrálsky štandardný čas", "CHADT": "chathamský letný čas", "EDT": "severoamerický východný letný čas", "UYT": "uruguajský štandardný čas", "EST": "severoamerický východný štandardný čas", "ECT": "ekvádorský čas", "PST": "severoamerický tichomorský štandardný čas", "ChST": "chamorrský štandardný čas", "HNT": "newfoundlandský štandardný čas", "WIB": "západoindonézsky čas", "MYT": "malajzijský čas", "CST": "severoamerický centrálny štandardný čas", "OEZ": "východoeurópsky štandardný čas", "HAT": "newfoundlandský letný čas", "ARST": "argentínsky letný čas", "JDT": "japonský letný čas", "HAST": "havajsko-aleutský štandardný čas", "WAST": "západoafrický letný čas", "WART": "západoargentínsky štandardný čas", "IST": "indický čas", "WIT": "východoindonézsky čas", "MST": "severoamerický horský štandardný čas", "∅∅∅": "brazílsky letný čas", "EAT": "východoafrický čas", "LHST": "štandardný čas ostrova lorda Howa", "JST": "japonský štandardný čas", "AST": "atlantický štandardný čas", "HKT": "hongkonský štandardný čas", "CDT": "severoamerický centrálny letný čas", "WEZ": "západoeurópsky štandardný čas", "CLT": "čilský štandardný čas", "WITA": "stredoindonézsky čas", "AKST": "aljašský štandardný čas", "NZST": "novozélandský štandardný čas", "MDT": "severoamerický horský letný čas", "COST": "kolumbijský letný čas", "GMT": "greenwichský čas", "ACDT": "stredoaustrálsky letný čas", "TMST": "turkménsky letný čas", "AWDT": "západoaustrálsky letný čas", "WARST": "západoargentínsky letný čas", "CHAST": "chathamský štandardný čas", "VET": "venezuelský čas", "HADT": "havajsko-aleutský letný čas", "GYT": "guyanský čas", "ACWST": "stredozápadný austrálsky štandardný čas", "ACWDT": "stredozápadný austrálsky letný čas", "CLST": "čilský letný čas", "CAT": "stredoafrický čas", "LHDT": "letný čas ostrova lorda Howa", "BOT": "bolívijský čas", "WESZ": "západoeurópsky letný čas", "ART": "argentínsky štandardný čas", "AKDT": "aljašský letný čas", "PDT": "severoamerický tichomorský letný čas", "AWST": "západoaustrálsky štandardný čas", "SRT": "surinamský čas", "AEDT": "východoaustrálsky letný čas", "ADT": "atlantický letný čas", "WAT": "západoafrický štandardný čas", "BT": "bhutánsky čas", "HKST": "hongkonský letný čas", "TMT": "turkménsky štandardný čas", "MEZ": "stredoeurópsky štandardný čas", "UYST": "uruguajský letný čas", "SGT": "singapurský štandardný čas", "SAST": "juhoafrický čas", "OESZ": "východoeurópsky letný čas", "ACST": "stredoaustrálsky štandardný čas", "MESZ": "stredoeurópsky letný čas", "NZDT": "novozélandský letný čas", "COT": "kolumbijský štandardný čas", "GFT": "francúzskoguyanský čas"},
+ timezones: map[string]string{"CST": "severoamerický centrálny štandardný čas", "ECT": "ekvádorský čas", "AWDT": "západoaustrálsky letný čas", "ARST": "argentínsky letný čas", "HNT": "newfoundlandský štandardný čas", "AEST": "východoaustrálsky štandardný čas", "ChST": "chamorrský štandardný čas", "EAT": "východoafrický čas", "JST": "japonský štandardný čas", "MESZ": "stredoeurópsky letný čas", "ACDT": "stredoaustrálsky letný čas", "VET": "venezuelský čas", "PDT": "severoamerický tichomorský letný čas", "CHADT": "chathamský letný čas", "AKDT": "aljašský letný čas", "ART": "argentínsky štandardný čas", "COT": "kolumbijský štandardný čas", "GMT": "greenwichský čas", "UYST": "uruguajský letný čas", "WART": "západoargentínsky štandardný čas", "SRT": "surinamský čas", "GYT": "guyanský čas", "BOT": "bolívijský čas", "SAST": "juhoafrický čas", "WIB": "západoindonézsky čas", "CLT": "čilský štandardný čas", "MYT": "malajzijský čas", "ACWDT": "stredozápadný austrálsky letný čas", "TMT": "turkménsky štandardný čas", "OEZ": "východoeurópsky štandardný čas", "WARST": "západoargentínsky letný čas", "JDT": "japonský letný čas", "HADT": "havajsko-aleutský letný čas", "CAT": "stredoafrický čas", "CLST": "čilský letný čas", "UYT": "uruguajský štandardný čas", "∅∅∅": "brazílsky letný čas", "NZDT": "novozélandský letný čas", "EDT": "severoamerický východný letný čas", "TMST": "turkménsky letný čas", "CDT": "severoamerický centrálny letný čas", "ACWST": "stredozápadný austrálsky štandardný čas", "NZST": "novozélandský štandardný čas", "MDT": "severoamerický horský letný čas", "WESZ": "západoeurópsky letný čas", "AKST": "aljašský štandardný čas", "AST": "atlantický štandardný čas", "ADT": "atlantický letný čas", "WAT": "západoafrický štandardný čas", "SGT": "singapurský štandardný čas", "LHST": "štandardný čas ostrova lorda Howa", "LHDT": "letný čas ostrova lorda Howa", "MST": "severoamerický horský štandardný čas", "HAST": "havajsko-aleutský štandardný čas", "EST": "severoamerický východný štandardný čas", "MEZ": "stredoeurópsky štandardný čas", "HAT": "newfoundlandský letný čas", "ACST": "stredoaustrálsky štandardný čas", "GFT": "francúzskoguyanský čas", "CHAST": "chathamský štandardný čas", "WIT": "východoindonézsky čas", "HKT": "hongkonský štandardný čas", "AWST": "západoaustrálsky štandardný čas", "OESZ": "východoeurópsky letný čas", "HKST": "hongkonský letný čas", "PST": "severoamerický tichomorský štandardný čas", "WAST": "západoafrický letný čas", "IST": "indický čas", "COST": "kolumbijský letný čas", "AEDT": "východoaustrálsky letný čas", "BT": "bhutánsky čas", "WITA": "stredoindonézsky čas", "WEZ": "západoeurópsky štandardný čas"},
}
}
diff --git a/sk/sk_test.go b/sk/sk_test.go
new file mode 100644
index 00000000..25a4c6b5
--- /dev/null
+++ b/sk/sk_test.go
@@ -0,0 +1,1120 @@
+package sk
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "sk"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/sk_SK/sk_SK.go b/sk_SK/sk_SK.go
index e8878295..25d71565 100644
--- a/sk_SK/sk_SK.go
+++ b/sk_SK/sk_SK.go
@@ -75,7 +75,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"pred Kr.", "po Kr."},
erasNarrow: []string{"", ""},
erasWide: []string{"pred Kristom", "po Kristovi"},
- timezones: map[string]string{"WAT": "západoafrický štandardný čas", "HAT": "newfoundlandský letný čas", "LHDT": "letný čas ostrova lorda Howa", "CDT": "severoamerický centrálny letný čas", "COT": "kolumbijský štandardný čas", "HADT": "havajsko-aleutský letný čas", "AWDT": "západoaustrálsky letný čas", "AEDT": "východoaustrálsky letný čas", "MST": "severoamerický horský štandardný čas", "AST": "atlantický štandardný čas", "HAST": "havajsko-aleutský štandardný čas", "WAST": "západoafrický letný čas", "HNT": "newfoundlandský štandardný čas", "SRT": "surinamský čas", "CST": "severoamerický centrálny štandardný čas", "MESZ": "stredoeurópsky letný čas", "NZST": "novozélandský štandardný čas", "CLT": "čilský štandardný čas", "EST": "severoamerický východný štandardný čas", "SAST": "juhoafrický čas", "AKDT": "aljašský letný čas", "AWST": "západoaustrálsky štandardný čas", "BOT": "bolívijský čas", "CHAST": "chathamský štandardný čas", "NZDT": "novozélandský letný čas", "SGT": "singapurský štandardný čas", "TMT": "turkménsky štandardný čas", "HKST": "hongkonský letný čas", "IST": "indický čas", "UYST": "uruguajský letný čas", "CLST": "čilský letný čas", "CAT": "stredoafrický čas", "∅∅∅": "azorský letný čas", "ChST": "chamorrský štandardný čas", "ECT": "ekvádorský čas", "WESZ": "západoeurópsky letný čas", "ACWDT": "stredozápadný austrálsky letný čas", "GMT": "greenwichský čas", "CHADT": "chathamský letný čas", "HKT": "hongkonský štandardný čas", "TMST": "turkménsky letný čas", "AKST": "aljašský štandardný čas", "GYT": "guyanský čas", "UYT": "uruguajský štandardný čas", "VET": "venezuelský čas", "WITA": "stredoindonézsky čas", "ACST": "stredoaustrálsky štandardný čas", "JST": "japonský štandardný čas", "MDT": "severoamerický horský letný čas", "WART": "západoargentínsky štandardný čas", "WARST": "západoargentínsky letný čas", "GFT": "francúzskoguyanský čas", "PST": "severoamerický tichomorský štandardný čas", "WEZ": "západoeurópsky štandardný čas", "COST": "kolumbijský letný čas", "OESZ": "východoeurópsky letný čas", "WIT": "východoindonézsky čas", "EAT": "východoafrický čas", "ARST": "argentínsky letný čas", "PDT": "severoamerický tichomorský letný čas", "MYT": "malajzijský čas", "AEST": "východoaustrálsky štandardný čas", "OEZ": "východoeurópsky štandardný čas", "ADT": "atlantický letný čas", "BT": "bhutánsky čas", "WIB": "západoindonézsky čas", "ACDT": "stredoaustrálsky letný čas", "LHST": "štandardný čas ostrova lorda Howa", "JDT": "japonský letný čas", "ACWST": "stredozápadný austrálsky štandardný čas", "EDT": "severoamerický východný letný čas", "ART": "argentínsky štandardný čas", "MEZ": "stredoeurópsky štandardný čas"},
+ timezones: map[string]string{"TMT": "turkménsky štandardný čas", "CAT": "stredoafrický čas", "WAT": "západoafrický štandardný čas", "SRT": "surinamský čas", "∅∅∅": "azorský letný čas", "AST": "atlantický štandardný čas", "BOT": "bolívijský čas", "PDT": "severoamerický tichomorský letný čas", "NZDT": "novozélandský letný čas", "ACWST": "stredozápadný austrálsky štandardný čas", "COST": "kolumbijský letný čas", "UYST": "uruguajský letný čas", "AEDT": "východoaustrálsky letný čas", "LHDT": "letný čas ostrova lorda Howa", "SAST": "juhoafrický čas", "LHST": "štandardný čas ostrova lorda Howa", "MYT": "malajzijský čas", "GFT": "francúzskoguyanský čas", "ECT": "ekvádorský čas", "AWST": "západoaustrálsky štandardný čas", "PST": "severoamerický tichomorský štandardný čas", "EAT": "východoafrický čas", "SGT": "singapurský štandardný čas", "CST": "severoamerický centrálny štandardný čas", "MST": "MST", "MDT": "MDT", "AKDT": "aljašský letný čas", "TMST": "turkménsky letný čas", "WAST": "západoafrický letný čas", "CLST": "čilský letný čas", "HKST": "hongkonský letný čas", "AWDT": "západoaustrálsky letný čas", "WITA": "stredoindonézsky čas", "EST": "severoamerický východný štandardný čas", "ACST": "stredoaustrálsky štandardný čas", "ChST": "chamorrský štandardný čas", "ACWDT": "stredozápadný austrálsky letný čas", "ARST": "argentínsky letný čas", "JST": "japonský štandardný čas", "EDT": "severoamerický východný letný čas", "WART": "západoargentínsky štandardný čas", "CDT": "severoamerický centrálny letný čas", "ACDT": "stredoaustrálsky letný čas", "VET": "venezuelský čas", "WIT": "východoindonézsky čas", "MESZ": "stredoeurópsky letný čas", "WESZ": "západoeurópsky letný čas", "COT": "kolumbijský štandardný čas", "GYT": "guyanský čas", "OEZ": "východoeurópsky štandardný čas", "OESZ": "východoeurópsky letný čas", "GMT": "greenwichský čas", "CHADT": "chathamský letný čas", "HKT": "hongkonský štandardný čas", "HADT": "havajsko-aleutský letný čas", "WEZ": "západoeurópsky štandardný čas", "ADT": "atlantický letný čas", "IST": "indický čas", "HAT": "newfoundlandský letný čas", "CLT": "čilský štandardný čas", "UYT": "uruguajský štandardný čas", "CHAST": "chathamský štandardný čas", "HAST": "havajsko-aleutský štandardný čas", "WIB": "západoindonézsky čas", "AEST": "východoaustrálsky štandardný čas", "WARST": "západoargentínsky letný čas", "AKST": "aljašský štandardný čas", "MEZ": "stredoeurópsky štandardný čas", "BT": "bhutánsky čas", "ART": "argentínsky štandardný čas", "JDT": "japonský letný čas", "NZST": "novozélandský štandardný čas", "HNT": "newfoundlandský štandardný čas"},
}
}
diff --git a/sk_SK/sk_SK_test.go b/sk_SK/sk_SK_test.go
new file mode 100644
index 00000000..991910a0
--- /dev/null
+++ b/sk_SK/sk_SK_test.go
@@ -0,0 +1,1120 @@
+package sk_SK
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "sk_SK"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/sl/sl.go b/sl/sl.go
index 11e2f9eb..4bdd99ce 100644
--- a/sl/sl.go
+++ b/sl/sl.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"pr. Kr.", "po n. št."},
erasNarrow: []string{"", ""},
erasWide: []string{"pred Kristusom", "naše štetje"},
- timezones: map[string]string{"WAT": "Zahodnoafriški standardni čas", "ChST": "Čamorski standardni čas", "CLT": "Čilski standardni čas", "HADT": "Havajski aleutski poletni čas", "HNT": "Novofundlandski standardni čas", "CDT": "Centralni poletni čas", "MESZ": "Srednjeevropski poletni čas", "COT": "Kolumbijski standardni čas", "CAT": "Centralnoafriški čas", "HAST": "Havajski aleutski standardni čas", "HKST": "Hongkonški poletni čas", "GMT": "Greenwiški srednji čas", "TMT": "Turkmenistanski standardni čas", "AWST": "Avstralski zahodni standardni čas", "SRT": "Surinamski čas", "WEZ": "Zahodnoevropski standardni čas", "AKST": "Aljaški standardni čas", "ACWST": "Avstralski centralni zahodni standardni čas", "ACWDT": "Avstralski centralni zahodni poletni čas", "AEST": "Avstralski vzhodni standardni čas", "CHAST": "Čatamski standardni čas", "CHADT": "Čatamski poletni čas", "NZDT": "Novozelandski poletni čas", "ADT": "Atlantski poletni čas", "HAT": "Novofundlandski poletni čas", "GFT": "Čas: Francoska Gvajana", "ART": "Argentinski standardni čas", "LHST": "Standardni čas otoka Lord Howe", "BOT": "Bolivijski čas", "SAST": "Južnoafriški čas", "OESZ": "Vzhodnoevropski poletni čas", "VET": "Venezuelski čas", "GYT": "Gvajanski čas", "UYST": "Urugvajski poletni čas", "AST": "Atlantski standardni čas", "BT": "Butanski čas", "CLST": "Čilski poletni čas", "∅∅∅": "Amazonski poletni čas", "LHDT": "Poletni čas otoka Lord Howe", "JDT": "Japonski poletni čas", "EDT": "Vzhodni poletni čas", "MDT": "MDT", "ARST": "Argentinski poletni čas", "TMST": "Turkmenistanski poletni čas", "AWDT": "Avstralski zahodni poletni čas", "MEZ": "Srednjeevropski standardni čas", "SGT": "Singapurski standardni čas", "NZST": "Novozelandski standardni čas", "EST": "Vzhodni standardni čas", "HKT": "Hongkonški standardni čas", "IST": "Indijski standardni čas", "OEZ": "Vzhodnoevropski standardni čas", "WITA": "Indonezijski osrednji čas", "ACDT": "Avstralski centralni poletni čas", "CST": "Centralni standardni čas", "PST": "Pacifiški standardni čas", "UYT": "Urugvajski standardni čas", "WARST": "Argentinski zahodni poletni čas", "WIT": "Indonezijski vzhodni čas", "EAT": "Vzhodnoafriški čas", "MST": "MST", "ACST": "Avstralski centralni standardni čas", "AKDT": "Aljaški poletni čas", "AEDT": "Avstralski vzhodni poletni čas", "COST": "Kolumbijski poletni čas", "WAST": "Zahodnoafriški poletni čas", "WART": "Argentinski zahodni standardni čas", "PDT": "Pacifiški poletni čas", "WESZ": "Zahodnoevropski poletni čas", "ECT": "Ekvadorski čas", "WIB": "Indonezijski zahodni čas", "MYT": "Malezijski čas", "JST": "Japonski standardni čas"},
+ timezones: map[string]string{"ECT": "Ekvadorski čas", "HKST": "Hongkonški poletni čas", "WITA": "Indonezijski osrednji čas", "MESZ": "Srednjeevropski poletni čas", "BT": "Butanski čas", "LHDT": "Poletni čas otoka Lord Howe", "UYT": "Urugvajski standardni čas", "AKDT": "Aljaški poletni čas", "COT": "Kolumbijski standardni čas", "TMT": "Turkmenistanski standardni čas", "CLT": "Čilski standardni čas", "ACWDT": "Avstralski centralni zahodni poletni čas", "SAST": "Južnoafriški čas", "EDT": "Vzhodni poletni čas", "LHST": "Standardni čas otoka Lord Howe", "TMST": "Turkmenistanski poletni čas", "WEZ": "Zahodnoevropski standardni čas", "MST": "Gorski standardni čas", "CST": "Centralni standardni čas", "WART": "Argentinski zahodni standardni čas", "HKT": "Hongkonški standardni čas", "ART": "Argentinski standardni čas", "MEZ": "Srednjeevropski standardni čas", "NZDT": "Novozelandski poletni čas", "IST": "Indijski standardni čas", "HAT": "Novofundlandski poletni čas", "WESZ": "Zahodnoevropski poletni čas", "MDT": "Gorski poletni čas", "GFT": "Čas: Francoska Gvajana", "CHAST": "Čatamski standardni čas", "HAST": "Havajski aleutski standardni čas", "EST": "Vzhodni standardni čas", "HNT": "Novofundlandski standardni čas", "AWST": "Avstralski zahodni standardni čas", "AWDT": "Avstralski zahodni poletni čas", "ARST": "Argentinski poletni čas", "PDT": "Pacifiški poletni čas", "NZST": "Novozelandski standardni čas", "GYT": "Gvajanski čas", "CAT": "Centralnoafriški čas", "MYT": "Malezijski čas", "JDT": "Japonski poletni čas", "SRT": "Surinamski čas", "SGT": "Singapurski standardni čas", "AEST": "Avstralski vzhodni standardni čas", "AEDT": "Avstralski vzhodni poletni čas", "CLST": "Čilski poletni čas", "CHADT": "Čatamski poletni čas", "WAST": "Zahodnoafriški poletni čas", "ChST": "Čamorski standardni čas", "JST": "Japonski standardni čas", "ACDT": "Avstralski centralni poletni čas", "AST": "Atlantski standardni čas", "CDT": "Centralni poletni čas", "AKST": "Aljaški standardni čas", "ACWST": "Avstralski centralni zahodni standardni čas", "BOT": "Bolivijski čas", "OESZ": "Vzhodnoevropski poletni čas", "EAT": "Vzhodnoafriški čas", "WARST": "Argentinski zahodni poletni čas", "VET": "Venezuelski čas", "ADT": "Atlantski poletni čas", "WAT": "Zahodnoafriški standardni čas", "WIT": "Indonezijski vzhodni čas", "PST": "Pacifiški standardni čas", "∅∅∅": "Amazonski poletni čas", "COST": "Kolumbijski poletni čas", "GMT": "Greenwiški srednji čas", "UYST": "Urugvajski poletni čas", "ACST": "Avstralski centralni standardni čas", "HADT": "Havajski aleutski poletni čas", "WIB": "Indonezijski zahodni čas", "OEZ": "Vzhodnoevropski standardni čas"},
}
}
diff --git a/sl/sl_test.go b/sl/sl_test.go
new file mode 100644
index 00000000..80e34f43
--- /dev/null
+++ b/sl/sl_test.go
@@ -0,0 +1,1120 @@
+package sl
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "sl"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/sl_SI/sl_SI.go b/sl_SI/sl_SI.go
index 35444f67..0252680a 100644
--- a/sl_SI/sl_SI.go
+++ b/sl_SI/sl_SI.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"pr. Kr.", "po n. št."},
erasNarrow: []string{"", ""},
erasWide: []string{"pred Kristusom", "naše štetje"},
- timezones: map[string]string{"ACWDT": "Avstralski centralni zahodni poletni čas", "PDT": "Pacifiški poletni čas", "AWDT": "Avstralski zahodni poletni čas", "GFT": "Čas: Francoska Gvajana", "IST": "Indijski standardni čas", "HNT": "Novofundlandski standardni čas", "LHDT": "Poletni čas otoka Lord Howe", "OEZ": "Vzhodnoevropski standardni čas", "AST": "Atlantski standardni čas", "UYT": "Urugvajski standardni čas", "AEDT": "Avstralski vzhodni poletni čas", "MST": "Gorski standardni čas", "ACWST": "Avstralski centralni zahodni standardni čas", "WARST": "Argentinski zahodni poletni čas", "TMST": "Turkmenistanski poletni čas", "GYT": "Gvajanski čas", "MESZ": "Srednjeevropski poletni čas", "GMT": "Greenwiški srednji čas", "ACDT": "Avstralski centralni poletni čas", "JDT": "Japonski poletni čas", "MDT": "Gorski poletni čas", "WEZ": "Zahodnoevropski standardni čas", "WIT": "Indonezijski vzhodni čas", "ACST": "Avstralski centralni standardni čas", "SAST": "Južnoafriški čas", "HAT": "Novofundlandski poletni čas", "MEZ": "Srednjeevropski standardni čas", "NZDT": "Novozelandski poletni čas", "EST": "Vzhodni standardni čas", "EDT": "Vzhodni poletni čas", "COST": "Kolumbijski poletni čas", "ECT": "Ekvadorski čas", "UYST": "Urugvajski poletni čas", "CST": "Centralni standardni čas", "WAT": "Zahodnoafriški standardni čas", "WIB": "Indonezijski zahodni čas", "CHAST": "Čatamski standardni čas", "CLST": "Čilski poletni čas", "WESZ": "Zahodnoevropski poletni čas", "WAST": "Zahodnoafriški poletni čas", "HKST": "Hongkonški poletni čas", "TMT": "Turkmenistanski standardni čas", "LHST": "Standardni čas otoka Lord Howe", "∅∅∅": "Azorski poletni čas", "ARST": "Argentinski poletni čas", "HADT": "Havajski aleutski poletni čas", "WITA": "Indonezijski osrednji čas", "EAT": "Vzhodnoafriški čas", "AKST": "Aljaški standardni čas", "ADT": "Atlantski poletni čas", "AEST": "Avstralski vzhodni standardni čas", "COT": "Kolumbijski standardni čas", "HKT": "Hongkonški standardni čas", "CDT": "Centralni poletni čas", "NZST": "Novozelandski standardni čas", "AKDT": "Aljaški poletni čas", "CLT": "Čilski standardni čas", "ChST": "Čamorski standardni čas", "SGT": "Singapurski standardni čas", "WART": "Argentinski zahodni standardni čas", "MYT": "Malezijski čas", "SRT": "Surinamski čas", "VET": "Venezuelski čas", "HAST": "Havajski aleutski standardni čas", "AWST": "Avstralski zahodni standardni čas", "BOT": "Bolivijski čas", "CAT": "Centralnoafriški čas", "CHADT": "Čatamski poletni čas", "BT": "Butanski čas", "OESZ": "Vzhodnoevropski poletni čas", "ART": "Argentinski standardni čas", "JST": "Japonski standardni čas", "PST": "Pacifiški standardni čas"},
+ timezones: map[string]string{"AWST": "Avstralski zahodni standardni čas", "JDT": "Japonski poletni čas", "WESZ": "Zahodnoevropski poletni čas", "COT": "Kolumbijski standardni čas", "GMT": "Greenwiški srednji čas", "AEDT": "Avstralski vzhodni poletni čas", "UYST": "Urugvajski poletni čas", "∅∅∅": "Brasilski poletni čas", "EST": "Vzhodni standardni čas", "TMT": "Turkmenistanski standardni čas", "MDT": "Gorski poletni čas", "ACWST": "Avstralski centralni zahodni standardni čas", "NZDT": "Novozelandski poletni čas", "BOT": "Bolivijski čas", "ECT": "Ekvadorski čas", "CAT": "Centralnoafriški čas", "WIB": "Indonezijski zahodni čas", "ACST": "Avstralski centralni standardni čas", "ADT": "Atlantski poletni čas", "EDT": "Vzhodni poletni čas", "AEST": "Avstralski vzhodni standardni čas", "GFT": "Čas: Francoska Gvajana", "WITA": "Indonezijski osrednji čas", "SGT": "Singapurski standardni čas", "COST": "Kolumbijski poletni čas", "OESZ": "Vzhodnoevropski poletni čas", "CHAST": "Čatamski standardni čas", "ART": "Argentinski standardni čas", "MEZ": "Srednjeevropski standardni čas", "MYT": "Malezijski čas", "AKST": "Aljaški standardni čas", "NZST": "Novozelandski standardni čas", "WAT": "Zahodnoafriški standardni čas", "ACDT": "Avstralski centralni poletni čas", "VET": "Venezuelski čas", "AKDT": "Aljaški poletni čas", "AST": "Atlantski standardni čas", "MESZ": "Srednjeevropski poletni čas", "PDT": "Pacifiški poletni čas", "OEZ": "Vzhodnoevropski standardni čas", "EAT": "Vzhodnoafriški čas", "LHST": "Standardni čas otoka Lord Howe", "WART": "Argentinski zahodni standardni čas", "CHADT": "Čatamski poletni čas", "ACWDT": "Avstralski centralni zahodni poletni čas", "WAST": "Zahodnoafriški poletni čas", "HAT": "Novofundlandski poletni čas", "HAST": "Havajski aleutski standardni čas", "HADT": "Havajski aleutski poletni čas", "UYT": "Urugvajski standardni čas", "AWDT": "Avstralski zahodni poletni čas", "ARST": "Argentinski poletni čas", "JST": "Japonski standardni čas", "HNT": "Novofundlandski standardni čas", "BT": "Butanski čas", "LHDT": "Poletni čas otoka Lord Howe", "SAST": "Južnoafriški čas", "IST": "Indijski standardni čas", "WEZ": "Zahodnoevropski standardni čas", "GYT": "Gvajanski čas", "CST": "Centralni standardni čas", "CDT": "Centralni poletni čas", "SRT": "Surinamski čas", "TMST": "Turkmenistanski poletni čas", "ChST": "Čamorski standardni čas", "CLST": "Čilski poletni čas", "WARST": "Argentinski zahodni poletni čas", "HKT": "Hongkonški standardni čas", "HKST": "Hongkonški poletni čas", "MST": "Gorski standardni čas", "CLT": "Čilski standardni čas", "WIT": "Indonezijski vzhodni čas", "PST": "Pacifiški standardni čas"},
}
}
diff --git a/sl_SI/sl_SI_test.go b/sl_SI/sl_SI_test.go
new file mode 100644
index 00000000..f4c9147a
--- /dev/null
+++ b/sl_SI/sl_SI_test.go
@@ -0,0 +1,1120 @@
+package sl_SI
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "sl_SI"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/smn/smn.go b/smn/smn.go
index 61ae4b15..dde66459 100644
--- a/smn/smn.go
+++ b/smn/smn.go
@@ -60,7 +60,7 @@ func New() locales.Translator {
daysAbbreviated: []string{"pa", "vu", "ma", "ko", "tu", "vá", "lá"},
daysNarrow: []string{"P", "V", "M", "K", "T", "V", "L"},
daysWide: []string{"pasepeeivi", "vuossaargâ", "majebaargâ", "koskoho", "tuorâstuv", "vástuppeeivi", "lávurduv"},
- timezones: map[string]string{"JST": "JST", "CDT": "CDT", "WEZ": "WEZ", "GFT": "GFT", "MESZ": "MESZ", "WART": "WART", "WARST": "WARST", "WIB": "WIB", "PDT": "PDT", "AWDT": "AWDT", "LHDT": "LHDT", "CLST": "CLST", "MDT": "MDT", "HKST": "HKST", "MEZ": "MEZ", "UYST": "UYST", "COT": "COT", "AST": "AST", "GMT": "GMT", "ACST": "ACST", "NZST": "NZST", "ACWDT": "ACWDT", "ChST": "ChST", "ECT": "ECT", "WAT": "WAT", "HKT": "HKT", "VET": "VET", "EST": "EST", "COST": "COST", "TMST": "TMST", "ARST": "ARST", "NZDT": "NZDT", "CAT": "CAT", "TMT": "TMT", "OESZ": "OESZ", "ART": "ART", "HADT": "HADT", "WITA": "WITA", "OEZ": "OEZ", "CLT": "CLT", "MST": "MST", "AKST": "AKST", "LHST": "LHST", "AEST": "AEST", "WAST": "WAST", "BT": "BT", "HAST": "HAST", "WIT": "WIT", "MYT": "MYT", "BOT": "BOT", "CHADT": "CHADT", "WESZ": "WESZ", "JDT": "JDT", "SRT": "SRT", "PST": "PST", "AEDT": "AEDT", "SGT": "SGT", "HNT": "HNT", "UYT": "UYT", "HAT": "HAT", "CST": "CST", "ACDT": "ACDT", "∅∅∅": "∅∅∅", "EDT": "EDT", "IST": "IST", "SAST": "SAST", "EAT": "EAT", "AKDT": "AKDT", "AWST": "AWST", "GYT": "GYT", "CHAST": "CHAST", "ACWST": "ACWST", "ADT": "ADT"},
+ timezones: map[string]string{"WESZ": "WESZ", "OESZ": "OESZ", "ChST": "ChST", "CST": "CST", "WARST": "WARST", "ACWDT": "ACWDT", "WAT": "WAT", "NZDT": "NZDT", "GYT": "GYT", "WIB": "WIB", "HNT": "HNT", "HKST": "HKST", "HAST": "HAST", "ADT": "ADT", "TMST": "TMST", "AEST": "AEST", "LHDT": "LHDT", "JDT": "JDT", "AKST": "AKST", "PST": "PST", "ACDT": "ACDT", "MST": "MST", "AST": "AST", "MESZ": "MESZ", "PDT": "PDT", "∅∅∅": "∅∅∅", "HAT": "HAT", "AEDT": "AEDT", "UYT": "UYT", "UYST": "UYST", "EAT": "EAT", "AWST": "AWST", "EDT": "EDT", "ECT": "ECT", "AWDT": "AWDT", "BOT": "BOT", "EST": "EST", "MYT": "MYT", "ACST": "ACST", "VET": "VET", "MDT": "MDT", "GMT": "GMT", "CLT": "CLT", "WIT": "WIT", "HKT": "HKT", "CHAST": "CHAST", "CDT": "CDT", "WART": "WART", "SRT": "SRT", "GFT": "GFT", "AKDT": "AKDT", "WEZ": "WEZ", "SGT": "SGT", "ACWST": "ACWST", "IST": "IST", "WAST": "WAST", "TMT": "TMT", "SAST": "SAST", "CAT": "CAT", "CLST": "CLST", "MEZ": "MEZ", "HADT": "HADT", "WITA": "WITA", "NZST": "NZST", "COT": "COT", "BT": "BT", "ART": "ART", "ARST": "ARST", "COST": "COST", "OEZ": "OEZ", "LHST": "LHST", "CHADT": "CHADT", "JST": "JST"},
}
}
@@ -115,7 +115,7 @@ func (smn *smn) MonthAbbreviated(month time.Month) string {
// MonthsAbbreviated returns the locales abbreviated months
func (smn *smn) MonthsAbbreviated() []string {
- return smn.monthsAbbreviated[1:]
+ return nil
}
// MonthNarrow returns the locales narrow month given the 'month' provided
@@ -125,7 +125,7 @@ func (smn *smn) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (smn *smn) MonthsNarrow() []string {
- return smn.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/smn/smn_test.go b/smn/smn_test.go
new file mode 100644
index 00000000..ae03eaf5
--- /dev/null
+++ b/smn/smn_test.go
@@ -0,0 +1,1120 @@
+package smn
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "smn"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/smn_FI/smn_FI.go b/smn_FI/smn_FI.go
index ec636a66..c9cae8ea 100644
--- a/smn_FI/smn_FI.go
+++ b/smn_FI/smn_FI.go
@@ -60,7 +60,7 @@ func New() locales.Translator {
daysAbbreviated: []string{"pa", "vu", "ma", "ko", "tu", "vá", "lá"},
daysNarrow: []string{"P", "V", "M", "K", "T", "V", "L"},
daysWide: []string{"pasepeeivi", "vuossaargâ", "majebaargâ", "koskoho", "tuorâstuv", "vástuppeeivi", "lávurduv"},
- timezones: map[string]string{"MDT": "MDT", "CST": "CST", "AKDT": "AKDT", "WARST": "WARST", "ARST": "ARST", "JST": "JST", "PST": "PST", "MESZ": "MESZ", "OEZ": "OEZ", "ACDT": "ACDT", "JDT": "JDT", "NZDT": "NZDT", "VET": "VET", "COST": "COST", "HAST": "HAST", "MEZ": "MEZ", "NZST": "NZST", "IST": "IST", "PDT": "PDT", "ACWDT": "ACWDT", "LHDT": "LHDT", "SRT": "SRT", "AKST": "AKST", "ChST": "ChST", "CLT": "CLT", "ADT": "ADT", "HNT": "HNT", "WIB": "WIB", "WEZ": "WEZ", "CHADT": "CHADT", "WIT": "WIT", "ART": "ART", "CLST": "CLST", "SGT": "SGT", "WART": "WART", "GFT": "GFT", "WAST": "WAST", "MST": "MST", "UYT": "UYT", "CHAST": "CHAST", "HKST": "HKST", "OESZ": "OESZ", "EAT": "EAT", "AEST": "AEST", "ECT": "ECT", "HKT": "HKT", "SAST": "SAST", "AWST": "AWST", "MYT": "MYT", "BOT": "BOT", "WESZ": "WESZ", "COT": "COT", "∅∅∅": "∅∅∅", "HADT": "HADT", "TMST": "TMST", "UYST": "UYST", "ACWST": "ACWST", "AST": "AST", "GMT": "GMT", "GYT": "GYT", "TMT": "TMT", "LHST": "LHST", "AEDT": "AEDT", "CAT": "CAT", "EDT": "EDT", "WAT": "WAT", "BT": "BT", "HAT": "HAT", "WITA": "WITA", "ACST": "ACST", "EST": "EST", "AWDT": "AWDT", "CDT": "CDT"},
+ timezones: map[string]string{"PST": "PST", "NZDT": "NZDT", "WESZ": "WESZ", "HNT": "HNT", "HKST": "HKST", "AKDT": "AKDT", "WEZ": "WEZ", "UYST": "UYST", "ACWDT": "ACWDT", "AKST": "AKST", "PDT": "PDT", "WAST": "WAST", "TMST": "TMST", "LHDT": "LHDT", "EAT": "EAT", "CST": "CST", "CDT": "CDT", "ChST": "ChST", "OESZ": "OESZ", "CLST": "CLST", "WART": "WART", "SRT": "SRT", "BOT": "BOT", "WIB": "WIB", "CAT": "CAT", "GMT": "GMT", "MDT": "MDT", "JST": "JST", "COT": "COT", "MYT": "MYT", "JDT": "JDT", "HADT": "HADT", "LHST": "LHST", "MST": "MST", "HKT": "HKT", "ECT": "ECT", "NZST": "NZST", "SGT": "SGT", "TMT": "TMT", "UYT": "UYT", "CHADT": "CHADT", "AST": "AST", "WAT": "WAT", "OEZ": "OEZ", "ACDT": "ACDT", "IST": "IST", "COST": "COST", "WARST": "WARST", "ADT": "ADT", "EDT": "EDT", "GYT": "GYT", "GFT": "GFT", "AWST": "AWST", "BT": "BT", "ARST": "ARST", "∅∅∅": "∅∅∅", "HAT": "HAT", "AEDT": "AEDT", "CHAST": "CHAST", "VET": "VET", "AWDT": "AWDT", "WITA": "WITA", "EST": "EST", "HAST": "HAST", "CLT": "CLT", "WIT": "WIT", "ART": "ART", "MESZ": "MESZ", "SAST": "SAST", "ACST": "ACST", "ACWST": "ACWST", "MEZ": "MEZ", "AEST": "AEST"},
}
}
@@ -115,7 +115,7 @@ func (smn *smn_FI) MonthAbbreviated(month time.Month) string {
// MonthsAbbreviated returns the locales abbreviated months
func (smn *smn_FI) MonthsAbbreviated() []string {
- return smn.monthsAbbreviated[1:]
+ return nil
}
// MonthNarrow returns the locales narrow month given the 'month' provided
@@ -125,7 +125,7 @@ func (smn *smn_FI) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (smn *smn_FI) MonthsNarrow() []string {
- return smn.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/smn_FI/smn_FI_test.go b/smn_FI/smn_FI_test.go
new file mode 100644
index 00000000..25815c3a
--- /dev/null
+++ b/smn_FI/smn_FI_test.go
@@ -0,0 +1,1120 @@
+package smn_FI
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "smn_FI"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/sn/sn.go b/sn/sn.go
index 97c4c2c4..b52027bc 100644
--- a/sn/sn.go
+++ b/sn/sn.go
@@ -61,7 +61,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"", ""},
erasWide: []string{"Kristo asati auya", "Kristo ashaya"},
- timezones: map[string]string{"MEZ": "MEZ", "AEST": "AEST", "AWST": "AWST", "OESZ": "OESZ", "SRT": "SRT", "CHAST": "CHAST", "WEZ": "WEZ", "ACWST": "ACWST", "COT": "COT", "WART": "WART", "HNT": "HNT", "ART": "ART", "JST": "JST", "CST": "CST", "CDT": "CDT", "ChST": "ChST", "∅∅∅": "∅∅∅", "PST": "PST", "NZDT": "NZDT", "ECT": "ECT", "HKST": "HKST", "WIT": "WIT", "HAST": "HAST", "JDT": "JDT", "AKDT": "AKDT", "NZST": "NZST", "UYST": "UYST", "WESZ": "WESZ", "ACWDT": "ACWDT", "HADT": "HADT", "HKT": "HKT", "IST": "IST", "SAST": "SAST", "GMT": "GMT", "WITA": "WITA", "AKST": "AKST", "WIB": "WIB", "ACST": "ACST", "EAT": "EAT", "GYT": "GYT", "UYT": "UYT", "AEDT": "AEDT", "VET": "VET", "EDT": "EDT", "EST": "EST", "BT": "BT", "COST": "COST", "ADT": "ADT", "LHDT": "LHDT", "MYT": "MYT", "BOT": "BOT", "MESZ": "MESZ", "WAT": "WAT", "ACDT": "ACDT", "ARST": "ARST", "CLT": "CLT", "CLST": "CLST", "SGT": "SGT", "AST": "AST", "CHADT": "CHADT", "HAT": "HAT", "LHST": "LHST", "CAT": "CAT", "AWDT": "AWDT", "MST": "MST", "WAST": "WAST", "GFT": "GFT", "TMT": "TMT", "PDT": "PDT", "MDT": "MDT", "WARST": "WARST", "OEZ": "OEZ", "TMST": "TMST"},
+ timezones: map[string]string{"WESZ": "WESZ", "AEDT": "AEDT", "AWDT": "AWDT", "ART": "ART", "EDT": "EDT", "HKT": "HKT", "ADT": "ADT", "EST": "EST", "WIB": "WIB", "AEST": "AEST", "NZST": "NZST", "CHAST": "CHAST", "SGT": "SGT", "OEZ": "OEZ", "ChST": "ChST", "LHST": "LHST", "CLST": "CLST", "ACDT": "ACDT", "SRT": "SRT", "AKST": "AKST", "PST": "PST", "TMT": "TMT", "WEZ": "WEZ", "WIT": "WIT", "CST": "CST", "WART": "WART", "HKST": "HKST", "ACWDT": "ACWDT", "MESZ": "MESZ", "NZDT": "NZDT", "COST": "COST", "EAT": "EAT", "UYST": "UYST", "WARST": "WARST", "WITA": "WITA", "CHADT": "CHADT", "SAST": "SAST", "PDT": "PDT", "HADT": "HADT", "∅∅∅": "∅∅∅", "CDT": "CDT", "ECT": "ECT", "CAT": "CAT", "HAT": "HAT", "GMT": "GMT", "VET": "VET", "TMST": "TMST", "HNT": "HNT", "COT": "COT", "JST": "JST", "JDT": "JDT", "WAT": "WAT", "MYT": "MYT", "CLT": "CLT", "AKDT": "AKDT", "BOT": "BOT", "WAST": "WAST", "OESZ": "OESZ", "LHDT": "LHDT", "MST": "MST", "ACST": "ACST", "AST": "AST", "ARST": "ARST", "GFT": "GFT", "AWST": "AWST", "IST": "IST", "HAST": "HAST", "BT": "BT", "MDT": "MDT", "GYT": "GYT", "UYT": "UYT", "ACWST": "ACWST", "MEZ": "MEZ"},
}
}
diff --git a/sn/sn_test.go b/sn/sn_test.go
new file mode 100644
index 00000000..beff22a3
--- /dev/null
+++ b/sn/sn_test.go
@@ -0,0 +1,1120 @@
+package sn
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "sn"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/sn_ZW/sn_ZW.go b/sn_ZW/sn_ZW.go
index 46cc7dd9..5d79295b 100644
--- a/sn_ZW/sn_ZW.go
+++ b/sn_ZW/sn_ZW.go
@@ -61,7 +61,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"", ""},
erasWide: []string{"Kristo asati auya", "Kristo ashaya"},
- timezones: map[string]string{"MDT": "MDT", "AST": "AST", "ACST": "ACST", "ARST": "ARST", "AEDT": "AEDT", "WARST": "WARST", "JST": "JST", "AEST": "AEST", "EST": "EST", "MST": "MST", "OESZ": "OESZ", "PDT": "PDT", "MYT": "MYT", "JDT": "JDT", "ECT": "ECT", "ADT": "ADT", "AWDT": "AWDT", "AKST": "AKST", "MEZ": "MEZ", "BOT": "BOT", "CLT": "CLT", "WEZ": "WEZ", "IST": "IST", "GMT": "GMT", "WAT": "WAT", "OEZ": "OEZ", "HNT": "HNT", "WITA": "WITA", "LHDT": "LHDT", "GYT": "GYT", "UYST": "UYST", "HAST": "HAST", "WIB": "WIB", "ACWDT": "ACWDT", "COT": "COT", "WIT": "WIT", "AWST": "AWST", "LHST": "LHST", "CAT": "CAT", "HAT": "HAT", "NZDT": "NZDT", "UYT": "UYT", "CST": "CST", "ACWST": "ACWST", "WAST": "WAST", "AKDT": "AKDT", "HKST": "HKST", "VET": "VET", "WESZ": "WESZ", "EDT": "EDT", "SAST": "SAST", "∅∅∅": "∅∅∅", "WART": "WART", "CDT": "CDT", "CHADT": "CHADT", "HADT": "HADT", "GFT": "GFT", "TMT": "TMT", "MESZ": "MESZ", "CLST": "CLST", "COST": "COST", "SGT": "SGT", "HKT": "HKT", "ACDT": "ACDT", "ART": "ART", "TMST": "TMST", "EAT": "EAT", "SRT": "SRT", "BT": "BT", "NZST": "NZST", "ChST": "ChST", "CHAST": "CHAST", "PST": "PST"},
+ timezones: map[string]string{"SRT": "SRT", "MESZ": "MESZ", "HAST": "HAST", "HAT": "HAT", "ChST": "ChST", "CST": "CST", "JDT": "JDT", "MDT": "MDT", "CHADT": "CHADT", "NZST": "NZST", "NZDT": "NZDT", "HADT": "HADT", "COT": "COT", "AKDT": "AKDT", "ADT": "ADT", "WITA": "WITA", "EDT": "EDT", "WESZ": "WESZ", "COST": "COST", "CHAST": "CHAST", "EST": "EST", "WIB": "WIB", "UYST": "UYST", "WART": "WART", "VET": "VET", "ACWST": "ACWST", "ART": "ART", "WEZ": "WEZ", "AEDT": "AEDT", "LHDT": "LHDT", "MYT": "MYT", "GFT": "GFT", "ARST": "ARST", "WIT": "WIT", "CLT": "CLT", "AST": "AST", "IST": "IST", "MEZ": "MEZ", "LHST": "LHST", "CDT": "CDT", "ACST": "ACST", "ECT": "ECT", "AKST": "AKST", "PST": "PST", "OESZ": "OESZ", "GMT": "GMT", "JST": "JST", "AWDT": "AWDT", "BOT": "BOT", "CAT": "CAT", "GYT": "GYT", "ACDT": "ACDT", "HKST": "HKST", "SGT": "SGT", "TMT": "TMT", "WAT": "WAT", "AEST": "AEST", "EAT": "EAT", "WARST": "WARST", "HKT": "HKT", "AWST": "AWST", "TMST": "TMST", "OEZ": "OEZ", "SAST": "SAST", "PDT": "PDT", "HNT": "HNT", "∅∅∅": "∅∅∅", "MST": "MST", "ACWDT": "ACWDT", "WAST": "WAST", "UYT": "UYT", "BT": "BT", "CLST": "CLST"},
}
}
diff --git a/sn_ZW/sn_ZW_test.go b/sn_ZW/sn_ZW_test.go
new file mode 100644
index 00000000..e70d0ac9
--- /dev/null
+++ b/sn_ZW/sn_ZW_test.go
@@ -0,0 +1,1120 @@
+package sn_ZW
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "sn_ZW"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/so/so.go b/so/so.go
index b409bcb5..fc73784e 100644
--- a/so/so.go
+++ b/so/so.go
@@ -61,7 +61,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"CK", "CD"},
erasNarrow: []string{"", ""},
erasWide: []string{"Ciise ka hor (CS)", "Ciise ka dib (CS)"},
- timezones: map[string]string{"AWST": "AWST", "LHDT": "LHDT", "JDT": "JDT", "EST": "EST", "WARST": "WARST", "WIT": "WIT", "MEZ": "MEZ", "ACWDT": "ACWDT", "MST": "MST", "COT": "COT", "COST": "COST", "NZDT": "NZDT", "AEST": "AEST", "HNT": "HNT", "MYT": "MYT", "BOT": "BOT", "HAST": "HAST", "SGT": "SGT", "AST": "AST", "ADT": "ADT", "WART": "WART", "CHADT": "CHADT", "CLT": "CLT", "∅∅∅": "∅∅∅", "WITA": "WITA", "ACST": "ACST", "TMST": "TMST", "AKDT": "AKDT", "CHAST": "CHAST", "WEZ": "WEZ", "HAT": "HAT", "SRT": "SRT", "CST": "CST", "HKT": "HKT", "MDT": "MDT", "WESZ": "WESZ", "OESZ": "OESZ", "ACDT": "ACDT", "EAT": "EAT", "LHST": "LHST", "NZST": "NZST", "ACWST": "ACWST", "CAT": "CAT", "JST": "JST", "UYT": "UYT", "CLST": "CLST", "HKST": "HKST", "AWDT": "AWDT", "ChST": "ChST", "VET": "VET", "OEZ": "OEZ", "MESZ": "MESZ", "CDT": "CDT", "PDT": "PDT", "GFT": "GFT", "ARST": "ARST", "BT": "BT", "SAST": "SAST", "ART": "ART", "PST": "PST", "AKST": "AKST", "UYST": "UYST", "AEDT": "AEDT", "GMT": "GMT", "WIB": "WIB", "IST": "IST", "TMT": "TMT", "ECT": "ECT", "WAST": "WAST", "WAT": "WAT", "GYT": "GYT", "EDT": "EDT", "HADT": "HADT"},
+ timezones: map[string]string{"MYT": "MYT", "CDT": "CDT", "GFT": "GFT", "ADT": "ADT", "BOT": "BOT", "COST": "COST", "BT": "BT", "ACDT": "ACDT", "WITA": "WITA", "WART": "WART", "HKST": "HKST", "PST": "PST", "OEZ": "OEZ", "AEDT": "AEDT", "EAT": "EAT", "MESZ": "MESZ", "SGT": "SGT", "TMT": "TMT", "MDT": "MDT", "ACWST": "ACWST", "WAST": "WAST", "HNT": "HNT", "OESZ": "OESZ", "UYST": "UYST", "WIB": "WIB", "ARST": "ARST", "MEZ": "MEZ", "SAST": "SAST", "AEST": "AEST", "ACST": "ACST", "ACWDT": "ACWDT", "AST": "AST", "TMST": "TMST", "WESZ": "WESZ", "LHST": "LHST", "VET": "VET", "AKST": "AKST", "AWST": "AWST", "AWDT": "AWDT", "NZST": "NZST", "COT": "COT", "UYT": "UYT", "CST": "CST", "JST": "JST", "NZDT": "NZDT", "WAT": "WAT", "∅∅∅": "∅∅∅", "CLT": "CLT", "MST": "MST", "CHAST": "CHAST", "PDT": "PDT", "EST": "EST", "EDT": "EDT", "WEZ": "WEZ", "ChST": "ChST", "ART": "ART", "IST": "IST", "CHADT": "CHADT", "GYT": "GYT", "GMT": "GMT", "CLST": "CLST", "WIT": "WIT", "HKT": "HKT", "ECT": "ECT", "JDT": "JDT", "AKDT": "AKDT", "CAT": "CAT", "HAT": "HAT", "WARST": "WARST", "SRT": "SRT", "HAST": "HAST", "LHDT": "LHDT", "HADT": "HADT"},
}
}
diff --git a/so/so_test.go b/so/so_test.go
new file mode 100644
index 00000000..1b927d6e
--- /dev/null
+++ b/so/so_test.go
@@ -0,0 +1,1120 @@
+package so
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "so"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/so_DJ/so_DJ.go b/so_DJ/so_DJ.go
index bb3f2bdc..7d7af28c 100644
--- a/so_DJ/so_DJ.go
+++ b/so_DJ/so_DJ.go
@@ -61,7 +61,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"CK", "CD"},
erasNarrow: []string{"", ""},
erasWide: []string{"Ciise ka hor (CS)", "Ciise ka dib (CS)"},
- timezones: map[string]string{"COT": "COT", "COST": "COST", "WIT": "WIT", "AWST": "AWST", "CST": "CST", "VET": "VET", "AKST": "AKST", "GYT": "GYT", "CAT": "CAT", "ECT": "ECT", "WITA": "WITA", "TMST": "TMST", "ART": "ART", "MYT": "MYT", "ADT": "ADT", "GMT": "GMT", "BOT": "BOT", "CHADT": "CHADT", "AEST": "AEST", "EAT": "EAT", "CLST": "CLST", "EDT": "EDT", "AKDT": "AKDT", "ChST": "ChST", "SGT": "SGT", "HAT": "HAT", "SRT": "SRT", "PST": "PST", "ACWST": "ACWST", "WESZ": "WESZ", "AST": "AST", "HKT": "HKT", "ACWDT": "ACWDT", "OESZ": "OESZ", "TMT": "TMT", "JDT": "JDT", "UYST": "UYST", "WIB": "WIB", "HNT": "HNT", "MDT": "MDT", "ARST": "ARST", "BT": "BT", "∅∅∅": "∅∅∅", "CLT": "CLT", "AEDT": "AEDT", "ACDT": "ACDT", "OEZ": "OEZ", "GFT": "GFT", "MST": "MST", "JST": "JST", "WAT": "WAT", "HADT": "HADT", "WARST": "WARST", "IST": "IST", "LHST": "LHST", "MEZ": "MEZ", "EST": "EST", "LHDT": "LHDT", "UYT": "UYT", "WEZ": "WEZ", "HKST": "HKST", "ACST": "ACST", "PDT": "PDT", "AWDT": "AWDT", "SAST": "SAST", "WART": "WART", "NZDT": "NZDT", "CHAST": "CHAST", "HAST": "HAST", "WAST": "WAST", "CDT": "CDT", "MESZ": "MESZ", "NZST": "NZST"},
+ timezones: map[string]string{"ARST": "ARST", "HADT": "HADT", "WAST": "WAST", "TMT": "TMT", "CHAST": "CHAST", "ACWDT": "ACWDT", "PST": "PST", "WIB": "WIB", "AEST": "AEST", "ACDT": "ACDT", "NZST": "NZST", "TMST": "TMST", "EAT": "EAT", "SRT": "SRT", "SGT": "SGT", "OESZ": "OESZ", "BT": "BT", "MYT": "MYT", "CHADT": "CHADT", "VET": "VET", "EDT": "EDT", "MESZ": "MESZ", "ACST": "ACST", "∅∅∅": "∅∅∅", "SAST": "SAST", "ChST": "ChST", "GYT": "GYT", "LHST": "LHST", "UYST": "UYST", "WIT": "WIT", "CDT": "CDT", "MEZ": "MEZ", "CAT": "CAT", "CLST": "CLST", "UYT": "UYT", "GFT": "GFT", "EST": "EST", "NZDT": "NZDT", "MST": "MST", "ACWST": "ACWST", "WITA": "WITA", "JST": "JST", "COT": "COT", "AST": "AST", "ECT": "ECT", "AWST": "AWST", "GMT": "GMT", "LHDT": "LHDT", "HKST": "HKST", "ADT": "ADT", "AKST": "AKST", "HAST": "HAST", "BOT": "BOT", "CST": "CST", "ART": "ART", "JDT": "JDT", "IST": "IST", "PDT": "PDT", "WESZ": "WESZ", "HNT": "HNT", "COST": "COST", "WARST": "WARST", "OEZ": "OEZ", "WEZ": "WEZ", "HAT": "HAT", "AWDT": "AWDT", "AKDT": "AKDT", "AEDT": "AEDT", "CLT": "CLT", "MDT": "MDT", "HKT": "HKT", "WART": "WART", "WAT": "WAT"},
}
}
diff --git a/so_DJ/so_DJ_test.go b/so_DJ/so_DJ_test.go
new file mode 100644
index 00000000..07bf86f1
--- /dev/null
+++ b/so_DJ/so_DJ_test.go
@@ -0,0 +1,1120 @@
+package so_DJ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "so_DJ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/so_ET/so_ET.go b/so_ET/so_ET.go
index b383aef2..f81ac3b0 100644
--- a/so_ET/so_ET.go
+++ b/so_ET/so_ET.go
@@ -61,7 +61,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"CK", "CD"},
erasNarrow: []string{"", ""},
erasWide: []string{"Ciise ka hor (CS)", "Ciise ka dib (CS)"},
- timezones: map[string]string{"GFT": "GFT", "NZST": "NZST", "VET": "VET", "GMT": "GMT", "CST": "CST", "CLT": "CLT", "AWST": "AWST", "CHADT": "CHADT", "HKST": "HKST", "WIT": "WIT", "OEZ": "OEZ", "TMST": "TMST", "COST": "COST", "OESZ": "OESZ", "ACST": "ACST", "ART": "ART", "MYT": "MYT", "WESZ": "WESZ", "WITA": "WITA", "SRT": "SRT", "AKDT": "AKDT", "ACWST": "ACWST", "PDT": "PDT", "LHDT": "LHDT", "NZDT": "NZDT", "ACWDT": "ACWDT", "HADT": "HADT", "SGT": "SGT", "MDT": "MDT", "AWDT": "AWDT", "MESZ": "MESZ", "UYST": "UYST", "WART": "WART", "UYT": "UYT", "CHAST": "CHAST", "COT": "COT", "WAT": "WAT", "HNT": "HNT", "JST": "JST", "LHST": "LHST", "MEZ": "MEZ", "BOT": "BOT", "CLST": "CLST", "WAST": "WAST", "WIB": "WIB", "WEZ": "WEZ", "SAST": "SAST", "BT": "BT", "WARST": "WARST", "MST": "MST", "ARST": "ARST", "TMT": "TMT", "CDT": "CDT", "HAT": "HAT", "JDT": "JDT", "AEST": "AEST", "EDT": "EDT", "HKT": "HKT", "EAT": "EAT", "∅∅∅": "∅∅∅", "GYT": "GYT", "AEDT": "AEDT", "ECT": "ECT", "AST": "AST", "ADT": "ADT", "AKST": "AKST", "CAT": "CAT", "EST": "EST", "IST": "IST", "ACDT": "ACDT", "PST": "PST", "ChST": "ChST", "HAST": "HAST"},
+ timezones: map[string]string{"COST": "COST", "AEDT": "AEDT", "WIT": "WIT", "CLST": "CLST", "ACWST": "ACWST", "HAST": "HAST", "HNT": "HNT", "AKST": "AKST", "ADT": "ADT", "EST": "EST", "HAT": "HAT", "ACST": "ACST", "HKT": "HKT", "JST": "JST", "WESZ": "WESZ", "OEZ": "OEZ", "CLT": "CLT", "CST": "CST", "WART": "WART", "AWST": "AWST", "ARST": "ARST", "TMT": "TMT", "MYT": "MYT", "UYST": "UYST", "ACDT": "ACDT", "VET": "VET", "AWDT": "AWDT", "GMT": "GMT", "WARST": "WARST", "WEZ": "WEZ", "GYT": "GYT", "SAST": "SAST", "WAT": "WAT", "WAST": "WAST", "UYT": "UYT", "MDT": "MDT", "PDT": "PDT", "BOT": "BOT", "LHST": "LHST", "LHDT": "LHDT", "GFT": "GFT", "SGT": "SGT", "OESZ": "OESZ", "NZST": "NZST", "IST": "IST", "COT": "COT", "CAT": "CAT", "EAT": "EAT", "MST": "MST", "ACWDT": "ACWDT", "MEZ": "MEZ", "NZDT": "NZDT", "SRT": "SRT", "AKDT": "AKDT", "PST": "PST", "∅∅∅": "∅∅∅", "JDT": "JDT", "ChST": "ChST", "AEST": "AEST", "CHADT": "CHADT", "MESZ": "MESZ", "EDT": "EDT", "HADT": "HADT", "WIB": "WIB", "WITA": "WITA", "AST": "AST", "BT": "BT", "ECT": "ECT", "HKST": "HKST", "CHAST": "CHAST", "CDT": "CDT", "ART": "ART", "TMST": "TMST"},
}
}
diff --git a/so_ET/so_ET_test.go b/so_ET/so_ET_test.go
new file mode 100644
index 00000000..4c26b309
--- /dev/null
+++ b/so_ET/so_ET_test.go
@@ -0,0 +1,1120 @@
+package so_ET
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "so_ET"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/so_KE/so_KE.go b/so_KE/so_KE.go
index 5c876405..9d0d4cd2 100644
--- a/so_KE/so_KE.go
+++ b/so_KE/so_KE.go
@@ -61,7 +61,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"CK", "CD"},
erasNarrow: []string{"", ""},
erasWide: []string{"Ciise ka hor (CS)", "Ciise ka dib (CS)"},
- timezones: map[string]string{"JST": "JST", "WESZ": "WESZ", "AEST": "AEST", "ChST": "ChST", "TMST": "TMST", "AKDT": "AKDT", "AWST": "AWST", "AWDT": "AWDT", "CAT": "CAT", "COST": "COST", "ACDT": "ACDT", "PDT": "PDT", "LHST": "LHST", "ACWDT": "ACWDT", "WITA": "WITA", "WIT": "WIT", "UYT": "UYT", "CLST": "CLST", "WAT": "WAT", "HKST": "HKST", "ARST": "ARST", "ACST": "ACST", "NZST": "NZST", "VET": "VET", "ADT": "ADT", "WAST": "WAST", "GFT": "GFT", "CDT": "CDT", "MESZ": "MESZ", "CHADT": "CHADT", "AEDT": "AEDT", "COT": "COT", "WEZ": "WEZ", "MDT": "MDT", "WARST": "WARST", "EAT": "EAT", "AKST": "AKST", "CST": "CST", "HADT": "HADT", "BT": "BT", "ART": "ART", "GYT": "GYT", "NZDT": "NZDT", "CLT": "CLT", "MST": "MST", "WART": "WART", "HAT": "HAT", "TMT": "TMT", "LHDT": "LHDT", "CHAST": "CHAST", "HAST": "HAST", "SAST": "SAST", "HKT": "HKT", "GMT": "GMT", "∅∅∅": "∅∅∅", "BOT": "BOT", "UYST": "UYST", "ACWST": "ACWST", "AST": "AST", "PST": "PST", "MYT": "MYT", "SRT": "SRT", "MEZ": "MEZ", "IST": "IST", "JDT": "JDT", "SGT": "SGT", "WIB": "WIB", "OESZ": "OESZ", "HNT": "HNT", "EST": "EST", "EDT": "EDT", "ECT": "ECT", "OEZ": "OEZ"},
+ timezones: map[string]string{"EST": "EST", "WESZ": "WESZ", "JDT": "JDT", "HAST": "HAST", "OESZ": "OESZ", "MST": "MST", "ACST": "ACST", "ECT": "ECT", "EDT": "EDT", "NZDT": "NZDT", "HNT": "HNT", "BT": "BT", "CLT": "CLT", "WIB": "WIB", "WARST": "WARST", "GFT": "GFT", "AST": "AST", "AKDT": "AKDT", "AKST": "AKST", "MESZ": "MESZ", "WEZ": "WEZ", "ChST": "ChST", "UYST": "UYST", "ACDT": "ACDT", "CHADT": "CHADT", "ADT": "ADT", "GMT": "GMT", "LHST": "LHST", "CDT": "CDT", "CHAST": "CHAST", "HADT": "HADT", "SAST": "SAST", "COT": "COT", "MDT": "MDT", "VET": "VET", "WAT": "WAT", "TMT": "TMT", "EAT": "EAT", "CST": "CST", "IST": "IST", "HAT": "HAT", "TMST": "TMST", "ART": "ART", "PDT": "PDT", "OEZ": "OEZ", "CLST": "CLST", "HKST": "HKST", "ACWDT": "ACWDT", "MEZ": "MEZ", "BOT": "BOT", "SGT": "SGT", "LHDT": "LHDT", "UYT": "UYT", "WIT": "WIT", "JST": "JST", "NZST": "NZST", "AEDT": "AEDT", "AWDT": "AWDT", "PST": "PST", "WAST": "WAST", "COST": "COST", "AWST": "AWST", "HKT": "HKT", "ACWST": "ACWST", "ARST": "ARST", "∅∅∅": "∅∅∅", "CAT": "CAT", "AEST": "AEST", "SRT": "SRT", "WITA": "WITA", "GYT": "GYT", "MYT": "MYT", "WART": "WART"},
}
}
diff --git a/so_KE/so_KE_test.go b/so_KE/so_KE_test.go
new file mode 100644
index 00000000..9c2c2e44
--- /dev/null
+++ b/so_KE/so_KE_test.go
@@ -0,0 +1,1120 @@
+package so_KE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "so_KE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/so_SO/so_SO.go b/so_SO/so_SO.go
index 106b65fe..0bd59326 100644
--- a/so_SO/so_SO.go
+++ b/so_SO/so_SO.go
@@ -61,7 +61,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"CK", "CD"},
erasNarrow: []string{"", ""},
erasWide: []string{"Ciise ka hor (CS)", "Ciise ka dib (CS)"},
- timezones: map[string]string{"SRT": "SRT", "AKDT": "AKDT", "MESZ": "MESZ", "CHADT": "CHADT", "WESZ": "WESZ", "WIT": "WIT", "MYT": "MYT", "AEDT": "AEDT", "ChST": "ChST", "CLT": "CLT", "IST": "IST", "MDT": "MDT", "LHST": "LHST", "GYT": "GYT", "PDT": "PDT", "WITA": "WITA", "TMST": "TMST", "PST": "PST", "WEZ": "WEZ", "COST": "COST", "HAST": "HAST", "WAST": "WAST", "CDT": "CDT", "MEZ": "MEZ", "OESZ": "OESZ", "ARST": "ARST", "ACDT": "ACDT", "UYT": "UYT", "WART": "WART", "HAT": "HAT", "OEZ": "OEZ", "AEST": "AEST", "EDT": "EDT", "BT": "BT", "WARST": "WARST", "GFT": "GFT", "ART": "ART", "ADT": "ADT", "GMT": "GMT", "JST": "JST", "NZST": "NZST", "UYST": "UYST", "CST": "CST", "AST": "AST", "JDT": "JDT", "ACWST": "ACWST", "ACST": "ACST", "EAT": "EAT", "AWST": "AWST", "AWDT": "AWDT", "NZDT": "NZDT", "MST": "MST", "VET": "VET", "EST": "EST", "HNT": "HNT", "WIB": "WIB", "CLST": "CLST", "ACWDT": "ACWDT", "CAT": "CAT", "HADT": "HADT", "TMT": "TMT", "LHDT": "LHDT", "BOT": "BOT", "CHAST": "CHAST", "ECT": "ECT", "∅∅∅": "∅∅∅", "SGT": "SGT", "HKT": "HKT", "HKST": "HKST", "WAT": "WAT", "COT": "COT", "AKST": "AKST", "SAST": "SAST"},
+ timezones: map[string]string{"PDT": "PDT", "SGT": "SGT", "GFT": "GFT", "ECT": "ECT", "WART": "WART", "AWST": "AWST", "ChST": "ChST", "CLT": "CLT", "CHADT": "CHADT", "JDT": "JDT", "HAST": "HAST", "LHST": "LHST", "CHAST": "CHAST", "TMT": "TMT", "CAT": "CAT", "LHDT": "LHDT", "SRT": "SRT", "ACWDT": "ACWDT", "NZDT": "NZDT", "IST": "IST", "COST": "COST", "∅∅∅": "∅∅∅", "WIB": "WIB", "EAT": "EAT", "COT": "COT", "TMST": "TMST", "WAST": "WAST", "MDT": "MDT", "AST": "AST", "ADT": "ADT", "MESZ": "MESZ", "GYT": "GYT", "AEDT": "AEDT", "OESZ": "OESZ", "WIT": "WIT", "CDT": "CDT", "ACWST": "ACWST", "WITA": "WITA", "AKDT": "AKDT", "HAT": "HAT", "WEZ": "WEZ", "ACDT": "ACDT", "HKT": "HKT", "EDT": "EDT", "HADT": "HADT", "BOT": "BOT", "SAST": "SAST", "OEZ": "OEZ", "MYT": "MYT", "HNT": "HNT", "WAT": "WAT", "GMT": "GMT", "CLST": "CLST", "ART": "ART", "ARST": "ARST", "AKST": "AKST", "MEZ": "MEZ", "UYT": "UYT", "UYST": "UYST", "VET": "VET", "PST": "PST", "WESZ": "WESZ", "CST": "CST", "AWDT": "AWDT", "NZST": "NZST", "WARST": "WARST", "HKST": "HKST", "BT": "BT", "ACST": "ACST", "JST": "JST", "EST": "EST", "AEST": "AEST", "MST": "MST"},
}
}
diff --git a/so_SO/so_SO_test.go b/so_SO/so_SO_test.go
new file mode 100644
index 00000000..2e06e32c
--- /dev/null
+++ b/so_SO/so_SO_test.go
@@ -0,0 +1,1120 @@
+package so_SO
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "so_SO"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/sq/sq.go b/sq/sq.go
index 5f14d3c3..6c32b2a6 100644
--- a/sq/sq.go
+++ b/sq/sq.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"p.e.r.", "e.r."},
erasNarrow: []string{"p.e.r.", "e.r."},
erasWide: []string{"para erës së re", "erës së re"},
- timezones: map[string]string{"GYT": "Ora e Guajanës", "WEZ": "Ora standarde e Europës Perëndimore", "CLST": "Ora verore e Kilit", "PDT": "Ora verore amerikane e Bregut të Paqësorit", "ECT": "Ora e Ekuadorit", "HAST": "Ora standarde e Ishujve Hauai-Aleutian", "SGT": "Ora e Singaporit", "ADT": "Ora verore e Atlantikut", "ARST": "Ora verore e Argjentinës", "TMST": "Ora verore e Turkmenistanit", "BOT": "Ora e Bolivisë", "UYT": "Ora standarde e Uruguait", "COST": "Ora verore e Kolumbisë", "CAT": "Ora e Afrikës Qendrore", "HKT": "Ora standarde e Hong-Kongut", "OESZ": "Ora verore e Europës Lindore", "AKDT": "Ora verore e Alsaskës", "ACWST": "Ora standarde e Australisë Qendroro-Perëndimore", "AEDT": "Ora verore e Australisë Lindore", "ChST": "Ora e Kamorros", "BT": "Ora e Butanit", "ACST": "Ora standarde e Australisë Qendrore", "ACDT": "Ora verore e Australisë Qendrore", "SRT": "Ora e Surinamit", "HADT": "Ora verore e Ishujve Hauai-Aleutian", "WIT": "Ora e Indonezisë Lindore", "OEZ": "Ora standarde e Europës Lindore", "IST": "Ora standarde e Indisë", "LHDT": "Ora verore e Lord-Houit", "CST": "Ora standarde e SHBA-së Qendrore", "CHADT": "Ora verore e Katamit", "WESZ": "Ora verore e Europës Perëndimore", "WART": "Ora standarde e Argjentinës Perëndimore", "JST": "Ora standarde e Japonisë", "AST": "Ora standarde e Atlantikut", "MDT": "Ora verore e Makaos", "EAT": "Ora e Afrikës Lindore", "AKST": "Ora standarde e Alaskës", "CDT": "Ora verore e SHBA-së Qendrore", "EST": "Ora standarde e SHBA-së Lindore", "WAST": "Ora verore e Afrikës Perëndimore", "HAT": "Ora verore e Njufaundlendit [Tokës së Re]", "GFT": "Ora e Guajanës Franceze", "WITA": "Ora e Indonezisë Qendrore", "JDT": "Ora verore e Japonisë", "MEZ": "Ora standarde e Europës Qendrore", "ACWDT": "Ora verore e Australisë Qendroro-Perëndimore", "CLT": "Ora standarde e Kilit", "HKST": "Ora verore e Hong-Kongut", "GMT": "Ora e Meridianit të Grinuiçit", "PST": "Ora standarde amerikane e Bregut të Paqësorit", "AWST": "Ora standarde e Australisë Perëndimore", "SAST": "Ora standarde e Afrikës Jugore", "AWDT": "Ora verore e Australisë Perëndimore", "NZST": "Ora standarde e Zelandës së Re", "EDT": "Ora verore e SHBA-së Lindore", "WIB": "Ora e Indonezisë Perëndimore", "MST": "Ora standarde e Makaos", "∅∅∅": "Ora verore e Amazonës", "TMT": "Ora standarde e Turkmenistanit", "COT": "Ora standarde e Kolumbisë", "WAT": "Ora standarde e Afrikës Perëndimore", "HNT": "Ora standarde e Njufaundlendit [Tokës së Re]", "ART": "Ora standarde e Argjentinës", "MESZ": "Ora verore e Europës Qendrore", "WARST": "Ora verore e Argjentinës Perëndimore", "UYST": "Ora verore e Uruguait", "AEST": "Ora standarde e Australisë Lindore", "CHAST": "Ora standarde e Katamit", "MYT": "Ora e Malajzisë", "NZDT": "Ora verore e Zelandës së Re", "VET": "Ora e Venezuelës", "LHST": "Ora standarde e Lord-Houit"},
+ timezones: map[string]string{"ACWDT": "Ora verore e Australisë Qendroro-Perëndimore", "TMT": "Ora standarde e Turkmenistanit", "MDT": "Ora verore e Makaos", "CHADT": "Ora verore e Katamit", "ARST": "Ora verore e Argjentinës", "WESZ": "Ora verore e Europës Perëndimore", "GYT": "Ora e Guajanës", "WARST": "Ora verore e Argjentinës Perëndimore", "AWST": "Ora standarde e Australisë Perëndimore", "HAST": "Ora standarde e Ishujve Hauai-Aleutian", "WEZ": "Ora standarde e Europës Perëndimore", "OESZ": "Ora verore e Europës Lindore", "GMT": "Ora e Meridianit të Grinuiçit", "GFT": "Ora e Guajanës Franceze", "AWDT": "Ora verore e Australisë Perëndimore", "AKDT": "Ora verore e Alsaskës", "HNT": "Ora standarde e Njufaundlendit [Tokës së Re]", "COT": "Ora standarde e Kolumbisë", "UYST": "Ora verore e Uruguait", "LHDT": "Ora verore e Lord-Houit", "MST": "Ora standarde e Makaos", "AST": "Ora standarde e Atlantikut", "IST": "Ora standarde e Indisë", "ACWST": "Ora standarde e Australisë Qendroro-Perëndimore", "SRT": "Ora e Surinamit", "VET": "Ora e Venezuelës", "ART": "Ora standarde e Argjentinës", "CLST": "Ora verore e Kilit", "CDT": "Ora verore e SHBA-së Qendrore", "ACDT": "Ora verore e Australisë Qendrore", "HKST": "Ora verore e Hong-Kongut", "SAST": "Ora standarde e Afrikës Jugore", "HAT": "Ora verore e Njufaundlendit [Tokës së Re]", "ChST": "Ora e Kamorros", "WART": "Ora standarde e Argjentinës Perëndimore", "∅∅∅": "Ora verore e Azoreve", "ADT": "Ora verore e Atlantikut", "PDT": "Ora verore amerikane e Bregut të Paqësorit", "NZDT": "Ora verore e Zelandës së Re", "SGT": "Ora e Singaporit", "AKST": "Ora standarde e Alaskës", "PST": "Ora standarde amerikane e Bregut të Paqësorit", "CAT": "Ora e Afrikës Qendrore", "WIB": "Ora e Indonezisë Perëndimore", "MYT": "Ora e Malajzisë", "UYT": "Ora standarde e Uruguait", "WAST": "Ora verore e Afrikës Perëndimore", "LHST": "Ora standarde e Lord-Houit", "WITA": "Ora e Indonezisë Qendrore", "BOT": "Ora e Bolivisë", "TMST": "Ora verore e Turkmenistanit", "CLT": "Ora standarde e Kilit", "HKT": "Ora standarde e Hong-Kongut", "CHAST": "Ora standarde e Katamit", "NZST": "Ora standarde e Zelandës së Re", "WAT": "Ora standarde e Afrikës Perëndimore", "AEST": "Ora standarde e Australisë Lindore", "EAT": "Ora e Afrikës Lindore", "ECT": "Ora e Ekuadorit", "MEZ": "Ora standarde e Europës Qendrore", "EDT": "Ora verore e SHBA-së Lindore", "CST": "Ora standarde e SHBA-së Qendrore", "WIT": "Ora e Indonezisë Lindore", "MESZ": "Ora verore e Europës Qendrore", "HADT": "Ora verore e Ishujve Hauai-Aleutian", "EST": "Ora standarde e SHBA-së Lindore", "COST": "Ora verore e Kolumbisë", "OEZ": "Ora standarde e Europës Lindore", "ACST": "Ora standarde e Australisë Qendrore", "JST": "Ora standarde e Japonisë", "JDT": "Ora verore e Japonisë", "AEDT": "Ora verore e Australisë Lindore", "BT": "Ora e Butanit"},
}
}
diff --git a/sq/sq_test.go b/sq/sq_test.go
new file mode 100644
index 00000000..4f308337
--- /dev/null
+++ b/sq/sq_test.go
@@ -0,0 +1,1120 @@
+package sq
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "sq"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/sq_AL/sq_AL.go b/sq_AL/sq_AL.go
index 05aa0e3b..e3206121 100644
--- a/sq_AL/sq_AL.go
+++ b/sq_AL/sq_AL.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"p.e.r.", "e.r."},
erasNarrow: []string{"p.e.r.", "e.r."},
erasWide: []string{"para erës së re", "erës së re"},
- timezones: map[string]string{"MESZ": "Ora verore e Europës Qendrore", "WESZ": "Ora verore e Europës Perëndimore", "HADT": "Ora verore e Ishujve Hauai-Aleutian", "WIB": "Ora e Indonezisë Perëndimore", "MDT": "Ora verore e Makaos", "TMST": "Ora verore e Turkmenistanit", "AKDT": "Ora verore e Alsaskës", "NZDT": "Ora verore e Zelandës së Re", "CST": "Ora standarde e SHBA-së Qendrore", "CDT": "Ora verore e SHBA-së Qendrore", "ADT": "Ora verore e Atlantikut", "OEZ": "Ora standarde e Europës Lindore", "EAT": "Ora e Afrikës Lindore", "MYT": "Ora e Malajzisë", "AKST": "Ora standarde e Alaskës", "CHADT": "Ora verore e Katamit", "COST": "Ora verore e Kolumbisë", "HAST": "Ora standarde e Ishujve Hauai-Aleutian", "MST": "Ora standarde e Makaos", "ACST": "Ora standarde e Australisë Qendrore", "LHDT": "Ora verore e Lord-Houit", "WART": "Ora standarde e Argjentinës Perëndimore", "JDT": "Ora verore e Japonisë", "BOT": "Ora e Bolivisë", "VET": "Ora e Venezuelës", "COT": "Ora standarde e Kolumbisë", "ECT": "Ora e Ekuadorit", "CAT": "Ora e Afrikës Qendrore", "WITA": "Ora e Indonezisë Qendrore", "WIT": "Ora e Indonezisë Lindore", "ACDT": "Ora verore e Australisë Qendrore", "SRT": "Ora e Surinamit", "EST": "Ora standarde e SHBA-së Lindore", "HKST": "Ora verore e Hong-Kongut", "GFT": "Ora e Guajanës Franceze", "MEZ": "Ora standarde e Europës Qendrore", "JST": "Ora standarde e Japonisë", "ChST": "Ora e Kamorros", "SAST": "Ora standarde e Afrikës Jugore", "OESZ": "Ora verore e Europës Lindore", "AEDT": "Ora verore e Australisë Lindore", "HAT": "Ora verore e Njufaundlendit [Tokës së Re]", "UYT": "Ora standarde e Uruguait", "WAT": "Ora standarde e Afrikës Perëndimore", "BT": "Ora e Butanit", "ART": "Ora standarde e Argjentinës", "ARST": "Ora verore e Argjentinës", "TMT": "Ora standarde e Turkmenistanit", "AWDT": "Ora verore e Australisë Perëndimore", "LHST": "Ora standarde e Lord-Houit", "EDT": "Ora verore e SHBA-së Lindore", "WAST": "Ora verore e Afrikës Perëndimore", "WARST": "Ora verore e Argjentinës Perëndimore", "GYT": "Ora e Guajanës", "CLST": "Ora verore e Kilit", "GMT": "Ora e Meridianit të Grinuiçit", "HNT": "Ora standarde e Njufaundlendit [Tokës së Re]", "UYST": "Ora verore e Uruguait", "∅∅∅": "Ora verore e Amazonës", "PDT": "Ora verore amerikane e Bregut të Paqësorit", "CHAST": "Ora standarde e Katamit", "CLT": "Ora standarde e Kilit", "AST": "Ora standarde e Atlantikut", "HKT": "Ora standarde e Hong-Kongut", "PST": "Ora standarde amerikane e Bregut të Paqësorit", "ACWST": "Ora standarde e Australisë Qendroro-Perëndimore", "ACWDT": "Ora verore e Australisë Qendroro-Perëndimore", "IST": "Ora standarde e Indisë", "AWST": "Ora standarde e Australisë Perëndimore", "NZST": "Ora standarde e Zelandës së Re", "AEST": "Ora standarde e Australisë Lindore", "WEZ": "Ora standarde e Europës Perëndimore", "SGT": "Ora e Singaporit"},
+ timezones: map[string]string{"MST": "Ora standarde e Makaos", "CHAST": "Ora standarde e Katamit", "CAT": "Ora e Afrikës Qendrore", "WIT": "Ora e Indonezisë Lindore", "BT": "Ora e Butanit", "∅∅∅": "Ora verore e Azoreve", "JDT": "Ora verore e Japonisë", "AST": "Ora standarde e Atlantikut", "COST": "Ora verore e Kolumbisë", "WAT": "Ora standarde e Afrikës Perëndimore", "VET": "Ora e Venezuelës", "ADT": "Ora verore e Atlantikut", "NZST": "Ora standarde e Zelandës së Re", "IST": "Ora standarde e Indisë", "NZDT": "Ora verore e Zelandës së Re", "ARST": "Ora verore e Argjentinës", "SAST": "Ora standarde e Afrikës Jugore", "PST": "Ora standarde amerikane e Bregut të Paqësorit", "LHST": "Ora standarde e Lord-Houit", "HKST": "Ora verore e Hong-Kongut", "EDT": "Ora verore e SHBA-së Lindore", "WAST": "Ora verore e Afrikës Perëndimore", "CDT": "Ora verore e SHBA-së Qendrore", "ART": "Ora standarde e Argjentinës", "HADT": "Ora verore e Ishujve Hauai-Aleutian", "OEZ": "Ora standarde e Europës Lindore", "ChST": "Ora e Kamorros", "EAT": "Ora e Afrikës Lindore", "LHDT": "Ora verore e Lord-Houit", "GFT": "Ora e Guajanës Franceze", "ACWST": "Ora standarde e Australisë Qendroro-Perëndimore", "PDT": "Ora verore amerikane e Bregut të Paqësorit", "WEZ": "Ora standarde e Europës Perëndimore", "CLST": "Ora verore e Kilit", "HAT": "Ora verore e Njufaundlendit [Tokës së Re]", "GYT": "Ora e Guajanës", "ACST": "Ora standarde e Australisë Qendrore", "MDT": "Ora verore e Makaos", "JST": "Ora standarde e Japonisë", "AKDT": "Ora verore e Alsaskës", "HAST": "Ora standarde e Ishujve Hauai-Aleutian", "WIB": "Ora e Indonezisë Perëndimore", "WARST": "Ora verore e Argjentinës Perëndimore", "MEZ": "Ora standarde e Europës Qendrore", "MESZ": "Ora verore e Europës Qendrore", "GMT": "Ora e Meridianit të Grinuiçit", "AWDT": "Ora verore e Australisë Perëndimore", "OESZ": "Ora verore e Europës Lindore", "ACDT": "Ora verore e Australisë Qendrore", "TMT": "Ora standarde e Turkmenistanit", "TMST": "Ora verore e Turkmenistanit", "WESZ": "Ora verore e Europës Perëndimore", "AEDT": "Ora verore e Australisë Lindore", "CST": "Ora standarde e SHBA-së Qendrore", "UYST": "Ora verore e Uruguait", "WART": "Ora standarde e Argjentinës Perëndimore", "SRT": "Ora e Surinamit", "HKT": "Ora standarde e Hong-Kongut", "CHADT": "Ora verore e Katamit", "WITA": "Ora e Indonezisë Qendrore", "AKST": "Ora standarde e Alaskës", "CLT": "Ora standarde e Kilit", "BOT": "Ora e Bolivisë", "EST": "Ora standarde e SHBA-së Lindore", "HNT": "Ora standarde e Njufaundlendit [Tokës së Re]", "AEST": "Ora standarde e Australisë Lindore", "ACWDT": "Ora verore e Australisë Qendroro-Perëndimore", "AWST": "Ora standarde e Australisë Perëndimore", "UYT": "Ora standarde e Uruguait", "MYT": "Ora e Malajzisë", "ECT": "Ora e Ekuadorit", "COT": "Ora standarde e Kolumbisë", "SGT": "Ora e Singaporit"},
}
}
diff --git a/sq_AL/sq_AL_test.go b/sq_AL/sq_AL_test.go
new file mode 100644
index 00000000..7bcfcd5f
--- /dev/null
+++ b/sq_AL/sq_AL_test.go
@@ -0,0 +1,1120 @@
+package sq_AL
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "sq_AL"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/sq_MK/sq_MK.go b/sq_MK/sq_MK.go
index c7d11896..d3f5708e 100644
--- a/sq_MK/sq_MK.go
+++ b/sq_MK/sq_MK.go
@@ -48,7 +48,7 @@ func New() locales.Translator {
locale: "sq_MK",
pluralsCardinal: []locales.PluralRule{2, 6},
pluralsOrdinal: []locales.PluralRule{2, 5, 6},
- pluralsRange: []locales.PluralRule{2, 6},
+ pluralsRange: []locales.PluralRule{6, 2},
decimal: ",",
group: " ",
minus: "-",
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"p.e.r.", "e.r."},
erasNarrow: []string{"p.e.r.", "e.r."},
erasWide: []string{"para erës së re", "erës së re"},
- timezones: map[string]string{"CST": "Ora standarde e SHBA-së Qendrore", "∅∅∅": "Ora verore e Brasilës", "SAST": "Ora standarde e Afrikës Jugore", "HKST": "Ora verore e Hong-Kongut", "LHDT": "Ora verore e Lord-Houit", "OEZ": "Ora standarde e Europës Lindore", "MEZ": "Ora standarde e Europës Qendrore", "NZDT": "Ora verore e Zelandës së Re", "CHADT": "Ora verore e Katamit", "CLST": "Ora verore e Kilit", "WAST": "Ora verore e Afrikës Perëndimore", "BT": "Ora e Butanit", "GFT": "Ora e Guajanës Franceze", "WITA": "Ora e Indonezisë Qendrore", "PDT": "Ora verore amerikane e Bregut të Paqësorit", "AWDT": "Ora verore e Australisë Perëndimore", "AKST": "Ora standarde e Alaskës", "MYT": "Ora e Malajzisë", "EST": "Ora standarde e SHBA-së Lindore", "COT": "Ora standarde e Kolumbisë", "WAT": "Ora standarde e Afrikës Perëndimore", "HKT": "Ora standarde e Hong-Kongut", "ACDT": "Ora verore e Australisë Qendrore", "MESZ": "Ora verore e Europës Qendrore", "AST": "Ora standarde e Atlantikut", "OESZ": "Ora verore e Europës Lindore", "ADT": "Ora verore e Atlantikut", "IST": "Ora standarde e Indisë", "GMT": "Ora e Meridianit të Grinuiçit", "WESZ": "Ora verore e Europës Perëndimore", "MDT": "Ora verore amerikane e Brezit Malor", "CLT": "Ora standarde e Kilit", "CAT": "Ora e Afrikës Qendrore", "COST": "Ora verore e Kolumbisë", "TMST": "Ora verore e Turkmenistanit", "PST": "Ora standarde amerikane e Bregut të Paqësorit", "GYT": "Ora e Guajanës", "ChST": "Ora e Kamorros", "EDT": "Ora verore e SHBA-së Lindore", "SGT": "Ora e Singaporit", "WIB": "Ora e Indonezisë Perëndimore", "ACST": "Ora standarde e Australisë Qendrore", "HAT": "Ora verore e Njufaundlendit [Tokës së Re]", "SRT": "Ora e Surinamit", "JST": "Ora standarde e Japonisë", "NZST": "Ora standarde e Zelandës së Re", "WEZ": "Ora standarde e Europës Perëndimore", "AEST": "Ora standarde e Australisë Lindore", "ECT": "Ora e Ekuadorit", "HADT": "Ora verore e Ishujve Hauai-Aleutian", "ACWDT": "Ora verore e Australisë Qendroro-Perëndimore", "ARST": "Ora verore e Argjentinës", "VET": "Ora e Venezuelës", "EAT": "Ora e Afrikës Lindore", "ART": "Ora standarde e Argjentinës", "TMT": "Ora standarde e Turkmenistanit", "UYST": "Ora verore e Uruguait", "AEDT": "Ora verore e Australisë Lindore", "CHAST": "Ora standarde e Katamit", "ACWST": "Ora standarde e Australisë Qendroro-Perëndimore", "WART": "Ora standarde e Argjentinës Perëndimore", "WARST": "Ora verore e Argjentinës Perëndimore", "MST": "Ora standarde amerikane e Brezit Malor", "HAST": "Ora standarde e Ishujve Hauai-Aleutian", "HNT": "Ora standarde e Njufaundlendit [Tokës së Re]", "JDT": "Ora verore e Japonisë", "UYT": "Ora standarde e Uruguait", "WIT": "Ora e Indonezisë Lindore", "BOT": "Ora e Bolivisë", "AWST": "Ora standarde e Australisë Perëndimore", "CDT": "Ora verore e SHBA-së Qendrore", "AKDT": "Ora verore e Alsaskës", "LHST": "Ora standarde e Lord-Houit"},
+ timezones: map[string]string{"SRT": "Ora e Surinamit", "CHAST": "Ora standarde e Katamit", "ACWST": "Ora standarde e Australisë Qendroro-Perëndimore", "WITA": "Ora e Indonezisë Qendrore", "WEZ": "Ora standarde e Europës Perëndimore", "HAT": "Ora verore e Njufaundlendit [Tokës së Re]", "COST": "Ora verore e Kolumbisë", "EAT": "Ora e Afrikës Lindore", "JDT": "Ora verore e Japonisë", "NZST": "Ora standarde e Zelandës së Re", "ECT": "Ora e Ekuadorit", "VET": "Ora e Venezuelës", "ARST": "Ora verore e Argjentinës", "NZDT": "Ora verore e Zelandës së Re", "GYT": "Ora e Guajanës", "OESZ": "Ora verore e Europës Lindore", "WART": "Ora standarde e Argjentinës Perëndimore", "ACST": "Ora standarde e Australisë Qendrore", "IST": "Ora standarde e Indisë", "UYST": "Ora verore e Uruguait", "PST": "Ora standarde amerikane e Bregut të Paqësorit", "WAST": "Ora verore e Afrikës Perëndimore", "AEDT": "Ora verore e Australisë Lindore", "LHST": "Ora standarde e Lord-Houit", "MDT": "Ora verore amerikane e Brezit Malor", "HADT": "Ora verore e Ishujve Hauai-Aleutian", "∅∅∅": "Ora verore e Brasilës", "HKST": "Ora verore e Hong-Kongut", "ART": "Ora standarde e Argjentinës", "AKDT": "Ora verore e Alsaskës", "SAST": "Ora standarde e Afrikës Jugore", "TMST": "Ora verore e Turkmenistanit", "LHDT": "Ora verore e Lord-Houit", "CLT": "Ora standarde e Kilit", "BT": "Ora e Butanit", "AKST": "Ora standarde e Alaskës", "AEST": "Ora standarde e Australisë Lindore", "MYT": "Ora e Malajzisë", "UYT": "Ora standarde e Uruguait", "CST": "Ora standarde e SHBA-së Qendrore", "WAT": "Ora standarde e Afrikës Perëndimore", "WIT": "Ora e Indonezisë Lindore", "EDT": "Ora verore e SHBA-së Lindore", "GMT": "Ora e Meridianit të Grinuiçit", "WARST": "Ora verore e Argjentinës Perëndimore", "AST": "Ora standarde e Atlantikut", "OEZ": "Ora standarde e Europës Lindore", "CLST": "Ora verore e Kilit", "CDT": "Ora verore e SHBA-së Qendrore", "TMT": "Ora standarde e Turkmenistanit", "AWST": "Ora standarde e Australisë Perëndimore", "EST": "Ora standarde e SHBA-së Lindore", "MEZ": "Ora standarde e Europës Qendrore", "COT": "Ora standarde e Kolumbisë", "CHADT": "Ora verore e Katamit", "HKT": "Ora standarde e Hong-Kongut", "ADT": "Ora verore e Atlantikut", "BOT": "Ora e Bolivisë", "SGT": "Ora e Singaporit", "WIB": "Ora e Indonezisë Perëndimore", "ChST": "Ora e Kamorros", "GFT": "Ora e Guajanës Franceze", "MESZ": "Ora verore e Europës Qendrore", "HAST": "Ora standarde e Ishujve Hauai-Aleutian", "HNT": "Ora standarde e Njufaundlendit [Tokës së Re]", "CAT": "Ora e Afrikës Qendrore", "MST": "Ora standarde amerikane e Brezit Malor", "ACDT": "Ora verore e Australisë Qendrore", "ACWDT": "Ora verore e Australisë Qendroro-Perëndimore", "AWDT": "Ora verore e Australisë Perëndimore", "WESZ": "Ora verore e Europës Perëndimore", "JST": "Ora standarde e Japonisë", "PDT": "Ora verore amerikane e Bregut të Paqësorit"},
}
}
diff --git a/sq_MK/sq_MK_test.go b/sq_MK/sq_MK_test.go
new file mode 100644
index 00000000..9da8172d
--- /dev/null
+++ b/sq_MK/sq_MK_test.go
@@ -0,0 +1,1120 @@
+package sq_MK
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "sq_MK"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/sq_XK/sq_XK.go b/sq_XK/sq_XK.go
index 5275101f..4063d329 100644
--- a/sq_XK/sq_XK.go
+++ b/sq_XK/sq_XK.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"p.e.r.", "e.r."},
erasNarrow: []string{"p.e.r.", "e.r."},
erasWide: []string{"para erës së re", "erës së re"},
- timezones: map[string]string{"MEZ": "Ora standarde e Europës Qendrore", "CAT": "Ora e Afrikës Qendrore", "HNT": "Ora standarde e Njufaundlendit [Tokës së Re]", "HAT": "Ora verore e Njufaundlendit [Tokës së Re]", "GYT": "Ora e Guajanës", "SRT": "Ora e Surinamit", "NZDT": "Ora verore e Zelandës së Re", "IST": "Ora standarde e Indisë", "AWDT": "Ora verore e Australisë Perëndimore", "CHAST": "Ora standarde e Katamit", "WITA": "Ora e Indonezisë Qendrore", "WART": "Ora standarde e Argjentinës Perëndimore", "AKDT": "Ora verore e Alsaskës", "COST": "Ora verore e Kolumbisë", "ARST": "Ora verore e Argjentinës", "ECT": "Ora e Ekuadorit", "SAST": "Ora standarde e Afrikës Jugore", "ART": "Ora standarde e Argjentinës", "JST": "Ora standarde e Japonisë", "AKST": "Ora standarde e Alaskës", "LHDT": "Ora verore e Lord-Houit", "MST": "Ora standarde amerikane e Brezit Malor", "AEST": "Ora standarde e Australisë Lindore", "ACWDT": "Ora verore e Australisë Qendroro-Perëndimore", "ChST": "Ora e Kamorros", "HKT": "Ora standarde e Hong-Kongut", "MYT": "Ora e Malajzisë", "MESZ": "Ora verore e Europës Qendrore", "BOT": "Ora e Bolivisë", "ADT": "Ora verore e Atlantikut", "HAST": "Ora standarde e Ishujve Hauai-Aleutian", "BT": "Ora e Butanit", "HKST": "Ora verore e Hong-Kongut", "GFT": "Ora e Guajanës Franceze", "ACDT": "Ora verore e Australisë Qendrore", "UYST": "Ora verore e Uruguait", "VET": "Ora e Venezuelës", "AST": "Ora standarde e Atlantikut", "WARST": "Ora verore e Argjentinës Perëndimore", "OEZ": "Ora standarde e Europës Lindore", "NZST": "Ora standarde e Zelandës së Re", "ACWST": "Ora standarde e Australisë Qendroro-Perëndimore", "ACST": "Ora standarde e Australisë Qendrore", "WESZ": "Ora verore e Europës Perëndimore", "EDT": "Ora verore e SHBA-së Lindore", "COT": "Ora standarde e Kolumbisë", "WAT": "Ora standarde e Afrikës Perëndimore", "WAST": "Ora verore e Afrikës Perëndimore", "TMT": "Ora standarde e Turkmenistanit", "TMST": "Ora verore e Turkmenistanit", "PDT": "Ora verore amerikane e Bregut të Paqësorit", "MDT": "Ora verore amerikane e Brezit Malor", "CLST": "Ora verore e Kilit", "CDT": "Ora verore e SHBA-së Qendrore", "∅∅∅": "Ora verore e Brasilës", "EAT": "Ora e Afrikës Lindore", "JDT": "Ora verore e Japonisë", "AWST": "Ora standarde e Australisë Perëndimore", "UYT": "Ora standarde e Uruguait", "CST": "Ora standarde e SHBA-së Qendrore", "SGT": "Ora e Singaporit", "WIT": "Ora e Indonezisë Lindore", "WIB": "Ora e Indonezisë Perëndimore", "WEZ": "Ora standarde e Europës Perëndimore", "AEDT": "Ora verore e Australisë Lindore", "LHST": "Ora standarde e Lord-Houit", "HADT": "Ora verore e Ishujve Hauai-Aleutian", "OESZ": "Ora verore e Europës Lindore", "GMT": "Ora e Meridianit të Grinuiçit", "PST": "Ora standarde amerikane e Bregut të Paqësorit", "CLT": "Ora standarde e Kilit", "EST": "Ora standarde e SHBA-së Lindore", "CHADT": "Ora verore e Katamit"},
+ timezones: map[string]string{"UYST": "Ora verore e Uruguait", "CST": "Ora standarde e SHBA-së Qendrore", "MEZ": "Ora standarde e Europës Qendrore", "COST": "Ora verore e Kolumbisë", "SGT": "Ora e Singaporit", "LHDT": "Ora verore e Lord-Houit", "MYT": "Ora e Malajzisë", "CLT": "Ora standarde e Kilit", "ACWST": "Ora standarde e Australisë Qendroro-Perëndimore", "WAST": "Ora verore e Afrikës Perëndimore", "COT": "Ora standarde e Kolumbisë", "OEZ": "Ora standarde e Europës Lindore", "AEST": "Ora standarde e Australisë Lindore", "CLST": "Ora verore e Kilit", "SRT": "Ora e Surinamit", "HNT": "Ora standarde e Njufaundlendit [Tokës së Re]", "AWDT": "Ora verore e Australisë Perëndimore", "NZDT": "Ora verore e Zelandës së Re", "WEZ": "Ora standarde e Europës Perëndimore", "WIT": "Ora e Indonezisë Lindore", "CDT": "Ora verore e SHBA-së Qendrore", "WARST": "Ora verore e Argjentinës Perëndimore", "IST": "Ora standarde e Indisë", "EST": "Ora standarde e SHBA-së Lindore", "GMT": "Ora e Meridianit të Grinuiçit", "ADT": "Ora verore e Atlantikut", "NZST": "Ora standarde e Zelandës së Re", "∅∅∅": "Ora verore e Brasilës", "EDT": "Ora verore e SHBA-së Lindore", "MDT": "Ora verore amerikane e Brezit Malor", "AST": "Ora standarde e Atlantikut", "ACWDT": "Ora verore e Australisë Qendroro-Perëndimore", "ART": "Ora standarde e Argjentinës", "GYT": "Ora e Guajanës", "LHST": "Ora standarde e Lord-Houit", "HKST": "Ora verore e Hong-Kongut", "ARST": "Ora verore e Argjentinës", "WITA": "Ora e Indonezisë Qendrore", "TMT": "Ora standarde e Turkmenistanit", "MST": "Ora standarde amerikane e Brezit Malor", "UYT": "Ora standarde e Uruguait", "WART": "Ora standarde e Argjentinës Perëndimore", "PST": "Ora standarde amerikane e Bregut të Paqësorit", "HADT": "Ora verore e Ishujve Hauai-Aleutian", "OESZ": "Ora verore e Europës Lindore", "EAT": "Ora e Afrikës Lindore", "AWST": "Ora standarde e Australisë Perëndimore", "PDT": "Ora verore amerikane e Bregut të Paqësorit", "HAST": "Ora standarde e Ishujve Hauai-Aleutian", "AEDT": "Ora verore e Australisë Lindore", "AKST": "Ora standarde e Alaskës", "JST": "Ora standarde e Japonisë", "HAT": "Ora verore e Njufaundlendit [Tokës së Re]", "ChST": "Ora e Kamorros", "GFT": "Ora e Guajanës Franceze", "ECT": "Ora e Ekuadorit", "VET": "Ora e Venezuelës", "SAST": "Ora standarde e Afrikës Jugore", "WAT": "Ora standarde e Afrikës Perëndimore", "WESZ": "Ora verore e Europës Perëndimore", "ACST": "Ora standarde e Australisë Qendrore", "CHAST": "Ora standarde e Katamit", "AKDT": "Ora verore e Alsaskës", "CAT": "Ora e Afrikës Qendrore", "HKT": "Ora standarde e Hong-Kongut", "JDT": "Ora verore e Japonisë", "MESZ": "Ora verore e Europës Qendrore", "ACDT": "Ora verore e Australisë Qendrore", "WIB": "Ora e Indonezisë Perëndimore", "BT": "Ora e Butanit", "CHADT": "Ora verore e Katamit", "BOT": "Ora e Bolivisë", "TMST": "Ora verore e Turkmenistanit"},
}
}
@@ -113,8 +113,8 @@ func (sq *sq_XK) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
func (sq *sq_XK) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
n := math.Abs(num)
- nMod100 := math.Mod(n, 100)
nMod10 := math.Mod(n, 10)
+ nMod100 := math.Mod(n, 100)
if n == 1 {
return locales.PluralRuleOne
diff --git a/sq_XK/sq_XK_test.go b/sq_XK/sq_XK_test.go
new file mode 100644
index 00000000..ef0cb6ed
--- /dev/null
+++ b/sq_XK/sq_XK_test.go
@@ -0,0 +1,1120 @@
+package sq_XK
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "sq_XK"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/sr/sr.go b/sr/sr.go
index d3c054c1..379b8a2d 100644
--- a/sr/sr.go
+++ b/sr/sr.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"п. н. е.", "н. е."},
erasNarrow: []string{"п.н.е.", "н.е."},
erasWide: []string{"пре нове ере", "нове ере"},
- timezones: map[string]string{"HAT": "Њуфаундленд летње рачунање времена", "EAT": "Источно-афричко време", "ACST": "Аустралијско централно стандардно време", "LHST": "Лорд Хов стандардно време", "ChST": "Чаморо време", "CLT": "Чиле стандардно време", "ADT": "Атланско лтње рачунање времена", "SAST": "Јужно-афричко време", "TMT": "Туркменистан стандардно време", "AWDT": "Аустралијско западно летње рачунање времена", "BT": "Бутан време", "WARST": "Западна Аргентина летње рачунање времена", "GMT": "Средње време по Гриничу", "NZDT": "Нови Зеланд летње рачунање времена", "UYST": "Уругвај летње рачунање времена", "WESZ": "Западноевропско летње рачунање времена", "EST": "Северноамерички Источно стандардно време", "AST": "Атланско стандардно време", "WART": "Западна Аргентина стандардно време", "JST": "Јапанско стандардно време", "WAST": "Западно-афричко летње рачунање времена", "WIT": "Источно-индонезијско време", "CDT": "Северноамерички Централно летње рачунање времена", "MESZ": "Средњеевропско летње рачунање времена", "WEZ": "Западноевропско стандардно време", "AEST": "Аустралијско источно стандардно време", "IST": "Индијско стандардно време", "VET": "Венецуела време", "∅∅∅": "Бразилија летње рачунање времена", "LHDT": "Лорд Хов летње рачунање времена", "GYT": "Гвајана време", "SRT": "Суринам време", "ECT": "Еквадор време", "SGT": "Сингапур стандардно време", "HKT": "Хонг Конг стандардно време", "MST": "Макао стандардно време", "ACWST": "Аустралијско централно западно стандардно време", "ACWDT": "Аустралијско централно западно летње рачунање времена", "CAT": "Централно-афричко време", "HAST": "Хавајско-алеутско стандардно време", "WIB": "Западно-индонезијско време", "PDT": "Северноамерички Пацифичко летње рачунање времена", "CHAST": "Чатам стандардно време", "GFT": "Француска Гвајана време", "AEDT": "Аустралијско источно летње рачунање времена", "CLST": "Чиле летње рачунање времена", "EDT": "Северноамерички Источно летње рачунање времена", "COST": "Колумбија летње рачунање времена", "HADT": "Хавајско-алеутско летње рачунање времена", "WITA": "Централно-индонезијско време", "TMST": "Туркменистан летње рачунање времена", "JDT": "Јапанско летње рачунање времена", "NZST": "Нови Зеланд стандардно време", "AKST": "Аљаска, стандардно време", "MYT": "Малезија време", "HKST": "Хонг Конг летње рачунање времена", "ACDT": "Аустралијско централно летње рачунање времена", "ART": "Аргентина стандардно време", "ARST": "Аргентина летње рачунање времена", "MEZ": "Средњеевропско стандардно време", "OEZ": "Источноевропско стандардно време", "HNT": "Њуфаундленд стандардно време", "AKDT": "Аљаска, летње рачунање времена", "CST": "Северноамерички Централно стандардно време", "COT": "Колумбија стандардно време", "WAT": "Западно-афричко стандардно време", "OESZ": "Источноевропско летње рачунање времена", "MDT": "Макао летње рачунање времена", "PST": "Северноамерички Пацифичко стандардно време", "AWST": "Аустралијско западно стандардно време", "BOT": "Боливија време", "UYT": "Уругвај стандардно време", "CHADT": "Чатам летње рачунање времена"},
+ timezones: map[string]string{"CLST": "Чиле летње рачунање времена", "ACST": "Аустралијско централно стандардно време", "HKT": "Хонг Конг стандардно време", "HAST": "Хавајско-алеутско стандардно време", "GYT": "Гвајана време", "UYST": "Уругвај летње рачунање времена", "AWST": "Аустралијско западно стандардно време", "HAT": "Њуфаундленд летње рачунање времена", "AEDT": "Аустралијско источно летње рачунање времена", "AEST": "Аустралијско источно стандардно време", "ECT": "Еквадор време", "AWDT": "Аустралијско западно летње рачунање времена", "SAST": "Јужно-афричко време", "OEZ": "Источноевропско стандардно време", "TMT": "Туркменистан стандардно време", "BT": "Бутан време", "GFT": "Француска Гвајана време", "HKST": "Хонг Конг летње рачунање времена", "HADT": "Хавајско-алеутско летње рачунање времена", "SRT": "Суринам време", "WAT": "Западно-афричко стандардно време", "GMT": "Средње време по Гриничу", "EDT": "Северноамерички Источно летње рачунање времена", "WIT": "Источно-индонезијско време", "LHDT": "Лорд Хов летње рачунање времена", "WART": "Западна Аргентина стандардно време", "JST": "Јапанско стандардно време", "HNT": "Њуфаундленд стандардно време", "SGT": "Сингапур стандардно време", "COT": "Колумбија стандардно време", "CLT": "Чиле стандардно време", "ART": "Аргентина стандардно време", "BOT": "Боливија време", "WESZ": "Западноевропско летње рачунање времена", "WEZ": "Западноевропско стандардно време", "MDT": "Северноамерички Планинско летње рачунање времена", "ACDT": "Аустралијско централно летње рачунање времена", "WITA": "Централно-индонезијско време", "EST": "Северноамерички Источно стандардно време", "NZST": "Нови Зеланд стандардно време", "CAT": "Централно-афричко време", "∅∅∅": "Бразилија летње рачунање времена", "ARST": "Аргентина летње рачунање времена", "JDT": "Јапанско летње рачунање времена", "MESZ": "Средњеевропско летње рачунање времена", "COST": "Колумбија летње рачунање времена", "LHST": "Лорд Хов стандардно време", "AKST": "Аљаска, стандардно време", "PST": "Северноамерички Пацифичко стандардно време", "NZDT": "Нови Зеланд летње рачунање времена", "MEZ": "Средњеевропско стандардно време", "WIB": "Западно-индонезијско време", "CDT": "Северноамерички Централно летње рачунање времена", "CHAST": "Чатам стандардно време", "ACWDT": "Аустралијско централно западно летње рачунање времена", "IST": "Индијско стандардно време", "EAT": "Источно-афричко време", "MST": "Северноамерички Планинско стандардно време", "MYT": "Малезија време", "OESZ": "Источноевропско летње рачунање времена", "AKDT": "Аљаска, летње рачунање времена", "TMST": "Туркменистан летње рачунање времена", "ChST": "Чаморо време", "ACWST": "Аустралијско централно западно стандардно време", "WAST": "Западно-афричко летње рачунање времена", "UYT": "Уругвај стандардно време", "CST": "Северноамерички Централно стандардно време", "WARST": "Западна Аргентина летње рачунање времена", "AST": "Атланско стандардно време", "CHADT": "Чатам летње рачунање времена", "VET": "Венецуела време", "ADT": "Атланско лтње рачунање времена", "PDT": "Северноамерички Пацифичко летње рачунање времена"},
}
}
diff --git a/sr/sr_test.go b/sr/sr_test.go
new file mode 100644
index 00000000..fcb9dfdf
--- /dev/null
+++ b/sr/sr_test.go
@@ -0,0 +1,1120 @@
+package sr
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "sr"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/sr_Cyrl/sr_Cyrl.go b/sr_Cyrl/sr_Cyrl.go
index 5e712318..6bcbb852 100644
--- a/sr_Cyrl/sr_Cyrl.go
+++ b/sr_Cyrl/sr_Cyrl.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"п. н. е.", "н. е."},
erasNarrow: []string{"п.н.е.", "н.е."},
erasWide: []string{"пре нове ере", "нове ере"},
- timezones: map[string]string{"WEZ": "Западноевропско стандардно време", "ECT": "Еквадор време", "HAST": "Хавајско-алеутско стандардно време", "BT": "Бутан време", "CHAST": "Чатам стандардно време", "VET": "Венецуела време", "WESZ": "Западноевропско летње рачунање времена", "ChST": "Чаморо време", "WARST": "Западна Аргентина летње рачунање времена", "HNT": "Њуфаундленд стандардно време", "JDT": "Јапанско летње рачунање времена", "AWST": "Аустралијско западно стандардно време", "ACWDT": "Аустралијско централно западно летње рачунање времена", "HADT": "Хавајско-алеутско летње рачунање времена", "SAST": "Јужно-афричко време", "PST": "Северноамерички Пацифичко стандардно време", "AWDT": "Аустралијско западно летње рачунање времена", "HKT": "Хонг Конг стандардно време", "WIT": "Источно-индонезијско време", "SGT": "Сингапур стандардно време", "WITA": "Централно-индонезијско време", "MST": "Макао стандардно време", "MDT": "Макао летње рачунање времена", "GYT": "Гвајана време", "ACWST": "Аустралијско централно западно стандардно време", "AST": "Атланско стандардно време", "TMST": "Туркменистан летње рачунање времена", "LHDT": "Лорд Хов летње рачунање времена", "UYT": "Уругвај стандардно време", "UYST": "Уругвај летње рачунање времена", "IST": "Индијско стандардно време", "ACDT": "Аустралијско централно летње рачунање времена", "AEST": "Аустралијско источно стандардно време", "ADT": "Атланско лтње рачунање времена", "WAST": "Западно-афричко летње рачунање времена", "WART": "Западна Аргентина стандардно време", "GMT": "Средње време по Гриничу", "AEDT": "Аустралијско источно летње рачунање времена", "COT": "Колумбија стандардно време", "HKST": "Хонг Конг летње рачунање времена", "ACST": "Аустралијско централно стандардно време", "ARST": "Аргентина летње рачунање времена", "SRT": "Суринам време", "NZDT": "Нови Зеланд летње рачунање времена", "CLT": "Чиле стандардно време", "EDT": "Северноамерички Источно летње рачунање времена", "EAT": "Источно-афричко време", "JST": "Јапанско стандардно време", "LHST": "Лорд Хов стандардно време", "CDT": "Северноамерички Централно летње рачунање времена", "BOT": "Боливија време", "ART": "Аргентина стандардно време", "MYT": "Малезија време", "AKDT": "Аљаска, летње рачунање времена", "CHADT": "Чатам летње рачунање времена", "CLST": "Чиле летње рачунање времена", "WAT": "Западно-афричко стандардно време", "OESZ": "Источноевропско летње рачунање времена", "OEZ": "Источноевропско стандардно време", "HAT": "Њуфаундленд летње рачунање времена", "GFT": "Француска Гвајана време", "PDT": "Северноамерички Пацифичко летње рачунање времена", "CST": "Северноамерички Централно стандардно време", "CAT": "Централно-афричко време", "COST": "Колумбија летње рачунање времена", "WIB": "Западно-индонезијско време", "TMT": "Туркменистан стандардно време", "AKST": "Аљаска, стандардно време", "MEZ": "Средњеевропско стандардно време", "MESZ": "Средњеевропско летње рачунање времена", "NZST": "Нови Зеланд стандардно време", "∅∅∅": "Амазон летње рачунање времена", "EST": "Северноамерички Источно стандардно време"},
+ timezones: map[string]string{"AWDT": "Аустралијско западно летње рачунање времена", "HADT": "Хавајско-алеутско летње рачунање времена", "MST": "Северноамерички Планинско стандардно време", "CST": "Северноамерички Централно стандардно време", "AST": "Атланско стандардно време", "ART": "Аргентина стандардно време", "ARST": "Аргентина летње рачунање времена", "MEZ": "Средњеевропско стандардно време", "WAST": "Западно-афричко летње рачунање времена", "CDT": "Северноамерички Централно летње рачунање времена", "AWST": "Аустралијско западно стандардно време", "BOT": "Боливија време", "COT": "Колумбија стандардно време", "ACDT": "Аустралијско централно летње рачунање времена", "ACWST": "Аустралијско централно западно стандардно време", "JST": "Јапанско стандардно време", "OESZ": "Источноевропско летње рачунање времена", "GFT": "Француска Гвајана време", "EDT": "Северноамерички Источно летње рачунање времена", "HAST": "Хавајско-алеутско стандардно време", "LHDT": "Лорд Хов летње рачунање времена", "ACWDT": "Аустралијско централно западно летње рачунање времена", "CAT": "Централно-афричко време", "ChST": "Чаморо време", "GYT": "Гвајана време", "HKT": "Хонг Конг стандардно време", "HKST": "Хонг Конг летње рачунање времена", "SGT": "Сингапур стандардно време", "WIT": "Источно-индонезијско време", "ACST": "Аустралијско централно стандардно време", "EST": "Северноамерички Источно стандардно време", "MESZ": "Средњеевропско летње рачунање времена", "∅∅∅": "Амазон летње рачунање времена", "WESZ": "Западноевропско летње рачунање времена", "BT": "Бутан време", "VET": "Венецуела време", "SAST": "Јужно-афричко време", "COST": "Колумбија летње рачунање времена", "WIB": "Западно-индонезијско време", "MDT": "Северноамерички Планинско летње рачунање времена", "MYT": "Малезија време", "AKDT": "Аљаска, летње рачунање времена", "PST": "Северноамерички Пацифичко стандардно време", "UYT": "Уругвај стандардно време", "WARST": "Западна Аргентина летње рачунање времена", "TMT": "Туркменистан стандардно време", "AEST": "Аустралијско источно стандардно време", "EAT": "Источно-афричко време", "CLST": "Чиле летње рачунање времена", "WITA": "Централно-индонезијско време", "LHST": "Лорд Хов стандардно време", "CHAST": "Чатам стандардно време", "CHADT": "Чатам летње рачунање времена", "AKST": "Аљаска, стандардно време", "ADT": "Атланско лтње рачунање времена", "JDT": "Јапанско летње рачунање времена", "IST": "Индијско стандардно време", "WAT": "Западно-афричко стандардно време", "OEZ": "Источноевропско стандардно време", "GMT": "Средње време по Гриничу", "WART": "Западна Аргентина стандардно време", "AEDT": "Аустралијско источно летње рачунање времена", "PDT": "Северноамерички Пацифичко летње рачунање времена", "NZST": "Нови Зеланд стандардно време", "NZDT": "Нови Зеланд летње рачунање времена", "TMST": "Туркменистан летње рачунање времена", "WEZ": "Западноевропско стандардно време", "HNT": "Њуфаундленд стандардно време", "HAT": "Њуфаундленд летње рачунање времена", "CLT": "Чиле стандардно време", "UYST": "Уругвај летње рачунање времена", "SRT": "Суринам време", "ECT": "Еквадор време"},
}
}
diff --git a/sr_Cyrl/sr_Cyrl_test.go b/sr_Cyrl/sr_Cyrl_test.go
new file mode 100644
index 00000000..57bb8fff
--- /dev/null
+++ b/sr_Cyrl/sr_Cyrl_test.go
@@ -0,0 +1,1120 @@
+package sr_Cyrl
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "sr_Cyrl"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/sr_Cyrl_BA/sr_Cyrl_BA.go b/sr_Cyrl_BA/sr_Cyrl_BA.go
index cf5f1d5a..26cc330a 100644
--- a/sr_Cyrl_BA/sr_Cyrl_BA.go
+++ b/sr_Cyrl_BA/sr_Cyrl_BA.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"п. н. е.", "н. е."},
erasNarrow: []string{"п.н.е.", "н.е."},
erasWide: []string{"пре нове ере", "нове ере"},
- timezones: map[string]string{"WART": "Западна Аргентина стандардно време", "ACDT": "Аустралијско централно летње рачунање времена", "MEZ": "Средњеевропско стандардно време", "UYST": "Уругвај летње рачунање времена", "ChST": "Чаморо време", "COT": "Колумбија стандардно време", "WIT": "Источно-индонезијско време", "IST": "Индијско стандардно време", "AWST": "Аустралијско западно стандардно време", "NZDT": "Нови Зеланд летње рачунање времена", "VET": "Венецуела време", "CHAST": "Чатам стандардно време", "EDT": "Северноамерички Источно летње рачунање времена", "ADT": "Атланско лтње рачунање времена", "HKST": "Хонг Конг летње рачунање времена", "OESZ": "Источноевропско летње рачунање времена", "PDT": "Северноамерички Пацифичко летње рачунање времена", "CST": "Северноамерички Централно стандардно време", "BOT": "Боливија време", "CLST": "Чиле летње рачунање времена", "LHST": "Лорд Хов стандардно време", "SRT": "Суринам време", "GYT": "Гвајана време", "WEZ": "Западноевропско стандардно време", "ACWST": "Аустралијско централно западно стандардно време", "HKT": "Хонг Конг стандардно време", "HNT": "Њуфаундленд стандардно време", "HAT": "Њуфаундленд летње рачунање времена", "ART": "Аргентина стандардно време", "AKDT": "Аљаска, летње рачунање времена", "EST": "Северноамерички Источно стандардно време", "BT": "Бутан време", "AKST": "Аљаска, стандардно време", "AWDT": "Аустралијско западно летње рачунање времена", "AEDT": "Аустралијско источно летње рачунање времена", "WAT": "Западно-афричко стандардно време", "GMT": "Средње време по Гриничу", "ACST": "Аустралијско централно стандардно време", "ARST": "Аргентина летње рачунање времена", "LHDT": "Лорд Хов летње рачунање времена", "UYT": "Уругвај стандардно време", "MDT": "Макао летње рачунање времена", "TMST": "Туркменистан летње рачунање времена", "MYT": "Малезија време", "MESZ": "Средњеевропско летње рачунање времена", "NZST": "Нови Зеланд стандардно време", "CAT": "Централно-афричко време", "EAT": "Источно-афричко време", "TMT": "Туркменистан стандардно време", "COST": "Колумбија летње рачунање времена", "SAST": "Јужно-афричко време", "OEZ": "Источноевропско стандардно време", "GFT": "Француска Гвајана време", "CHADT": "Чатам летње рачунање времена", "ECT": "Еквадор време", "WAST": "Западно-афричко летње рачунање времена", "JDT": "Јапанско летње рачунање времена", "CLT": "Чиле стандардно време", "WESZ": "Западноевропско летње рачунање времена", "HAST": "Хавајско-алеутско стандардно време", "∅∅∅": "Амазон летње рачунање времена", "AEST": "Аустралијско источно стандардно време", "AST": "Атланско стандардно време", "WIB": "Западно-индонезијско време", "MST": "Макао стандардно време", "CDT": "Северноамерички Централно летње рачунање времена", "HADT": "Хавајско-алеутско летње рачунање времена", "WARST": "Западна Аргентина летње рачунање времена", "WITA": "Централно-индонезијско време", "JST": "Јапанско стандардно време", "PST": "Северноамерички Пацифичко стандардно време", "ACWDT": "Аустралијско централно западно летње рачунање времена", "SGT": "Сингапур стандардно време"},
+ timezones: map[string]string{"CLT": "Чиле стандардно време", "WARST": "Западна Аргентина летње рачунање времена", "GFT": "Француска Гвајана време", "CHAST": "Чатам стандардно време", "HADT": "Хавајско-алеутско летње рачунање времена", "SGT": "Сингапур стандардно време", "WAST": "Западно-афричко летње рачунање времена", "TMT": "Туркменистан стандардно време", "SRT": "Суринам време", "HKST": "Хонг Конг летње рачунање времена", "JDT": "Јапанско летње рачунање времена", "PDT": "Северноамерички Пацифичко летње рачунање времена", "∅∅∅": "Амазон летње рачунање времена", "ACWST": "Аустралијско централно западно стандардно време", "HNT": "Њуфаундленд стандардно време", "WAT": "Западно-афричко стандардно време", "WESZ": "Западноевропско летње рачунање времена", "OESZ": "Источноевропско летње рачунање времена", "VET": "Венецуела време", "ACWDT": "Аустралијско централно западно летње рачунање времена", "OEZ": "Источноевропско стандардно време", "WART": "Западна Аргентина стандардно време", "AST": "Атланско стандардно време", "HAST": "Хавајско-алеутско стандардно време", "CDT": "Северноамерички Централно летње рачунање времена", "ADT": "Атланско лтње рачунање времена", "NZST": "Нови Зеланд стандардно време", "COST": "Колумбија летње рачунање времена", "BT": "Бутан време", "ACDT": "Аустралијско централно летње рачунање времена", "EST": "Северноамерички Источно стандардно време", "GMT": "Средње време по Гриничу", "WIT": "Источно-индонезијско време", "CLST": "Чиле летње рачунање времена", "LHDT": "Лорд Хов летње рачунање времена", "CHADT": "Чатам летње рачунање времена", "WIB": "Западно-индонезијско време", "TMST": "Туркменистан летње рачунање времена", "AEDT": "Аустралијско источно летње рачунање времена", "PST": "Северноамерички Пацифичко стандардно време", "MYT": "Малезија време", "HKT": "Хонг Конг стандардно време", "AWST": "Аустралијско западно стандардно време", "WITA": "Централно-индонезијско време", "AKST": "Аљаска, стандардно време", "WEZ": "Западноевропско стандардно време", "UYT": "Уругвај стандардно време", "EAT": "Источно-афричко време", "ECT": "Еквадор време", "AKDT": "Аљаска, летње рачунање времена", "SAST": "Јужно-афричко време", "HAT": "Њуфаундленд летње рачунање времена", "GYT": "Гвајана време", "MEZ": "Средњеевропско стандардно време", "IST": "Индијско стандардно време", "CAT": "Централно-афричко време", "ARST": "Аргентина летње рачунање времена", "NZDT": "Нови Зеланд летње рачунање времена", "CST": "Северноамерички Централно стандардно време", "LHST": "Лорд Хов стандардно време", "ACST": "Аустралијско централно стандардно време", "EDT": "Северноамерички Источно летње рачунање времена", "COT": "Колумбија стандардно време", "ChST": "Чаморо време", "UYST": "Уругвај летње рачунање времена", "AWDT": "Аустралијско западно летње рачунање времена", "MESZ": "Средњеевропско летње рачунање времена", "BOT": "Боливија време", "MST": "Северноамерички Планинско стандардно време", "MDT": "Северноамерички Планинско летње рачунање времена", "ART": "Аргентина стандардно време", "JST": "Јапанско стандардно време", "AEST": "Аустралијско источно стандардно време"},
}
}
@@ -103,10 +103,10 @@ func (sr *sr_Cyrl_BA) CardinalPluralRule(num float64, v uint64) locales.PluralRu
n := math.Abs(num)
i := int64(n)
f := locales.F(n, v)
- iMod10 := i % 10
iMod100 := i % 100
- fMod100 := f % 100
+ iMod10 := i % 10
fMod10 := f % 10
+ fMod100 := f % 100
if (v == 0 && iMod10 == 1 && iMod100 != 11) || (fMod10 == 1 && fMod100 != 11) {
return locales.PluralRuleOne
diff --git a/sr_Cyrl_BA/sr_Cyrl_BA_test.go b/sr_Cyrl_BA/sr_Cyrl_BA_test.go
new file mode 100644
index 00000000..81943dd2
--- /dev/null
+++ b/sr_Cyrl_BA/sr_Cyrl_BA_test.go
@@ -0,0 +1,1120 @@
+package sr_Cyrl_BA
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "sr_Cyrl_BA"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/sr_Cyrl_ME/sr_Cyrl_ME.go b/sr_Cyrl_ME/sr_Cyrl_ME.go
index 01d4b6a0..ad95963f 100644
--- a/sr_Cyrl_ME/sr_Cyrl_ME.go
+++ b/sr_Cyrl_ME/sr_Cyrl_ME.go
@@ -48,7 +48,7 @@ func New() locales.Translator {
locale: "sr_Cyrl_ME",
pluralsCardinal: []locales.PluralRule{2, 4, 6},
pluralsOrdinal: []locales.PluralRule{6},
- pluralsRange: []locales.PluralRule{2, 4, 6},
+ pluralsRange: []locales.PluralRule{4, 6, 2},
decimal: ",",
group: ".",
minus: "-",
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"п. н. е.", "н. е."},
erasNarrow: []string{"п.н.е.", "н.е."},
erasWide: []string{"пре нове ере", "нове ере"},
- timezones: map[string]string{"UYT": "Уругвај стандардно време", "∅∅∅": "Бразилија летње рачунање времена", "HAT": "Њуфаундленд летње рачунање времена", "WIB": "Западно-индонезијско време", "VET": "Венецуела време", "AEST": "Аустралијско источно стандардно време", "WAT": "Западно-афричко стандардно време", "HNT": "Њуфаундленд стандардно време", "AWST": "Аустралијско западно стандардно време", "UYST": "Уругвај летње рачунање времена", "NZST": "Нови Зеланд стандардно време", "SAST": "Јужно-афричко време", "AKST": "Аљаска, стандардно време", "CDT": "Северноамерички Централно летње рачунање времена", "NZDT": "Нови Зеланд летње рачунање времена", "OEZ": "Источноевропско стандардно време", "GMT": "Средње време по Гриничу", "ACST": "Аустралијско централно стандардно време", "JST": "Јапанско стандардно време", "HAST": "Хавајско-алеутско стандардно време", "ARST": "Аргентина летње рачунање времена", "BOT": "Боливија време", "ECT": "Еквадор време", "COT": "Колумбија стандардно време", "WARST": "Западна Аргентина летње рачунање времена", "WAST": "Западно-афричко летње рачунање времена", "OESZ": "Источноевропско летње рачунање времена", "LHST": "Лорд Хов стандардно време", "SRT": "Суринам време", "CHADT": "Чатам летње рачунање времена", "HKT": "Хонг Конг стандардно време", "HKST": "Хонг Конг летње рачунање времена", "CLT": "Чиле стандардно време", "WESZ": "Западноевропско летње рачунање времена", "ACWDT": "Аустралијско централно западно летње рачунање времена", "IST": "Индијско стандардно време", "MESZ": "Средњеевропско летње рачунање времена", "GFT": "Француска Гвајана време", "WITA": "Централно-индонезијско време", "ACDT": "Аустралијско централно летње рачунање времена", "MYT": "Малезија време", "MEZ": "Средњеевропско стандардно време", "COST": "Колумбија летње рачунање времена", "WART": "Западна Аргентина стандардно време", "JDT": "Јапанско летње рачунање времена", "HADT": "Хавајско-алеутско летње рачунање времена", "WIT": "Источно-индонезијско време", "ART": "Аргентина стандардно време", "GYT": "Гвајана време", "ChST": "Чаморо време", "AST": "Атланско стандардно време", "BT": "Бутан време", "CHAST": "Чатам стандардно време", "AEDT": "Аустралијско источно летње рачунање времена", "ADT": "Атланско лтње рачунање времена", "PST": "Северноамерички Пацифичко стандардно време", "SGT": "Сингапур стандардно време", "MST": "Макао стандардно време", "AKDT": "Аљаска, летње рачунање времена", "EST": "Северноамерички Источно стандардно време", "EDT": "Северноамерички Источно летње рачунање времена", "AWDT": "Аустралијско западно летње рачунање времена", "ACWST": "Аустралијско централно западно стандардно време", "LHDT": "Лорд Хов летње рачунање времена", "CST": "Северноамерички Централно стандардно време", "WEZ": "Западноевропско стандардно време", "TMT": "Туркменистан стандардно време", "MDT": "Макао летње рачунање времена", "EAT": "Источно-афричко време", "PDT": "Северноамерички Пацифичко летње рачунање времена", "CLST": "Чиле летње рачунање времена", "CAT": "Централно-афричко време", "TMST": "Туркменистан летње рачунање времена"},
+ timezones: map[string]string{"UYT": "Уругвај стандардно време", "HKST": "Хонг Конг летње рачунање времена", "CHAST": "Чатам стандардно време", "HNT": "Њуфаундленд стандардно време", "LHDT": "Лорд Хов летње рачунање времена", "MYT": "Малезија време", "WIT": "Источно-индонезијско време", "WART": "Западна Аргентина стандардно време", "ADT": "Атланско лтње рачунање времена", "PST": "Северноамерички Пацифичко стандардно време", "WAT": "Западно-афричко стандардно време", "MDT": "Северноамерички Планинско летње рачунање времена", "WEZ": "Западноевропско стандардно време", "GYT": "Гвајана време", "OESZ": "Источноевропско летње рачунање времена", "WARST": "Западна Аргентина летње рачунање времена", "AST": "Атланско стандардно време", "MESZ": "Средњеевропско летње рачунање времена", "SAST": "Јужно-афричко време", "COST": "Колумбија летње рачунање времена", "AEDT": "Аустралијско источно летње рачунање времена", "ECT": "Еквадор време", "NZDT": "Нови Зеланд летње рачунање времена", "WESZ": "Западноевропско летње рачунање времена", "HAT": "Њуфаундленд летње рачунање времена", "OEZ": "Источноевропско стандардно време", "CHADT": "Чатам летње рачунање времена", "AWDT": "Аустралијско западно летње рачунање времена", "WITA": "Централно-индонезијско време", "BOT": "Боливија време", "COT": "Колумбија стандардно време", "SRT": "Суринам време", "AWST": "Аустралијско западно стандардно време", "LHST": "Лорд Хов стандардно време", "JST": "Јапанско стандардно време", "JDT": "Јапанско летње рачунање времена", "IST": "Индијско стандардно време", "HAST": "Хавајско-алеутско стандардно време", "SGT": "Сингапур стандардно време", "CLST": "Чиле летње рачунање времена", "ACDT": "Аустралијско централно летње рачунање времена", "NZST": "Нови Зеланд стандардно време", "GMT": "Средње време по Гриничу", "∅∅∅": "Перу летње рачунање времена", "ARST": "Аргентина летње рачунање времена", "EDT": "Северноамерички Источно летње рачунање времена", "MST": "Северноамерички Планинско стандардно време", "TMST": "Туркменистан летње рачунање времена", "ChST": "Чаморо време", "MEZ": "Средњеевропско стандардно време", "ACWDT": "Аустралијско централно западно летње рачунање времена", "AKST": "Аљаска, стандардно време", "AEST": "Аустралијско источно стандардно време", "ACWST": "Аустралијско централно западно стандардно време", "ACST": "Аустралијско централно стандардно време", "HKT": "Хонг Конг стандардно време", "AKDT": "Аљаска, летње рачунање времена", "BT": "Бутан време", "CDT": "Северноамерички Централно летње рачунање времена", "EST": "Северноамерички Источно стандардно време", "WIB": "Западно-индонезијско време", "CAT": "Централно-афричко време", "CLT": "Чиле стандардно време", "CST": "Северноамерички Централно стандардно време", "GFT": "Француска Гвајана време", "VET": "Венецуела време", "PDT": "Северноамерички Пацифичко летње рачунање времена", "WAST": "Западно-афричко летње рачунање времена", "EAT": "Источно-афричко време", "ART": "Аргентина стандардно време", "HADT": "Хавајско-алеутско летње рачунање времена", "TMT": "Туркменистан стандардно време", "UYST": "Уругвај летње рачунање времена"},
}
}
diff --git a/sr_Cyrl_ME/sr_Cyrl_ME_test.go b/sr_Cyrl_ME/sr_Cyrl_ME_test.go
new file mode 100644
index 00000000..4135a25f
--- /dev/null
+++ b/sr_Cyrl_ME/sr_Cyrl_ME_test.go
@@ -0,0 +1,1120 @@
+package sr_Cyrl_ME
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "sr_Cyrl_ME"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/sr_Cyrl_RS/sr_Cyrl_RS.go b/sr_Cyrl_RS/sr_Cyrl_RS.go
index 21141cad..f544dcde 100644
--- a/sr_Cyrl_RS/sr_Cyrl_RS.go
+++ b/sr_Cyrl_RS/sr_Cyrl_RS.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"п. н. е.", "н. е."},
erasNarrow: []string{"п.н.е.", "н.е."},
erasWide: []string{"пре нове ере", "нове ере"},
- timezones: map[string]string{"GFT": "Француска Гвајана време", "MST": "Макао стандардно време", "ACST": "Аустралијско централно стандардно време", "PDT": "Северноамерички Пацифичко летње рачунање времена", "VET": "Венецуела време", "AEST": "Аустралијско источно стандардно време", "CHAST": "Чатам стандардно време", "OEZ": "Источноевропско стандардно време", "ACWST": "Аустралијско централно западно стандардно време", "GMT": "Средње време по Гриничу", "AKDT": "Аљаска, летње рачунање времена", "CHADT": "Чатам летње рачунање времена", "COST": "Колумбија летње рачунање времена", "ECT": "Еквадор време", "TMT": "Туркменистан стандардно време", "IST": "Индијско стандардно време", "HNT": "Њуфаундленд стандардно време", "BOT": "Боливија време", "EDT": "Северноамерички Источно летње рачунање времена", "HADT": "Хавајско-алеутско летње рачунање времена", "UYT": "Уругвај стандардно време", "UYST": "Уругвај летње рачунање времена", "CLT": "Чиле стандардно време", "NZDT": "Нови Зеланд летње рачунање времена", "ARST": "Аргентина летње рачунање времена", "SRT": "Суринам време", "AWST": "Аустралијско западно стандардно време", "GYT": "Гвајана време", "MEZ": "Средњеевропско стандардно време", "ACWDT": "Аустралијско централно западно летње рачунање времена", "CLST": "Чиле летње рачунање времена", "HAST": "Хавајско-алеутско стандардно време", "BT": "Бутан време", "WARST": "Западна Аргентина летње рачунање времена", "ART": "Аргентина стандардно време", "JST": "Јапанско стандардно време", "WAT": "Западно-афричко стандардно време", "ACDT": "Аустралијско централно летње рачунање времена", "PST": "Северноамерички Пацифичко стандардно време", "LHST": "Лорд Хов стандардно време", "HAT": "Њуфаундленд летње рачунање времена", "∅∅∅": "Акре летње рачунање времена", "WIB": "Западно-индонезијско време", "SGT": "Сингапур стандардно време", "TMST": "Туркменистан летње рачунање времена", "EST": "Северноамерички Источно стандардно време", "WART": "Западна Аргентина стандардно време", "WEZ": "Западноевропско стандардно време", "AST": "Атланско стандардно време", "OESZ": "Источноевропско летње рачунање времена", "WITA": "Централно-индонезијско време", "AWDT": "Аустралијско западно летње рачунање времена", "NZST": "Нови Зеланд стандардно време", "CAT": "Централно-афричко време", "ADT": "Атланско лтње рачунање времена", "WIT": "Источно-индонезијско време", "CDT": "Северноамерички Централно летње рачунање времена", "AEDT": "Аустралијско источно летње рачунање времена", "WAST": "Западно-афричко летње рачунање времена", "EAT": "Источно-афричко време", "AKST": "Аљаска, стандардно време", "JDT": "Јапанско летње рачунање времена", "MESZ": "Средњеевропско летње рачунање времена", "WESZ": "Западноевропско летње рачунање времена", "ChST": "Чаморо време", "COT": "Колумбија стандардно време", "SAST": "Јужно-афричко време", "LHDT": "Лорд Хов летње рачунање времена", "CST": "Северноамерички Централно стандардно време", "HKST": "Хонг Конг летње рачунање времена", "MDT": "Макао летње рачунање времена", "MYT": "Малезија време", "HKT": "Хонг Конг стандардно време"},
+ timezones: map[string]string{"BT": "Бутан време", "ARST": "Аргентина летње рачунање времена", "EST": "Северноамерички Источно стандардно време", "PDT": "Северноамерички Пацифичко летње рачунање времена", "HAST": "Хавајско-алеутско стандардно време", "COST": "Колумбија летње рачунање времена", "AEDT": "Аустралијско источно летње рачунање времена", "ChST": "Чаморо време", "UYST": "Уругвај летње рачунање времена", "CHADT": "Чатам летње рачунање времена", "WESZ": "Западноевропско летње рачунање времена", "TMT": "Туркменистан стандардно време", "∅∅∅": "Бразилија летње рачунање времена", "EDT": "Северноамерички Источно летње рачунање времена", "OESZ": "Источноевропско летње рачунање времена", "WARST": "Западна Аргентина летње рачунање времена", "ACWDT": "Аустралијско централно западно летње рачунање времена", "JST": "Јапанско стандардно време", "NZST": "Нови Зеланд стандардно време", "WART": "Западна Аргентина стандардно време", "ECT": "Еквадор време", "AST": "Атланско стандардно време", "WAT": "Западно-афричко стандардно време", "AEST": "Аустралијско источно стандардно време", "CST": "Северноамерички Централно стандардно време", "HKST": "Хонг Конг летње рачунање времена", "VET": "Венецуела време", "MEZ": "Средњеевропско стандардно време", "SGT": "Сингапур стандардно време", "OEZ": "Источноевропско стандардно време", "AWDT": "Аустралијско западно летње рачунање времена", "IST": "Индијско стандардно време", "BOT": "Боливија време", "HAT": "Њуфаундленд летње рачунање времена", "EAT": "Источно-афричко време", "WIT": "Источно-индонезијско време", "AWST": "Аустралијско западно стандардно време", "ART": "Аргентина стандардно време", "LHST": "Лорд Хов стандардно време", "MYT": "Малезија време", "ACST": "Аустралијско централно стандардно време", "HKT": "Хонг Конг стандардно време", "AKST": "Аљаска, стандардно време", "ADT": "Атланско лтње рачунање времена", "WIB": "Западно-индонезијско време", "MST": "Северноамерички Планинско стандардно време", "UYT": "Уругвај стандардно време", "GFT": "Француска Гвајана време", "CLT": "Чиле стандардно време", "AKDT": "Аљаска, летње рачунање времена", "HADT": "Хавајско-алеутско летње рачунање времена", "HNT": "Њуфаундленд стандардно време", "GMT": "Средње време по Гриничу", "WITA": "Централно-индонезијско време", "ACDT": "Аустралијско централно летње рачунање времена", "ACWST": "Аустралијско централно западно стандардно време", "PST": "Северноамерички Пацифичко стандардно време", "WAST": "Западно-афричко летње рачунање времена", "COT": "Колумбија стандардно време", "MDT": "Северноамерички Планинско летње рачунање времена", "SAST": "Јужно-афричко време", "MESZ": "Средњеевропско летње рачунање времена", "CAT": "Централно-афричко време", "WEZ": "Западноевропско стандардно време", "GYT": "Гвајана време", "CLST": "Чиле летње рачунање времена", "SRT": "Суринам време", "CHAST": "Чатам стандардно време", "TMST": "Туркменистан летње рачунање времена", "LHDT": "Лорд Хов летње рачунање времена", "CDT": "Северноамерички Централно летње рачунање времена", "JDT": "Јапанско летње рачунање времена", "NZDT": "Нови Зеланд летње рачунање времена"},
}
}
@@ -105,8 +105,8 @@ func (sr *sr_Cyrl_RS) CardinalPluralRule(num float64, v uint64) locales.PluralRu
f := locales.F(n, v)
iMod10 := i % 10
iMod100 := i % 100
- fMod10 := f % 10
fMod100 := f % 100
+ fMod10 := f % 10
if (v == 0 && iMod10 == 1 && iMod100 != 11) || (fMod10 == 1 && fMod100 != 11) {
return locales.PluralRuleOne
diff --git a/sr_Cyrl_RS/sr_Cyrl_RS_test.go b/sr_Cyrl_RS/sr_Cyrl_RS_test.go
new file mode 100644
index 00000000..92732fe0
--- /dev/null
+++ b/sr_Cyrl_RS/sr_Cyrl_RS_test.go
@@ -0,0 +1,1120 @@
+package sr_Cyrl_RS
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "sr_Cyrl_RS"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/sr_Cyrl_XK/sr_Cyrl_XK.go b/sr_Cyrl_XK/sr_Cyrl_XK.go
index 88fbffe5..28e72376 100644
--- a/sr_Cyrl_XK/sr_Cyrl_XK.go
+++ b/sr_Cyrl_XK/sr_Cyrl_XK.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"п. н. е.", "н. е."},
erasNarrow: []string{"п.н.е.", "н.е."},
erasWide: []string{"пре нове ере", "нове ере"},
- timezones: map[string]string{"HADT": "Хавајско-алеутско летње рачунање времена", "OESZ": "Источноевропско летње рачунање времена", "ACST": "Аустралијско централно стандардно време", "MEZ": "Средњеевропско стандардно време", "UYT": "Уругвај стандардно време", "CDT": "Северноамерички Централно летње рачунање времена", "CLST": "Чиле летње рачунање времена", "WIB": "Западно-индонезијско време", "MYT": "Малезија време", "BT": "Бутан време", "CAT": "Централно-афричко време", "GMT": "Средње време по Гриничу", "AEST": "Аустралијско источно стандардно време", "HAT": "Њуфаундленд летње рачунање времена", "JST": "Јапанско стандардно време", "WARST": "Западна Аргентина летње рачунање времена", "CHADT": "Чатам летње рачунање времена", "WESZ": "Западноевропско летње рачунање времена", "WAST": "Западно-афричко летње рачунање времена", "ARST": "Аргентина летње рачунање времена", "TMT": "Туркменистан стандардно време", "GYT": "Гвајана време", "NZST": "Нови Зеланд стандардно време", "AEDT": "Аустралијско источно летње рачунање времена", "LHDT": "Лорд Хов летње рачунање времена", "ACDT": "Аустралијско централно летње рачунање времена", "WEZ": "Западноевропско стандардно време", "EST": "Северноамерички Источно стандардно време", "EDT": "Северноамерички Источно летње рачунање времена", "∅∅∅": "Бразилија летње рачунање времена", "WART": "Западна Аргентина стандардно време", "SAST": "Јужно-афричко време", "ART": "Аргентина стандардно време", "MST": "Северноамерички Планинско стандардно време", "AWST": "Аустралијско западно стандардно време", "EAT": "Источно-афричко време", "COST": "Колумбија летње рачунање времена", "HAST": "Хавајско-алеутско стандардно време", "TMST": "Туркменистан летње рачунање времена", "AWDT": "Аустралијско западно летње рачунање времена", "AKST": "Аљаска, стандардно време", "AKDT": "Аљаска, летње рачунање времена", "CHAST": "Чатам стандардно време", "ChST": "Чаморо време", "CLT": "Чиле стандардно време", "ECT": "Еквадор време", "SGT": "Сингапур стандардно време", "HKT": "Хонг Конг стандардно време", "PDT": "Северноамерички Пацифичко летње рачунање времена", "ACWDT": "Аустралијско централно западно летње рачунање времена", "WITA": "Централно-индонезијско време", "HNT": "Њуфаундленд стандардно време", "OEZ": "Источноевропско стандардно време", "IST": "Индијско стандардно време", "NZDT": "Нови Зеланд летње рачунање времена", "BOT": "Боливија време", "COT": "Колумбија стандардно време", "ADT": "Атланско лтње рачунање времена", "WAT": "Западно-афричко стандардно време", "LHST": "Лорд Хов стандардно време", "SRT": "Суринам време", "CST": "Северноамерички Централно стандардно време", "ACWST": "Аустралијско централно западно стандардно време", "UYST": "Уругвај летње рачунање времена", "HKST": "Хонг Конг летње рачунање времена", "AST": "Атланско стандардно време", "MESZ": "Средњеевропско летње рачунање времена", "VET": "Венецуела време", "GFT": "Француска Гвајана време", "WIT": "Источно-индонезијско време", "PST": "Северноамерички Пацифичко стандардно време", "JDT": "Јапанско летње рачунање времена", "MDT": "Северноамерички Планинско летње рачунање времена"},
+ timezones: map[string]string{"GMT": "Средње време по Гриничу", "CLT": "Чиле стандардно време", "SRT": "Суринам време", "ACDT": "Аустралијско централно летње рачунање времена", "EDT": "Северноамерички Источно летње рачунање времена", "∅∅∅": "Амазон летње рачунање времена", "ChST": "Чаморо време", "MDT": "Северноамерички Планинско летње рачунање времена", "LHDT": "Лорд Хов летње рачунање времена", "PDT": "Северноамерички Пацифичко летње рачунање времена", "WIB": "Западно-индонезијско време", "WEZ": "Западноевропско стандардно време", "NZDT": "Нови Зеланд летње рачунање времена", "MYT": "Малезија време", "ADT": "Атланско лтње рачунање времена", "SAST": "Јужно-афричко време", "CLST": "Чиле летње рачунање времена", "WITA": "Централно-индонезијско време", "TMT": "Туркменистан стандардно време", "EAT": "Источно-афричко време", "JST": "Јапанско стандардно време", "MEZ": "Средњеевропско стандардно време", "HNT": "Њуфаундленд стандардно време", "HAT": "Њуфаундленд летње рачунање времена", "OEZ": "Источноевропско стандардно време", "BT": "Бутан време", "ACST": "Аустралијско централно стандардно време", "PST": "Северноамерички Пацифичко стандардно време", "MESZ": "Средњеевропско летње рачунање времена", "GYT": "Гвајана време", "WESZ": "Западноевропско летње рачунање времена", "AEST": "Аустралијско источно стандардно време", "UYT": "Уругвај стандардно време", "ECT": "Еквадор време", "JDT": "Јапанско летње рачунање времена", "NZST": "Нови Зеланд стандардно време", "COT": "Колумбија стандардно време", "CAT": "Централно-афричко време", "AKST": "Аљаска, стандардно време", "AKDT": "Аљаска, летње рачунање времена", "ACWST": "Аустралијско централно западно стандардно време", "IST": "Индијско стандардно време", "MST": "Северноамерички Планинско стандардно време", "LHST": "Лорд Хов стандардно време", "VET": "Венецуела време", "AST": "Атланско стандардно време", "UYST": "Уругвај летње рачунање времена", "ACWDT": "Аустралијско централно западно летње рачунање времена", "HAST": "Хавајско-алеутско стандардно време", "EST": "Северноамерички Источно стандардно време", "WIT": "Источно-индонезијско време", "ART": "Аргентина стандардно време", "WAT": "Западно-афричко стандардно време", "AEDT": "Аустралијско источно летње рачунање времена", "CDT": "Северноамерички Централно летње рачунање времена", "HADT": "Хавајско-алеутско летње рачунање времена", "WAST": "Западно-афричко летње рачунање времена", "CST": "Северноамерички Централно стандардно време", "HKT": "Хонг Конг стандардно време", "CHAST": "Чатам стандардно време", "AWST": "Аустралијско западно стандардно време", "WART": "Западна Аргентина стандардно време", "CHADT": "Чатам летње рачунање времена", "SGT": "Сингапур стандардно време", "TMST": "Туркменистан летње рачунање времена", "OESZ": "Источноевропско летње рачунање времена", "GFT": "Француска Гвајана време", "HKST": "Хонг Конг летње рачунање времена", "AWDT": "Аустралијско западно летње рачунање времена", "ARST": "Аргентина летње рачунање времена", "BOT": "Боливија време", "COST": "Колумбија летње рачунање времена", "WARST": "Западна Аргентина летње рачунање времена"},
}
}
diff --git a/sr_Cyrl_XK/sr_Cyrl_XK_test.go b/sr_Cyrl_XK/sr_Cyrl_XK_test.go
new file mode 100644
index 00000000..5b26586e
--- /dev/null
+++ b/sr_Cyrl_XK/sr_Cyrl_XK_test.go
@@ -0,0 +1,1120 @@
+package sr_Cyrl_XK
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "sr_Cyrl_XK"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/sr_Latn/sr_Latn.go b/sr_Latn/sr_Latn.go
index 9349215f..f423c7d9 100644
--- a/sr_Latn/sr_Latn.go
+++ b/sr_Latn/sr_Latn.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"p. n. e.", "n. e."},
erasNarrow: []string{"p.n.e.", "n.e."},
erasWide: []string{"pre nove ere", "nove ere"},
- timezones: map[string]string{"GYT": "Gvajana vreme", "∅∅∅": "Azori letnje računanje vremena", "MEZ": "Srednjeevropsko standardno vreme", "WAT": "Zapadno-afričko standardno vreme", "UYT": "Urugvaj standardno vreme", "CDT": "Severnoamerički Centralno letnje računanje vremena", "HKST": "Hong Kong letnje računanje vremena", "OEZ": "Istočnoevropsko standardno vreme", "ACWDT": "Australijsko centralno zapadno letnje računanje vremena", "EST": "Severnoamerički Istočno standardno vreme", "AST": "Atlansko standardno vreme", "ACST": "Australijsko centralno standardno vreme", "ACDT": "Australijsko centralno letnje računanje vremena", "AWDT": "Australijsko zapadno letnje računanje vremena", "CAT": "Centralno-afričko vreme", "HADT": "Havajsko-aleutsko letnje računanje vremena", "SGT": "Singapur standardno vreme", "GFT": "Francuska Gvajana vreme", "AEDT": "Australijsko istočno letnje računanje vremena", "ECT": "Ekvador vreme", "HNT": "Njufaundlend standardno vreme", "AEST": "Australijsko istočno standardno vreme", "EDT": "Severnoamerički Istočno letnje računanje vremena", "COST": "Kolumbija letnje računanje vremena", "LHST": "Lord Hov standardno vreme", "PST": "Severnoamerički Pacifičko standardno vreme", "CST": "Severnoamerički Centralno standardno vreme", "MST": "Severnoamerički Planinsko standardno vreme", "CLT": "Čile standardno vreme", "ADT": "Atlansko ltnje računanje vremena", "HKT": "Hong Kong standardno vreme", "ART": "Argentina standardno vreme", "ARST": "Argentina letnje računanje vremena", "EAT": "Istočno-afričko vreme", "LHDT": "Lord Hov letnje računanje vremena", "WEZ": "Zapadnoevropsko standardno vreme", "ACWST": "Australijsko centralno zapadno standardno vreme", "HAT": "Njufaundlend letnje računanje vremena", "GMT": "Srednje vreme po Griniču", "PDT": "Severnoamerički Pacifičko letnje računanje vremena", "NZST": "Novi Zeland standardno vreme", "NZDT": "Novi Zeland letnje računanje vremena", "VET": "Venecuela vreme", "WIB": "Zapadno-indonezijsko vreme", "BT": "Butan vreme", "TMST": "Turkmenistan letnje računanje vremena", "JDT": "Japansko letnje računanje vremena", "AWST": "Australijsko zapadno standardno vreme", "COT": "Kolumbija standardno vreme", "WART": "Zapadna Argentina standardno vreme", "SAST": "Južno-afričko vreme", "BOT": "Bolivija vreme", "MYT": "Malezija vreme", "MESZ": "Srednjeevropsko letnje računanje vremena", "CLST": "Čile letnje računanje vremena", "WESZ": "Zapadnoevropsko letnje računanje vremena", "IST": "Indijsko standardno vreme", "AKDT": "Aljaska, letnje računanje vremena", "UYST": "Urugvaj letnje računanje vremena", "HAST": "Havajsko-aleutsko standardno vreme", "ChST": "Čamoro vreme", "WITA": "Centralno-indonezijsko vreme", "WIT": "Istočno-indonezijsko vreme", "OESZ": "Istočnoevropsko letnje računanje vremena", "TMT": "Turkmenistan standardno vreme", "CHADT": "Čatam letnje računanje vremena", "WARST": "Zapadna Argentina letnje računanje vremena", "WAST": "Zapadno-afričko letnje računanje vremena", "JST": "Japansko standardno vreme", "SRT": "Surinam vreme", "AKST": "Aljaska, standardno vreme", "MDT": "Severnoamerički Planinsko letnje računanje vremena", "CHAST": "Čatam standardno vreme"},
+ timezones: map[string]string{"CHADT": "Čatam letnje računanje vremena", "HAST": "Havajsko-aleutsko standardno vreme", "SGT": "Singapur standardno vreme", "WESZ": "Zapadnoevropsko letnje računanje vremena", "EAT": "Istočno-afričko vreme", "ACWDT": "Australijsko centralno zapadno letnje računanje vremena", "BT": "Butan vreme", "CHAST": "Čatam standardno vreme", "BOT": "Bolivija vreme", "WAT": "Zapadno-afričko standardno vreme", "AEST": "Australijsko istočno standardno vreme", "AWST": "Australijsko zapadno standardno vreme", "WEZ": "Zapadnoevropsko standardno vreme", "OESZ": "Istočnoevropsko letnje računanje vremena", "ART": "Argentina standardno vreme", "MESZ": "Srednjeevropsko letnje računanje vremena", "NZDT": "Novi Zeland letnje računanje vremena", "IST": "Indijsko standardno vreme", "ChST": "Čamoro vreme", "GYT": "Gvajana vreme", "GMT": "Srednje vreme po Griniču", "UYST": "Urugvaj letnje računanje vremena", "WART": "Zapadna Argentina standardno vreme", "ADT": "Atlansko ltnje računanje vremena", "PST": "Severnoamerički Pacifičko standardno vreme", "MEZ": "Srednjeevropsko standardno vreme", "SAST": "Južno-afričko vreme", "WIT": "Istočno-indonezijsko vreme", "CST": "Severnoamerički Centralno standardno vreme", "AWDT": "Australijsko zapadno letnje računanje vremena", "WIB": "Zapadno-indonezijsko vreme", "MYT": "Malezija vreme", "COT": "Kolumbija standardno vreme", "COST": "Kolumbija letnje računanje vremena", "JST": "Japansko standardno vreme", "HADT": "Havajsko-aleutsko letnje računanje vremena", "HAT": "Njufaundlend letnje računanje vremena", "SRT": "Surinam vreme", "ACST": "Australijsko centralno standardno vreme", "ACDT": "Australijsko centralno letnje računanje vremena", "VET": "Venecuela vreme", "HKST": "Hong Kong letnje računanje vremena", "OEZ": "Istočnoevropsko standardno vreme", "CLST": "Čile letnje računanje vremena", "GFT": "Francuska Gvajana vreme", "ACWST": "Australijsko centralno zapadno standardno vreme", "TMST": "Turkmenistan letnje računanje vremena", "ECT": "Ekvador vreme", "HKT": "Hong Kong standardno vreme", "JDT": "Japansko letnje računanje vremena", "CDT": "Severnoamerički Centralno letnje računanje vremena", "AST": "Atlansko standardno vreme", "LHDT": "Lord Hov letnje računanje vremena", "MDT": "Makao letnje računanje vremena", "ARST": "Argentina letnje računanje vremena", "AKDT": "Aljaska, letnje računanje vremena", "TMT": "Turkmenistan standardno vreme", "CLT": "Čile standardno vreme", "WAST": "Zapadno-afričko letnje računanje vremena", "AKST": "Aljaska, standardno vreme", "PDT": "Severnoamerički Pacifičko letnje računanje vremena", "NZST": "Novi Zeland standardno vreme", "EST": "Severnoamerički Istočno standardno vreme", "HNT": "Njufaundlend standardno vreme", "UYT": "Urugvaj standardno vreme", "WARST": "Zapadna Argentina letnje računanje vremena", "MST": "Makao standardno vreme", "WITA": "Centralno-indonezijsko vreme", "EDT": "Severnoamerički Istočno letnje računanje vremena", "CAT": "Centralno-afričko vreme", "∅∅∅": "Azori letnje računanje vremena", "AEDT": "Australijsko istočno letnje računanje vremena", "LHST": "Lord Hov standardno vreme"},
}
}
@@ -103,8 +103,8 @@ func (sr *sr_Latn) CardinalPluralRule(num float64, v uint64) locales.PluralRule
n := math.Abs(num)
i := int64(n)
f := locales.F(n, v)
- iMod100 := i % 100
iMod10 := i % 10
+ iMod100 := i % 100
fMod100 := f % 100
fMod10 := f % 10
diff --git a/sr_Latn/sr_Latn_test.go b/sr_Latn/sr_Latn_test.go
new file mode 100644
index 00000000..a72ad052
--- /dev/null
+++ b/sr_Latn/sr_Latn_test.go
@@ -0,0 +1,1120 @@
+package sr_Latn
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "sr_Latn"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/sr_Latn_BA/sr_Latn_BA.go b/sr_Latn_BA/sr_Latn_BA.go
index 842e8c19..c51bd8ae 100644
--- a/sr_Latn_BA/sr_Latn_BA.go
+++ b/sr_Latn_BA/sr_Latn_BA.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"п. н. е.", "н. е."},
erasNarrow: []string{"п.н.е.", "н.е."},
erasWide: []string{"пре нове ере", "нове ере"},
- timezones: map[string]string{"AKDT": "Аљаска, летње рачунање времена", "WAST": "Западно-афричко летње рачунање времена", "EAT": "Источно-афричко време", "UYST": "Уругвај летње рачунање времена", "CHAST": "Чатам стандардно време", "ACWST": "Аустралијско централно западно стандардно време", "ACDT": "Аустралијско централно летње рачунање времена", "TMST": "Туркменистан летње рачунање времена", "MST": "Макао стандардно време", "CLST": "Чиле летње рачунање времена", "SRT": "Суринам време", "HAST": "Хавајско-алеутско стандардно време", "MYT": "Малезија време", "WESZ": "Западноевропско летње рачунање времена", "EDT": "Северноамерички Источно летње рачунање времена", "HNT": "Њуфаундленд стандардно време", "HAT": "Њуфаундленд летње рачунање времена", "IST": "Индијско стандардно време", "AWST": "Аустралијско западно стандардно време", "LHDT": "Лорд Хов летње рачунање времена", "JST": "Јапанско стандардно време", "NZDT": "Нови Зеланд летње рачунање времена", "COST": "Колумбија летње рачунање времена", "ACST": "Аустралијско централно стандардно време", "∅∅∅": "Амазон летње рачунање времена", "TMT": "Туркменистан стандардно време", "MDT": "Макао летње рачунање времена", "ADT": "Атланско лтње рачунање времена", "BT": "Бутан време", "HKT": "Хонг Конг стандардно време", "WARST": "Западна Аргентина летње рачунање времена", "NZST": "Нови Зеланд стандардно време", "JDT": "Јапанско летње рачунање времена", "CHADT": "Чатам летње рачунање времена", "WEZ": "Западноевропско стандардно време", "WAT": "Западно-афричко стандардно време", "GMT": "Средње време по Гриничу", "UYT": "Уругвај стандардно време", "AEST": "Аустралијско источно стандардно време", "AEDT": "Аустралијско источно летње рачунање времена", "CST": "Северноамерички Централно стандардно време", "COT": "Колумбија стандардно време", "SGT": "Сингапур стандардно време", "SAST": "Јужно-афричко време", "WITA": "Централно-индонезијско време", "GYT": "Гвајана време", "EST": "Северноамерички Источно стандардно време", "WART": "Западна Аргентина стандардно време", "ChST": "Чаморо време", "WIT": "Источно-индонезијско време", "WIB": "Западно-индонезијско време", "AKST": "Аљаска, стандардно време", "CDT": "Северноамерички Централно летње рачунање времена", "HKST": "Хонг Конг летње рачунање времена", "ART": "Аргентина стандардно време", "ARST": "Аргентина летње рачунање времена", "AWDT": "Аустралијско западно летње рачунање времена", "AST": "Атланско стандардно време", "HADT": "Хавајско-алеутско летње рачунање времена", "GFT": "Француска Гвајана време", "OESZ": "Источноевропско летње рачунање времена", "PST": "Северноамерички Пацифичко стандардно време", "PDT": "Северноамерички Пацифичко летње рачунање времена", "LHST": "Лорд Хов стандардно време", "BOT": "Боливија време", "VET": "Венецуела време", "ECT": "Еквадор време", "ACWDT": "Аустралијско централно западно летње рачунање времена", "CAT": "Централно-афричко време", "OEZ": "Источноевропско стандардно време", "MEZ": "Средњеевропско стандардно време", "MESZ": "Средњеевропско летње рачунање времена", "CLT": "Чиле стандардно време"},
+ timezones: map[string]string{"WARST": "Западна Аргентина летње рачунање времена", "ART": "Аргентина стандардно време", "PDT": "Северноамерички Пацифичко летње рачунање времена", "COT": "Колумбија стандардно време", "CLST": "Чиле летње рачунање времена", "HKST": "Хонг Конг летње рачунање времена", "CHADT": "Чатам летње рачунање времена", "ACWST": "Аустралијско централно западно стандардно време", "WIB": "Западно-индонезијско време", "WIT": "Источно-индонезијско време", "SRT": "Суринам време", "TMST": "Туркменистан летње рачунање времена", "MYT": "Малезија време", "ECT": "Еквадор време", "GMT": "Средње време по Гриничу", "CLT": "Чиле стандардно време", "CST": "Северноамерички Централно стандардно време", "ACWDT": "Аустралијско централно западно летње рачунање времена", "WITA": "Централно-индонезијско време", "NZST": "Нови Зеланд стандардно време", "BOT": "Боливија време", "ACDT": "Аустралијско централно летње рачунање времена", "IST": "Индијско стандардно време", "PST": "Северноамерички Пацифичко стандардно време", "WEZ": "Западноевропско стандардно време", "OESZ": "Источноевропско летње рачунање времена", "UYT": "Уругвај стандардно време", "UYST": "Уругвај летње рачунање времена", "MDT": "Макао летње рачунање времена", "ADT": "Атланско лтње рачунање времена", "ARST": "Аргентина летње рачунање времена", "TMT": "Туркменистан стандардно време", "HAT": "Њуфаундленд летње рачунање времена", "CDT": "Северноамерички Централно летње рачунање времена", "MESZ": "Средњеевропско летње рачунање времена", "WESZ": "Западноевропско летње рачунање времена", "COST": "Колумбија летње рачунање времена", "GYT": "Гвајана време", "VET": "Венецуела време", "JDT": "Јапанско летње рачунање времена", "CAT": "Централно-афричко време", "AEST": "Аустралијско источно стандардно време", "AEDT": "Аустралијско источно летње рачунање времена", "AST": "Атланско стандардно време", "WART": "Западна Аргентина стандардно време", "EAT": "Источно-афричко време", "LHDT": "Лорд Хов летње рачунање времена", "SGT": "Сингапур стандардно време", "∅∅∅": "Азори летње рачунање времена", "HADT": "Хавајско-алеутско летње рачунање времена", "WAT": "Западно-афричко стандардно време", "WAST": "Западно-афричко летње рачунање времена", "HNT": "Њуфаундленд стандардно време", "HAST": "Хавајско-алеутско стандардно време", "CHAST": "Чатам стандардно време", "JST": "Јапанско стандардно време", "AWST": "Аустралијско западно стандардно време", "EST": "Северноамерички Источно стандардно време", "EDT": "Северноамерички Источно летње рачунање времена", "OEZ": "Источноевропско стандардно време", "ChST": "Чаморо време", "LHST": "Лорд Хов стандардно време", "HKT": "Хонг Конг стандардно време", "AKST": "Аљаска, стандардно време", "AWDT": "Аустралијско западно летње рачунање времена", "SAST": "Јужно-афричко време", "MEZ": "Средњеевропско стандардно време", "BT": "Бутан време", "ACST": "Аустралијско централно стандардно време", "GFT": "Француска Гвајана време", "MST": "Макао стандардно време", "AKDT": "Аљаска, летње рачунање времена", "NZDT": "Нови Зеланд летње рачунање времена"},
}
}
@@ -105,8 +105,8 @@ func (sr *sr_Latn_BA) CardinalPluralRule(num float64, v uint64) locales.PluralRu
f := locales.F(n, v)
iMod10 := i % 10
iMod100 := i % 100
- fMod100 := f % 100
fMod10 := f % 10
+ fMod100 := f % 100
if (v == 0 && iMod10 == 1 && iMod100 != 11) || (fMod10 == 1 && fMod100 != 11) {
return locales.PluralRuleOne
diff --git a/sr_Latn_BA/sr_Latn_BA_test.go b/sr_Latn_BA/sr_Latn_BA_test.go
new file mode 100644
index 00000000..a0c906e7
--- /dev/null
+++ b/sr_Latn_BA/sr_Latn_BA_test.go
@@ -0,0 +1,1120 @@
+package sr_Latn_BA
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "sr_Latn_BA"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/sr_Latn_ME/sr_Latn_ME.go b/sr_Latn_ME/sr_Latn_ME.go
index 3bea8723..6e55dbd9 100644
--- a/sr_Latn_ME/sr_Latn_ME.go
+++ b/sr_Latn_ME/sr_Latn_ME.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"п. н. е.", "н. е."},
erasNarrow: []string{"п.н.е.", "н.е."},
erasWide: []string{"пре нове ере", "нове ере"},
- timezones: map[string]string{"CHADT": "Чатам летње рачунање времена", "WESZ": "Западноевропско летње рачунање времена", "COST": "Колумбија летње рачунање времена", "IST": "Индијско стандардно време", "GYT": "Гвајана време", "MYT": "Малезија време", "JST": "Јапанско стандардно време", "AKDT": "Аљаска, летње рачунање времена", "AST": "Атланско стандардно време", "ADT": "Атланско лтње рачунање времена", "WAST": "Западно-афричко летње рачунање времена", "ACDT": "Аустралијско централно летње рачунање времена", "BOT": "Боливија време", "ChST": "Чаморо време", "ACWST": "Аустралијско централно западно стандардно време", "ACWDT": "Аустралијско централно западно летње рачунање времена", "SAST": "Јужно-афричко време", "TMT": "Туркменистан стандардно време", "EAT": "Источно-афричко време", "PDT": "Северноамерички Пацифичко летње рачунање времена", "CST": "Северноамерички Централно стандардно време", "SGT": "Сингапур стандардно време", "WITA": "Централно-индонезијско време", "AWDT": "Аустралијско западно летње рачунање времена", "UYST": "Уругвај летње рачунање времена", "CLT": "Чиле стандардно време", "ECT": "Еквадор време", "HAST": "Хавајско-алеутско стандардно време", "WART": "Западна Аргентина стандардно време", "OEZ": "Источноевропско стандардно време", "LHDT": "Лорд Хов летње рачунање времена", "NZST": "Нови Зеланд стандардно време", "VET": "Венецуела време", "COT": "Колумбија стандардно време", "WIT": "Источно-индонезијско време", "CLST": "Чиле летње рачунање времена", "BT": "Бутан време", "HNT": "Њуфаундленд стандардно време", "AWST": "Аустралијско западно стандардно време", "SRT": "Суринам време", "AKST": "Аљаска, стандардно време", "PST": "Северноамерички Пацифичко стандардно време", "WEZ": "Западноевропско стандардно време", "∅∅∅": "Амазон летње рачунање времена", "ARST": "Аргентина летње рачунање времена", "TMST": "Туркменистан летње рачунање времена", "CHAST": "Чатам стандардно време", "AEDT": "Аустралијско источно летње рачунање времена", "MESZ": "Средњеевропско летње рачунање времена", "AEST": "Аустралијско источно стандардно време", "CAT": "Централно-афричко време", "EST": "Северноамерички Источно стандардно време", "WIB": "Западно-индонезијско време", "MDT": "Макао летње рачунање времена", "UYT": "Уругвај стандардно време", "EDT": "Северноамерички Источно летње рачунање времена", "HKT": "Хонг Конг стандардно време", "HKST": "Хонг Конг летње рачунање времена", "GMT": "Средње време по Гриничу", "ART": "Аргентина стандардно време", "MST": "Макао стандардно време", "ACST": "Аустралијско централно стандардно време", "JDT": "Јапанско летње рачунање времена", "HAT": "Њуфаундленд летње рачунање времена", "LHST": "Лорд Хов стандардно време", "CDT": "Северноамерички Централно летње рачунање времена", "HADT": "Хавајско-алеутско летње рачунање времена", "MEZ": "Средњеевропско стандардно време", "WAT": "Западно-афричко стандардно време", "GFT": "Француска Гвајана време", "OESZ": "Источноевропско летње рачунање времена", "NZDT": "Нови Зеланд летње рачунање времена", "WARST": "Западна Аргентина летње рачунање времена"},
+ timezones: map[string]string{"ARST": "Аргентина летње рачунање времена", "AEDT": "Аустралијско источно летње рачунање времена", "CLST": "Чиле летње рачунање времена", "LHST": "Лорд Хов стандардно време", "MDT": "Макао летње рачунање времена", "AKST": "Аљаска, стандардно време", "ACWDT": "Аустралијско централно западно летње рачунање времена", "HAT": "Њуфаундленд летње рачунање времена", "CHADT": "Чатам летње рачунање времена", "CAT": "Централно-афричко време", "WESZ": "Западноевропско летње рачунање времена", "WIB": "Западно-индонезијско време", "WAST": "Западно-афричко летње рачунање времена", "GYT": "Гвајана време", "CDT": "Северноамерички Централно летње рачунање времена", "MST": "Макао стандардно време", "HKST": "Хонг Конг летње рачунање времена", "AST": "Атланско стандардно време", "NZDT": "Нови Зеланд летње рачунање времена", "WITA": "Централно-индонезијско време", "UYST": "Уругвај летње рачунање времена", "PST": "Северноамерички Пацифичко стандардно време", "PDT": "Северноамерички Пацифичко летње рачунање времена", "WAT": "Западно-афричко стандардно време", "HKT": "Хонг Конг стандардно време", "JDT": "Јапанско летње рачунање времена", "HAST": "Хавајско-алеутско стандардно време", "BOT": "Боливија време", "SAST": "Јужно-афричко време", "COT": "Колумбија стандардно време", "OESZ": "Источноевропско летње рачунање времена", "BT": "Бутан време", "SRT": "Суринам време", "VET": "Венецуела време", "ACWST": "Аустралијско централно западно стандардно време", "ACST": "Аустралијско централно стандардно време", "MEZ": "Средњеевропско стандардно време", "LHDT": "Лорд Хов летње рачунање времена", "HADT": "Хавајско-алеутско летње рачунање времена", "NZST": "Нови Зеланд стандардно време", "EDT": "Северноамерички Источно летње рачунање времена", "OEZ": "Источноевропско стандардно време", "AEST": "Аустралијско источно стандардно време", "∅∅∅": "Азори летње рачунање времена", "JST": "Јапанско стандардно време", "ART": "Аргентина стандардно време", "TMT": "Туркменистан стандардно време", "GMT": "Средње време по Гриничу", "ChST": "Чаморо време", "CLT": "Чиле стандардно време", "WIT": "Источно-индонезијско време", "ECT": "Еквадор време", "ADT": "Атланско лтње рачунање времена", "EST": "Северноамерички Источно стандардно време", "WARST": "Западна Аргентина летње рачунање времена", "WEZ": "Западноевропско стандардно време", "UYT": "Уругвај стандардно време", "AKDT": "Аљаска, летње рачунање времена", "MESZ": "Средњеевропско летње рачунање времена", "SGT": "Сингапур стандардно време", "WART": "Западна Аргентина стандардно време", "IST": "Индијско стандардно време", "COST": "Колумбија летње рачунање времена", "GFT": "Француска Гвајана време", "TMST": "Туркменистан летње рачунање времена", "CHAST": "Чатам стандардно време", "AWDT": "Аустралијско западно летње рачунање времена", "HNT": "Њуфаундленд стандардно време", "EAT": "Источно-афричко време", "MYT": "Малезија време", "CST": "Северноамерички Централно стандардно време", "ACDT": "Аустралијско централно летње рачунање времена", "AWST": "Аустралијско западно стандардно време"},
}
}
@@ -105,8 +105,8 @@ func (sr *sr_Latn_ME) CardinalPluralRule(num float64, v uint64) locales.PluralRu
f := locales.F(n, v)
iMod10 := i % 10
iMod100 := i % 100
- fMod100 := f % 100
fMod10 := f % 10
+ fMod100 := f % 100
if (v == 0 && iMod10 == 1 && iMod100 != 11) || (fMod10 == 1 && fMod100 != 11) {
return locales.PluralRuleOne
diff --git a/sr_Latn_ME/sr_Latn_ME_test.go b/sr_Latn_ME/sr_Latn_ME_test.go
new file mode 100644
index 00000000..61fcd8ca
--- /dev/null
+++ b/sr_Latn_ME/sr_Latn_ME_test.go
@@ -0,0 +1,1120 @@
+package sr_Latn_ME
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "sr_Latn_ME"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/sr_Latn_RS/sr_Latn_RS.go b/sr_Latn_RS/sr_Latn_RS.go
index 6514324c..e97e60c8 100644
--- a/sr_Latn_RS/sr_Latn_RS.go
+++ b/sr_Latn_RS/sr_Latn_RS.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"п. н. е.", "н. е."},
erasNarrow: []string{"п.н.е.", "н.е."},
erasWide: []string{"пре нове ере", "нове ере"},
- timezones: map[string]string{"GMT": "Средње време по Гриничу", "WIB": "Западно-индонезијско време", "OEZ": "Источноевропско стандардно време", "CST": "Северноамерички Централно стандардно време", "ADT": "Атланско лтње рачунање времена", "MYT": "Малезија време", "ART": "Аргентина стандардно време", "MDT": "Макао летње рачунање времена", "WAT": "Западно-афричко стандардно време", "ACWST": "Аустралијско централно западно стандардно време", "BT": "Бутан време", "VET": "Венецуела време", "ECT": "Еквадор време", "LHST": "Лорд Хов стандардно време", "CHADT": "Чатам летње рачунање времена", "HAST": "Хавајско-алеутско стандардно време", "HAT": "Њуфаундленд летње рачунање времена", "IST": "Индијско стандардно време", "CHAST": "Чатам стандардно време", "CAT": "Централно-афричко време", "JST": "Јапанско стандардно време", "AKDT": "Аљаска, летње рачунање времена", "PST": "Северноамерички Пацифичко стандардно време", "ChST": "Чаморо време", "WESZ": "Западноевропско летње рачунање времена", "EST": "Северноамерички Источно стандардно време", "TMT": "Туркменистан стандардно време", "AWDT": "Аустралијско западно летње рачунање времена", "JDT": "Јапанско летње рачунање времена", "AKST": "Аљаска, стандардно време", "NZST": "Нови Зеланд стандардно време", "CLT": "Чиле стандардно време", "ACWDT": "Аустралијско централно западно летње рачунање времена", "SAST": "Јужно-афричко време", "AWST": "Аустралијско западно стандардно време", "GYT": "Гвајана време", "HNT": "Њуфаундленд стандардно време", "WIT": "Источно-индонезијско време", "COT": "Колумбија стандардно време", "AST": "Атланско стандардно време", "ACDT": "Аустралијско централно летње рачунање времена", "MESZ": "Средњеевропско летње рачунање времена", "UYT": "Уругвај стандардно време", "SGT": "Сингапур стандардно време", "MST": "Макао стандардно време", "PDT": "Северноамерички Пацифичко летње рачунање времена", "CLST": "Чиле летње рачунање времена", "NZDT": "Нови Зеланд летње рачунање времена", "CDT": "Северноамерички Централно летње рачунање времена", "AEST": "Аустралијско источно стандардно време", "WEZ": "Западноевропско стандардно време", "HKST": "Хонг Конг летње рачунање времена", "OESZ": "Источноевропско летње рачунање времена", "LHDT": "Лорд Хов летње рачунање времена", "SRT": "Суринам време", "AEDT": "Аустралијско источно летње рачунање времена", "WARST": "Западна Аргентина летње рачунање времена", "EAT": "Источно-афричко време", "MEZ": "Средњеевропско стандардно време", "WITA": "Централно-индонезијско време", "HADT": "Хавајско-алеутско летње рачунање времена", "WAST": "Западно-афричко летње рачунање времена", "UYST": "Уругвај летње рачунање времена", "HKT": "Хонг Конг стандардно време", "WART": "Западна Аргентина стандардно време", "ACST": "Аустралијско централно стандардно време", "BOT": "Боливија време", "TMST": "Туркменистан летње рачунање времена", "COST": "Колумбија летње рачунање времена", "EDT": "Северноамерички Источно летње рачунање времена", "GFT": "Француска Гвајана време", "ARST": "Аргентина летње рачунање времена", "∅∅∅": "Амазон летње рачунање времена"},
+ timezones: map[string]string{"BOT": "Боливија време", "EST": "Северноамерички Источно стандардно време", "CST": "Северноамерички Централно стандардно време", "AEST": "Аустралијско источно стандардно време", "LHST": "Лорд Хов стандардно време", "AWDT": "Аустралијско западно летње рачунање времена", "ART": "Аргентина стандардно време", "NZST": "Нови Зеланд стандардно време", "WAT": "Западно-афричко стандардно време", "WEZ": "Западноевропско стандардно време", "MDT": "Северноамерички Планинско летње рачунање времена", "WART": "Западна Аргентина стандардно време", "WAST": "Западно-афричко летње рачунање времена", "WITA": "Централно-индонезијско време", "ACWDT": "Аустралијско централно западно летње рачунање времена", "∅∅∅": "Амазон летње рачунање времена", "TMT": "Туркменистан стандардно време", "TMST": "Туркменистан летње рачунање времена", "CHAST": "Чатам стандардно време", "AKDT": "Аљаска, летње рачунање времена", "HAT": "Њуфаундленд летње рачунање времена", "COT": "Колумбија стандардно време", "COST": "Колумбија летње рачунање времена", "SRT": "Суринам време", "ACST": "Аустралијско централно стандардно време", "GMT": "Средње време по Гриничу", "CLST": "Чиле летње рачунање времена", "BT": "Бутан време", "CAT": "Централно-афричко време", "CLT": "Чиле стандардно време", "GFT": "Француска Гвајана време", "PST": "Северноамерички Пацифичко стандардно време", "EDT": "Северноамерички Источно летње рачунање времена", "WIB": "Западно-индонезијско време", "CDT": "Северноамерички Централно летње рачунање времена", "HKST": "Хонг Конг летње рачунање времена", "PDT": "Северноамерички Пацифичко летње рачунање времена", "IST": "Индијско стандардно време", "OEZ": "Источноевропско стандардно време", "UYST": "Уругвај летње рачунање времена", "ACDT": "Аустралијско централно летње рачунање времена", "HKT": "Хонг Конг стандардно време", "JDT": "Јапанско летње рачунање времена", "HADT": "Хавајско-алеутско летње рачунање времена", "NZDT": "Нови Зеланд летње рачунање времена", "UYT": "Уругвај стандардно време", "ChST": "Чаморо време", "OESZ": "Источноевропско летње рачунање времена", "MYT": "Малезија време", "WARST": "Западна Аргентина летње рачунање времена", "AST": "Атланско стандардно време", "MESZ": "Средњеевропско летње рачунање времена", "HAST": "Хавајско-алеутско стандардно време", "SAST": "Јужно-афричко време", "LHDT": "Лорд Хов летње рачунање времена", "VET": "Венецуела време", "ADT": "Атланско лтње рачунање времена", "SGT": "Сингапур стандардно време", "GYT": "Гвајана време", "ECT": "Еквадор време", "ARST": "Аргентина летње рачунање времена", "AEDT": "Аустралијско источно летње рачунање времена", "WIT": "Источно-индонезијско време", "EAT": "Источно-афричко време", "WESZ": "Западноевропско летње рачунање времена", "JST": "Јапанско стандардно време", "ACWST": "Аустралијско централно западно стандардно време", "MEZ": "Средњеевропско стандардно време", "HNT": "Њуфаундленд стандардно време", "AWST": "Аустралијско западно стандардно време", "MST": "Северноамерички Планинско стандардно време", "CHADT": "Чатам летње рачунање времена", "AKST": "Аљаска, стандардно време"},
}
}
diff --git a/sr_Latn_RS/sr_Latn_RS_test.go b/sr_Latn_RS/sr_Latn_RS_test.go
new file mode 100644
index 00000000..c854e719
--- /dev/null
+++ b/sr_Latn_RS/sr_Latn_RS_test.go
@@ -0,0 +1,1120 @@
+package sr_Latn_RS
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "sr_Latn_RS"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/sr_Latn_XK/sr_Latn_XK.go b/sr_Latn_XK/sr_Latn_XK.go
index 92cf2644..9f8a7689 100644
--- a/sr_Latn_XK/sr_Latn_XK.go
+++ b/sr_Latn_XK/sr_Latn_XK.go
@@ -48,7 +48,7 @@ func New() locales.Translator {
locale: "sr_Latn_XK",
pluralsCardinal: []locales.PluralRule{2, 4, 6},
pluralsOrdinal: []locales.PluralRule{6},
- pluralsRange: []locales.PluralRule{2, 4, 6},
+ pluralsRange: []locales.PluralRule{4, 6, 2},
decimal: ",",
group: ".",
minus: "-",
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"п. н. е.", "н. е."},
erasNarrow: []string{"п.н.е.", "н.е."},
erasWide: []string{"пре нове ере", "нове ере"},
- timezones: map[string]string{"MYT": "Малезија време", "CST": "Северноамерички Централно стандардно време", "AEDT": "Аустралијско источно летње рачунање времена", "COST": "Колумбија летње рачунање времена", "HNT": "Њуфаундленд стандардно време", "CLT": "Чиле стандардно време", "SRT": "Суринам време", "NZST": "Нови Зеланд стандардно време", "CHADT": "Чатам летње рачунање времена", "MESZ": "Средњеевропско летње рачунање времена", "COT": "Колумбија стандардно време", "BT": "Бутан време", "GMT": "Средње време по Гриничу", "WIT": "Источно-индонезијско време", "ARST": "Аргентина летње рачунање времена", "NZDT": "Нови Зеланд летње рачунање времена", "BOT": "Боливија време", "WAT": "Западно-афричко стандардно време", "WITA": "Централно-индонезијско време", "OEZ": "Источноевропско стандардно време", "JST": "Јапанско стандардно време", "HAST": "Хавајско-алеутско стандардно време", "HADT": "Хавајско-алеутско летње рачунање времена", "HKT": "Хонг Конг стандардно време", "GFT": "Француска Гвајана време", "AWST": "Аустралијско западно стандардно време", "CHAST": "Чатам стандардно време", "ACWDT": "Аустралијско централно западно летње рачунање времена", "WAST": "Западно-афричко летње рачунање времена", "TMT": "Туркменистан стандардно време", "EST": "Северноамерички Источно стандардно време", "HAT": "Њуфаундленд летње рачунање времена", "LHST": "Лорд Хов стандардно време", "MEZ": "Средњеевропско стандардно време", "WEZ": "Западноевропско стандардно време", "WESZ": "Западноевропско летње рачунање времена", "ECT": "Еквадор време", "AWDT": "Аустралијско западно летње рачунање времена", "MST": "Северноамерички Планинско стандардно време", "ACWST": "Аустралијско централно западно стандардно време", "EDT": "Северноамерички Источно летње рачунање времена", "SGT": "Сингапур стандардно време", "UYT": "Уругвај стандардно време", "UYST": "Уругвај летње рачунање времена", "AEST": "Аустралијско источно стандардно време", "ChST": "Чаморо време", "JDT": "Јапанско летње рачунање времена", "SAST": "Јужно-афричко време", "IST": "Индијско стандардно време", "OESZ": "Источноевропско летње рачунање времена", "ART": "Аргентина стандардно време", "PST": "Северноамерички Пацифичко стандардно време", "CAT": "Централно-афричко време", "WIB": "Западно-индонезијско време", "EAT": "Источно-афричко време", "GYT": "Гвајана време", "ACDT": "Аустралијско централно летње рачунање времена", "AST": "Атланско стандардно време", "WARST": "Западна Аргентина летње рачунање времена", "CLST": "Чиле летње рачунање времена", "ACST": "Аустралијско централно стандардно време", "CDT": "Северноамерички Централно летње рачунање времена", "WART": "Западна Аргентина стандардно време", "TMST": "Туркменистан летње рачунање времена", "LHDT": "Лорд Хов летње рачунање времена", "HKST": "Хонг Конг летње рачунање времена", "AKST": "Аљаска, стандардно време", "AKDT": "Аљаска, летње рачунање времена", "PDT": "Северноамерички Пацифичко летње рачунање времена", "MDT": "Северноамерички Планинско летње рачунање времена", "VET": "Венецуела време", "∅∅∅": "Бразилија летње рачунање времена", "ADT": "Атланско лтње рачунање времена"},
+ timezones: map[string]string{"CLST": "Чиле летње рачунање времена", "AWDT": "Аустралијско западно летње рачунање времена", "HADT": "Хавајско-алеутско летње рачунање времена", "WAT": "Западно-афричко стандардно време", "WAST": "Западно-афричко летње рачунање времена", "SGT": "Сингапур стандардно време", "OEZ": "Источноевропско стандардно време", "WIT": "Источно-индонезијско време", "WITA": "Централно-индонезијско време", "SAST": "Јужно-афричко време", "JST": "Јапанско стандардно време", "AST": "Атланско стандардно време", "MEZ": "Средњеевропско стандардно време", "WEZ": "Западноевропско стандардно време", "WARST": "Западна Аргентина летње рачунање времена", "ECT": "Еквадор време", "LHDT": "Лорд Хов летње рачунање времена", "ACST": "Аустралијско централно стандардно време", "HKT": "Хонг Конг стандардно време", "CHADT": "Чатам летње рачунање времена", "NZST": "Нови Зеланд стандардно време", "CAT": "Централно-афричко време", "CLT": "Чиле стандардно време", "WART": "Западна Аргентина стандардно време", "EDT": "Северноамерички Источно летње рачунање времена", "PST": "Северноамерички Пацифичко стандардно време", "ART": "Аргентина стандардно време", "EAT": "Источно-афричко време", "CST": "Северноамерички Централно стандардно време", "CDT": "Северноамерички Централно летње рачунање времена", "ACDT": "Аустралијско централно летње рачунање времена", "PDT": "Северноамерички Пацифичко летње рачунање времена", "ACWDT": "Аустралијско централно западно летње рачунање времена", "ARST": "Аргентина летње рачунање времена", "OESZ": "Источноевропско летње рачунање времена", "GMT": "Средње време по Гриничу", "AEDT": "Аустралијско источно летње рачунање времена", "BT": "Бутан време", "SRT": "Суринам време", "ADT": "Атланско лтње рачунање времена", "NZDT": "Нови Зеланд летње рачунање времена", "AKST": "Аљаска, стандардно време", "HAT": "Њуфаундленд летње рачунање времена", "MYT": "Малезија време", "VET": "Венецуела време", "JDT": "Јапанско летње рачунање времена", "BOT": "Боливија време", "TMT": "Туркменистан стандардно време", "HNT": "Њуфаундленд стандардно време", "AEST": "Аустралијско источно стандардно време", "LHST": "Лорд Хов стандардно време", "ACWST": "Аустралијско централно западно стандардно време", "MESZ": "Средњеевропско летње рачунање времена", "WESZ": "Западноевропско летње рачунање времена", "ChST": "Чаморо време", "UYST": "Уругвај летње рачунање времена", "MST": "Северноамерички Планинско стандардно време", "HKST": "Хонг Конг летње рачунање времена", "AKDT": "Аљаска, летње рачунање времена", "GYT": "Гвајана време", "MDT": "Северноамерички Планинско летње рачунање времена", "GFT": "Француска Гвајана време", "HAST": "Хавајско-алеутско стандардно време", "WIB": "Западно-индонезијско време", "COST": "Колумбија летње рачунање времена", "UYT": "Уругвај стандардно време", "IST": "Индијско стандардно време", "EST": "Северноамерички Источно стандардно време", "COT": "Колумбија стандардно време", "∅∅∅": "Бразилија летње рачунање времена", "CHAST": "Чатам стандардно време", "AWST": "Аустралијско западно стандардно време", "TMST": "Туркменистан летње рачунање времена"},
}
}
diff --git a/sr_Latn_XK/sr_Latn_XK_test.go b/sr_Latn_XK/sr_Latn_XK_test.go
new file mode 100644
index 00000000..e0089c08
--- /dev/null
+++ b/sr_Latn_XK/sr_Latn_XK_test.go
@@ -0,0 +1,1120 @@
+package sr_Latn_XK
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "sr_Latn_XK"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/sv/sv.go b/sv/sv.go
index 57efac70..967888d0 100644
--- a/sv/sv.go
+++ b/sv/sv.go
@@ -68,7 +68,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"f.Kr.", "e.Kr."},
erasNarrow: []string{"f.Kr.", "e.Kr."},
erasWide: []string{"före Kristus", "efter Kristus"},
- timezones: map[string]string{"HADT": "Honolulu, sommartid", "ACWDT": "västcentralaustralisk sommartid", "ChST": "Chamorrotid", "CAT": "centralafrikansk tid", "∅∅∅": "Amazonas, sommartid", "HKST": "Hongkong, sommartid", "HNT": "Newfoundland, normaltid", "WART": "västargentinsk normaltid", "WIB": "västindonesisk tid", "AWDT": "västaustralisk sommartid", "NZDT": "nyzeeländsk sommartid", "GMT": "Greenwichtid", "TMT": "turkmensk normaltid", "ART": "östargentinsk normaltid", "MYT": "malaysisk tid", "SGT": "Singaporetid", "OEZ": "östeuropeisk normaltid", "GFT": "Franska Guyanatid", "UYST": "uruguayansk sommartid", "CHADT": "Chatham, sommartid", "WEZ": "västeuropeisk normaltid", "BOT": "boliviansk tid", "ACWST": "västcentralaustralisk normaltid", "WAST": "västafrikansk sommartid", "ACDT": "centralaustralisk sommartid", "AKDT": "Alaska, sommartid", "CST": "centralnordamerikansk normaltid", "PDT": "västnordamerikansk sommartid", "VET": "venezuelansk tid", "ARST": "östargentinsk sommartid", "PST": "västnordamerikansk normaltid", "GYT": "Guyanatid", "CDT": "centralnordamerikansk sommartid", "COST": "colombiansk sommartid", "MST": "Macaunormaltid", "MDT": "Macausommartid", "ACST": "centralaustralisk normaltid", "WARST": "västargentinsk sommartid", "HKT": "Hongkong, normaltid", "MEZ": "centraleuropeisk normaltid", "EDT": "östnordamerikansk sommartid", "SAST": "sydafrikansk tid", "NZST": "nyzeeländsk normaltid", "AEST": "östaustralisk normaltid", "AST": "nordamerikansk atlantnormaltid", "CHAST": "Chatham, normaltid", "IST": "indisk tid", "TMST": "turkmensk sommartid", "EAT": "östafrikansk tid", "MESZ": "centraleuropeisk sommartid", "EST": "östnordamerikansk normaltid", "COT": "colombiansk normaltid", "HAST": "Honolulu, normaltid", "AKST": "Alaska, normaltid", "LHST": "Lord Howe, normaltid", "CLST": "chilensk sommartid", "WAT": "västafrikansk normaltid", "HAT": "Newfoundland, sommartid", "JST": "japansk normaltid", "LHDT": "Lord Howe, sommartid", "AEDT": "östaustralisk sommartid", "JDT": "japansk sommartid", "CLT": "chilensk normaltid", "BT": "bhutansk tid", "SRT": "Surinamtid", "AWST": "västaustralisk normaltid", "ADT": "nordamerikansk atlantsommartid", "WITA": "centralindonesisk tid", "WIT": "östindonesisk tid", "OESZ": "östeuropeisk sommartid", "UYT": "uruguayansk normaltid", "WESZ": "västeuropeisk sommartid", "ECT": "ecuadoriansk tid"},
+ timezones: map[string]string{"MEZ": "centraleuropeisk normaltid", "TMST": "turkmensk sommartid", "CLST": "chilensk sommartid", "VET": "venezuelansk tid", "MDT": "Macausommartid", "JDT": "japansk sommartid", "HAT": "Newfoundland, sommartid", "ARST": "östargentinsk sommartid", "HNT": "Newfoundland, normaltid", "MYT": "malaysisk tid", "UYT": "uruguayansk normaltid", "WIT": "östindonesisk tid", "BT": "bhutansk tid", "CHAST": "Chatham, normaltid", "ADT": "nordamerikansk atlantsommartid", "WAT": "västafrikansk normaltid", "TMT": "turkmensk normaltid", "COST": "colombiansk sommartid", "ChST": "Chamorrotid", "LHDT": "Lord Howe, sommartid", "WARST": "västargentinsk sommartid", "BOT": "boliviansk tid", "IST": "indisk tid", "AKDT": "Alaska, sommartid", "OESZ": "östeuropeisk sommartid", "SRT": "Surinamtid", "AWST": "västaustralisk normaltid", "ART": "östargentinsk normaltid", "HKT": "Hongkong, normaltid", "EST": "östnordamerikansk normaltid", "WESZ": "västeuropeisk sommartid", "HAST": "Honolulu, normaltid", "OEZ": "östeuropeisk normaltid", "LHST": "Lord Howe, normaltid", "HKST": "Hongkong, sommartid", "AKST": "Alaska, normaltid", "PDT": "västnordamerikansk sommartid", "∅∅∅": "azorisk sommartid", "CHADT": "Chatham, sommartid", "GYT": "Guyanatid", "AWDT": "västaustralisk sommartid", "WEZ": "västeuropeisk normaltid", "AEDT": "östaustralisk sommartid", "PST": "västnordamerikansk normaltid", "EDT": "östnordamerikansk sommartid", "AEST": "östaustralisk normaltid", "WAST": "västafrikansk sommartid", "ECT": "ecuadoriansk tid", "ACWST": "västcentralaustralisk normaltid", "SAST": "sydafrikansk tid", "MESZ": "centraleuropeisk sommartid", "HADT": "Honolulu, sommartid", "SGT": "Singaporetid", "COT": "colombiansk normaltid", "ACST": "centralaustralisk normaltid", "ACDT": "centralaustralisk sommartid", "MST": "Macaunormaltid", "NZST": "nyzeeländsk normaltid", "NZDT": "nyzeeländsk sommartid", "WIB": "västindonesisk tid", "GMT": "Greenwichtid", "CLT": "chilensk normaltid", "WART": "västargentinsk normaltid", "AST": "nordamerikansk atlantnormaltid", "ACWDT": "västcentralaustralisk sommartid", "EAT": "östafrikansk tid", "WITA": "centralindonesisk tid", "JST": "japansk normaltid", "CAT": "centralafrikansk tid", "UYST": "uruguayansk sommartid", "CST": "centralnordamerikansk normaltid", "CDT": "centralnordamerikansk sommartid", "GFT": "Franska Guyanatid"},
}
}
diff --git a/sv/sv_test.go b/sv/sv_test.go
new file mode 100644
index 00000000..7df10cfb
--- /dev/null
+++ b/sv/sv_test.go
@@ -0,0 +1,1120 @@
+package sv
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "sv"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/sv_AX/sv_AX.go b/sv_AX/sv_AX.go
index 5adb0ca4..5aeba5f9 100644
--- a/sv_AX/sv_AX.go
+++ b/sv_AX/sv_AX.go
@@ -68,7 +68,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"f.Kr.", "e.Kr."},
erasNarrow: []string{"f.Kr.", "e.Kr."},
erasWide: []string{"före Kristus", "efter Kristus"},
- timezones: map[string]string{"CLST": "chilensk sommartid", "VET": "venezuelansk tid", "HNT": "Newfoundland, normaltid", "ART": "östargentinsk normaltid", "MDT": "Macausommartid", "MEZ": "centraleuropeisk normaltid", "CHADT": "Chatham, sommartid", "JDT": "japansk sommartid", "UYST": "uruguayansk sommartid", "ChST": "Chamorrotid", "ACWDT": "västcentralaustralisk sommartid", "SAST": "sydafrikansk tid", "ACWST": "västcentralaustralisk normaltid", "GFT": "Franska Guyanatid", "TMST": "turkmensk sommartid", "JST": "japansk normaltid", "AKST": "Alaska, normaltid", "BOT": "boliviansk tid", "WAT": "västafrikansk normaltid", "ACDT": "centralaustralisk sommartid", "AWDT": "västaustralisk sommartid", "CST": "centralnordamerikansk normaltid", "CHAST": "Chatham, normaltid", "SGT": "Singaporetid", "GMT": "Greenwichtid", "WESZ": "västeuropeisk sommartid", "WART": "västargentinsk normaltid", "WARST": "västargentinsk sommartid", "OESZ": "östeuropeisk sommartid", "MST": "Macaunormaltid", "WEZ": "västeuropeisk normaltid", "WAST": "västafrikansk sommartid", "HAT": "Newfoundland, sommartid", "AEDT": "östaustralisk sommartid", "HKST": "Hongkong, sommartid", "PDT": "västnordamerikansk sommartid", "CDT": "centralnordamerikansk sommartid", "COST": "colombiansk sommartid", "HAST": "Honolulu, normaltid", "WIT": "östindonesisk tid", "EAT": "östafrikansk tid", "ECT": "ecuadoriansk tid", "COT": "colombiansk normaltid", "NZST": "nyzeeländsk normaltid", "CLT": "chilensk normaltid", "WITA": "centralindonesisk tid", "ARST": "östargentinsk sommartid", "∅∅∅": "Amazonas, sommartid", "PST": "västnordamerikansk normaltid", "UYT": "uruguayansk normaltid", "HKT": "Hongkong, normaltid", "OEZ": "östeuropeisk normaltid", "SRT": "Surinamtid", "AKDT": "Alaska, sommartid", "NZDT": "nyzeeländsk sommartid", "ADT": "nordamerikansk atlantsommartid", "WIB": "västindonesisk tid", "IST": "indisk tid", "LHST": "Lord Howe, normaltid", "CAT": "centralafrikansk tid", "HADT": "Honolulu, sommartid", "GYT": "Guyanatid", "MYT": "malaysisk tid", "EST": "östnordamerikansk normaltid", "BT": "bhutansk tid", "EDT": "östnordamerikansk sommartid", "TMT": "turkmensk normaltid", "ACST": "centralaustralisk normaltid", "LHDT": "Lord Howe, sommartid", "AWST": "västaustralisk normaltid", "MESZ": "centraleuropeisk sommartid", "AEST": "östaustralisk normaltid", "AST": "nordamerikansk atlantnormaltid"},
+ timezones: map[string]string{"ACST": "centralaustralisk normaltid", "LHST": "Lord Howe, normaltid", "ACDT": "centralaustralisk sommartid", "OESZ": "östeuropeisk sommartid", "WARST": "västargentinsk sommartid", "ARST": "östargentinsk sommartid", "AKDT": "Alaska, sommartid", "EST": "östnordamerikansk normaltid", "CAT": "centralafrikansk tid", "GYT": "Guyanatid", "GMT": "Greenwichtid", "HKST": "Hongkong, sommartid", "AKST": "Alaska, normaltid", "HAST": "Honolulu, normaltid", "ChST": "Chamorrotid", "JDT": "japansk sommartid", "NZDT": "nyzeeländsk sommartid", "COST": "colombiansk sommartid", "TMT": "turkmensk normaltid", "CLST": "chilensk sommartid", "CDT": "centralnordamerikansk sommartid", "ACWST": "västcentralaustralisk normaltid", "HADT": "Honolulu, sommartid", "IST": "indisk tid", "CLT": "chilensk normaltid", "JST": "japansk normaltid", "EDT": "östnordamerikansk sommartid", "PST": "västnordamerikansk normaltid", "AEDT": "östaustralisk sommartid", "ECT": "ecuadoriansk tid", "MDT": "Macausommartid", "AWST": "västaustralisk normaltid", "ART": "östargentinsk normaltid", "OEZ": "östeuropeisk normaltid", "MYT": "malaysisk tid", "BT": "bhutansk tid", "EAT": "östafrikansk tid", "WITA": "centralindonesisk tid", "AST": "nordamerikansk atlantnormaltid", "ADT": "nordamerikansk atlantsommartid", "MESZ": "centraleuropeisk sommartid", "BOT": "boliviansk tid", "UYT": "uruguayansk normaltid", "WIT": "östindonesisk tid", "WART": "västargentinsk normaltid", "CHAST": "Chatham, normaltid", "CHADT": "Chatham, sommartid", "VET": "venezuelansk tid", "HKT": "Hongkong, normaltid", "SRT": "Surinamtid", "MST": "Macaunormaltid", "COT": "colombiansk normaltid", "WAT": "västafrikansk normaltid", "WAST": "västafrikansk sommartid", "NZST": "nyzeeländsk normaltid", "SAST": "sydafrikansk tid", "HNT": "Newfoundland, normaltid", "SGT": "Singaporetid", "PDT": "västnordamerikansk sommartid", "WIB": "västindonesisk tid", "GFT": "Franska Guyanatid", "WEZ": "västeuropeisk normaltid", "TMST": "turkmensk sommartid", "LHDT": "Lord Howe, sommartid", "CST": "centralnordamerikansk normaltid", "ACWDT": "västcentralaustralisk sommartid", "AWDT": "västaustralisk sommartid", "∅∅∅": "västbrasiliansk sommartid", "AEST": "östaustralisk normaltid", "MEZ": "centraleuropeisk normaltid", "WESZ": "västeuropeisk sommartid", "HAT": "Newfoundland, sommartid", "UYST": "uruguayansk sommartid"},
}
}
diff --git a/sv_AX/sv_AX_test.go b/sv_AX/sv_AX_test.go
new file mode 100644
index 00000000..f7bc010d
--- /dev/null
+++ b/sv_AX/sv_AX_test.go
@@ -0,0 +1,1120 @@
+package sv_AX
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "sv_AX"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/sv_FI/sv_FI.go b/sv_FI/sv_FI.go
index c0a17009..f31e3600 100644
--- a/sv_FI/sv_FI.go
+++ b/sv_FI/sv_FI.go
@@ -68,7 +68,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"f.Kr.", "e.Kr."},
erasNarrow: []string{"f.Kr.", "e.Kr."},
erasWide: []string{"före Kristus", "efter Kristus"},
- timezones: map[string]string{"ChST": "Chamorrotid", "SGT": "Singaporetid", "HKT": "Hongkong, normaltid", "JST": "japansk normaltid", "NZST": "nyzeeländsk normaltid", "BOT": "boliviansk tid", "WAT": "västafrikansk normaltid", "CAT": "centralafrikansk tid", "ADT": "nordamerikansk atlantsommartid", "GYT": "Guyanatid", "MEZ": "centraleuropeisk normaltid", "UYST": "uruguayansk sommartid", "ACWST": "västcentralaustralisk normaltid", "MDT": "Klippiga bergen, sommartid", "CLT": "chilensk normaltid", "HKST": "Hongkong, sommartid", "WARST": "västargentinsk sommartid", "ART": "östargentinsk normaltid", "MST": "Klippiga bergen, normaltid", "EDT": "östnordamerikansk sommartid", "HAT": "Newfoundland, sommartid", "TMT": "turkmensk normaltid", "WESZ": "västeuropeisk sommartid", "CLST": "chilensk sommartid", "IST": "indisk tid", "ARST": "östargentinsk sommartid", "ACDT": "centralaustralisk sommartid", "TMST": "turkmensk sommartid", "PST": "västnordamerikansk normaltid", "LHST": "Lord Howe, normaltid", "UYT": "uruguayansk normaltid", "WEZ": "västeuropeisk normaltid", "EST": "östnordamerikansk normaltid", "HADT": "Honolulu, sommartid", "ACST": "centralaustralisk normaltid", "AKST": "Alaska, normaltid", "MYT": "malaysisk tid", "SRT": "Surinamtid", "MESZ": "centraleuropeisk sommartid", "NZDT": "nyzeeländsk sommartid", "AEDT": "östaustralisk sommartid", "LHDT": "Lord Howe, sommartid", "JDT": "japansk sommartid", "ECT": "ecuadoriansk tid", "WIB": "västindonesisk tid", "∅∅∅": "azorisk sommartid", "COT": "colombiansk normaltid", "COST": "colombiansk sommartid", "EAT": "östafrikansk tid", "AEST": "östaustralisk normaltid", "HAST": "Honolulu, normaltid", "WITA": "centralindonesisk tid", "AKDT": "Alaska, sommartid", "CDT": "centralnordamerikansk sommartid", "ACWDT": "västcentralaustralisk sommartid", "VET": "venezuelansk tid", "AST": "nordamerikansk atlantnormaltid", "BT": "bhutansk tid", "AWST": "västaustralisk normaltid", "CST": "centralnordamerikansk normaltid", "SAST": "sydafrikansk tid", "OEZ": "östeuropeisk normaltid", "HNT": "Newfoundland, normaltid", "WIT": "östindonesisk tid", "PDT": "västnordamerikansk sommartid", "CHADT": "Chatham, sommartid", "WAST": "västafrikansk sommartid", "GFT": "Franska Guyanatid", "AWDT": "västaustralisk sommartid", "CHAST": "Chatham, normaltid", "WART": "västargentinsk normaltid", "OESZ": "östeuropeisk sommartid", "GMT": "Greenwichtid"},
+ timezones: map[string]string{"OEZ": "östeuropeisk normaltid", "CHAST": "Chatham, normaltid", "ECT": "ecuadoriansk tid", "HAST": "Honolulu, normaltid", "WAST": "västafrikansk sommartid", "HAT": "Newfoundland, sommartid", "WIB": "västindonesisk tid", "UYST": "uruguayansk sommartid", "WITA": "centralindonesisk tid", "ART": "östargentinsk normaltid", "ARST": "östargentinsk sommartid", "BOT": "boliviansk tid", "COST": "colombiansk sommartid", "ACDT": "centralaustralisk sommartid", "VET": "venezuelansk tid", "ADT": "nordamerikansk atlantsommartid", "AWST": "västaustralisk normaltid", "COT": "colombiansk normaltid", "GYT": "Guyanatid", "HADT": "Honolulu, sommartid", "EST": "östnordamerikansk normaltid", "HNT": "Newfoundland, normaltid", "AEDT": "östaustralisk sommartid", "LHDT": "Lord Howe, sommartid", "CST": "centralnordamerikansk normaltid", "CAT": "centralafrikansk tid", "WEZ": "västeuropeisk normaltid", "BT": "bhutansk tid", "JST": "japansk normaltid", "AKDT": "Alaska, sommartid", "AWDT": "västaustralisk sommartid", "PDT": "västnordamerikansk sommartid", "MESZ": "centraleuropeisk sommartid", "NZST": "nyzeeländsk normaltid", "NZDT": "nyzeeländsk sommartid", "EDT": "östnordamerikansk sommartid", "TMST": "turkmensk sommartid", "WAT": "västafrikansk normaltid", "CHADT": "Chatham, sommartid", "EAT": "östafrikansk tid", "CLT": "chilensk normaltid", "SRT": "Surinamtid", "AKST": "Alaska, normaltid", "ACWST": "västcentralaustralisk normaltid", "SAST": "sydafrikansk tid", "IST": "indisk tid", "AEST": "östaustralisk normaltid", "∅∅∅": "azorisk sommartid", "MST": "Macaunormaltid", "SGT": "Singaporetid", "CDT": "centralnordamerikansk sommartid", "ACST": "centralaustralisk normaltid", "ACWDT": "västcentralaustralisk sommartid", "MEZ": "centraleuropeisk normaltid", "GFT": "Franska Guyanatid", "JDT": "japansk sommartid", "TMT": "turkmensk normaltid", "WART": "västargentinsk normaltid", "LHST": "Lord Howe, normaltid", "MDT": "Macausommartid", "PST": "västnordamerikansk normaltid", "WESZ": "västeuropeisk sommartid", "GMT": "Greenwichtid", "WIT": "östindonesisk tid", "WARST": "västargentinsk sommartid", "HKT": "Hongkong, normaltid", "HKST": "Hongkong, sommartid", "ChST": "Chamorrotid", "UYT": "uruguayansk normaltid", "MYT": "malaysisk tid", "AST": "nordamerikansk atlantnormaltid", "OESZ": "östeuropeisk sommartid", "CLST": "chilensk sommartid"},
}
}
diff --git a/sv_FI/sv_FI_test.go b/sv_FI/sv_FI_test.go
new file mode 100644
index 00000000..1db6a364
--- /dev/null
+++ b/sv_FI/sv_FI_test.go
@@ -0,0 +1,1120 @@
+package sv_FI
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "sv_FI"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/sv_SE/sv_SE.go b/sv_SE/sv_SE.go
index 085c65e1..c4b8fa23 100644
--- a/sv_SE/sv_SE.go
+++ b/sv_SE/sv_SE.go
@@ -68,7 +68,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"f.Kr.", "e.Kr."},
erasNarrow: []string{"f.Kr.", "e.Kr."},
erasWide: []string{"före Kristus", "efter Kristus"},
- timezones: map[string]string{"OESZ": "östeuropeisk sommartid", "UYST": "uruguayansk sommartid", "EDT": "östnordamerikansk sommartid", "GMT": "Greenwichtid", "AWDT": "västaustralisk sommartid", "JDT": "japansk sommartid", "ChST": "Chamorrotid", "CHADT": "Chatham, sommartid", "WESZ": "västeuropeisk sommartid", "COST": "colombiansk sommartid", "HADT": "Honolulu, sommartid", "WARST": "västargentinsk sommartid", "LHDT": "Lord Howe, sommartid", "CLT": "chilensk normaltid", "WAT": "västafrikansk normaltid", "HNT": "Newfoundland, normaltid", "ART": "östargentinsk normaltid", "ARST": "östargentinsk sommartid", "AEST": "östaustralisk normaltid", "CDT": "centralnordamerikansk sommartid", "MDT": "Klippiga bergen, sommartid", "COT": "colombiansk normaltid", "CAT": "centralafrikansk tid", "WIT": "östindonesisk tid", "AWST": "västaustralisk normaltid", "NZDT": "nyzeeländsk sommartid", "TMT": "turkmensk normaltid", "MYT": "malaysisk tid", "MESZ": "centraleuropeisk sommartid", "CST": "centralnordamerikansk normaltid", "CHAST": "Chatham, normaltid", "GFT": "Franska Guyanatid", "ACST": "centralaustralisk normaltid", "TMST": "turkmensk sommartid", "SRT": "Surinamtid", "∅∅∅": "azorisk sommartid", "AEDT": "östaustralisk sommartid", "JST": "japansk normaltid", "AKST": "Alaska, normaltid", "CLST": "chilensk sommartid", "VET": "venezuelansk tid", "WEZ": "västeuropeisk normaltid", "BT": "bhutansk tid", "ACDT": "centralaustralisk sommartid", "LHST": "Lord Howe, normaltid", "MST": "Klippiga bergen, normaltid", "AST": "nordamerikansk atlantnormaltid", "ADT": "nordamerikansk atlantsommartid", "GYT": "Guyanatid", "ACWDT": "västcentralaustralisk sommartid", "EST": "östnordamerikansk normaltid", "HKT": "Hongkong, normaltid", "HKST": "Hongkong, sommartid", "WART": "västargentinsk normaltid", "WIB": "västindonesisk tid", "EAT": "östafrikansk tid", "ACWST": "västcentralaustralisk normaltid", "BOT": "boliviansk tid", "ECT": "ecuadoriansk tid", "IST": "indisk tid", "NZST": "nyzeeländsk normaltid", "UYT": "uruguayansk normaltid", "HAST": "Honolulu, normaltid", "SAST": "sydafrikansk tid", "OEZ": "östeuropeisk normaltid", "HAT": "Newfoundland, sommartid", "PDT": "västnordamerikansk sommartid", "WAST": "västafrikansk sommartid", "AKDT": "Alaska, sommartid", "MEZ": "centraleuropeisk normaltid", "SGT": "Singaporetid", "WITA": "centralindonesisk tid", "PST": "västnordamerikansk normaltid"},
+ timezones: map[string]string{"TMT": "turkmensk normaltid", "WESZ": "västeuropeisk sommartid", "HAT": "Newfoundland, sommartid", "HKST": "Hongkong, sommartid", "AST": "nordamerikansk atlantnormaltid", "EDT": "östnordamerikansk sommartid", "GYT": "Guyanatid", "PST": "västnordamerikansk normaltid", "WEZ": "västeuropeisk normaltid", "LHST": "Lord Howe, normaltid", "ECT": "ecuadoriansk tid", "AKDT": "Alaska, sommartid", "CLT": "chilensk normaltid", "TMST": "turkmensk sommartid", "GMT": "Greenwichtid", "AEST": "östaustralisk normaltid", "ChST": "Chamorrotid", "MYT": "malaysisk tid", "BT": "bhutansk tid", "JST": "japansk normaltid", "NZST": "nyzeeländsk normaltid", "CST": "centralnordamerikansk normaltid", "CDT": "centralnordamerikansk sommartid", "UYT": "uruguayansk normaltid", "MST": "Klippiga bergen, normaltid", "WIB": "västindonesisk tid", "WARST": "västargentinsk sommartid", "GFT": "Franska Guyanatid", "HKT": "Hongkong, normaltid", "SAST": "sydafrikansk tid", "PDT": "västnordamerikansk sommartid", "CLST": "chilensk sommartid", "CHADT": "Chatham, sommartid", "COST": "colombiansk sommartid", "CAT": "centralafrikansk tid", "JDT": "japansk sommartid", "ADT": "nordamerikansk atlantsommartid", "NZDT": "nyzeeländsk sommartid", "WIT": "östindonesisk tid", "VET": "venezuelansk tid", "ART": "östargentinsk normaltid", "ARST": "östargentinsk sommartid", "HAST": "Honolulu, normaltid", "WAST": "västafrikansk sommartid", "ACDT": "centralaustralisk sommartid", "ACWST": "västcentralaustralisk normaltid", "MEZ": "centraleuropeisk normaltid", "SGT": "Singaporetid", "WAT": "västafrikansk normaltid", "MDT": "Klippiga bergen, sommartid", "AKST": "Alaska, normaltid", "HADT": "Honolulu, sommartid", "IST": "indisk tid", "COT": "colombiansk normaltid", "AEDT": "östaustralisk sommartid", "ACWDT": "västcentralaustralisk sommartid", "MESZ": "centraleuropeisk sommartid", "AWST": "västaustralisk normaltid", "BOT": "boliviansk tid", "SRT": "Surinamtid", "AWDT": "västaustralisk sommartid", "UYST": "uruguayansk sommartid", "LHDT": "Lord Howe, sommartid", "EST": "östnordamerikansk normaltid", "∅∅∅": "Amazonas, sommartid", "WITA": "centralindonesisk tid", "OESZ": "östeuropeisk sommartid", "EAT": "östafrikansk tid", "ACST": "centralaustralisk normaltid", "WART": "västargentinsk normaltid", "CHAST": "Chatham, normaltid", "HNT": "Newfoundland, normaltid", "OEZ": "östeuropeisk normaltid"},
}
}
@@ -109,8 +109,8 @@ func (sv *sv_SE) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
func (sv *sv_SE) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
n := math.Abs(num)
- nMod100 := math.Mod(n, 100)
nMod10 := math.Mod(n, 10)
+ nMod100 := math.Mod(n, 100)
if (nMod10 == 1 || nMod10 == 2) && (nMod100 != 11 && nMod100 != 12) {
return locales.PluralRuleOne
diff --git a/sv_SE/sv_SE_test.go b/sv_SE/sv_SE_test.go
new file mode 100644
index 00000000..7a2bcf53
--- /dev/null
+++ b/sv_SE/sv_SE_test.go
@@ -0,0 +1,1120 @@
+package sv_SE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "sv_SE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/sw/sw.go b/sw/sw.go
index 5a9171a9..b55e015a 100644
--- a/sw/sw.go
+++ b/sw/sw.go
@@ -47,7 +47,7 @@ func New() locales.Translator {
locale: "sw",
pluralsCardinal: []locales.PluralRule{2, 6},
pluralsOrdinal: []locales.PluralRule{6},
- pluralsRange: []locales.PluralRule{6, 2},
+ pluralsRange: []locales.PluralRule{2, 6},
decimal: ".",
group: ",",
minus: "-",
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"", ""},
erasWide: []string{"Kabla ya Kristo", "Baada ya Kristo"},
- timezones: map[string]string{"ACWST": "Saa Wastani za Magharibi ya Kati ya Australia", "OESZ": "Saa za Majira ya joto za Mashariki mwa Ulaya", "HNT": "Saa za Wastani za Newfoundland", "HAT": "Saa za Mchana za Newfoundland", "ACDT": "Saa za Mchana za Australia ya Kati", "PDT": "Saa za Mchana za Pasifiki", "LHDT": "Saa za Mchana za Lord Howe", "ADT": "Saa za Mchana za Atlantiki", "WAST": "Saa za Majira ya joto za Afrika Magharibi", "HKST": "Saa za Majira ya joto za Hong Kong", "WITA": "Saa za Indonesia ya Kati", "JST": "Saa Wastani za Japani", "AWDT": "Saa za Mchana za Australia Magharibi", "WEZ": "Saa Wastani za Magharibi mwa Ulaya", "ACWDT": "Saa za Mchana za Magharibi ya Kati ya Australia", "CAT": "Saa za Afrika ya Kati", "HADT": "Saa za Mchana za Hawaii-Aleutian", "WIB": "Saa za Magharibi mwa Indonesia", "GFT": "Saa za Guiana ya Ufaransa", "UYT": "Saa Wastani za Urugwai", "UYST": "Saa za Majira ya joto za Urugwai", "AST": "Saa za Wastani za Atlantiki", "SAST": "Saa Wastani za Afrika Kusini", "ACST": "Saa Wastani za Australia ya Kati", "SRT": "Saa za Suriname", "HKT": "Saa Wastani za Hong Kong", "WIT": "Saa za Mashariki mwa Indonesia", "OEZ": "Saa Wastani za Mashariki mwa Ulaya", "ARST": "Saa za Majira ya joto za Ajentina", "CLST": "Saa za Majira ya joto za Chile", "HAST": "Saa za Wastani za Hawaii-Aleutian", "BT": "Saa za Bhutan", "CLT": "Saa Wastani za Chile", "EDT": "Saa za Mchana za Mashariki", "AKST": "Saa za Wastani za Alaska", "AWST": "Saa Wastani za Australia Magharibi", "NZST": "Saa Wastani za Nyuzilandi", "AKDT": "Saa za Mchana za Alaska", "LHST": "Saa Wastani za Lord Howe", "VET": "Saa za Venezuela", "WART": "Saa Wastani za Magharibi mwa Ajentina", "IST": "Saa Wastani za India", "EAT": "Saa za Afrika Mashariki", "TMT": "Saa Wastani za Turkmenistan", "BOT": "Saa za Bolivia", "MDT": "Saa za Mchana za Mountain", "ART": "Saa Wastani za Ajentina", "GYT": "Saa za Guyana", "CST": "Saa za Wastani za Kati", "MESZ": "Saa za Majira ya joto za Ulaya ya Kati", "AEDT": "Saa za Mchana za Mashariki mwa Australia", "GMT": "Saa za Greenwich", "ChST": "Saa Wastani za Chamorro", "CHADT": "Saa za Mchana za Chatham", "COST": "Saa za Majira ya joto za Kolombia", "ECT": "Saa za Ekwado", "CDT": "Saa za Mchana za Kati", "MST": "Saa za Wastani za Mountain", "EST": "Saa za Wastani za Mashariki", "JDT": "Saa za Mchana za Japani", "WESZ": "Saa za Majira ya joto za Magharibi mwa Ulaya", "COT": "Saa Wastani za Kolombia", "∅∅∅": "Saa za Majira ya joto za Brasilia", "WARST": "Saa za Majira ya joto za Magharibi mwa Ajentina", "TMST": "Saa za Majira ya joto za Turkmenistan", "PST": "Saa za Wastani za Pasifiki", "AEST": "Saa Wastani za Mashariki mwa Australia", "CHAST": "Saa Wastani za Chatham", "SGT": "Saa Wastani za Singapore", "MEZ": "Saa Wastani za Ulaya ya kati", "NZDT": "Saa za Mchana za Nyuzilandi", "WAT": "Saa Wastani za Afrika Magharibi", "MYT": "Saa za Malaysia"},
+ timezones: map[string]string{"HAST": "Saa za Wastani za Hawaii-Aleutian", "HADT": "Saa za Mchana za Hawaii-Aleutian", "EST": "Saa za Wastani za Mashariki", "WIB": "Saa za Magharibi mwa Indonesia", "UYT": "Saa Wastani za Urugwai", "HKT": "Saa Wastani za Hong Kong", "AST": "Saa za Wastani za Atlantiki", "ACWST": "Saa Wastani za Magharibi ya Kati ya Australia", "LHST": "Saa Wastani za Lord Howe", "∅∅∅": "Saa za Majira ya joto za Brasilia", "JDT": "Saa za Mchana za Japani", "ACWDT": "Saa za Mchana za Magharibi ya Kati ya Australia", "MEZ": "Saa Wastani za Ulaya ya kati", "UYST": "Saa za Majira ya joto za Urugwai", "AWDT": "Saa za Mchana za Australia Magharibi", "IST": "Saa Wastani za India", "AWST": "Saa Wastani za Australia Magharibi", "BT": "Saa za Bhutan", "CDT": "Saa za Mchana za Kati", "ACST": "Saa Wastani za Australia ya Kati", "WART": "Saa Wastani za Magharibi mwa Ajentina", "GFT": "Saa za Guiana ya Ufaransa", "AKST": "Saa za Wastani za Alaska", "TMST": "Saa za Majira ya joto za Turkmenistan", "WAST": "Saa za Majira ya joto za Afrika Magharibi", "HNT": "Saa za Wastani za Newfoundland", "CLST": "Saa za Majira ya joto za Chile", "HKST": "Saa za Majira ya joto za Hong Kong", "COST": "Saa za Majira ya joto za Kolombia", "OESZ": "Saa za Majira ya joto za Mashariki mwa Ulaya", "WIT": "Saa za Mashariki mwa Indonesia", "ACDT": "Saa za Mchana za Australia ya Kati", "WESZ": "Saa za Majira ya joto za Magharibi mwa Ulaya", "AEST": "Saa Wastani za Mashariki mwa Australia", "EDT": "Saa za Mchana za Mashariki", "PST": "Saa za Wastani za Pasifiki", "MESZ": "Saa za Majira ya joto za Ulaya ya Kati", "MDT": "Saa za Mchana za Mountain", "ADT": "Saa za Mchana za Atlantiki", "COT": "Saa Wastani za Kolombia", "TMT": "Saa Wastani za Turkmenistan", "GMT": "Saa za Greenwich", "ChST": "Saa Wastani za Chamorro", "MST": "Saa za Wastani za Mountain", "CAT": "Saa za Afrika ya Kati", "JST": "Saa Wastani za Japani", "ARST": "Saa za Majira ya joto za Ajentina", "PDT": "Saa za Mchana za Pasifiki", "ART": "Saa Wastani za Ajentina", "SAST": "Saa Wastani za Afrika Kusini", "WAT": "Saa Wastani za Afrika Magharibi", "CST": "Saa za Wastani za Kati", "CHADT": "Saa za Mchana za Chatham", "VET": "Saa za Venezuela", "AKDT": "Saa za Mchana za Alaska", "MYT": "Saa za Malaysia", "BOT": "Saa za Bolivia", "WEZ": "Saa Wastani za Magharibi mwa Ulaya", "CHAST": "Saa Wastani za Chatham", "NZDT": "Saa za Mchana za Nyuzilandi", "OEZ": "Saa Wastani za Mashariki mwa Ulaya", "AEDT": "Saa za Mchana za Mashariki mwa Australia", "CLT": "Saa Wastani za Chile", "LHDT": "Saa za Mchana za Lord Howe", "WARST": "Saa za Majira ya joto za Magharibi mwa Ajentina", "HAT": "Saa za Mchana za Newfoundland", "GYT": "Saa za Guyana", "NZST": "Saa Wastani za Nyuzilandi", "SGT": "Saa Wastani za Singapore", "EAT": "Saa za Afrika Mashariki", "SRT": "Saa za Suriname", "ECT": "Saa za Ekwado", "WITA": "Saa za Indonesia ya Kati"},
}
}
diff --git a/sw/sw_test.go b/sw/sw_test.go
new file mode 100644
index 00000000..8f972295
--- /dev/null
+++ b/sw/sw_test.go
@@ -0,0 +1,1120 @@
+package sw
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "sw"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/sw_CD/sw_CD.go b/sw_CD/sw_CD.go
index 8e9d7aa8..43b0602e 100644
--- a/sw_CD/sw_CD.go
+++ b/sw_CD/sw_CD.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"", ""},
erasWide: []string{"Kabla ya Kristo", "Baada ya Kristo"},
- timezones: map[string]string{"VET": "Saa za Venezuela", "TMT": "Saa Wastani za Turkmenistan", "WITA": "Saa za Indonesia ya Kati", "HAT": "Saa za Mchana za Newfoundland", "SRT": "Saa za Suriname", "EDT": "Saa za Mchana za Mashariki", "COST": "Saa za Majira ya joto za Kolombia", "WAT": "Saa Wastani za Afrika Magharibi", "MESZ": "Saa za Majira ya joto za Ulaya ya Kati", "CLT": "Saa Wastani za Chile", "AST": "Saa za Wastani za Atlantiki", "WEZ": "Saa Wastani za Magharibi mwa Ulaya", "ACWDT": "Saa za Mchana za Magharibi ya Kati ya Australia", "AEDT": "Saa za Mchana za Mashariki mwa Australia", "HAST": "Saa za Wastani za Hawaii-Aleutian", "SGT": "Saa Wastani za Singapore", "AWST": "Saa Wastani za Australia Magharibi", "NZST": "Saa Wastani za Nyuzilandi", "UYST": "Saa za Majira ya joto za Urugwai", "WARST": "Saa za Majira ya joto za Magharibi mwa Ajentina", "SAST": "Saa Wastani za Afrika Kusini", "ART": "Saa Wastani za Ajentina", "PST": "Saa za Wastani za Pasifiki", "LHST": "Saa Wastani za Lord Howe", "MDT": "Saa za Mchana za Mountain", "HKST": "Saa za Majira ya joto za Hong Kong", "PDT": "Saa za Mchana za Pasifiki", "CLST": "Saa za Majira ya joto za Chile", "COT": "Saa Wastani za Kolombia", "JST": "Saa Wastani za Japani", "BT": "Saa za Bhutan", "EST": "Saa za Wastani za Mashariki", "WIT": "Saa za Mashariki mwa Indonesia", "BOT": "Saa za Bolivia", "ACWST": "Saa Wastani za Magharibi ya Kati ya Australia", "ChST": "Saa Wastani za Chamorro", "NZDT": "Saa za Mchana za Nyuzilandi", "ACST": "Saa Wastani za Australia ya Kati", "MYT": "Saa za Malaysia", "AKDT": "Saa za Mchana za Alaska", "∅∅∅": "Saa za Majira ya joto za Azores", "ECT": "Saa za Ekwado", "WAST": "Saa za Majira ya joto za Afrika Magharibi", "GYT": "Saa za Guyana", "UYT": "Saa Wastani za Urugwai", "CAT": "Saa za Afrika ya Kati", "ADT": "Saa za Mchana za Atlantiki", "GFT": "Saa za Guiana ya Ufaransa", "EAT": "Saa za Afrika Mashariki", "OEZ": "Saa Wastani za Mashariki mwa Ulaya", "GMT": "Saa za Greenwich", "HNT": "Saa za Wastani za Newfoundland", "JDT": "Saa za Mchana za Japani", "MEZ": "Saa Wastani za Ulaya ya kati", "CHAST": "Saa Wastani za Chatham", "IST": "Saa Wastani za India", "TMST": "Saa za Majira ya joto za Turkmenistan", "ACDT": "Saa za Mchana za Australia ya Kati", "ARST": "Saa za Majira ya joto za Ajentina", "AKST": "Saa za Wastani za Alaska", "AEST": "Saa Wastani za Mashariki mwa Australia", "MST": "Saa za Wastani za Mountain", "LHDT": "Saa za Mchana za Lord Howe", "WART": "Saa Wastani za Magharibi mwa Ajentina", "HKT": "Saa Wastani za Hong Kong", "CDT": "Saa za Mchana za Kati", "WESZ": "Saa za Majira ya joto za Magharibi mwa Ulaya", "HADT": "Saa za Mchana za Hawaii-Aleutian", "WIB": "Saa za Magharibi mwa Indonesia", "OESZ": "Saa za Majira ya joto za Mashariki mwa Ulaya", "AWDT": "Saa za Mchana za Australia Magharibi", "CST": "Saa za Wastani za Kati", "CHADT": "Saa za Mchana za Chatham"},
+ timezones: map[string]string{"HKT": "Saa Wastani za Hong Kong", "AEDT": "Saa za Mchana za Mashariki mwa Australia", "ACDT": "Saa za Mchana za Australia ya Kati", "WARST": "Saa za Majira ya joto za Magharibi mwa Ajentina", "ACWDT": "Saa za Mchana za Magharibi ya Kati ya Australia", "NZDT": "Saa za Mchana za Nyuzilandi", "TMT": "Saa Wastani za Turkmenistan", "HAT": "Saa za Mchana za Newfoundland", "MEZ": "Saa Wastani za Ulaya ya kati", "WIB": "Saa za Magharibi mwa Indonesia", "CLT": "Saa Wastani za Chile", "MDT": "MDT", "CHAST": "Saa Wastani za Chatham", "AKST": "Saa za Wastani za Alaska", "COT": "Saa Wastani za Kolombia", "UYT": "Saa Wastani za Urugwai", "EAT": "Saa za Afrika Mashariki", "LHDT": "Saa za Mchana za Lord Howe", "ACWST": "Saa Wastani za Magharibi ya Kati ya Australia", "AWDT": "Saa za Mchana za Australia Magharibi", "BOT": "Saa za Bolivia", "GYT": "Saa za Guyana", "GMT": "Saa za Greenwich", "JST": "Saa Wastani za Japani", "MESZ": "Saa za Majira ya joto za Ulaya ya Kati", "NZST": "Saa Wastani za Nyuzilandi", "COST": "Saa za Majira ya joto za Kolombia", "WESZ": "Saa za Majira ya joto za Magharibi mwa Ulaya", "HNT": "Saa za Wastani za Newfoundland", "BT": "Saa za Bhutan", "VET": "Saa za Venezuela", "CHADT": "Saa za Mchana za Chatham", "SAST": "Saa Wastani za Afrika Kusini", "IST": "Saa Wastani za India", "AEST": "Saa Wastani za Mashariki mwa Australia", "MYT": "Saa za Malaysia", "CLST": "Saa za Majira ya joto za Chile", "HAST": "Saa za Wastani za Hawaii-Aleutian", "CAT": "Saa za Afrika ya Kati", "WAST": "Saa za Majira ya joto za Afrika Magharibi", "OESZ": "Saa za Majira ya joto za Mashariki mwa Ulaya", "WIT": "Saa za Mashariki mwa Indonesia", "ART": "Saa Wastani za Ajentina", "AWST": "Saa Wastani za Australia Magharibi", "HADT": "Saa za Mchana za Hawaii-Aleutian", "ChST": "Saa Wastani za Chamorro", "LHST": "Saa Wastani za Lord Howe", "GFT": "Saa za Guiana ya Ufaransa", "AKDT": "Saa za Mchana za Alaska", "ADT": "Saa za Mchana za Atlantiki", "PST": "Saa za Wastani za Pasifiki", "PDT": "Saa za Mchana za Pasifiki", "TMST": "Saa za Majira ya joto za Turkmenistan", "WART": "Saa Wastani za Magharibi mwa Ajentina", "WITA": "Saa za Indonesia ya Kati", "JDT": "Saa za Mchana za Japani", "WEZ": "Saa Wastani za Magharibi mwa Ulaya", "SRT": "Saa za Suriname", "UYST": "Saa za Majira ya joto za Urugwai", "MST": "MST", "EDT": "Saa za Mchana za Mashariki", "OEZ": "Saa Wastani za Mashariki mwa Ulaya", "CST": "Saa za Wastani za Kati", "WAT": "Saa Wastani za Afrika Magharibi", "CDT": "Saa za Mchana za Kati", "ACST": "Saa Wastani za Australia ya Kati", "ECT": "Saa za Ekwado", "ARST": "Saa za Majira ya joto za Ajentina", "EST": "Saa za Wastani za Mashariki", "∅∅∅": "Saa za Majira ya joto za Amazon", "HKST": "Saa za Majira ya joto za Hong Kong", "AST": "Saa za Wastani za Atlantiki", "SGT": "Saa Wastani za Singapore"},
}
}
diff --git a/sw_CD/sw_CD_test.go b/sw_CD/sw_CD_test.go
new file mode 100644
index 00000000..7c834e62
--- /dev/null
+++ b/sw_CD/sw_CD_test.go
@@ -0,0 +1,1120 @@
+package sw_CD
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "sw_CD"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/sw_KE/sw_KE.go b/sw_KE/sw_KE.go
index a9db94ff..aa4f0c85 100644
--- a/sw_KE/sw_KE.go
+++ b/sw_KE/sw_KE.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"", ""},
erasWide: []string{"Kabla ya Kristo", "Baada ya Kristo"},
- timezones: map[string]string{"SAST": "Saa Wastani za Afrika Kusini", "WAT": "Saa Wastani za Afrika Magharibi", "SRT": "Saa za Suriname", "ACWDT": "Saa za Mchana za Magharibi ya Kati ya Australia", "EST": "Saa za Wastani za Mashariki", "ADT": "Saa za Mchana za Atlantiki", "MYT": "Saa za Malaysia", "CDT": "Saa za Mchana za Kati", "IST": "Saa Wastani za India", "UYST": "Saa za Majira ya joto za Urugwai", "MDT": "Saa za Mchana za Mountain", "CAT": "Saa za Afrika ya Kati", "ACDT": "Saa za Mchana za Australia ya Kati", "AWST": "Saa Wastani za Australia Magharibi", "AKDT": "Saa za Mchana za Alaska", "MESZ": "Saa za Majira ya joto za Ulaya ya Kati", "HADT": "Saa za Mchana za Hawaii-Aleutian", "EAT": "Saa za Afrika Mashariki", "CHAST": "Saa Wastani za Chatham", "VET": "Saa za Venezuela", "WITA": "Saa za Indonesia ya Kati", "TMT": "Saa Wastani za Turkmenistan", "AEST": "Saa Wastani za Mashariki mwa Australia", "WEZ": "Saa Wastani za Magharibi mwa Ulaya", "ACWST": "Saa Wastani za Magharibi ya Kati ya Australia", "HAST": "Saa za Wastani za Hawaii-Aleutian", "ART": "Saa Wastani za Ajentina", "JST": "Saa Wastani za Japani", "NZDT": "Saa za Mchana za Nyuzilandi", "AST": "Saa za Wastani za Atlantiki", "WARST": "Saa za Majira ya joto za Magharibi mwa Ajentina", "ECT": "Saa za Ekwado", "SGT": "Saa Wastani za Singapore", "TMST": "Saa za Majira ya joto za Turkmenistan", "PST": "Saa za Wastani za Pasifiki", "∅∅∅": "Saa za Majira ya joto za Azores", "CHADT": "Saa za Mchana za Chatham", "COT": "Saa Wastani za Kolombia", "ChST": "Saa Wastani za Chamorro", "MEZ": "Saa Wastani za Ulaya ya kati", "COST": "Saa za Majira ya joto za Kolombia", "WAST": "Saa za Majira ya joto za Afrika Magharibi", "ARST": "Saa za Majira ya joto za Ajentina", "OEZ": "Saa Wastani za Mashariki mwa Ulaya", "AEDT": "Saa za Mchana za Mashariki mwa Australia", "EDT": "Saa za Mchana za Mashariki", "BT": "Saa za Bhutan", "WART": "Saa Wastani za Magharibi mwa Ajentina", "GMT": "Saa za Greenwich", "HAT": "Saa za Mchana za Newfoundland", "WIB": "Saa za Magharibi mwa Indonesia", "ACST": "Saa Wastani za Australia ya Kati", "LHST": "Saa Wastani za Lord Howe", "NZST": "Saa Wastani za Nyuzilandi", "MST": "Saa za Wastani za Mountain", "HKST": "Saa za Majira ya joto za Hong Kong", "GFT": "Saa za Guiana ya Ufaransa", "OESZ": "Saa za Majira ya joto za Mashariki mwa Ulaya", "WESZ": "Saa za Majira ya joto za Magharibi mwa Ulaya", "HKT": "Saa Wastani za Hong Kong", "HNT": "Saa za Wastani za Newfoundland", "GYT": "Saa za Guyana", "AKST": "Saa za Wastani za Alaska", "PDT": "Saa za Mchana za Pasifiki", "CLST": "Saa za Majira ya joto za Chile", "WIT": "Saa za Mashariki mwa Indonesia", "AWDT": "Saa za Mchana za Australia Magharibi", "LHDT": "Saa za Mchana za Lord Howe", "JDT": "Saa za Mchana za Japani", "UYT": "Saa Wastani za Urugwai", "BOT": "Saa za Bolivia", "CST": "Saa za Wastani za Kati", "CLT": "Saa Wastani za Chile"},
+ timezones: map[string]string{"∅∅∅": "Saa za Majira ya joto za Amazon", "WAST": "Saa za Majira ya joto za Afrika Magharibi", "HNT": "Saa za Wastani za Newfoundland", "OEZ": "Saa Wastani za Mashariki mwa Ulaya", "UYT": "Saa Wastani za Urugwai", "ACDT": "Saa za Mchana za Australia ya Kati", "ADT": "Saa za Mchana za Atlantiki", "ChST": "Saa Wastani za Chamorro", "NZST": "Saa Wastani za Nyuzilandi", "EST": "Saa za Wastani za Mashariki", "CHAST": "Saa Wastani za Chatham", "BOT": "Saa za Bolivia", "WEZ": "Saa Wastani za Magharibi mwa Ulaya", "AWDT": "Saa za Mchana za Australia Magharibi", "WAT": "Saa Wastani za Afrika Magharibi", "HAT": "Saa za Mchana za Newfoundland", "OESZ": "Saa za Majira ya joto za Mashariki mwa Ulaya", "LHDT": "Saa za Mchana za Lord Howe", "ACST": "Saa Wastani za Australia ya Kati", "ARST": "Saa za Majira ya joto za Ajentina", "COST": "Saa za Majira ya joto za Kolombia", "MDT": "MDT", "CST": "Saa za Wastani za Kati", "SRT": "Saa za Suriname", "GYT": "Saa za Guyana", "BT": "Saa za Bhutan", "GFT": "Saa za Guiana ya Ufaransa", "CHADT": "Saa za Mchana za Chatham", "WITA": "Saa za Indonesia ya Kati", "PST": "Saa za Wastani za Pasifiki", "WESZ": "Saa za Majira ya joto za Magharibi mwa Ulaya", "UYST": "Saa za Majira ya joto za Urugwai", "WARST": "Saa za Majira ya joto za Magharibi mwa Ajentina", "AST": "Saa za Wastani za Atlantiki", "ACWST": "Saa Wastani za Magharibi ya Kati ya Australia", "JDT": "Saa za Mchana za Japani", "PDT": "Saa za Mchana za Pasifiki", "TMT": "Saa Wastani za Turkmenistan", "TMST": "Saa za Majira ya joto za Turkmenistan", "AEDT": "Saa za Mchana za Mashariki mwa Australia", "CDT": "Saa za Mchana za Kati", "HKST": "Saa za Majira ya joto za Hong Kong", "WART": "Saa Wastani za Magharibi mwa Ajentina", "AKST": "Saa za Wastani za Alaska", "SAST": "Saa Wastani za Afrika Kusini", "HADT": "Saa za Mchana za Hawaii-Aleutian", "WIT": "Saa za Mashariki mwa Indonesia", "MYT": "Saa za Malaysia", "HKT": "Saa Wastani za Hong Kong", "VET": "Saa za Venezuela", "IST": "Saa Wastani za India", "COT": "Saa Wastani za Kolombia", "AEST": "Saa Wastani za Mashariki mwa Australia", "LHST": "Saa Wastani za Lord Howe", "MST": "MST", "ACWDT": "Saa za Mchana za Magharibi ya Kati ya Australia", "HAST": "Saa za Wastani za Hawaii-Aleutian", "SGT": "Saa Wastani za Singapore", "CLT": "Saa Wastani za Chile", "ECT": "Saa za Ekwado", "MEZ": "Saa Wastani za Ulaya ya kati", "AWST": "Saa Wastani za Australia Magharibi", "EDT": "Saa za Mchana za Mashariki", "MESZ": "Saa za Majira ya joto za Ulaya ya Kati", "GMT": "Saa za Greenwich", "EAT": "Saa za Afrika Mashariki", "CLST": "Saa za Majira ya joto za Chile", "ART": "Saa Wastani za Ajentina", "JST": "Saa Wastani za Japani", "NZDT": "Saa za Mchana za Nyuzilandi", "CAT": "Saa za Afrika ya Kati", "WIB": "Saa za Magharibi mwa Indonesia", "AKDT": "Saa za Mchana za Alaska"},
}
}
diff --git a/sw_KE/sw_KE_test.go b/sw_KE/sw_KE_test.go
new file mode 100644
index 00000000..fa61d74c
--- /dev/null
+++ b/sw_KE/sw_KE_test.go
@@ -0,0 +1,1120 @@
+package sw_KE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "sw_KE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/sw_TZ/sw_TZ.go b/sw_TZ/sw_TZ.go
index 37156828..d37ad68e 100644
--- a/sw_TZ/sw_TZ.go
+++ b/sw_TZ/sw_TZ.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"", ""},
erasWide: []string{"Kabla ya Kristo", "Baada ya Kristo"},
- timezones: map[string]string{"HKST": "Saa za Majira ya joto za Hong Kong", "WARST": "Saa za Majira ya joto za Magharibi mwa Ajentina", "ChST": "Saa Wastani za Chamorro", "CHAST": "Saa Wastani za Chatham", "WAT": "Saa Wastani za Afrika Magharibi", "MEZ": "Saa Wastani za Ulaya ya kati", "NZDT": "Saa za Mchana za Nyuzilandi", "UYST": "Saa za Majira ya joto za Urugwai", "CST": "Saa za Wastani za Kati", "GYT": "Saa za Guyana", "UYT": "Saa Wastani za Urugwai", "CLST": "Saa za Majira ya joto za Chile", "MDT": "MDT", "ART": "Saa Wastani za Ajentina", "AKDT": "Saa za Mchana za Alaska", "ACWDT": "Saa za Mchana za Magharibi ya Kati ya Australia", "CLT": "Saa Wastani za Chile", "COT": "Saa Wastani za Kolombia", "HADT": "Saa za Mchana za Hawaii-Aleutian", "WITA": "Saa za Indonesia ya Kati", "EAT": "Saa za Afrika Mashariki", "CHADT": "Saa za Mchana za Chatham", "EST": "Saa za Wastani za Mashariki", "COST": "Saa za Majira ya joto za Kolombia", "HAST": "Saa za Wastani za Hawaii-Aleutian", "OEZ": "Saa Wastani za Mashariki mwa Ulaya", "LHDT": "Saa za Mchana za Lord Howe", "MESZ": "Saa za Majira ya joto za Ulaya ya Kati", "VET": "Saa za Venezuela", "WESZ": "Saa za Majira ya joto za Magharibi mwa Ulaya", "WIB": "Saa za Magharibi mwa Indonesia", "TMT": "Saa Wastani za Turkmenistan", "ACST": "Saa Wastani za Australia ya Kati", "TMST": "Saa za Majira ya joto za Turkmenistan", "AWDT": "Saa za Mchana za Australia Magharibi", "LHST": "Saa Wastani za Lord Howe", "∅∅∅": "∅∅∅", "PST": "Saa za Wastani za Pasifiki", "JST": "Saa Wastani za Japani", "CDT": "Saa za Mchana za Kati", "WEZ": "Saa Wastani za Magharibi mwa Ulaya", "AKST": "Saa za Wastani za Alaska", "WIT": "Saa za Mashariki mwa Indonesia", "ARST": "Saa za Majira ya joto za Ajentina", "PDT": "Saa za Mchana za Pasifiki", "NZST": "Saa Wastani za Nyuzilandi", "AEDT": "Saa za Mchana za Mashariki mwa Australia", "BT": "Saa za Bhutan", "HNT": "Saa za Wastani za Newfoundland", "MST": "MST", "AEST": "Saa Wastani za Mashariki mwa Australia", "HKT": "Saa Wastani za Hong Kong", "HAT": "Saa za Mchana za Newfoundland", "MYT": "Saa za Malaysia", "IST": "Saa Wastani za India", "WAST": "Saa za Majira ya joto za Afrika Magharibi", "OESZ": "Saa za Majira ya joto za Mashariki mwa Ulaya", "GMT": "Saa za Greenwich", "ACDT": "Saa za Mchana za Australia ya Kati", "SGT": "Saa Wastani za Singapore", "SRT": "Saa za Suriname", "CAT": "Saa za Afrika ya Kati", "ECT": "Saa za Ekwado", "SAST": "Saa Wastani za Afrika Kusini", "BOT": "Saa za Bolivia", "ACWST": "Saa Wastani za Magharibi ya Kati ya Australia", "ADT": "Saa za Mchana za Atlantiki", "WART": "Saa Wastani za Magharibi mwa Ajentina", "GFT": "Saa za Guiana ya Ufaransa", "AWST": "Saa Wastani za Australia Magharibi", "JDT": "Saa za Mchana za Japani", "EDT": "Saa za Mchana za Mashariki", "AST": "Saa za Wastani za Atlantiki"},
+ timezones: map[string]string{"JDT": "Saa za Mchana za Japani", "WIT": "Saa za Mashariki mwa Indonesia", "ACDT": "Saa za Mchana za Australia ya Kati", "OESZ": "Saa za Majira ya joto za Mashariki mwa Ulaya", "AEDT": "Saa za Mchana za Mashariki mwa Australia", "ACWDT": "Saa za Mchana za Magharibi ya Kati ya Australia", "HADT": "Saa za Mchana za Hawaii-Aleutian", "COST": "Saa za Majira ya joto za Kolombia", "WESZ": "Saa za Majira ya joto za Magharibi mwa Ulaya", "ECT": "Saa za Ekwado", "AWST": "Saa Wastani za Australia Magharibi", "UYST": "Saa za Majira ya joto za Urugwai", "LHST": "Saa Wastani za Lord Howe", "SRT": "Saa za Suriname", "MESZ": "Saa za Majira ya joto za Ulaya ya Kati", "HAST": "Saa za Wastani za Hawaii-Aleutian", "PST": "Saa za Wastani za Pasifiki", "SGT": "Saa Wastani za Singapore", "LHDT": "Saa za Mchana za Lord Howe", "MST": "MST", "CAT": "Saa za Afrika ya Kati", "WEZ": "Saa Wastani za Magharibi mwa Ulaya", "GYT": "Saa za Guyana", "ADT": "Saa za Mchana za Atlantiki", "NZDT": "Saa za Mchana za Nyuzilandi", "GFT": "Saa za Guiana ya Ufaransa", "AWDT": "Saa za Mchana za Australia Magharibi", "AEST": "Saa Wastani za Mashariki mwa Australia", "EAT": "Saa za Afrika Mashariki", "CDT": "Saa za Mchana za Kati", "HKT": "Saa Wastani za Hong Kong", "PDT": "Saa za Mchana za Pasifiki", "HNT": "Saa za Wastani za Newfoundland", "BT": "Saa za Bhutan", "HKST": "Saa za Majira ya joto za Hong Kong", "BOT": "Saa za Bolivia", "WIB": "Saa za Magharibi mwa Indonesia", "CST": "Saa za Wastani za Kati", "TMST": "Saa za Majira ya joto za Turkmenistan", "WAT": "Saa Wastani za Afrika Magharibi", "ACST": "Saa Wastani za Australia ya Kati", "VET": "Saa za Venezuela", "ART": "Saa Wastani za Ajentina", "AKST": "Saa za Wastani za Alaska", "IST": "Saa Wastani za India", "HAT": "Saa za Mchana za Newfoundland", "WITA": "Saa za Indonesia ya Kati", "AST": "Saa za Wastani za Atlantiki", "MEZ": "Saa Wastani za Ulaya ya kati", "NZST": "Saa Wastani za Nyuzilandi", "COT": "Saa Wastani za Kolombia", "TMT": "Saa Wastani za Turkmenistan", "UYT": "Saa Wastani za Urugwai", "∅∅∅": "Saa za Majira ya joto za Azores", "CHADT": "Saa za Mchana za Chatham", "AKDT": "Saa za Mchana za Alaska", "SAST": "Saa Wastani za Afrika Kusini", "WAST": "Saa za Majira ya joto za Afrika Magharibi", "CLT": "Saa Wastani za Chile", "CLST": "Saa za Majira ya joto za Chile", "WARST": "Saa za Majira ya joto za Magharibi mwa Ajentina", "MDT": "MDT", "ARST": "Saa za Majira ya joto za Ajentina", "JST": "Saa Wastani za Japani", "EST": "Saa za Wastani za Mashariki", "WART": "Saa Wastani za Magharibi mwa Ajentina", "ACWST": "Saa Wastani za Magharibi ya Kati ya Australia", "OEZ": "Saa Wastani za Mashariki mwa Ulaya", "GMT": "Saa za Greenwich", "ChST": "Saa Wastani za Chamorro", "CHAST": "Saa Wastani za Chatham", "EDT": "Saa za Mchana za Mashariki", "MYT": "Saa za Malaysia"},
}
}
diff --git a/sw_TZ/sw_TZ_test.go b/sw_TZ/sw_TZ_test.go
new file mode 100644
index 00000000..92030765
--- /dev/null
+++ b/sw_TZ/sw_TZ_test.go
@@ -0,0 +1,1120 @@
+package sw_TZ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "sw_TZ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/sw_UG/sw_UG.go b/sw_UG/sw_UG.go
index 1e98ac3e..dc3035ec 100644
--- a/sw_UG/sw_UG.go
+++ b/sw_UG/sw_UG.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"", ""},
erasWide: []string{"Kabla ya Kristo", "Baada ya Kristo"},
- timezones: map[string]string{"EDT": "Saa za Mchana za Mashariki", "ECT": "Saa za Ekwado", "ART": "Saa Wastani za Ajentina", "LHDT": "Saa za Mchana za Lord Howe", "CDT": "Saa za Mchana za Kati", "HAST": "Saa za Wastani za Hawaii-Aleutian", "AWST": "Saa Wastani za Australia Magharibi", "ACWDT": "Saa za Mchana za Magharibi ya Kati ya Australia", "AEST": "Saa Wastani za Mashariki mwa Australia", "AEDT": "Saa za Mchana za Mashariki mwa Australia", "EST": "Saa za Wastani za Mashariki", "∅∅∅": "Saa za Majira ya joto za Brasilia", "MST": "MST", "MDT": "MDT", "GMT": "Saa za Greenwich", "HNT": "Saa za Wastani za Newfoundland", "ARST": "Saa za Majira ya joto za Ajentina", "PST": "Saa za Wastani za Pasifiki", "JDT": "Saa za Mchana za Japani", "SGT": "Saa Wastani za Singapore", "EAT": "Saa za Afrika Mashariki", "ACDT": "Saa za Mchana za Australia ya Kati", "UYT": "Saa Wastani za Urugwai", "CLST": "Saa za Majira ya joto za Chile", "BT": "Saa za Bhutan", "TMT": "Saa Wastani za Turkmenistan", "WESZ": "Saa za Majira ya joto za Magharibi mwa Ulaya", "CLT": "Saa Wastani za Chile", "AWDT": "Saa za Mchana za Australia Magharibi", "UYST": "Saa za Majira ya joto za Urugwai", "CHADT": "Saa za Mchana za Chatham", "HKST": "Saa za Majira ya joto za Hong Kong", "WIB": "Saa za Magharibi mwa Indonesia", "PDT": "Saa za Mchana za Pasifiki", "MYT": "Saa za Malaysia", "NZST": "Saa Wastani za Nyuzilandi", "WITA": "Saa za Indonesia ya Kati", "WIT": "Saa za Mashariki mwa Indonesia", "TMST": "Saa za Majira ya joto za Turkmenistan", "GYT": "Saa za Guyana", "ACWST": "Saa Wastani za Magharibi ya Kati ya Australia", "ChST": "Saa Wastani za Chamorro", "ADT": "Saa za Mchana za Atlantiki", "WARST": "Saa za Majira ya joto za Magharibi mwa Ajentina", "MESZ": "Saa za Majira ya joto za Ulaya ya Kati", "BOT": "Saa za Bolivia", "COT": "Saa Wastani za Kolombia", "HADT": "Saa za Mchana za Hawaii-Aleutian", "WAT": "Saa Wastani za Afrika Magharibi", "OESZ": "Saa za Majira ya joto za Mashariki mwa Ulaya", "SRT": "Saa za Suriname", "COST": "Saa za Majira ya joto za Kolombia", "SAST": "Saa Wastani za Afrika Kusini", "HKT": "Saa Wastani za Hong Kong", "AKDT": "Saa za Mchana za Alaska", "LHST": "Saa Wastani za Lord Howe", "WEZ": "Saa Wastani za Magharibi mwa Ulaya", "WART": "Saa Wastani za Magharibi mwa Ajentina", "OEZ": "Saa Wastani za Mashariki mwa Ulaya", "VET": "Saa za Venezuela", "AST": "Saa za Wastani za Atlantiki", "HAT": "Saa za Mchana za Newfoundland", "AKST": "Saa za Wastani za Alaska", "JST": "Saa Wastani za Japani", "CST": "Saa za Wastani za Kati", "MEZ": "Saa Wastani za Ulaya ya kati", "CAT": "Saa za Afrika ya Kati", "WAST": "Saa za Majira ya joto za Afrika Magharibi", "IST": "Saa Wastani za India", "GFT": "Saa za Guiana ya Ufaransa", "ACST": "Saa Wastani za Australia ya Kati", "NZDT": "Saa za Mchana za Nyuzilandi", "CHAST": "Saa Wastani za Chatham"},
+ timezones: map[string]string{"HADT": "Saa za Mchana za Hawaii-Aleutian", "HAT": "Saa za Mchana za Newfoundland", "OESZ": "Saa za Majira ya joto za Mashariki mwa Ulaya", "AEST": "Saa Wastani za Mashariki mwa Australia", "PDT": "Saa za Mchana za Pasifiki", "BT": "Saa za Bhutan", "WARST": "Saa za Majira ya joto za Magharibi mwa Ajentina", "PST": "Saa za Wastani za Pasifiki", "LHDT": "Saa za Mchana za Lord Howe", "AKDT": "Saa za Mchana za Alaska", "ADT": "Saa za Mchana za Atlantiki", "NZST": "Saa Wastani za Nyuzilandi", "HAST": "Saa za Wastani za Hawaii-Aleutian", "UYST": "Saa za Majira ya joto za Urugwai", "HKST": "Saa za Majira ya joto za Hong Kong", "HNT": "Saa za Wastani za Newfoundland", "OEZ": "Saa Wastani za Mashariki mwa Ulaya", "AWST": "Saa Wastani za Australia Magharibi", "BOT": "Saa za Bolivia", "MDT": "Saa za Mchana za Mountain", "WART": "Saa Wastani za Magharibi mwa Ajentina", "VET": "Saa za Venezuela", "WESZ": "Saa za Majira ya joto za Magharibi mwa Ulaya", "MST": "Saa za Wastani za Mountain", "GFT": "Saa za Guiana ya Ufaransa", "ECT": "Saa za Ekwado", "JDT": "Saa za Mchana za Japani", "NZDT": "Saa za Mchana za Nyuzilandi", "GYT": "Saa za Guyana", "WIT": "Saa za Mashariki mwa Indonesia", "CLT": "Saa Wastani za Chile", "CST": "Saa za Wastani za Kati", "ARST": "Saa za Majira ya joto za Ajentina", "EST": "Saa za Wastani za Mashariki", "LHST": "Saa Wastani za Lord Howe", "AWDT": "Saa za Mchana za Australia Magharibi", "WEZ": "Saa Wastani za Magharibi mwa Ulaya", "COST": "Saa za Majira ya joto za Kolombia", "MEZ": "Saa Wastani za Ulaya ya kati", "WIB": "Saa za Magharibi mwa Indonesia", "ACST": "Saa Wastani za Australia ya Kati", "CHAST": "Saa Wastani za Chatham", "CHADT": "Saa za Mchana za Chatham", "MESZ": "Saa za Majira ya joto za Ulaya ya Kati", "∅∅∅": "Saa za Majira ya joto za Amazon", "SGT": "Saa Wastani za Singapore", "AEDT": "Saa za Mchana za Mashariki mwa Australia", "UYT": "Saa Wastani za Urugwai", "CLST": "Saa za Majira ya joto za Chile", "AST": "Saa za Wastani za Atlantiki", "TMST": "Saa za Majira ya joto za Turkmenistan", "WAT": "Saa Wastani za Afrika Magharibi", "AKST": "Saa za Wastani za Alaska", "EDT": "Saa za Mchana za Mashariki", "WAST": "Saa za Majira ya joto za Afrika Magharibi", "EAT": "Saa za Afrika Mashariki", "WITA": "Saa za Indonesia ya Kati", "SAST": "Saa Wastani za Afrika Kusini", "IST": "Saa Wastani za India", "CAT": "Saa za Afrika ya Kati", "ChST": "Saa Wastani za Chamorro", "MYT": "Saa za Malaysia", "ACDT": "Saa za Mchana za Australia ya Kati", "SRT": "Saa za Suriname", "JST": "Saa Wastani za Japani", "ACWST": "Saa Wastani za Magharibi ya Kati ya Australia", "ACWDT": "Saa za Mchana za Magharibi ya Kati ya Australia", "ART": "Saa Wastani za Ajentina", "TMT": "Saa Wastani za Turkmenistan", "COT": "Saa Wastani za Kolombia", "GMT": "Saa za Greenwich", "CDT": "Saa za Mchana za Kati", "HKT": "Saa Wastani za Hong Kong"},
}
}
diff --git a/sw_UG/sw_UG_test.go b/sw_UG/sw_UG_test.go
new file mode 100644
index 00000000..a42471e0
--- /dev/null
+++ b/sw_UG/sw_UG_test.go
@@ -0,0 +1,1120 @@
+package sw_UG
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "sw_UG"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ta/ta.go b/ta/ta.go
index fcf84671..ccf092ef 100644
--- a/ta/ta.go
+++ b/ta/ta.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"கி.மு.", "கி.பி."},
erasNarrow: []string{"", ""},
erasWide: []string{"கிறிஸ்துவுக்கு முன்", "அன்னோ டோமினி"},
- timezones: map[string]string{"SAST": "தென் ஆப்பிரிக்க நிலையான நேரம்", "WAT": "மேற்கு ஆப்பிரிக்க நிலையான நேரம்", "HKT": "ஹாங்காங் நிலையான நேரம்", "IST": "இந்திய நிலையான நேரம்", "ACST": "ஆஸ்திரேலியன் மத்திய நிலையான நேரம்", "AKST": "அலாஸ்கா நிலையான நேரம்", "EST": "கிழக்கத்திய நிலையான நேரம்", "SGT": "சிங்கப்பூர் நிலையான நேரம்", "GFT": "ஃபிரஞ்சு கயானா நேரம்", "EAT": "கிழக்கு ஆப்பிரிக்க நேரம்", "ART": "அர்ஜென்டினா நிலையான நேரம்", "NZDT": "நியூசிலாந்து பகலொளி நேரம்", "CHADT": "சத்தாம் பகலொளி நேரம்", "AEDT": "ஆஸ்திரேலியன் கிழக்கத்திய பகலொளி நேரம்", "WIT": "கிழக்கத்திய இந்தோனேசியா நேரம்", "JST": "ஜப்பான் நிலையான நேரம்", "JDT": "ஜப்பான் பகலொளி நேரம்", "MESZ": "மத்திய ஐரோப்பிய கோடை நேரம்", "NZST": "நியூசிலாந்து நிலையான நேரம்", "VET": "வெனிசுலா நேரம்", "AST": "அட்லாண்டிக் நிலையான நேரம்", "WAST": "மேற்கு ஆப்பிரிக்கா கோடை நேரம்", "MYT": "மலேஷிய நேரம்", "AWST": "ஆஸ்திரேலியன் மேற்கத்திய நிலையான நேரம்", "AWDT": "ஆஸ்திரேலியன் மேற்கத்திய பகலொளி நேரம்", "MDT": "மவுன்டைன் பகலொளி நேரம்", "WART": "மேற்கத்திய அர்ஜென்டினா நிலையான நேரம்", "ECT": "ஈக்வடார் நேரம்", "ADT": "அட்லாண்டிக் பகலொளி நேரம்", "ARST": "அர்ஜென்டினா கோடை நேரம்", "AKDT": "அலாஸ்கா பகலொளி நேரம்", "MST": "மவுன்டைன் நிலையான நேரம்", "COST": "கொலம்பியா கோடை நேரம்", "LHST": "லார்ட் ஹோவ் நிலையான நேரம்", "CDT": "மத்திய பகலொளி நேரம்", "OESZ": "கிழக்கத்திய ஐரோப்பிய கோடை நேரம்", "GMT": "கிரீன்விச் சராசரி நேரம்", "CHAST": "சத்தாம் நிலையான நேரம்", "HADT": "ஹவாய்-அலேஷியன் பகலொளி நேரம்", "HKST": "ஹாங்காங் கோடை நேரம்", "HNT": "நியூஃபவுண்ட்லாந்து நிலையான நேரம்", "HAT": "நியூஃபவுண்ட்லாந்து பகலொளி நேரம்", "AEST": "ஆஸ்திரேலியன் கிழக்கத்திய நிலையான நேரம்", "BT": "பூடான் நேரம்", "MEZ": "மத்திய ஐரோப்பிய நிலையான நேரம்", "WITA": "மத்திய இந்தோனேசியா நேரம்", "UYST": "உருகுவே கோடை நேரம்", "GYT": "கயானா நேரம்", "WIB": "மேற்கத்திய இந்தோனேசியா நேரம்", "TMT": "துர்க்மெனிஸ்தான் நிலையான நேரம்", "ACWST": "ஆஸ்திரேலியன் மத்திய மேற்கத்திய நிலையான நேரம்", "HAST": "ஹவாய்-அலேஷியன் நிலையான நேரம்", "ACWDT": "ஆஸ்திரேலியன் மத்திய மேற்கத்திய பகலொளி நேரம்", "CST": "மத்திய நிலையான நேரம்", "COT": "கொலம்பியா நிலையான நேரம்", "WARST": "மேற்கத்திய அர்ஜென்டினா கோடை நேரம்", "ACDT": "ஆஸ்திரேலியன் மத்திய பகலொளி நேரம்", "PST": "பசிபிக் நிலையான நேரம்", "PDT": "பசிபிக் பகலொளி நேரம்", "BOT": "பொலிவியா நேரம்", "ChST": "சாமோரோ நிலையான நேரம்", "CAT": "மத்திய ஆப்பிரிக்க நேரம்", "WEZ": "மேற்கத்திய ஐரோப்பிய நிலையான நேரம்", "∅∅∅": "பிரேசிலியா கோடை நேரம்", "OEZ": "கிழக்கத்திய ஐரோப்பிய நிலையான நேரம்", "TMST": "துர்க்மெனிஸ்தான் கோடை நேரம்", "CLT": "சிலி நிலையான நேரம்", "CLST": "சிலி கோடை நேரம்", "UYT": "உருகுவே நிலையான நேரம்", "EDT": "கிழக்கத்திய பகலொளி நேரம்", "LHDT": "லார்ட் ஹோவ் பகலொளி நேரம்", "WESZ": "மேற்கத்திய ஐரோப்பிய கோடை நேரம்", "SRT": "சுரினாம் நேரம்"},
+ timezones: map[string]string{"ADT": "அட்லாண்டிக் பகலொளி நேரம்", "MESZ": "மத்திய ஐரோப்பிய கோடை நேரம்", "WEZ": "மேற்கத்திய ஐரோப்பிய நிலையான நேரம்", "VET": "வெனிசுலா நேரம்", "AST": "அட்லாண்டிக் நிலையான நேரம்", "GYT": "கயானா நேரம்", "CLT": "சிலி நிலையான நேரம்", "WARST": "மேற்கத்திய அர்ஜென்டினா கோடை நேரம்", "CLST": "சிலி கோடை நேரம்", "ACWDT": "ஆஸ்திரேலியன் மத்திய மேற்கத்திய பகலொளி நேரம்", "AWST": "ஆஸ்திரேலியன் மேற்கத்திய நிலையான நேரம்", "ART": "அர்ஜென்டினா நிலையான நேரம்", "WAT": "மேற்கு ஆப்பிரிக்க நிலையான நேரம்", "TMST": "துர்க்மெனிஸ்தான் கோடை நேரம்", "GMT": "கிரீன்விச் சராசரி நேரம்", "MDT": "மவுன்டைன் பகலொளி நேரம்", "SRT": "சுரினாம் நேரம்", "NZDT": "நியூசிலாந்து பகலொளி நேரம்", "COT": "கொலம்பியா நிலையான நேரம்", "BT": "பூடான் நேரம்", "LHST": "லார்ட் ஹோவ் நிலையான நேரம்", "PST": "பசிபிக் நிலையான நேரம்", "HAST": "ஹவாய்-அலேஷியன் நிலையான நேரம்", "LHDT": "லார்ட் ஹோவ் பகலொளி நேரம்", "MYT": "மலேஷிய நேரம்", "WART": "மேற்கத்திய அர்ஜென்டினா நிலையான நேரம்", "CDT": "மத்திய பகலொளி நேரம்", "CHAST": "சத்தாம் நிலையான நேரம்", "WESZ": "மேற்கத்திய ஐரோப்பிய கோடை நேரம்", "HNT": "நியூஃபவுண்ட்லாந்து நிலையான நேரம்", "TMT": "துர்க்மெனிஸ்தான் நிலையான நேரம்", "WIT": "கிழக்கத்திய இந்தோனேசியா நேரம்", "ECT": "ஈக்வடார் நேரம்", "ARST": "அர்ஜென்டினா கோடை நேரம்", "EDT": "கிழக்கத்திய பகலொளி நேரம்", "OESZ": "கிழக்கத்திய ஐரோப்பிய கோடை நேரம்", "EAT": "கிழக்கு ஆப்பிரிக்க நேரம்", "GFT": "ஃபிரஞ்சு கயானா நேரம்", "HKST": "ஹாங்காங் கோடை நேரம்", "HADT": "ஹவாய்-அலேஷியன் பகலொளி நேரம்", "OEZ": "கிழக்கத்திய ஐரோப்பிய நிலையான நேரம்", "UYST": "உருகுவே கோடை நேரம்", "CST": "மத்திய நிலையான நேரம்", "ACST": "ஆஸ்திரேலியன் மத்திய நிலையான நேரம்", "JST": "ஜப்பான் நிலையான நேரம்", "AKST": "அலாஸ்கா நிலையான நேரம்", "EST": "கிழக்கத்திய நிலையான நேரம்", "∅∅∅": "அமேசான் கோடை நேரம்", "HAT": "நியூஃபவுண்ட்லாந்து பகலொளி நேரம்", "CAT": "மத்திய ஆப்பிரிக்க நேரம்", "UYT": "உருகுவே நிலையான நேரம்", "PDT": "பசிபிக் பகலொளி நேரம்", "WIB": "மேற்கத்திய இந்தோனேசியா நேரம்", "AEST": "ஆஸ்திரேலியன் கிழக்கத்திய நிலையான நேரம்", "MST": "மவுன்டைன் நிலையான நேரம்", "HKT": "ஹாங்காங் நிலையான நேரம்", "NZST": "நியூசிலாந்து நிலையான நேரம்", "SGT": "சிங்கப்பூர் நிலையான நேரம்", "JDT": "ஜப்பான் பகலொளி நேரம்", "AKDT": "அலாஸ்கா பகலொளி நேரம்", "COST": "கொலம்பியா கோடை நேரம்", "ACDT": "ஆஸ்திரேலியன் மத்திய பகலொளி நேரம்", "CHADT": "சத்தாம் பகலொளி நேரம்", "ACWST": "ஆஸ்திரேலியன் மத்திய மேற்கத்திய நிலையான நேரம்", "MEZ": "மத்திய ஐரோப்பிய நிலையான நேரம்", "BOT": "பொலிவியா நேரம்", "SAST": "தென் ஆப்பிரிக்க நிலையான நேரம்", "ChST": "சாமோரோ நிலையான நேரம்", "AEDT": "ஆஸ்திரேலியன் கிழக்கத்திய பகலொளி நேரம்", "AWDT": "ஆஸ்திரேலியன் மேற்கத்திய பகலொளி நேரம்", "WITA": "மத்திய இந்தோனேசியா நேரம்", "IST": "இந்திய நிலையான நேரம்", "WAST": "மேற்கு ஆப்பிரிக்கா கோடை நேரம்"},
}
}
diff --git a/ta/ta_test.go b/ta/ta_test.go
new file mode 100644
index 00000000..2cc59d8e
--- /dev/null
+++ b/ta/ta_test.go
@@ -0,0 +1,1120 @@
+package ta
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ta"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ta_IN/ta_IN.go b/ta_IN/ta_IN.go
index d0c7e204..a5d94146 100644
--- a/ta_IN/ta_IN.go
+++ b/ta_IN/ta_IN.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"கி.மு.", "கி.பி."},
erasNarrow: []string{"", ""},
erasWide: []string{"கிறிஸ்துவுக்கு முன்", "அன்னோ டோமினி"},
- timezones: map[string]string{"WAST": "மேற்கு ஆப்பிரிக்கா கோடை நேரம்", "COT": "கொலம்பியா நிலையான நேரம்", "ECT": "ஈக்வடார் நேரம்", "HAST": "ஹவாய்-அலேஷியன் நிலையான நேரம்", "PST": "பசிபிக் நிலையான நேரம்", "PDT": "பசிபிக் பகலொளி நேரம்", "GYT": "கயானா நேரம்", "JDT": "ஜப்பான் பகலொளி நேரம்", "EDT": "கிழக்கத்திய பகலொளி நேரம்", "OEZ": "கிழக்கத்திய ஐரோப்பிய நிலையான நேரம்", "CDT": "மத்திய பகலொளி நேரம்", "VET": "வெனிசுலா நேரம்", "CHAST": "சத்தாம் நிலையான நேரம்", "HADT": "ஹவாய்-அலேஷியன் பகலொளி நேரம்", "GMT": "கிரீன்விச் சராசரி நேரம்", "TMST": "துர்க்மெனிஸ்தான் கோடை நேரம்", "SRT": "சுரினாம் நேரம்", "JST": "ஜப்பான் நிலையான நேரம்", "ACWDT": "ஆஸ்திரேலியன் மத்திய மேற்கத்திய பகலொளி நேரம்", "ChST": "சாமோரோ நிலையான நேரம்", "SGT": "சிங்கப்பூர் நிலையான நேரம்", "IST": "இந்திய நிலையான நேரம்", "ARST": "அர்ஜென்டினா கோடை நேரம்", "EST": "கிழக்கத்திய நிலையான நேரம்", "HKST": "ஹாங்காங் கோடை நேரம்", "EAT": "கிழக்கு ஆப்பிரிக்க நேரம்", "AWDT": "ஆஸ்திரேலியன் மேற்கத்திய பகலொளி நேரம்", "UYST": "உருகுவே கோடை நேரம்", "WART": "மேற்கத்திய அர்ஜென்டினா நிலையான நேரம்", "WARST": "மேற்கத்திய அர்ஜென்டினா கோடை நேரம்", "OESZ": "கிழக்கத்திய ஐரோப்பிய கோடை நேரம்", "HNT": "நியூஃபவுண்ட்லாந்து நிலையான நேரம்", "AKST": "அலாஸ்கா நிலையான நேரம்", "MESZ": "மத்திய ஐரோப்பிய கோடை நேரம்", "UYT": "உருகுவே நிலையான நேரம்", "TMT": "துர்க்மெனிஸ்தான் நிலையான நேரம்", "CHADT": "சத்தாம் பகலொளி நேரம்", "COST": "கொலம்பியா கோடை நேரம்", "ADT": "அட்லாண்டிக் பகலொளி நேரம்", "HKT": "ஹாங்காங் நிலையான நேரம்", "GFT": "ஃபிரஞ்சு கயானா நேரம்", "ACDT": "ஆஸ்திரேலியன் மத்திய பகலொளி நேரம்", "AWST": "ஆஸ்திரேலியன் மேற்கத்திய நிலையான நேரம்", "LHST": "லார்ட் ஹோவ் நிலையான நேரம்", "LHDT": "லார்ட் ஹோவ் பகலொளி நேரம்", "CLST": "சிலி கோடை நேரம்", "WAT": "மேற்கு ஆப்பிரிக்க நிலையான நேரம்", "MDT": "மக்காவ் கோடை நேரம்", "WESZ": "மேற்கத்திய ஐரோப்பிய கோடை நேரம்", "AEST": "ஆஸ்திரேலியன் கிழக்கத்திய நிலையான நேரம்", "WEZ": "மேற்கத்திய ஐரோப்பிய நிலையான நேரம்", "SAST": "தென் ஆப்பிரிக்க நிலையான நேரம்", "BT": "பூடான் நேரம்", "MST": "மக்காவ் தர நேரம்", "ART": "அர்ஜென்டினா நிலையான நேரம்", "MYT": "மலேஷிய நேரம்", "NZST": "நியூசிலாந்து நிலையான நேரம்", "BOT": "பொலிவியா நேரம்", "CLT": "சிலி நிலையான நேரம்", "CAT": "மத்திய ஆப்பிரிக்க நேரம்", "WITA": "மத்திய இந்தோனேசியா நேரம்", "AEDT": "ஆஸ்திரேலியன் கிழக்கத்திய பகலொளி நேரம்", "AST": "அட்லாண்டிக் நிலையான நேரம்", "∅∅∅": "அமேசான் கோடை நேரம்", "CST": "மத்திய நிலையான நேரம்", "HAT": "நியூஃபவுண்ட்லாந்து பகலொளி நேரம்", "ACST": "ஆஸ்திரேலியன் மத்திய நிலையான நேரம்", "AKDT": "அலாஸ்கா பகலொளி நேரம்", "NZDT": "நியூசிலாந்து பகலொளி நேரம்", "WIB": "மேற்கத்திய இந்தோனேசியா நேரம்", "WIT": "கிழக்கத்திய இந்தோனேசியா நேரம்", "MEZ": "மத்திய ஐரோப்பிய நிலையான நேரம்", "ACWST": "ஆஸ்திரேலியன் மத்திய மேற்கத்திய நிலையான நேரம்"},
+ timezones: map[string]string{"AST": "அட்லாண்டிக் நிலையான நேரம்", "SGT": "சிங்கப்பூர் நிலையான நேரம்", "ChST": "சாமோரோ நிலையான நேரம்", "UYT": "உருகுவே நிலையான நேரம்", "VET": "வெனிசுலா நேரம்", "MDT": "மக்காவ் கோடை நேரம்", "TMT": "துர்க்மெனிஸ்தான் நிலையான நேரம்", "BT": "பூடான் நேரம்", "ACST": "ஆஸ்திரேலியன் மத்திய நிலையான நேரம்", "ART": "அர்ஜென்டினா நிலையான நேரம்", "EST": "கிழக்கத்திய நிலையான நேரம்", "SAST": "தென் ஆப்பிரிக்க நிலையான நேரம்", "COST": "கொலம்பியா கோடை நேரம்", "AKDT": "அலாஸ்கா பகலொளி நேரம்", "EAT": "கிழக்கு ஆப்பிரிக்க நேரம்", "WITA": "மத்திய இந்தோனேசியா நேரம்", "HAST": "ஹவாய்-அலேஷியன் நிலையான நேரம்", "∅∅∅": "அமேசான் கோடை நேரம்", "HNT": "நியூஃபவுண்ட்லாந்து நிலையான நேரம்", "AEDT": "ஆஸ்திரேலியன் கிழக்கத்திய பகலொளி நேரம்", "MESZ": "மத்திய ஐரோப்பிய கோடை நேரம்", "WAST": "மேற்கு ஆப்பிரிக்கா கோடை நேரம்", "CAT": "மத்திய ஆப்பிரிக்க நேரம்", "WIT": "கிழக்கத்திய இந்தோனேசியா நேரம்", "ARST": "அர்ஜென்டினா கோடை நேரம்", "IST": "இந்திய நிலையான நேரம்", "BOT": "பொலிவியா நேரம்", "OESZ": "கிழக்கத்திய ஐரோப்பிய கோடை நேரம்", "CLST": "சிலி கோடை நேரம்", "CHADT": "சத்தாம் பகலொளி நேரம்", "ADT": "அட்லாண்டிக் பகலொளி நேரம்", "COT": "கொலம்பியா நிலையான நேரம்", "PST": "பசிபிக் நிலையான நேரம்", "LHDT": "லார்ட் ஹோவ் பகலொளி நேரம்", "NZST": "நியூசிலாந்து நிலையான நேரம்", "WAT": "மேற்கு ஆப்பிரிக்க நிலையான நேரம்", "WEZ": "மேற்கத்திய ஐரோப்பிய நிலையான நேரம்", "MYT": "மலேஷிய நேரம்", "SRT": "சுரினாம் நேரம்", "CST": "மத்திய நிலையான நேரம்", "CHAST": "சத்தாம் நிலையான நேரம்", "AWDT": "ஆஸ்திரேலியன் மேற்கத்திய பகலொளி நேரம்", "PDT": "பசிபிக் பகலொளி நேரம்", "GYT": "கயானா நேரம்", "ACDT": "ஆஸ்திரேலியன் மத்திய பகலொளி நேரம்", "HKST": "ஹாங்காங் கோடை நேரம்", "AKST": "அலாஸ்கா நிலையான நேரம்", "HAT": "நியூஃபவுண்ட்லாந்து பகலொளி நேரம்", "MST": "மக்காவ் தர நேரம்", "MEZ": "மத்திய ஐரோப்பிய நிலையான நேரம்", "NZDT": "நியூசிலாந்து பகலொளி நேரம்", "WESZ": "மேற்கத்திய ஐரோப்பிய கோடை நேரம்", "TMST": "துர்க்மெனிஸ்தான் கோடை நேரம்", "LHST": "லார்ட் ஹோவ் நிலையான நேரம்", "GFT": "ஃபிரஞ்சு கயானா நேரம்", "HKT": "ஹாங்காங் நிலையான நேரம்", "EDT": "கிழக்கத்திய பகலொளி நேரம்", "GMT": "கிரீன்விச் சராசரி நேரம்", "OEZ": "கிழக்கத்திய ஐரோப்பிய நிலையான நேரம்", "CLT": "சிலி நிலையான நேரம்", "ECT": "ஈக்வடார் நேரம்", "ACWST": "ஆஸ்திரேலியன் மத்திய மேற்கத்திய நிலையான நேரம்", "ACWDT": "ஆஸ்திரேலியன் மத்திய மேற்கத்திய பகலொளி நேரம்", "HADT": "ஹவாய்-அலேஷியன் பகலொளி நேரம்", "WART": "மேற்கத்திய அர்ஜென்டினா நிலையான நேரம்", "WARST": "மேற்கத்திய அர்ஜென்டினா கோடை நேரம்", "AWST": "ஆஸ்திரேலியன் மேற்கத்திய நிலையான நேரம்", "JST": "ஜப்பான் நிலையான நேரம்", "JDT": "ஜப்பான் பகலொளி நேரம்", "WIB": "மேற்கத்திய இந்தோனேசியா நேரம்", "AEST": "ஆஸ்திரேலியன் கிழக்கத்திய நிலையான நேரம்", "UYST": "உருகுவே கோடை நேரம்", "CDT": "மத்திய பகலொளி நேரம்"},
}
}
diff --git a/ta_IN/ta_IN_test.go b/ta_IN/ta_IN_test.go
new file mode 100644
index 00000000..931757d5
--- /dev/null
+++ b/ta_IN/ta_IN_test.go
@@ -0,0 +1,1120 @@
+package ta_IN
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ta_IN"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ta_LK/ta_LK.go b/ta_LK/ta_LK.go
index 64759557..ffe7f9a2 100644
--- a/ta_LK/ta_LK.go
+++ b/ta_LK/ta_LK.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"கி.மு.", "கி.பி."},
erasNarrow: []string{"", ""},
erasWide: []string{"கிறிஸ்துவுக்கு முன்", "அன்னோ டோமினி"},
- timezones: map[string]string{"WAST": "மேற்கு ஆப்பிரிக்கா கோடை நேரம்", "OEZ": "கிழக்கத்திய ஐரோப்பிய நிலையான நேரம்", "ART": "அர்ஜென்டினா நிலையான நேரம்", "ACWDT": "ஆஸ்திரேலியன் மத்திய மேற்கத்திய பகலொளி நேரம்", "AEDT": "ஆஸ்திரேலியன் கிழக்கத்திய பகலொளி நேரம்", "AST": "அட்லாண்டிக் நிலையான நேரம்", "WARST": "மேற்கத்திய அர்ஜென்டினா கோடை நேரம்", "WESZ": "மேற்கத்திய ஐரோப்பிய கோடை நேரம்", "MST": "மக்காவ் தர நேரம்", "JDT": "ஜப்பான் பகலொளி நேரம்", "UYT": "உருகுவே நிலையான நேரம்", "CLST": "சிலி கோடை நேரம்", "ACWST": "ஆஸ்திரேலியன் மத்திய மேற்கத்திய நிலையான நேரம்", "WART": "மேற்கத்திய அர்ஜென்டினா நிலையான நேரம்", "HNT": "நியூஃபவுண்ட்லாந்து நிலையான நேரம்", "TMST": "துர்க்மெனிஸ்தான் கோடை நேரம்", "PDT": "பசிபிக் பகலொளி நேரம்", "NZST": "நியூசிலாந்து நிலையான நேரம்", "EST": "கிழக்கத்திய நிலையான நேரம்", "∅∅∅": "அக்ரே கோடை நேரம்", "WITA": "மத்திய இந்தோனேசியா நேரம்", "COT": "கொலம்பியா நிலையான நேரம்", "WAT": "மேற்கு ஆப்பிரிக்க நிலையான நேரம்", "HKT": "ஹாங்காங் நிலையான நேரம்", "AKST": "அலாஸ்கா நிலையான நேரம்", "AKDT": "அலாஸ்கா பகலொளி நேரம்", "ACST": "ஆஸ்திரேலியன் மத்திய நிலையான நேரம்", "ACDT": "ஆஸ்திரேலியன் மத்திய பகலொளி நேரம்", "MDT": "மக்காவ் கோடை நேரம்", "EDT": "கிழக்கத்திய பகலொளி நேரம்", "IST": "இந்திய நிலையான நேரம்", "GMT": "கிரீன்விச் சராசரி நேரம்", "AWST": "ஆஸ்திரேலியன் மேற்கத்திய நிலையான நேரம்", "AWDT": "ஆஸ்திரேலியன் மேற்கத்திய பகலொளி நேரம்", "MESZ": "மத்திய ஐரோப்பிய கோடை நேரம்", "SAST": "தென் ஆப்பிரிக்க நிலையான நேரம்", "OESZ": "கிழக்கத்திய ஐரோப்பிய கோடை நேரம்", "WIT": "கிழக்கத்திய இந்தோனேசியா நேரம்", "HAT": "நியூஃபவுண்ட்லாந்து பகலொளி நேரம்", "PST": "பசிபிக் நிலையான நேரம்", "CST": "மத்திய நிலையான நேரம்", "MEZ": "மத்திய ஐரோப்பிய நிலையான நேரம்", "NZDT": "நியூசிலாந்து பகலொளி நேரம்", "SGT": "சிங்கப்பூர் நிலையான நேரம்", "HKST": "ஹாங்காங் கோடை நேரம்", "ECT": "ஈக்வடார் நேரம்", "TMT": "துர்க்மெனிஸ்தான் நிலையான நேரம்", "EAT": "கிழக்கு ஆப்பிரிக்க நேரம்", "GYT": "கயானா நேரம்", "MYT": "மலேஷிய நேரம்", "BOT": "பொலிவியா நேரம்", "HADT": "ஹவாய்-அலேஷியன் பகலொளி நேரம்", "GFT": "ஃபிரஞ்சு கயானா நேரம்", "VET": "வெனிசுலா நேரம்", "SRT": "சுரினாம் நேரம்", "UYST": "உருகுவே கோடை நேரம்", "CDT": "மத்திய பகலொளி நேரம்", "ADT": "அட்லாண்டிக் பகலொளி நேரம்", "JST": "ஜப்பான் நிலையான நேரம்", "ChST": "சாமோரோ நிலையான நேரம்", "LHDT": "லார்ட் ஹோவ் பகலொளி நேரம்", "HAST": "ஹவாய்-அலேஷியன் நிலையான நேரம்", "WIB": "மேற்கத்திய இந்தோனேசியா நேரம்", "CHADT": "சத்தாம் பகலொளி நேரம்", "CAT": "மத்திய ஆப்பிரிக்க நேரம்", "ARST": "அர்ஜென்டினா கோடை நேரம்", "LHST": "லார்ட் ஹோவ் நிலையான நேரம்", "CLT": "சிலி நிலையான நேரம்", "WEZ": "மேற்கத்திய ஐரோப்பிய நிலையான நேரம்", "AEST": "ஆஸ்திரேலியன் கிழக்கத்திய நிலையான நேரம்", "COST": "கொலம்பியா கோடை நேரம்", "BT": "பூடான் நேரம்", "CHAST": "சத்தாம் நிலையான நேரம்"},
+ timezones: map[string]string{"CDT": "மத்திய பகலொளி நேரம்", "CHAST": "சத்தாம் நிலையான நேரம்", "AKST": "அலாஸ்கா நிலையான நேரம்", "ADT": "அட்லாண்டிக் பகலொளி நேரம்", "SAST": "தென் ஆப்பிரிக்க நிலையான நேரம்", "EAT": "கிழக்கு ஆப்பிரிக்க நேரம்", "LHST": "லார்ட் ஹோவ் நிலையான நேரம்", "WITA": "மத்திய இந்தோனேசியா நேரம்", "EDT": "கிழக்கத்திய பகலொளி நேரம்", "SGT": "சிங்கப்பூர் நிலையான நேரம்", "OEZ": "கிழக்கத்திய ஐரோப்பிய நிலையான நேரம்", "LHDT": "லார்ட் ஹோவ் பகலொளி நேரம்", "SRT": "சுரினாம் நேரம்", "MDT": "மக்காவ் கோடை நேரம்", "VET": "வெனிசுலா நேரம்", "ACWST": "ஆஸ்திரேலியன் மத்திய மேற்கத்திய நிலையான நேரம்", "ART": "அர்ஜென்டினா நிலையான நேரம்", "IST": "இந்திய நிலையான நேரம்", "WIT": "கிழக்கத்திய இந்தோனேசியா நேரம்", "PDT": "பசிபிக் பகலொளி நேரம்", "MEZ": "மத்திய ஐரோப்பிய நிலையான நேரம்", "WESZ": "மேற்கத்திய ஐரோப்பிய கோடை நேரம்", "GMT": "கிரீன்விச் சராசரி நேரம்", "ACST": "ஆஸ்திரேலியன் மத்திய நிலையான நேரம்", "ECT": "ஈக்வடார் நேரம்", "BOT": "பொலிவியா நேரம்", "HNT": "நியூஃபவுண்ட்லாந்து நிலையான நேரம்", "HAT": "நியூஃபவுண்ட்லாந்து பகலொளி நேரம்", "AEDT": "ஆஸ்திரேலியன் கிழக்கத்திய பகலொளி நேரம்", "UYT": "உருகுவே நிலையான நேரம்", "WART": "மேற்கத்திய அர்ஜென்டினா நிலையான நேரம்", "AWST": "ஆஸ்திரேலியன் மேற்கத்திய நிலையான நேரம்", "AWDT": "ஆஸ்திரேலியன் மேற்கத்திய பகலொளி நேரம்", "PST": "பசிபிக் நிலையான நேரம்", "∅∅∅": "அமேசான் கோடை நேரம்", "OESZ": "கிழக்கத்திய ஐரோப்பிய கோடை நேரம்", "CHADT": "சத்தாம் பகலொளி நேரம்", "JST": "ஜப்பான் நிலையான நேரம்", "MYT": "மலேஷிய நேரம்", "WARST": "மேற்கத்திய அர்ஜென்டினா கோடை நேரம்", "WAT": "மேற்கு ஆப்பிரிக்க நிலையான நேரம்", "WAST": "மேற்கு ஆப்பிரிக்கா கோடை நேரம்", "COT": "கொலம்பியா நிலையான நேரம்", "WIB": "மேற்கத்திய இந்தோனேசியா நேரம்", "CLT": "சிலி நிலையான நேரம்", "BT": "பூடான் நேரம்", "HKT": "ஹாங்காங் நிலையான நேரம்", "AST": "அட்லாண்டிக் நிலையான நேரம்", "JDT": "ஜப்பான் பகலொளி நேரம்", "HADT": "ஹவாய்-அலேஷியன் பகலொளி நேரம்", "ChST": "சாமோரோ நிலையான நேரம்", "GYT": "கயானா நேரம்", "MESZ": "மத்திய ஐரோப்பிய கோடை நேரம்", "NZST": "நியூசிலாந்து நிலையான நேரம்", "WEZ": "மேற்கத்திய ஐரோப்பிய நிலையான நேரம்", "COST": "கொலம்பியா கோடை நேரம்", "TMST": "துர்க்மெனிஸ்தான் கோடை நேரம்", "GFT": "ஃபிரஞ்சு கயானா நேரம்", "EST": "கிழக்கத்திய நிலையான நேரம்", "MST": "மக்காவ் தர நேரம்", "AKDT": "அலாஸ்கா பகலொளி நேரம்", "AEST": "ஆஸ்திரேலியன் கிழக்கத்திய நிலையான நேரம்", "CST": "மத்திய நிலையான நேரம்", "ACWDT": "ஆஸ்திரேலியன் மத்திய மேற்கத்திய பகலொளி நேரம்", "HAST": "ஹவாய்-அலேஷியன் நிலையான நேரம்", "NZDT": "நியூசிலாந்து பகலொளி நேரம்", "CLST": "சிலி கோடை நேரம்", "HKST": "ஹாங்காங் கோடை நேரம்", "ARST": "அர்ஜென்டினா கோடை நேரம்", "CAT": "மத்திய ஆப்பிரிக்க நேரம்", "TMT": "துர்க்மெனிஸ்தான் நிலையான நேரம்", "UYST": "உருகுவே கோடை நேரம்", "ACDT": "ஆஸ்திரேலியன் மத்திய பகலொளி நேரம்"},
}
}
diff --git a/ta_LK/ta_LK_test.go b/ta_LK/ta_LK_test.go
new file mode 100644
index 00000000..5540fc50
--- /dev/null
+++ b/ta_LK/ta_LK_test.go
@@ -0,0 +1,1120 @@
+package ta_LK
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ta_LK"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ta_MY/ta_MY.go b/ta_MY/ta_MY.go
index d8f1c155..d45e8b81 100644
--- a/ta_MY/ta_MY.go
+++ b/ta_MY/ta_MY.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"கி.மு.", "கி.பி."},
erasNarrow: []string{"", ""},
erasWide: []string{"கிறிஸ்துவுக்கு முன்", "அன்னோ டோமினி"},
- timezones: map[string]string{"WARST": "மேற்கத்திய அர்ஜென்டினா கோடை நேரம்", "TMST": "துர்க்மெனிஸ்தான் கோடை நேரம்", "AKST": "அலாஸ்கா நிலையான நேரம்", "VET": "வெனிசுலா நேரம்", "EST": "கிழக்கத்திய நிலையான நேரம்", "EDT": "கிழக்கத்திய பகலொளி நேரம்", "SAST": "தென் ஆப்பிரிக்க நிலையான நேரம்", "UYST": "உருகுவே கோடை நேரம்", "MDT": "மவுன்டைன் பகலொளி நேரம்", "COST": "கொலம்பியா கோடை நேரம்", "CLST": "சிலி கோடை நேரம்", "PDT": "பசிபிக் பகலொளி நேரம்", "SGT": "சிங்கப்பூர் நிலையான நேரம்", "HAST": "ஹவாய்-அலேஷியன் நிலையான நேரம்", "HKT": "ஹாங்காங் நிலையான நேரம்", "HNT": "நியூஃபவுண்ட்லாந்து நிலையான நேரம்", "AWDT": "ஆஸ்திரேலியன் மேற்கத்திய பகலொளி நேரம்", "LHST": "லார்ட் ஹோவ் நிலையான நேரம்", "ACWST": "ஆஸ்திரேலியன் மத்திய மேற்கத்திய நிலையான நேரம்", "CAT": "மத்திய ஆப்பிரிக்க நேரம்", "JST": "ஜப்பான் நிலையான நேரம்", "AKDT": "அலாஸ்கா பகலொளி நேரம்", "MEZ": "மத்திய ஐரோப்பிய நிலையான நேரம்", "MESZ": "மத்திய ஐரோப்பிய கோடை நேரம்", "ACWDT": "ஆஸ்திரேலியன் மத்திய மேற்கத்திய பகலொளி நேரம்", "EAT": "கிழக்கு ஆப்பிரிக்க நேரம்", "ECT": "ஈக்வடார் நேரம்", "AEDT": "ஆஸ்திரேலியன் கிழக்கத்திய பகலொளி நேரம்", "ChST": "சாமோரோ நிலையான நேரம்", "COT": "கொலம்பியா நிலையான நேரம்", "ART": "அர்ஜென்டினா நிலையான நேரம்", "ARST": "அர்ஜென்டினா கோடை நேரம்", "JDT": "ஜப்பான் பகலொளி நேரம்", "CDT": "மத்திய பகலொளி நேரம்", "CHADT": "சத்தாம் பகலொளி நேரம்", "WEZ": "மேற்கத்திய ஐரோப்பிய நிலையான நேரம்", "NZDT": "நியூசிலாந்து பகலொளி நேரம்", "ACDT": "ஆஸ்திரேலியன் மத்திய பகலொளி நேரம்", "LHDT": "லார்ட் ஹோவ் பகலொளி நேரம்", "AST": "அட்லாண்டிக் நிலையான நேரம்", "ACST": "ஆஸ்திரேலியன் மத்திய நிலையான நேரம்", "WAT": "மேற்கு ஆப்பிரிக்க நிலையான நேரம்", "HAT": "நியூஃபவுண்ட்லாந்து பகலொளி நேரம்", "WIB": "மேற்கத்திய இந்தோனேசியா நேரம்", "ADT": "அட்லாண்டிக் பகலொளி நேரம்", "WART": "மேற்கத்திய அர்ஜென்டினா நிலையான நேரம்", "TMT": "துர்க்மெனிஸ்தான் நிலையான நேரம்", "BOT": "பொலிவியா நேரம்", "CHAST": "சத்தாம் நிலையான நேரம்", "WITA": "மத்திய இந்தோனேசியா நேரம்", "OESZ": "கிழக்கத்திய ஐரோப்பிய கோடை நேரம்", "AWST": "ஆஸ்திரேலியன் மேற்கத்திய நிலையான நேரம்", "GYT": "கயானா நேரம்", "MYT": "மலேஷிய நேரம்", "SRT": "சுரினாம் நேரம்", "CST": "மத்திய நிலையான நேரம்", "CLT": "சிலி நிலையான நேரம்", "IST": "இந்திய நிலையான நேரம்", "OEZ": "கிழக்கத்திய ஐரோப்பிய நிலையான நேரம்", "NZST": "நியூசிலாந்து நிலையான நேரம்", "MST": "மவுன்டைன் நிலையான நேரம்", "HADT": "ஹவாய்-அலேஷியன் பகலொளி நேரம்", "AEST": "ஆஸ்திரேலியன் கிழக்கத்திய நிலையான நேரம்", "PST": "பசிபிக் நிலையான நேரம்", "GMT": "கிரீன்விச் சராசரி நேரம்", "UYT": "உருகுவே நிலையான நேரம்", "∅∅∅": "பிரேசிலியா கோடை நேரம்", "HKST": "ஹாங்காங் கோடை நேரம்", "WAST": "மேற்கு ஆப்பிரிக்கா கோடை நேரம்", "GFT": "ஃபிரஞ்சு கயானா நேரம்", "WIT": "கிழக்கத்திய இந்தோனேசியா நேரம்", "WESZ": "மேற்கத்திய ஐரோப்பிய கோடை நேரம்", "BT": "பூடான் நேரம்"},
+ timezones: map[string]string{"SGT": "சிங்கப்பூர் நிலையான நேரம்", "GYT": "கயானா நேரம்", "JST": "ஜப்பான் நிலையான நேரம்", "EST": "கிழக்கத்திய நிலையான நேரம்", "PDT": "பசிபிக் பகலொளி நேரம்", "OEZ": "கிழக்கத்திய ஐரோப்பிய நிலையான நேரம்", "OESZ": "கிழக்கத்திய ஐரோப்பிய கோடை நேரம்", "CHADT": "சத்தாம் பகலொளி நேரம்", "ARST": "அர்ஜென்டினா கோடை நேரம்", "HKT": "ஹாங்காங் நிலையான நேரம்", "PST": "பசிபிக் நிலையான நேரம்", "WIT": "கிழக்கத்திய இந்தோனேசியா நேரம்", "SRT": "சுரினாம் நேரம்", "ECT": "ஈக்வடார் நேரம்", "HNT": "நியூஃபவுண்ட்லாந்து நிலையான நேரம்", "ACWDT": "ஆஸ்திரேலியன் மத்திய மேற்கத்திய பகலொளி நேரம்", "∅∅∅": "அமேசான் கோடை நேரம்", "WARST": "மேற்கத்திய அர்ஜென்டினா கோடை நேரம்", "GFT": "ஃபிரஞ்சு கயானா நேரம்", "HKST": "ஹாங்காங் கோடை நேரம்", "WART": "மேற்கத்திய அர்ஜென்டினா நிலையான நேரம்", "UYST": "உருகுவே கோடை நேரம்", "VET": "வெனிசுலா நேரம்", "SAST": "தென் ஆப்பிரிக்க நிலையான நேரம்", "MEZ": "மத்திய ஐரோப்பிய நிலையான நேரம்", "COST": "கொலம்பியா கோடை நேரம்", "TMST": "துர்க்மெனிஸ்தான் கோடை நேரம்", "AWST": "ஆஸ்திரேலியன் மேற்கத்திய நிலையான நேரம்", "AWDT": "ஆஸ்திரேலியன் மேற்கத்திய பகலொளி நேரம்", "NZDT": "நியூசிலாந்து பகலொளி நேரம்", "EAT": "கிழக்கு ஆப்பிரிக்க நேரம்", "BT": "பூடான் நேரம்", "ACDT": "ஆஸ்திரேலியன் மத்திய பகலொளி நேரம்", "ADT": "அட்லாண்டிக் பகலொளி நேரம்", "ACWST": "ஆஸ்திரேலியன் மத்திய மேற்கத்திய நிலையான நேரம்", "WEZ": "மேற்கத்திய ஐரோப்பிய நிலையான நேரம்", "MYT": "மலேஷிய நேரம்", "ACST": "ஆஸ்திரேலியன் மத்திய நிலையான நேரம்", "WITA": "மத்திய இந்தோனேசியா நேரம்", "JDT": "ஜப்பான் பகலொளி நேரம்", "HADT": "ஹவாய்-அலேஷியன் பகலொளி நேரம்", "IST": "இந்திய நிலையான நேரம்", "TMT": "துர்க்மெனிஸ்தான் நிலையான நேரம்", "WAST": "மேற்கு ஆப்பிரிக்கா கோடை நேரம்", "HAT": "நியூஃபவுண்ட்லாந்து பகலொளி நேரம்", "ChST": "சாமோரோ நிலையான நேரம்", "MST": "மக்காவ் தர நேரம்", "CHAST": "சத்தாம் நிலையான நேரம்", "LHST": "லார்ட் ஹோவ் நிலையான நேரம்", "CST": "மத்திய நிலையான நேரம்", "WIB": "மேற்கத்திய இந்தோனேசியா நேரம்", "MDT": "மக்காவ் கோடை நேரம்", "MESZ": "மத்திய ஐரோப்பிய கோடை நேரம்", "WESZ": "மேற்கத்திய ஐரோப்பிய கோடை நேரம்", "GMT": "கிரீன்விச் சராசரி நேரம்", "AKST": "அலாஸ்கா நிலையான நேரம்", "AKDT": "அலாஸ்கா பகலொளி நேரம்", "COT": "கொலம்பியா நிலையான நேரம்", "CAT": "மத்திய ஆப்பிரிக்க நேரம்", "UYT": "உருகுவே நிலையான நேரம்", "LHDT": "லார்ட் ஹோவ் பகலொளி நேரம்", "ART": "அர்ஜென்டினா நிலையான நேரம்", "AST": "அட்லாண்டிக் நிலையான நேரம்", "AEDT": "ஆஸ்திரேலியன் கிழக்கத்திய பகலொளி நேரம்", "CLST": "சிலி கோடை நேரம்", "BOT": "பொலிவியா நேரம்", "AEST": "ஆஸ்திரேலியன் கிழக்கத்திய நிலையான நேரம்", "EDT": "கிழக்கத்திய பகலொளி நேரம்", "WAT": "மேற்கு ஆப்பிரிக்க நிலையான நேரம்", "CLT": "சிலி நிலையான நேரம்", "CDT": "மத்திய பகலொளி நேரம்", "HAST": "ஹவாய்-அலேஷியன் நிலையான நேரம்", "NZST": "நியூசிலாந்து நிலையான நேரம்"},
}
}
diff --git a/ta_MY/ta_MY_test.go b/ta_MY/ta_MY_test.go
new file mode 100644
index 00000000..ae1e12f3
--- /dev/null
+++ b/ta_MY/ta_MY_test.go
@@ -0,0 +1,1120 @@
+package ta_MY
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ta_MY"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ta_SG/ta_SG.go b/ta_SG/ta_SG.go
index e7f09e67..0566f20b 100644
--- a/ta_SG/ta_SG.go
+++ b/ta_SG/ta_SG.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"கி.மு.", "கி.பி."},
erasNarrow: []string{"", ""},
erasWide: []string{"கிறிஸ்துவுக்கு முன்", "அன்னோ டோமினி"},
- timezones: map[string]string{"MDT": "மக்காவ் கோடை நேரம்", "ACDT": "ஆஸ்திரேலியன் மத்திய பகலொளி நேரம்", "AEDT": "ஆஸ்திரேலியன் கிழக்கத்திய பகலொளி நேரம்", "BT": "பூடான் நேரம்", "GMT": "கிரீன்விச் சராசரி நேரம்", "HNT": "நியூஃபவுண்ட்லாந்து நிலையான நேரம்", "GFT": "ஃபிரஞ்சு கயானா நேரம்", "TMT": "துர்க்மெனிஸ்தான் நிலையான நேரம்", "ChST": "சாமோரோ நிலையான நேரம்", "ART": "அர்ஜென்டினா நிலையான நேரம்", "WAT": "மேற்கு ஆப்பிரிக்க நிலையான நேரம்", "ARST": "அர்ஜென்டினா கோடை நேரம்", "PDT": "பசிபிக் பகலொளி நேரம்", "GYT": "கயானா நேரம்", "JDT": "ஜப்பான் பகலொளி நேரம்", "CST": "மத்திய நிலையான நேரம்", "WEZ": "மேற்கத்திய ஐரோப்பிய நிலையான நேரம்", "WART": "மேற்கத்திய அர்ஜென்டினா நிலையான நேரம்", "AWST": "ஆஸ்திரேலியன் மேற்கத்திய நிலையான நேரம்", "UYT": "உருகுவே நிலையான நேரம்", "CAT": "மத்திய ஆப்பிரிக்க நேரம்", "COST": "கொலம்பியா கோடை நேரம்", "ECT": "ஈக்வடார் நேரம்", "AST": "அட்லாண்டிக் நிலையான நேரம்", "ACST": "ஆஸ்திரேலியன் மத்திய நிலையான நேரம்", "AWDT": "ஆஸ்திரேலியன் மேற்கத்திய பகலொளி நேரம்", "MESZ": "மத்திய ஐரோப்பிய கோடை நேரம்", "VET": "வெனிசுலா நேரம்", "EST": "கிழக்கத்திய நிலையான நேரம்", "EDT": "கிழக்கத்திய பகலொளி நேரம்", "ADT": "அட்லாண்டிக் பகலொளி நேரம்", "JST": "ஜப்பான் நிலையான நேரம்", "CHADT": "சத்தாம் பகலொளி நேரம்", "CLST": "சிலி கோடை நேரம்", "TMST": "துர்க்மெனிஸ்தான் கோடை நேரம்", "HKST": "ஹாங்காங் கோடை நேரம்", "OESZ": "கிழக்கத்திய ஐரோப்பிய கோடை நேரம்", "AKDT": "அலாஸ்கா பகலொளி நேரம்", "PST": "பசிபிக் நிலையான நேரம்", "ACWDT": "ஆஸ்திரேலியன் மத்திய மேற்கத்திய பகலொளி நேரம்", "WARST": "மேற்கத்திய அர்ஜென்டினா கோடை நேரம்", "MYT": "மலேஷிய நேரம்", "UYST": "உருகுவே கோடை நேரம்", "SAST": "தென் ஆப்பிரிக்க நிலையான நேரம்", "LHST": "லார்ட் ஹோவ் நிலையான நேரம்", "SRT": "சுரினாம் நேரம்", "ACWST": "ஆஸ்திரேலியன் மத்திய மேற்கத்திய நிலையான நேரம்", "HADT": "ஹவாய்-அலேஷியன் பகலொளி நேரம்", "SGT": "சிங்கப்பூர் நிலையான நேரம்", "WAST": "மேற்கு ஆப்பிரிக்கா கோடை நேரம்", "IST": "இந்திய நிலையான நேரம்", "HAT": "நியூஃபவுண்ட்லாந்து பகலொளி நேரம்", "WIT": "கிழக்கத்திய இந்தோனேசியா நேரம்", "EAT": "கிழக்கு ஆப்பிரிக்க நேரம்", "MEZ": "மத்திய ஐரோப்பிய நிலையான நேரம்", "WESZ": "மேற்கத்திய ஐரோப்பிய கோடை நேரம்", "AEST": "ஆஸ்திரேலியன் கிழக்கத்திய நிலையான நேரம்", "COT": "கொலம்பியா நிலையான நேரம்", "OEZ": "கிழக்கத்திய ஐரோப்பிய நிலையான நேரம்", "∅∅∅": "அமேசான் கோடை நேரம்", "BOT": "பொலிவியா நேரம்", "WIB": "மேற்கத்திய இந்தோனேசியா நேரம்", "MST": "மக்காவ் தர நேரம்", "LHDT": "லார்ட் ஹோவ் பகலொளி நேரம்", "HKT": "ஹாங்காங் நிலையான நேரம்", "CDT": "மத்திய பகலொளி நேரம்", "NZDT": "நியூசிலாந்து பகலொளி நேரம்", "CLT": "சிலி நிலையான நேரம்", "HAST": "ஹவாய்-அலேஷியன் நிலையான நேரம்", "WITA": "மத்திய இந்தோனேசியா நேரம்", "AKST": "அலாஸ்கா நிலையான நேரம்", "NZST": "நியூசிலாந்து நிலையான நேரம்", "CHAST": "சத்தாம் நிலையான நேரம்"},
+ timezones: map[string]string{"MEZ": "மத்திய ஐரோப்பிய நிலையான நேரம்", "WIB": "மேற்கத்திய இந்தோனேசியா நேரம்", "OESZ": "கிழக்கத்திய ஐரோப்பிய கோடை நேரம்", "WART": "மேற்கத்திய அர்ஜென்டினா நிலையான நேரம்", "ACWST": "ஆஸ்திரேலியன் மத்திய மேற்கத்திய நிலையான நேரம்", "ACWDT": "ஆஸ்திரேலியன் மத்திய மேற்கத்திய பகலொளி நேரம்", "AST": "அட்லாண்டிக் நிலையான நேரம்", "AWST": "ஆஸ்திரேலியன் மேற்கத்திய நிலையான நேரம்", "PST": "பசிபிக் நிலையான நேரம்", "WAST": "மேற்கு ஆப்பிரிக்கா கோடை நேரம்", "SGT": "சிங்கப்பூர் நிலையான நேரம்", "TMT": "துர்க்மெனிஸ்தான் நிலையான நேரம்", "GYT": "கயானா நேரம்", "LHST": "லார்ட் ஹோவ் நிலையான நேரம்", "EST": "கிழக்கத்திய நிலையான நேரம்", "HNT": "நியூஃபவுண்ட்லாந்து நிலையான நேரம்", "ChST": "சாமோரோ நிலையான நேரம்", "GFT": "ஃபிரஞ்சு கயானா நேரம்", "AKST": "அலாஸ்கா நிலையான நேரம்", "NZST": "நியூசிலாந்து நிலையான நேரம்", "AEST": "ஆஸ்திரேலியன் கிழக்கத்திய நிலையான நேரம்", "CLST": "சிலி கோடை நேரம்", "HKST": "ஹாங்காங் கோடை நேரம்", "ADT": "அட்லாண்டிக் பகலொளி நேரம்", "BOT": "பொலிவியா நேரம்", "HAT": "நியூஃபவுண்ட்லாந்து பகலொளி நேரம்", "MST": "மவுன்டைன் நிலையான நேரம்", "MDT": "மவுன்டைன் பகலொளி நேரம்", "UYT": "உருகுவே நிலையான நேரம்", "ACST": "ஆஸ்திரேலியன் மத்திய நிலையான நேரம்", "MESZ": "மத்திய ஐரோப்பிய கோடை நேரம்", "HAST": "ஹவாய்-அலேஷியன் நிலையான நேரம்", "COT": "கொலம்பியா நிலையான நேரம்", "EDT": "கிழக்கத்திய பகலொளி நேரம்", "WAT": "மேற்கு ஆப்பிரிக்க நிலையான நேரம்", "BT": "பூடான் நேரம்", "UYST": "உருகுவே கோடை நேரம்", "WARST": "மேற்கத்திய அர்ஜென்டினா கோடை நேரம்", "ARST": "அர்ஜென்டினா கோடை நேரம்", "OEZ": "கிழக்கத்திய ஐரோப்பிய நிலையான நேரம்", "AEDT": "ஆஸ்திரேலியன் கிழக்கத்திய பகலொளி நேரம்", "EAT": "கிழக்கு ஆப்பிரிக்க நேரம்", "ACDT": "ஆஸ்திரேலியன் மத்திய பகலொளி நேரம்", "SAST": "தென் ஆப்பிரிக்க நிலையான நேரம்", "WESZ": "மேற்கத்திய ஐரோப்பிய கோடை நேரம்", "HKT": "ஹாங்காங் நிலையான நேரம்", "CHADT": "சத்தாம் பகலொளி நேரம்", "AKDT": "அலாஸ்கா பகலொளி நேரம்", "AWDT": "ஆஸ்திரேலியன் மேற்கத்திய பகலொளி நேரம்", "ART": "அர்ஜென்டினா நிலையான நேரம்", "CAT": "மத்திய ஆப்பிரிக்க நேரம்", "TMST": "துர்க்மெனிஸ்தான் கோடை நேரம்", "GMT": "கிரீன்விச் சராசரி நேரம்", "WIT": "கிழக்கத்திய இந்தோனேசியா நேரம்", "CST": "மத்திய நிலையான நேரம்", "ECT": "ஈக்வடார் நேரம்", "WITA": "மத்திய இந்தோனேசியா நேரம்", "WEZ": "மேற்கத்திய ஐரோப்பிய நிலையான நேரம்", "CLT": "சிலி நிலையான நேரம்", "CDT": "மத்திய பகலொளி நேரம்", "CHAST": "சத்தாம் நிலையான நேரம்", "PDT": "பசிபிக் பகலொளி நேரம்", "IST": "இந்திய நிலையான நேரம்", "HADT": "ஹவாய்-அலேஷியன் பகலொளி நேரம்", "NZDT": "நியூசிலாந்து பகலொளி நேரம்", "COST": "கொலம்பியா கோடை நேரம்", "MYT": "மலேஷிய நேரம்", "SRT": "சுரினாம் நேரம்", "VET": "வெனிசுலா நேரம்", "JST": "ஜப்பான் நிலையான நேரம்", "∅∅∅": "அமேசான் கோடை நேரம்", "LHDT": "லார்ட் ஹோவ் பகலொளி நேரம்", "JDT": "ஜப்பான் பகலொளி நேரம்"},
}
}
diff --git a/ta_SG/ta_SG_test.go b/ta_SG/ta_SG_test.go
new file mode 100644
index 00000000..2bbfcbb5
--- /dev/null
+++ b/ta_SG/ta_SG_test.go
@@ -0,0 +1,1120 @@
+package ta_SG
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ta_SG"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/te/te.go b/te/te.go
index 8a4f8594..7112f2f1 100644
--- a/te/te.go
+++ b/te/te.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"క్రీపూ", "క్రీశ"},
erasNarrow: []string{"", ""},
erasWide: []string{"క్రీస్తు పూర్వం", "క్రీస్తు శకం"},
- timezones: map[string]string{"WART": "పశ్చిమ అర్జెంటీనా ప్రామాణిక సమయం", "∅∅∅": "అమెజాన్ వేసవి సమయం", "MDT": "మకావ్ వేసవి సమయం", "EST": "తూర్పు ప్రామాణిక సమయం", "CAT": "సెంట్రల్ ఆఫ్రికా సమయం", "MEZ": "సెంట్రల్ యూరోపియన్ ప్రామాణిక సమయం", "NZST": "న్యూజిల్యాండ్ ప్రామాణిక సమయం", "NZDT": "న్యూజిల్యాండ్ పగటి వెలుతురు సమయం", "CLST": "చిలీ వేసవి సమయం", "AST": "అట్లాంటిక్ ప్రామాణిక సమయం", "ARST": "ఆర్జెంటీనా వేసవి సమయం", "LHST": "లార్డ్ హోవ్ ప్రామాణిక సమయం", "UYST": "ఉరుగ్వే వేసవి సమయం", "SGT": "సింగపూర్ ప్రామాణిక సమయం", "PST": "పసిఫిక్ ప్రామాణిక సమయం", "UYT": "ఉరుగ్వే ప్రామాణిక సమయం", "CLT": "చిలీ ప్రామాణిక సమయం", "ACWDT": "మధ్యమ ఆస్ట్రేలియన్ పశ్చిమ పగటి సమయం", "AEST": "తూర్పు ఆస్ట్రేలియా ప్రామాణిక సమయం", "ART": "అర్జెంటీనా ప్రామాణిక సమయం", "MST": "మకావ్ ప్రామాణిక సమయం", "SRT": "సూరినామ్ సమయం", "ChST": "చామర్రో ప్రామాణిక సమయం", "OEZ": "తూర్పు యూరోపియన్ ప్రామాణిక సమయం", "OESZ": "తూర్పు యూరోపియన్ వేసవి సమయం", "GMT": "గ్రీన్\u200cవిచ్ సగటు సమయం", "TMT": "తుర్క్మెనిస్థాన్ ప్రామాణిక సమయం", "JST": "జపాన్ ప్రామాణిక సమయం", "HNT": "న్యూఫౌండ్ ల్యాండ్ ప్రామాణిక సమయం", "HAT": "న్యూఫౌండ్ ల్యాండ్ పగటి సమయం", "IST": "భారతదేశ సమయం", "BT": "భూటాన్ సమయం", "TMST": "తుర్క్మెనిస్థాన్ వేసవి సమయం", "HADT": "హవాయ్-అల్యూషియన్ పగటి వెలుతురు సమయం", "ECT": "ఈక్వడార్ సమయం", "HAST": "హవాయ్-అల్యూషియన్ ప్రామాణిక సమయం", "WIT": "తూర్పు ఇండోనేషియా సమయం", "EAT": "తూర్పు ఆఫ్రికా సమయం", "GYT": "గయానా సమయం", "AWDT": "పశ్చిమ ఆస్ట్రేలియన్ పగటి సమయం", "CST": "మధ్యమ ప్రామాణిక సమయం", "VET": "వెనిజులా సమయం", "AEDT": "తూర్పు ఆస్ట్రేలియా పగటి సమయం", "HKT": "హాంకాంగ్ ప్రామాణిక సమయం", "MYT": "మలేషియా సమయం", "AKDT": "అలాస్కా పగటి సమయం", "PDT": "పసిఫిక్ పగటి సమయం", "COST": "కొలంబియా వేసవి సమయం", "SAST": "దక్షిణ ఆఫ్రికా ప్రామాణిక సమయం", "CDT": "మధ్యమ పగటి సమయం", "WESZ": "పశ్చిమ యూరోపియన్ వేసవి సమయం", "COT": "కొలంబియా ప్రామాణిక సమయం", "CHAST": "చాథమ్ ప్రామాణిక సమయం", "WAT": "పశ్చిమ ఆఫ్రికా ప్రామాణిక సమయం", "WITA": "సెంట్రల్ ఇండోనేషియా సమయం", "WIB": "పశ్చిమ ఇండోనేషియా సమయం", "AKST": "అలాస్కా ప్రామాణిక సమయం", "WAST": "పశ్చిమ ఆఫ్రికా వేసవి సమయం", "CHADT": "చాథమ్ పగటి వెలుతురు సమయం", "WEZ": "పశ్చిమ యూరోపియన్ ప్రామాణిక సమయం", "WARST": "పశ్చిమ అర్జెంటీనా వేసవి సమయం", "ACDT": "ఆస్ట్రేలియా మధ్యమ పగటి సమయం", "LHDT": "లార్డ్ హోవ్ పగటి సమయం", "BOT": "బొలీవియా సమయం", "ADT": "అట్లాంటిక్ పగటి సమయం", "MESZ": "సెంట్రల్ యూరోపియన్ వేసవి సమయం", "ACWST": "మధ్యమ ఆస్ట్రేలియా పశ్చిమ ప్రామాణిక సమయం", "EDT": "తూర్పు పగటి సమయం", "AWST": "పశ్చిమ ఆస్ట్రేలియన్ ప్రామాణిక సమయం", "HKST": "హాంకాంగ్ వేసవి సమయం", "GFT": "ఫ్రెంచ్ గయానా సమయం", "ACST": "ఆస్ట్రేలియా మధ్యమ ప్రామాణిక సమయం", "JDT": "జపాన్ పగటి వెలుతురు సమయం"},
+ timezones: map[string]string{"WARST": "పశ్చిమ అర్జెంటీనా వేసవి సమయం", "MST": "మకావ్ ప్రామాణిక సమయం", "CHADT": "చాథమ్ పగటి వెలుతురు సమయం", "SAST": "దక్షిణ ఆఫ్రికా ప్రామాణిక సమయం", "ChST": "చామర్రో ప్రామాణిక సమయం", "WAT": "పశ్చిమ ఆఫ్రికా ప్రామాణిక సమయం", "WIB": "పశ్చిమ ఇండోనేషియా సమయం", "AEST": "తూర్పు ఆస్ట్రేలియా ప్రామాణిక సమయం", "MEZ": "సెంట్రల్ యూరోపియన్ ప్రామాణిక సమయం", "TMT": "తుర్క్మెనిస్థాన్ ప్రామాణిక సమయం", "WEZ": "పశ్చిమ యూరోపియన్ ప్రామాణిక సమయం", "CLST": "చిలీ వేసవి సమయం", "CST": "మధ్యమ ప్రామాణిక సమయం", "ACDT": "ఆస్ట్రేలియా మధ్యమ పగటి సమయం", "LHDT": "లార్డ్ హోవ్ పగటి సమయం", "MYT": "మలేషియా సమయం", "ECT": "ఈక్వడార్ సమయం", "IST": "భారతదేశ సమయం", "NZDT": "న్యూజిల్యాండ్ పగటి వెలుతురు సమయం", "OEZ": "తూర్పు యూరోపియన్ ప్రామాణిక సమయం", "CHAST": "చాథమ్ ప్రామాణిక సమయం", "AKST": "అలాస్కా ప్రామాణిక సమయం", "CAT": "సెంట్రల్ ఆఫ్రికా సమయం", "WAST": "పశ్చిమ ఆఫ్రికా వేసవి సమయం", "GFT": "ఫ్రెంచ్ గయానా సమయం", "HKST": "హాంకాంగ్ వేసవి సమయం", "VET": "వెనిజులా సమయం", "MESZ": "సెంట్రల్ యూరోపియన్ వేసవి సమయం", "OESZ": "తూర్పు యూరోపియన్ వేసవి సమయం", "ACWDT": "మధ్యమ ఆస్ట్రేలియన్ పశ్చిమ పగటి సమయం", "JST": "జపాన్ ప్రామాణిక సమయం", "BOT": "బొలీవియా సమయం", "HADT": "హవాయ్-అల్యూషియన్ పగటి వెలుతురు సమయం", "GMT": "గ్రీన్\u200cవిచ్ సగటు సమయం", "GYT": "గయానా సమయం", "LHST": "లార్డ్ హోవ్ ప్రామాణిక సమయం", "AKDT": "అలాస్కా పగటి సమయం", "EDT": "తూర్పు పగటి సమయం", "AEDT": "తూర్పు ఆస్ట్రేలియా పగటి సమయం", "WIT": "తూర్పు ఇండోనేషియా సమయం", "WITA": "సెంట్రల్ ఇండోనేషియా సమయం", "JDT": "జపాన్ పగటి వెలుతురు సమయం", "EST": "తూర్పు ప్రామాణిక సమయం", "HNT": "న్యూఫౌండ్ ల్యాండ్ ప్రామాణిక సమయం", "CDT": "మధ్యమ పగటి సమయం", "MDT": "మకావ్ వేసవి సమయం", "COST": "కొలంబియా వేసవి సమయం", "CLT": "చిలీ ప్రామాణిక సమయం", "ART": "అర్జెంటీనా ప్రామాణిక సమయం", "PDT": "పసిఫిక్ పగటి సమయం", "COT": "కొలంబియా ప్రామాణిక సమయం", "ACWST": "మధ్యమ ఆస్ట్రేలియా పశ్చిమ ప్రామాణిక సమయం", "AWST": "పశ్చిమ ఆస్ట్రేలియన్ ప్రామాణిక సమయం", "TMST": "తుర్క్మెనిస్థాన్ వేసవి సమయం", "UYT": "ఉరుగ్వే ప్రామాణిక సమయం", "BT": "భూటాన్ సమయం", "ACST": "ఆస్ట్రేలియా మధ్యమ ప్రామాణిక సమయం", "SRT": "సూరినామ్ సమయం", "∅∅∅": "అజోర్స్ వేసవి సమయం", "HKT": "హాంకాంగ్ ప్రామాణిక సమయం", "ADT": "అట్లాంటిక్ పగటి సమయం", "NZST": "న్యూజిల్యాండ్ ప్రామాణిక సమయం", "HAT": "న్యూఫౌండ్ ల్యాండ్ పగటి సమయం", "WART": "పశ్చిమ అర్జెంటీనా ప్రామాణిక సమయం", "AWDT": "పశ్చిమ ఆస్ట్రేలియన్ పగటి సమయం", "PST": "పసిఫిక్ ప్రామాణిక సమయం", "WESZ": "పశ్చిమ యూరోపియన్ వేసవి సమయం", "EAT": "తూర్పు ఆఫ్రికా సమయం", "UYST": "ఉరుగ్వే వేసవి సమయం", "AST": "అట్లాంటిక్ ప్రామాణిక సమయం", "ARST": "ఆర్జెంటీనా వేసవి సమయం", "HAST": "హవాయ్-అల్యూషియన్ ప్రామాణిక సమయం", "SGT": "సింగపూర్ ప్రామాణిక సమయం"},
}
}
diff --git a/te/te_test.go b/te/te_test.go
new file mode 100644
index 00000000..a8c203e1
--- /dev/null
+++ b/te/te_test.go
@@ -0,0 +1,1120 @@
+package te
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "te"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/te_IN/te_IN.go b/te_IN/te_IN.go
index 5c69b0ad..82abb1da 100644
--- a/te_IN/te_IN.go
+++ b/te_IN/te_IN.go
@@ -47,7 +47,7 @@ func New() locales.Translator {
locale: "te_IN",
pluralsCardinal: []locales.PluralRule{2, 6},
pluralsOrdinal: []locales.PluralRule{6},
- pluralsRange: []locales.PluralRule{2, 6},
+ pluralsRange: []locales.PluralRule{6, 2},
decimal: ".",
group: ",",
minus: "-",
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"క్రీపూ", "క్రీశ"},
erasNarrow: []string{"", ""},
erasWide: []string{"క్రీస్తు పూర్వం", "క్రీస్తు శకం"},
- timezones: map[string]string{"NZST": "న్యూజిల్యాండ్ ప్రామాణిక సమయం", "EDT": "తూర్పు పగటి సమయం", "COT": "కొలంబియా ప్రామాణిక సమయం", "ADT": "అట్లాంటిక్ పగటి సమయం", "SGT": "సింగపూర్ ప్రామాణిక సమయం", "GFT": "ఫ్రెంచ్ గయానా సమయం", "JDT": "జపాన్ పగటి వెలుతురు సమయం", "PDT": "పసిఫిక్ పగటి సమయం", "COST": "కొలంబియా వేసవి సమయం", "ECT": "ఈక్వడార్ సమయం", "WART": "పశ్చిమ అర్జెంటీనా ప్రామాణిక సమయం", "WIB": "పశ్చిమ ఇండోనేషియా సమయం", "EAT": "తూర్పు ఆఫ్రికా సమయం", "AKST": "అలాస్కా ప్రామాణిక సమయం", "CDT": "మధ్యమ పగటి సమయం", "GYT": "గయానా సమయం", "PST": "పసిఫిక్ ప్రామాణిక సమయం", "ACWST": "మధ్యమ ఆస్ట్రేలియా పశ్చిమ ప్రామాణిక సమయం", "ART": "అర్జెంటీనా ప్రామాణిక సమయం", "MST": "మకావ్ ప్రామాణిక సమయం", "UYT": "ఉరుగ్వే ప్రామాణిక సమయం", "WARST": "పశ్చిమ అర్జెంటీనా వేసవి సమయం", "OEZ": "తూర్పు యూరోపియన్ ప్రామాణిక సమయం", "LHST": "లార్డ్ హోవ్ ప్రామాణిక సమయం", "UYST": "ఉరుగ్వే వేసవి సమయం", "MDT": "మకావ్ వేసవి సమయం", "BOT": "బొలీవియా సమయం", "ACWDT": "మధ్యమ ఆస్ట్రేలియన్ పశ్చిమ పగటి సమయం", "EST": "తూర్పు ప్రామాణిక సమయం", "AST": "అట్లాంటిక్ ప్రామాణిక సమయం", "HKST": "హాంకాంగ్ వేసవి సమయం", "ChST": "చామర్రో ప్రామాణిక సమయం", "AEST": "తూర్పు ఆస్ట్రేలియా ప్రామాణిక సమయం", "AEDT": "తూర్పు ఆస్ట్రేలియా పగటి సమయం", "NZDT": "న్యూజిల్యాండ్ పగటి వెలుతురు సమయం", "HAST": "హవాయ్-అల్యూషియన్ ప్రామాణిక సమయం", "HADT": "హవాయ్-అల్యూషియన్ పగటి వెలుతురు సమయం", "IST": "భారతదేశ సమయం", "AWST": "పశ్చిమ ఆస్ట్రేలియన్ ప్రామాణిక సమయం", "AWDT": "పశ్చిమ ఆస్ట్రేలియన్ పగటి సమయం", "CST": "మధ్యమ ప్రామాణిక సమయం", "MEZ": "సెంట్రల్ యూరోపియన్ ప్రామాణిక సమయం", "MESZ": "సెంట్రల్ యూరోపియన్ వేసవి సమయం", "∅∅∅": "ఏకర్ వేసవి సమయం", "WAT": "పశ్చిమ ఆఫ్రికా ప్రామాణిక సమయం", "BT": "భూటాన్ సమయం", "JST": "జపాన్ ప్రామాణిక సమయం", "SRT": "సూరినామ్ సమయం", "CHADT": "చాథమ్ పగటి వెలుతురు సమయం", "HAT": "న్యూఫౌండ్ ల్యాండ్ పగటి సమయం", "WITA": "సెంట్రల్ ఇండోనేషియా సమయం", "ARST": "ఆర్జెంటీనా వేసవి సమయం", "ACDT": "ఆస్ట్రేలియా మధ్యమ పగటి సమయం", "GMT": "గ్రీన్\u200cవిచ్ సగటు సమయం", "ACST": "ఆస్ట్రేలియా మధ్యమ ప్రామాణిక సమయం", "AKDT": "అలాస్కా పగటి సమయం", "WEZ": "పశ్చిమ యూరోపియన్ ప్రామాణిక సమయం", "OESZ": "తూర్పు యూరోపియన్ వేసవి సమయం", "MYT": "మలేషియా సమయం", "CLT": "చిలీ ప్రామాణిక సమయం", "CLST": "చిలీ వేసవి సమయం", "VET": "వెనిజులా సమయం", "HNT": "న్యూఫౌండ్ ల్యాండ్ ప్రామాణిక సమయం", "LHDT": "లార్డ్ హోవ్ పగటి సమయం", "CAT": "సెంట్రల్ ఆఫ్రికా సమయం", "WAST": "పశ్చిమ ఆఫ్రికా వేసవి సమయం", "WIT": "తూర్పు ఇండోనేషియా సమయం", "TMST": "తుర్క్మెనిస్థాన్ వేసవి సమయం", "CHAST": "చాథమ్ ప్రామాణిక సమయం", "WESZ": "పశ్చిమ యూరోపియన్ వేసవి సమయం", "HKT": "హాంకాంగ్ ప్రామాణిక సమయం", "SAST": "దక్షిణ ఆఫ్రికా ప్రామాణిక సమయం", "TMT": "తుర్క్మెనిస్థాన్ ప్రామాణిక సమయం"},
+ timezones: map[string]string{"ACWST": "మధ్యమ ఆస్ట్రేలియా పశ్చిమ ప్రామాణిక సమయం", "MEZ": "సెంట్రల్ యూరోపియన్ ప్రామాణిక సమయం", "∅∅∅": "అమెజాన్ వేసవి సమయం", "MST": "మౌంటేన్ ప్రామాణిక సమయం", "MYT": "మలేషియా సమయం", "AKST": "అలాస్కా ప్రామాణిక సమయం", "EDT": "తూర్పు పగటి సమయం", "COST": "కొలంబియా వేసవి సమయం", "OEZ": "తూర్పు యూరోపియన్ ప్రామాణిక సమయం", "JDT": "జపాన్ పగటి వెలుతురు సమయం", "MESZ": "సెంట్రల్ యూరోపియన్ వేసవి సమయం", "VET": "వెనిజులా సమయం", "AWST": "పశ్చిమ ఆస్ట్రేలియన్ ప్రామాణిక సమయం", "ARST": "ఆర్జెంటీనా వేసవి సమయం", "NZST": "న్యూజిల్యాండ్ ప్రామాణిక సమయం", "UYT": "ఉరుగ్వే ప్రామాణిక సమయం", "CHADT": "చాథమ్ పగటి వెలుతురు సమయం", "ART": "అర్జెంటీనా ప్రామాణిక సమయం", "TMT": "తుర్క్మెనిస్థాన్ ప్రామాణిక సమయం", "AEST": "తూర్పు ఆస్ట్రేలియా ప్రామాణిక సమయం", "WIT": "తూర్పు ఇండోనేషియా సమయం", "BOT": "బొలీవియా సమయం", "HNT": "న్యూఫౌండ్ ల్యాండ్ ప్రామాణిక సమయం", "SGT": "సింగపూర్ ప్రామాణిక సమయం", "WIB": "పశ్చిమ ఇండోనేషియా సమయం", "MDT": "మౌంటేన్ పగటి సమయం", "HADT": "హవాయ్-అల్యూషియన్ పగటి వెలుతురు సమయం", "ACST": "ఆస్ట్రేలియా మధ్యమ ప్రామాణిక సమయం", "ACDT": "ఆస్ట్రేలియా మధ్యమ పగటి సమయం", "ECT": "ఈక్వడార్ సమయం", "CDT": "మధ్యమ పగటి సమయం", "WARST": "పశ్చిమ అర్జెంటీనా వేసవి సమయం", "IST": "భారతదేశ సమయం", "COT": "కొలంబియా ప్రామాణిక సమయం", "WESZ": "పశ్చిమ యూరోపియన్ వేసవి సమయం", "OESZ": "తూర్పు యూరోపియన్ వేసవి సమయం", "CLST": "చిలీ వేసవి సమయం", "EAT": "తూర్పు ఆఫ్రికా సమయం", "GFT": "ఫ్రెంచ్ గయానా సమయం", "JST": "జపాన్ ప్రామాణిక సమయం", "AST": "అట్లాంటిక్ ప్రామాణిక సమయం", "ACWDT": "మధ్యమ ఆస్ట్రేలియన్ పశ్చిమ పగటి సమయం", "PDT": "పసిఫిక్ పగటి సమయం", "TMST": "తుర్క్మెనిస్థాన్ వేసవి సమయం", "BT": "భూటాన్ సమయం", "CST": "మధ్యమ ప్రామాణిక సమయం", "AWDT": "పశ్చిమ ఆస్ట్రేలియన్ పగటి సమయం", "NZDT": "న్యూజిల్యాండ్ పగటి వెలుతురు సమయం", "GMT": "గ్రీన్\u200cవిచ్ సగటు సమయం", "AEDT": "తూర్పు ఆస్ట్రేలియా పగటి సమయం", "HKST": "హాంకాంగ్ వేసవి సమయం", "PST": "పసిఫిక్ ప్రామాణిక సమయం", "HAT": "న్యూఫౌండ్ ల్యాండ్ పగటి సమయం", "ChST": "చామర్రో ప్రామాణిక సమయం", "WART": "పశ్చిమ అర్జెంటీనా ప్రామాణిక సమయం", "ADT": "అట్లాంటిక్ పగటి సమయం", "CAT": "సెంట్రల్ ఆఫ్రికా సమయం", "CLT": "చిలీ ప్రామాణిక సమయం", "LHST": "లార్డ్ హోవ్ ప్రామాణిక సమయం", "HKT": "హాంకాంగ్ ప్రామాణిక సమయం", "SAST": "దక్షిణ ఆఫ్రికా ప్రామాణిక సమయం", "WEZ": "పశ్చిమ యూరోపియన్ ప్రామాణిక సమయం", "UYST": "ఉరుగ్వే వేసవి సమయం", "CHAST": "చాథమ్ ప్రామాణిక సమయం", "WITA": "సెంట్రల్ ఇండోనేషియా సమయం", "AKDT": "అలాస్కా పగటి సమయం", "HAST": "హవాయ్-అల్యూషియన్ ప్రామాణిక సమయం", "EST": "తూర్పు ప్రామాణిక సమయం", "WAT": "పశ్చిమ ఆఫ్రికా ప్రామాణిక సమయం", "GYT": "గయానా సమయం", "LHDT": "లార్డ్ హోవ్ పగటి సమయం", "WAST": "పశ్చిమ ఆఫ్రికా వేసవి సమయం", "SRT": "సూరినామ్ సమయం"},
}
}
diff --git a/te_IN/te_IN_test.go b/te_IN/te_IN_test.go
new file mode 100644
index 00000000..34096030
--- /dev/null
+++ b/te_IN/te_IN_test.go
@@ -0,0 +1,1120 @@
+package te_IN
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "te_IN"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/teo/teo.go b/teo/teo.go
index 32b7fa67..2ab4e4ae 100644
--- a/teo/teo.go
+++ b/teo/teo.go
@@ -63,7 +63,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"KK", "BK"},
erasNarrow: []string{"", ""},
erasWide: []string{"Kabla ya Christo", "Baada ya Christo"},
- timezones: map[string]string{"SAST": "SAST", "HAT": "HAT", "WIB": "WIB", "NZST": "NZST", "ECT": "ECT", "AWDT": "AWDT", "JDT": "JDT", "ADT": "ADT", "MYT": "MYT", "ACST": "ACST", "ACDT": "ACDT", "TMST": "TMST", "CHAST": "CHAST", "EDT": "EDT", "WART": "WART", "BOT": "BOT", "UYST": "UYST", "WESZ": "WESZ", "ChST": "ChST", "AST": "AST", "HKT": "HKT", "WARST": "WARST", "IST": "IST", "GYT": "GYT", "AEST": "AEST", "PDT": "PDT", "VET": "VET", "OESZ": "OESZ", "WIT": "WIT", "MEZ": "MEZ", "ART": "ART", "PST": "PST", "COST": "COST", "CLST": "CLST", "CAT": "CAT", "HAST": "HAST", "WITA": "WITA", "ARST": "ARST", "JST": "JST", "CDT": "CDT", "UYT": "UYT", "WAST": "WAST", "BT": "BT", "CST": "CST", "ACWST": "ACWST", "SGT": "SGT", "OEZ": "OEZ", "EAT": "EAT", "AEDT": "AEDT", "CHADT": "CHADT", "GFT": "GFT", "WEZ": "WEZ", "HNT": "HNT", "TMT": "TMT", "AKST": "AKST", "LHDT": "LHDT", "CLT": "CLT", "MESZ": "MESZ", "NZDT": "NZDT", "HADT": "HADT", "∅∅∅": "∅∅∅", "GMT": "GMT", "MST": "MST", "MDT": "MDT", "LHST": "LHST", "ACWDT": "ACWDT", "EST": "EST", "WAT": "WAT", "HKST": "HKST", "AKDT": "AKDT", "AWST": "AWST", "SRT": "SRT", "COT": "COT"},
+ timezones: map[string]string{"EST": "EST", "WITA": "WITA", "GMT": "GMT", "MYT": "MYT", "ARST": "ARST", "COST": "COST", "COT": "COT", "OEZ": "OEZ", "EDT": "EDT", "SGT": "SGT", "WIB": "WIB", "AEST": "AEST", "ChST": "ChST", "UYT": "UYT", "CST": "CST", "AST": "AST", "ART": "ART", "WAT": "WAT", "AKDT": "AKDT", "MESZ": "MESZ", "NZDT": "NZDT", "WART": "WART", "IST": "IST", "HKST": "HKST", "ACST": "ACST", "GFT": "GFT", "TMST": "TMST", "GYT": "GYT", "UYST": "UYST", "ECT": "ECT", "PST": "PST", "TMT": "TMT", "MST": "MST", "∅∅∅": "∅∅∅", "CDT": "CDT", "SRT": "SRT", "ACWST": "ACWST", "HNT": "HNT", "CLT": "CLT", "ACDT": "ACDT", "HKT": "HKT", "CHAST": "CHAST", "ADT": "ADT", "BOT": "BOT", "OESZ": "OESZ", "EAT": "EAT", "WARST": "WARST", "CHADT": "CHADT", "AWDT": "AWDT", "AEDT": "AEDT", "SAST": "SAST", "MEZ": "MEZ", "NZST": "NZST", "MDT": "MDT", "BT": "BT", "JST": "JST", "HAST": "HAST", "WEZ": "WEZ", "WIT": "WIT", "LHST": "LHST", "CLST": "CLST", "AWST": "AWST", "JDT": "JDT", "PDT": "PDT", "CAT": "CAT", "WESZ": "WESZ", "HAT": "HAT", "LHDT": "LHDT", "VET": "VET", "ACWDT": "ACWDT", "HADT": "HADT", "WAST": "WAST", "AKST": "AKST"},
}
}
diff --git a/teo/teo_test.go b/teo/teo_test.go
new file mode 100644
index 00000000..441bcf45
--- /dev/null
+++ b/teo/teo_test.go
@@ -0,0 +1,1120 @@
+package teo
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "teo"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/teo_KE/teo_KE.go b/teo_KE/teo_KE.go
index 951de359..edb1f830 100644
--- a/teo_KE/teo_KE.go
+++ b/teo_KE/teo_KE.go
@@ -63,7 +63,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"KK", "BK"},
erasNarrow: []string{"", ""},
erasWide: []string{"Kabla ya Christo", "Baada ya Christo"},
- timezones: map[string]string{"MESZ": "MESZ", "AKDT": "AKDT", "LHDT": "LHDT", "UYST": "UYST", "CLT": "CLT", "WAST": "WAST", "ART": "ART", "TMT": "TMT", "ACWST": "ACWST", "SAST": "SAST", "HKT": "HKT", "GYT": "GYT", "WARST": "WARST", "EAT": "EAT", "LHST": "LHST", "EST": "EST", "ADT": "ADT", "HAST": "HAST", "SGT": "SGT", "BT": "BT", "MST": "MST", "MDT": "MDT", "∅∅∅": "∅∅∅", "NZDT": "NZDT", "HKST": "HKST", "PDT": "PDT", "CDT": "CDT", "AWST": "AWST", "BOT": "BOT", "CAT": "CAT", "WITA": "WITA", "OESZ": "OESZ", "PST": "PST", "NZST": "NZST", "JDT": "JDT", "MEZ": "MEZ", "AEST": "AEST", "GMT": "GMT", "HAT": "HAT", "MYT": "MYT", "AKST": "AKST", "VET": "VET", "EDT": "EDT", "TMST": "TMST", "JST": "JST", "WAT": "WAT", "WIB": "WIB", "HNT": "HNT", "OEZ": "OEZ", "WESZ": "WESZ", "WART": "WART", "WIT": "WIT", "COT": "COT", "COST": "COST", "AST": "AST", "CST": "CST", "CLST": "CLST", "ChST": "ChST", "SRT": "SRT", "AEDT": "AEDT", "HADT": "HADT", "IST": "IST", "ARST": "ARST", "AWDT": "AWDT", "CHAST": "CHAST", "CHADT": "CHADT", "ACWDT": "ACWDT", "ACST": "ACST", "ACDT": "ACDT", "UYT": "UYT", "WEZ": "WEZ", "ECT": "ECT", "GFT": "GFT"},
+ timezones: map[string]string{"OESZ": "OESZ", "WART": "WART", "WARST": "WARST", "CHAST": "CHAST", "ACWDT": "ACWDT", "BOT": "BOT", "HADT": "HADT", "GMT": "GMT", "AEDT": "AEDT", "LHST": "LHST", "ACDT": "ACDT", "AKST": "AKST", "ART": "ART", "HAST": "HAST", "WAT": "WAT", "VET": "VET", "COT": "COT", "CLT": "CLT", "HKT": "HKT", "HKST": "HKST", "EDT": "EDT", "PDT": "PDT", "COST": "COST", "MDT": "MDT", "MYT": "MYT", "HAT": "HAT", "CLST": "CLST", "CHADT": "CHADT", "WITA": "WITA", "JDT": "JDT", "SAST": "SAST", "IST": "IST", "NZST": "NZST", "WIB": "WIB", "MESZ": "MESZ", "SGT": "SGT", "UYST": "UYST", "CST": "CST", "ACST": "ACST", "ADT": "ADT", "ACWST": "ACWST", "MEZ": "MEZ", "HNT": "HNT", "MST": "MST", "CDT": "CDT", "AWST": "AWST", "TMT": "TMT", "OEZ": "OEZ", "WIT": "WIT", "EAT": "EAT", "LHDT": "LHDT", "TMST": "TMST", "GFT": "GFT", "PST": "PST", "WEZ": "WEZ", "AKDT": "AKDT", "NZDT": "NZDT", "WAST": "WAST", "GYT": "GYT", "AST": "AST", "ARST": "ARST", "CAT": "CAT", "∅∅∅": "∅∅∅", "AWDT": "AWDT", "JST": "JST", "AEST": "AEST", "BT": "BT", "ECT": "ECT", "EST": "EST", "ChST": "ChST", "UYT": "UYT", "SRT": "SRT", "WESZ": "WESZ"},
}
}
diff --git a/teo_KE/teo_KE_test.go b/teo_KE/teo_KE_test.go
new file mode 100644
index 00000000..c5133fef
--- /dev/null
+++ b/teo_KE/teo_KE_test.go
@@ -0,0 +1,1120 @@
+package teo_KE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "teo_KE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/teo_UG/teo_UG.go b/teo_UG/teo_UG.go
index f135179c..258a2f80 100644
--- a/teo_UG/teo_UG.go
+++ b/teo_UG/teo_UG.go
@@ -63,7 +63,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"KK", "BK"},
erasNarrow: []string{"", ""},
erasWide: []string{"Kabla ya Christo", "Baada ya Christo"},
- timezones: map[string]string{"WIT": "WIT", "CST": "CST", "UYT": "UYT", "TMST": "TMST", "MST": "MST", "AKDT": "AKDT", "COT": "COT", "ACWDT": "ACWDT", "WAT": "WAT", "GFT": "GFT", "ACDT": "ACDT", "ART": "ART", "GYT": "GYT", "BT": "BT", "WESZ": "WESZ", "ACWST": "ACWST", "AST": "AST", "EST": "EST", "HNT": "HNT", "TMT": "TMT", "AWDT": "AWDT", "AEST": "AEST", "ECT": "ECT", "ADT": "ADT", "ACST": "ACST", "ARST": "ARST", "MYT": "MYT", "PDT": "PDT", "LHDT": "LHDT", "SGT": "SGT", "HADT": "HADT", "SAST": "SAST", "HKT": "HKT", "OESZ": "OESZ", "MEZ": "MEZ", "ChST": "ChST", "WIB": "WIB", "HAT": "HAT", "MDT": "MDT", "UYST": "UYST", "WAST": "WAST", "LHST": "LHST", "NZST": "NZST", "CHAST": "CHAST", "AEDT": "AEDT", "∅∅∅": "∅∅∅", "CDT": "CDT", "CHADT": "CHADT", "COST": "COST", "OEZ": "OEZ", "MESZ": "MESZ", "CLT": "CLT", "VET": "VET", "HKST": "HKST", "WART": "WART", "JDT": "JDT", "SRT": "SRT", "PST": "PST", "WEZ": "WEZ", "CAT": "CAT", "NZDT": "NZDT", "HAST": "HAST", "WITA": "WITA", "IST": "IST", "GMT": "GMT", "EAT": "EAT", "AWST": "AWST", "CLST": "CLST", "WARST": "WARST", "JST": "JST", "AKST": "AKST", "BOT": "BOT", "EDT": "EDT"},
+ timezones: map[string]string{"EDT": "EDT", "PST": "PST", "COT": "COT", "SRT": "SRT", "ACWST": "ACWST", "ARST": "ARST", "SGT": "SGT", "GMT": "GMT", "BOT": "BOT", "HADT": "HADT", "CAT": "CAT", "EST": "EST", "MESZ": "MESZ", "AEST": "AEST", "ChST": "ChST", "CLT": "CLT", "∅∅∅": "∅∅∅", "WARST": "WARST", "SAST": "SAST", "WIB": "WIB", "OEZ": "OEZ", "UYT": "UYT", "MYT": "MYT", "ACWDT": "ACWDT", "ART": "ART", "OESZ": "OESZ", "ACDT": "ACDT", "GFT": "GFT", "CHADT": "CHADT", "IST": "IST", "UYST": "UYST", "WIT": "WIT", "CDT": "CDT", "TMT": "TMT", "MST": "MST", "WAT": "WAT", "WEZ": "WEZ", "HNT": "HNT", "ACST": "ACST", "WART": "WART", "WESZ": "WESZ", "EAT": "EAT", "MDT": "MDT", "AKST": "AKST", "CST": "CST", "ECT": "ECT", "JDT": "JDT", "AKDT": "AKDT", "ADT": "ADT", "AEDT": "AEDT", "CLST": "CLST", "CHAST": "CHAST", "BT": "BT", "HKT": "HKT", "AWDT": "AWDT", "NZDT": "NZDT", "LHST": "LHST", "LHDT": "LHDT", "HKST": "HKST", "VET": "VET", "TMST": "TMST", "HAT": "HAT", "AST": "AST", "NZST": "NZST", "WAST": "WAST", "HAST": "HAST", "COST": "COST", "GYT": "GYT", "JST": "JST", "AWST": "AWST", "WITA": "WITA", "PDT": "PDT", "MEZ": "MEZ"},
}
}
diff --git a/teo_UG/teo_UG_test.go b/teo_UG/teo_UG_test.go
new file mode 100644
index 00000000..efa8c95c
--- /dev/null
+++ b/teo_UG/teo_UG_test.go
@@ -0,0 +1,1120 @@
+package teo_UG
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "teo_UG"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/th/th.go b/th/th.go
index 0956f98b..48d73879 100644
--- a/th/th.go
+++ b/th/th.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ปีก่อน ค.ศ.", "ค.ศ."},
erasNarrow: []string{"ก่อน ค.ศ.", "ค.ศ."},
erasWide: []string{"ปีก่อนคริสต์ศักราช", "คริสต์ศักราช"},
- timezones: map[string]string{"AEST": "เวลามาตรฐานทางตะวันออกของออสเตรเลีย", "AST": "เวลามาตรฐานแอตแลนติก", "GMT": "เวลามาตรฐานกรีนิช", "WIT": "เวลาอินโดนีเซียฝั่งตะวันออก", "ART": "เวลามาตรฐานอาร์เจนตินา", "AWDT": "เวลาออมแสงทางตะวันตกของออสเตรเลีย", "LHST": "เวลามาตรฐานลอร์ดโฮว์", "WEZ": "เวลามาตรฐานยุโรปตะวันตก", "CHADT": "เวลาออมแสงแชทัม", "SGT": "เวลาสิงคโปร์", "ACST": "เวลามาตรฐานทางตอนกลางของออสเตรเลีย", "SRT": "เวลาซูรินาเม", "LHDT": "เวลาออมแสงของลอร์ดโฮว์", "ACWDT": "เวลาออมแสงทางตะวันตกตอนกลางของออสเตรเลีย", "CHAST": "เวลามาตรฐานแชทัม", "MEZ": "เวลามาตรฐานยุโรปกลาง", "UYST": "เวลาฤดูร้อนอุรุกวัย", "HKT": "เวลามาตรฐานฮ่องกง", "WART": "เวลามาตรฐานทางตะวันตกของอาร์เจนตินา", "MESZ": "เวลาฤดูร้อนยุโรปกลาง", "CLT": "เวลามาตรฐานชิลี", "PST": "เวลามาตรฐานแปซิฟิกในอเมริกาเหนือ", "JDT": "เวลาออมแสงญี่ปุ่น", "NZDT": "เวลาออมแสงนิวซีแลนด์", "MST": "เวลามาตรฐานแถบภูเขาในอเมริกาเหนือ", "CAT": "เวลาแอฟริกากลาง", "WIB": "เวลาอินโดนีเซียฝั่งตะวันตก", "GFT": "เวลาเฟรนช์เกียนา", "CLST": "เวลาฤดูร้อนชิลี", "COT": "เวลามาตรฐานโคลอมเบีย", "HADT": "เวลาออมแสงฮาวาย-อะลูเชียน", "HNT": "เวลามาตรฐานนิวฟันด์แลนด์", "GYT": "เวลากายอานา", "IST": "เวลาอินเดีย", "UYT": "เวลามาตรฐานอุรุกวัย", "COST": "เวลาฤดูร้อนโคลอมเบีย", "∅∅∅": "เวลาฤดูร้อนบราซิเลีย", "HKST": "เวลาฤดูร้อนฮ่องกง", "ACDT": "เวลาออมแสงทางตอนกลางของออสเตรเลีย", "NZST": "เวลามาตรฐานนิวซีแลนด์", "WARST": "เวลาฤดูร้อนทางตะวันตกของอาร์เจนตินา", "AKDT": "เวลาออมแสงของอะแลสกา", "VET": "เวลาเวเนซุเอลา", "HAT": "เวลาออมแสงนิวฟันด์แลนด์", "EAT": "เวลาแอฟริกาตะวันออก", "AWST": "เวลามาตรฐานทางตะวันตกของออสเตรเลีย", "CDT": "เวลาออมแสงตอนกลางในอเมริกาเหนือ", "WESZ": "เวลาฤดูร้อนยุโรปตะวันตก", "ChST": "เวลาชามอร์โร", "OESZ": "เวลาฤดูร้อนยุโรปตะวันออก", "TMT": "เวลามาตรฐานเติร์กเมนิสถาน", "TMST": "เวลาฤดูร้อนเติร์กเมนิสถาน", "PDT": "เวลาออมแสงแปซิฟิกในอเมริกาเหนือ", "JST": "เวลามาตรฐานญี่ปุ่น", "AEDT": "เวลาออมแสงทางตะวันออกของออสเตรเลีย", "HAST": "เวลามาตรฐานฮาวาย-อะลูเชียน", "SAST": "เวลาแอฟริกาใต้", "WITA": "เวลาอินโดนีเซียตอนกลาง", "AKST": "เวลามาตรฐานอะแลสกา", "ECT": "เวลาเอกวาดอร์", "WAT": "เวลามาตรฐานแอฟริกาตะวันตก", "WAST": "เวลาฤดูร้อนแอฟริกาตะวันตก", "BT": "เวลาภูฏาน", "OEZ": "เวลามาตรฐานยุโรปตะวันออก", "MYT": "เวลามาเลเซีย", "BOT": "เวลาโบลิเวีย", "ACWST": "เวลามาตรฐานทางตะวันตกตอนกลางของออสเตรเลีย", "EDT": "เวลาออมแสงทางตะวันออกในอเมริกาเหนือ", "ADT": "เวลาออมแสงของแอตแลนติก", "CST": "เวลามาตรฐานตอนกลางในอเมริกาเหนือ", "MDT": "เวลาออมแสงแถบภูเขาในอเมริกาเหนือ", "EST": "เวลามาตรฐานทางตะวันออกในอเมริกาเหนือ", "ARST": "เวลาฤดูร้อนอาร์เจนตินา"},
+ timezones: map[string]string{"CST": "เวลามาตรฐานตอนกลางในอเมริกาเหนือ", "VET": "เวลาเวเนซุเอลา", "ART": "เวลามาตรฐานอาร์เจนตินา", "AEDT": "เวลาออมแสงทางตะวันออกของออสเตรเลีย", "CDT": "เวลาออมแสงตอนกลางในอเมริกาเหนือ", "HADT": "เวลาออมแสงฮาวาย-อะลูเชียน", "WEZ": "เวลามาตรฐานยุโรปตะวันตก", "ACST": "เวลามาตรฐานทางตอนกลางของออสเตรเลีย", "BOT": "เวลาโบลิเวีย", "PST": "เวลามาตรฐานแปซิฟิกในอเมริกาเหนือ", "HAST": "เวลามาตรฐานฮาวาย-อะลูเชียน", "PDT": "เวลาออมแสงแปซิฟิกในอเมริกาเหนือ", "HAT": "เวลาออมแสงนิวฟันด์แลนด์", "GMT": "เวลามาตรฐานกรีนิช", "CLT": "เวลามาตรฐานชิลี", "LHDT": "เวลาออมแสงของลอร์ดโฮว์", "WARST": "เวลาฤดูร้อนทางตะวันตกของอาร์เจนตินา", "JDT": "เวลาออมแสงญี่ปุ่น", "ACWST": "เวลามาตรฐานทางตะวันตกตอนกลางของออสเตรเลีย", "NZST": "เวลามาตรฐานนิวซีแลนด์", "EDT": "เวลาออมแสงทางตะวันออกในอเมริกาเหนือ", "EAT": "เวลาแอฟริกาตะวันออก", "BT": "เวลาภูฏาน", "GFT": "เวลาเฟรนช์เกียนา", "WITA": "เวลาอินโดนีเซียตอนกลาง", "MEZ": "เวลามาตรฐานยุโรปกลาง", "MESZ": "เวลาฤดูร้อนยุโรปกลาง", "SAST": "เวลาแอฟริกาใต้", "COT": "เวลามาตรฐานโคลอมเบีย", "CLST": "เวลาฤดูร้อนชิลี", "∅∅∅": "เวลาฤดูร้อนบราซิเลีย", "WART": "เวลามาตรฐานทางตะวันตกของอาร์เจนตินา", "ADT": "เวลาออมแสงของแอตแลนติก", "WAT": "เวลามาตรฐานแอฟริกาตะวันตก", "HNT": "เวลามาตรฐานนิวฟันด์แลนด์", "LHST": "เวลามาตรฐานลอร์ดโฮว์", "NZDT": "เวลาออมแสงนิวซีแลนด์", "TMT": "เวลามาตรฐานเติร์กเมนิสถาน", "TMST": "เวลาฤดูร้อนเติร์กเมนิสถาน", "WESZ": "เวลาฤดูร้อนยุโรปตะวันตก", "OEZ": "เวลามาตรฐานยุโรปตะวันออก", "HKST": "เวลาฤดูร้อนฮ่องกง", "AKST": "เวลามาตรฐานอะแลสกา", "AKDT": "เวลาออมแสงของอะแลสกา", "SGT": "เวลาสิงคโปร์", "AWDT": "เวลาออมแสงทางตะวันตกของออสเตรเลีย", "OESZ": "เวลาฤดูร้อนยุโรปตะวันออก", "WAST": "เวลาฤดูร้อนแอฟริกาตะวันตก", "UYST": "เวลาฤดูร้อนอุรุกวัย", "ACWDT": "เวลาออมแสงทางตะวันตกตอนกลางของออสเตรเลีย", "COST": "เวลาฤดูร้อนโคลอมเบีย", "WIB": "เวลาอินโดนีเซียฝั่งตะวันตก", "UYT": "เวลามาตรฐานอุรุกวัย", "CHADT": "เวลาออมแสงแชทัม", "IST": "เวลาอินเดีย", "GYT": "เวลากายอานา", "MYT": "เวลามาเลเซีย", "HKT": "เวลามาตรฐานฮ่องกง", "CHAST": "เวลามาตรฐานแชทัม", "CAT": "เวลาแอฟริกากลาง", "JST": "เวลามาตรฐานญี่ปุ่น", "AST": "เวลามาตรฐานแอตแลนติก", "EST": "เวลามาตรฐานทางตะวันออกในอเมริกาเหนือ", "ChST": "เวลาชามอร์โร", "ARST": "เวลาฤดูร้อนอาร์เจนตินา", "AWST": "เวลามาตรฐานทางตะวันตกของออสเตรเลีย", "AEST": "เวลามาตรฐานทางตะวันออกของออสเตรเลีย", "WIT": "เวลาอินโดนีเซียฝั่งตะวันออก", "MST": "เวลามาตรฐานแถบภูเขาในอเมริกาเหนือ", "ACDT": "เวลาออมแสงทางตอนกลางของออสเตรเลีย", "ECT": "เวลาเอกวาดอร์", "MDT": "เวลาออมแสงแถบภูเขาในอเมริกาเหนือ", "SRT": "เวลาซูรินาเม"},
}
}
diff --git a/th/th_test.go b/th/th_test.go
new file mode 100644
index 00000000..e3b51e30
--- /dev/null
+++ b/th/th_test.go
@@ -0,0 +1,1120 @@
+package th
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "th"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/th_TH/th_TH.go b/th_TH/th_TH.go
index 0bbf78cb..d5f98d3f 100644
--- a/th_TH/th_TH.go
+++ b/th_TH/th_TH.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ปีก่อน ค.ศ.", "ค.ศ."},
erasNarrow: []string{"ก่อน ค.ศ.", "ค.ศ."},
erasWide: []string{"ปีก่อนคริสต์ศักราช", "คริสต์ศักราช"},
- timezones: map[string]string{"MYT": "เวลามาเลเซีย", "JDT": "เวลาออมแสงญี่ปุ่น", "WEZ": "เวลามาตรฐานยุโรปตะวันตก", "LHDT": "เวลาออมแสงของลอร์ดโฮว์", "WIT": "เวลาอินโดนีเซียฝั่งตะวันออก", "CHAST": "เวลามาตรฐานแชทัม", "NZDT": "เวลาออมแสงนิวซีแลนด์", "AEDT": "เวลาออมแสงทางตะวันออกของออสเตรเลีย", "WESZ": "เวลาฤดูร้อนยุโรปตะวันตก", "AKDT": "เวลาออมแสงของอะแลสกา", "CST": "เวลามาตรฐานตอนกลางในอเมริกาเหนือ", "AEST": "เวลามาตรฐานทางตะวันออกของออสเตรเลีย", "SAST": "เวลาแอฟริกาใต้", "HNT": "เวลามาตรฐานนิวฟันด์แลนด์", "∅∅∅": "เวลาฤดูร้อนอะโซร์ส", "BOT": "เวลาโบลิเวีย", "UYT": "เวลามาตรฐานอุรุกวัย", "BT": "เวลาภูฏาน", "ART": "เวลามาตรฐานอาร์เจนตินา", "AWDT": "เวลาออมแสงทางตะวันตกของออสเตรเลีย", "CLT": "เวลามาตรฐานชิลี", "VET": "เวลาเวเนซุเอลา", "COST": "เวลาฤดูร้อนโคลอมเบีย", "SGT": "เวลาสิงคโปร์", "WARST": "เวลาฤดูร้อนทางตะวันตกของอาร์เจนตินา", "OESZ": "เวลาฤดูร้อนยุโรปตะวันออก", "ACWDT": "เวลาออมแสงทางตะวันตกตอนกลางของออสเตรเลีย", "SRT": "เวลาซูรินาเม", "UYST": "เวลาฤดูร้อนอุรุกวัย", "MST": "เวลามาตรฐานแถบภูเขาในอเมริกาเหนือ", "EST": "เวลามาตรฐานทางตะวันออกในอเมริกาเหนือ", "OEZ": "เวลามาตรฐานยุโรปตะวันออก", "WIB": "เวลาอินโดนีเซียฝั่งตะวันตก", "ARST": "เวลาฤดูร้อนอาร์เจนตินา", "LHST": "เวลามาตรฐานลอร์ดโฮว์", "TMST": "เวลาฤดูร้อนเติร์กเมนิสถาน", "GMT": "เวลามาตรฐานกรีนิช", "ChST": "เวลาชามอร์โร", "GFT": "เวลาเฟรนช์เกียนา", "ACWST": "เวลามาตรฐานทางตะวันตกตอนกลางของออสเตรเลีย", "AST": "เวลามาตรฐานแอตแลนติก", "HKT": "เวลามาตรฐานฮ่องกง", "EAT": "เวลาแอฟริกาตะวันออก", "AWST": "เวลามาตรฐานทางตะวันตกของออสเตรเลีย", "COT": "เวลามาตรฐานโคลอมเบีย", "ADT": "เวลาออมแสงของแอตแลนติก", "HKST": "เวลาฤดูร้อนฮ่องกง", "HAT": "เวลาออมแสงนิวฟันด์แลนด์", "WITA": "เวลาอินโดนีเซียตอนกลาง", "EDT": "เวลาออมแสงทางตะวันออกในอเมริกาเหนือ", "MEZ": "เวลามาตรฐานยุโรปกลาง", "NZST": "เวลามาตรฐานนิวซีแลนด์", "WAST": "เวลาฤดูร้อนแอฟริกาตะวันตก", "ACST": "เวลามาตรฐานทางตอนกลางของออสเตรเลีย", "TMT": "เวลามาตรฐานเติร์กเมนิสถาน", "PDT": "เวลาออมแสงแปซิฟิกในอเมริกาเหนือ", "AKST": "เวลามาตรฐานอะแลสกา", "MESZ": "เวลาฤดูร้อนยุโรปกลาง", "WAT": "เวลามาตรฐานแอฟริกาตะวันตก", "GYT": "เวลากายอานา", "HAST": "เวลามาตรฐานฮาวาย-อะลูเชียน", "WART": "เวลามาตรฐานทางตะวันตกของอาร์เจนตินา", "CAT": "เวลาแอฟริกากลาง", "CDT": "เวลาออมแสงตอนกลางในอเมริกาเหนือ", "MDT": "เวลาออมแสงแถบภูเขาในอเมริกาเหนือ", "CLST": "เวลาฤดูร้อนชิลี", "HADT": "เวลาออมแสงฮาวาย-อะลูเชียน", "IST": "เวลาอินเดีย", "PST": "เวลามาตรฐานแปซิฟิกในอเมริกาเหนือ", "CHADT": "เวลาออมแสงแชทัม", "ECT": "เวลาเอกวาดอร์", "ACDT": "เวลาออมแสงทางตอนกลางของออสเตรเลีย", "JST": "เวลามาตรฐานญี่ปุ่น"},
+ timezones: map[string]string{"CAT": "เวลาแอฟริกากลาง", "WESZ": "เวลาฤดูร้อนยุโรปตะวันตก", "ChST": "เวลาชามอร์โร", "LHST": "เวลามาตรฐานลอร์ดโฮว์", "WIT": "เวลาอินโดนีเซียฝั่งตะวันออก", "BOT": "เวลาโบลิเวีย", "COST": "เวลาฤดูร้อนโคลอมเบีย", "ACST": "เวลามาตรฐานทางตอนกลางของออสเตรเลีย", "SRT": "เวลาซูรินาเม", "WEZ": "เวลามาตรฐานยุโรปตะวันตก", "CLT": "เวลามาตรฐานชิลี", "CHAST": "เวลามาตรฐานแชทัม", "WITA": "เวลาอินโดนีเซียตอนกลาง", "EST": "เวลามาตรฐานทางตะวันออกในอเมริกาเหนือ", "JST": "เวลามาตรฐานญี่ปุ่น", "WAT": "เวลามาตรฐานแอฟริกาตะวันตก", "WIB": "เวลาอินโดนีเซียฝั่งตะวันตก", "AEST": "เวลามาตรฐานทางตะวันออกของออสเตรเลีย", "HKT": "เวลามาตรฐานฮ่องกง", "HKST": "เวลาฤดูร้อนฮ่องกง", "AWST": "เวลามาตรฐานทางตะวันตกของออสเตรเลีย", "HNT": "เวลามาตรฐานนิวฟันด์แลนด์", "HAT": "เวลาออมแสงนิวฟันด์แลนด์", "COT": "เวลามาตรฐานโคลอมเบีย", "MEZ": "เวลามาตรฐานยุโรปกลาง", "SGT": "เวลาสิงคโปร์", "GFT": "เวลาเฟรนช์เกียนา", "CHADT": "เวลาออมแสงแชทัม", "ADT": "เวลาออมแสงของแอตแลนติก", "JDT": "เวลาออมแสงญี่ปุ่น", "OESZ": "เวลาฤดูร้อนยุโรปตะวันออก", "AEDT": "เวลาออมแสงทางตะวันออกของออสเตรเลีย", "ACDT": "เวลาออมแสงทางตอนกลางของออสเตรเลีย", "WART": "เวลามาตรฐานทางตะวันตกของอาร์เจนตินา", "ARST": "เวลาฤดูร้อนอาร์เจนตินา", "NZST": "เวลามาตรฐานนิวซีแลนด์", "PST": "เวลามาตรฐานแปซิฟิกในอเมริกาเหนือ", "WAST": "เวลาฤดูร้อนแอฟริกาตะวันตก", "MYT": "เวลามาเลเซีย", "UYT": "เวลามาตรฐานอุรุกวัย", "∅∅∅": "เวลาฤดูร้อนบราซิเลีย", "ECT": "เวลาเอกวาดอร์", "SAST": "เวลาแอฟริกาใต้", "MESZ": "เวลาฤดูร้อนยุโรปกลาง", "NZDT": "เวลาออมแสงนิวซีแลนด์", "GMT": "เวลามาตรฐานกรีนิช", "EAT": "เวลาแอฟริกาตะวันออก", "BT": "เวลาภูฏาน", "UYST": "เวลาฤดูร้อนอุรุกวัย", "CDT": "เวลาออมแสงตอนกลางในอเมริกาเหนือ", "WARST": "เวลาฤดูร้อนทางตะวันตกของอาร์เจนตินา", "CST": "เวลามาตรฐานตอนกลางในอเมริกาเหนือ", "ACWST": "เวลามาตรฐานทางตะวันตกตอนกลางของออสเตรเลีย", "PDT": "เวลาออมแสงแปซิฟิกในอเมริกาเหนือ", "MDT": "เวลาออมแสงแถบภูเขาในอเมริกาเหนือ", "ACWDT": "เวลาออมแสงทางตะวันตกตอนกลางของออสเตรเลีย", "HAST": "เวลามาตรฐานฮาวาย-อะลูเชียน", "TMT": "เวลามาตรฐานเติร์กเมนิสถาน", "CLST": "เวลาฤดูร้อนชิลี", "VET": "เวลาเวเนซุเอลา", "AKDT": "เวลาออมแสงของอะแลสกา", "AWDT": "เวลาออมแสงทางตะวันตกของออสเตรเลีย", "LHDT": "เวลาออมแสงของลอร์ดโฮว์", "AST": "เวลามาตรฐานแอตแลนติก", "HADT": "เวลาออมแสงฮาวาย-อะลูเชียน", "OEZ": "เวลามาตรฐานยุโรปตะวันออก", "AKST": "เวลามาตรฐานอะแลสกา", "IST": "เวลาอินเดีย", "EDT": "เวลาออมแสงทางตะวันออกในอเมริกาเหนือ", "TMST": "เวลาฤดูร้อนเติร์กเมนิสถาน", "GYT": "เวลากายอานา", "MST": "เวลามาตรฐานแถบภูเขาในอเมริกาเหนือ", "ART": "เวลามาตรฐานอาร์เจนตินา"},
}
}
diff --git a/th_TH/th_TH_test.go b/th_TH/th_TH_test.go
new file mode 100644
index 00000000..8ab959e8
--- /dev/null
+++ b/th_TH/th_TH_test.go
@@ -0,0 +1,1120 @@
+package th_TH
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "th_TH"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ti/ti.go b/ti/ti.go
index 4a8c32fb..9ee5667c 100644
--- a/ti/ti.go
+++ b/ti/ti.go
@@ -58,7 +58,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ዓ/ዓ", "ዓ/ም"},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"AKDT": "AKDT", "AWDT": "AWDT", "CLT": "CLT", "COT": "COT", "ECT": "ECT", "SAST": "SAST", "IST": "IST", "AKST": "AKST", "HNT": "HNT", "VET": "VET", "JDT": "JDT", "JST": "JST", "NZDT": "NZDT", "WIB": "WIB", "HAT": "HAT", "PDT": "PDT", "HKT": "HKT", "SGT": "SGT", "WARST": "WARST", "OESZ": "OESZ", "CHAST": "CHAST", "LHDT": "LHDT", "MESZ": "MESZ", "NZST": "NZST", "EDT": "EDT", "GMT": "GMT", "TMST": "TMST", "ChST": "ChST", "GFT": "GFT", "GYT": "GYT", "LHST": "LHST", "MEZ": "MEZ", "EST": "EST", "ADT": "ADT", "WIT": "WIT", "MDT": "MDT", "PST": "PST", "CST": "CST", "HADT": "HADT", "HKST": "HKST", "ART": "ART", "ARST": "ARST", "MYT": "MYT", "WEZ": "WEZ", "WESZ": "WESZ", "COST": "COST", "WAT": "WAT", "EAT": "EAT", "BOT": "BOT", "UYT": "UYT", "UYST": "UYST", "AEDT": "AEDT", "CLST": "CLST", "AST": "AST", "ACDT": "ACDT", "CDT": "CDT", "AEST": "AEST", "TMT": "TMT", "AWST": "AWST", "ACWDT": "ACWDT", "WAST": "WAST", "BT": "BT", "OEZ": "OEZ", "SRT": "SRT", "∅∅∅": "∅∅∅", "ACWST": "ACWST", "CHADT": "CHADT", "CAT": "CAT", "WART": "WART", "WITA": "WITA", "ACST": "ACST", "HAST": "HAST", "MST": "MST"},
+ timezones: map[string]string{"COST": "COST", "HNT": "HNT", "GMT": "GMT", "ChST": "ChST", "SRT": "SRT", "JST": "JST", "IST": "IST", "CDT": "CDT", "NZDT": "NZDT", "CLST": "CLST", "UYT": "UYT", "EAT": "EAT", "WAST": "WAST", "LHDT": "LHDT", "ACST": "ACST", "HAST": "HAST", "SGT": "SGT", "GYT": "GYT", "WITA": "WITA", "AKDT": "AKDT", "HAT": "HAT", "UYST": "UYST", "BT": "BT", "COT": "COT", "TMT": "TMT", "TMST": "TMST", "WAT": "WAT", "AEDT": "AEDT", "ARST": "ARST", "SAST": "SAST", "WIB": "WIB", "LHST": "LHST", "CHADT": "CHADT", "CAT": "CAT", "MDT": "MDT", "AWDT": "AWDT", "PDT": "PDT", "AST": "AST", "HADT": "HADT", "OESZ": "OESZ", "ECT": "ECT", "MYT": "MYT", "WARST": "WARST", "GFT": "GFT", "WEZ": "WEZ", "AEST": "AEST", "JDT": "JDT", "ACWST": "ACWST", "BOT": "BOT", "EDT": "EDT", "MEZ": "MEZ", "CLT": "CLT", "MST": "MST", "VET": "VET", "EST": "EST", "PST": "PST", "WESZ": "WESZ", "∅∅∅": "∅∅∅", "CHAST": "CHAST", "AKST": "AKST", "MESZ": "MESZ", "AWST": "AWST", "ART": "ART", "NZST": "NZST", "ACWDT": "ACWDT", "OEZ": "OEZ", "CST": "CST", "HKST": "HKST", "ADT": "ADT", "HKT": "HKT", "WIT": "WIT", "ACDT": "ACDT", "WART": "WART"},
}
}
diff --git a/ti/ti_test.go b/ti/ti_test.go
new file mode 100644
index 00000000..1fdc058a
--- /dev/null
+++ b/ti/ti_test.go
@@ -0,0 +1,1120 @@
+package ti
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ti"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ti_ER/ti_ER.go b/ti_ER/ti_ER.go
index bfb01f48..c0f62938 100644
--- a/ti_ER/ti_ER.go
+++ b/ti_ER/ti_ER.go
@@ -58,7 +58,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ዓ/ዓ", "ዓ/ም"},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"CHAST": "CHAST", "OEZ": "OEZ", "CLST": "CLST", "WARST": "WARST", "PDT": "PDT", "CST": "CST", "EST": "EST", "IST": "IST", "GMT": "GMT", "MST": "MST", "JST": "JST", "WAT": "WAT", "HKT": "HKT", "OESZ": "OESZ", "TMT": "TMT", "ECT": "ECT", "CLT": "CLT", "WART": "WART", "UYT": "UYT", "NZST": "NZST", "ACWDT": "ACWDT", "SGT": "SGT", "ART": "ART", "ARST": "ARST", "HNT": "HNT", "∅∅∅": "∅∅∅", "GFT": "GFT", "NZDT": "NZDT", "WEZ": "WEZ", "CAT": "CAT", "AST": "AST", "WITA": "WITA", "JDT": "JDT", "LHDT": "LHDT", "HADT": "HADT", "HKST": "HKST", "MDT": "MDT", "ACDT": "ACDT", "AEST": "AEST", "CDT": "CDT", "COT": "COT", "COST": "COST", "ACST": "ACST", "LHST": "LHST", "PST": "PST", "MESZ": "MESZ", "ACWST": "ACWST", "SAST": "SAST", "WAST": "WAST", "MYT": "MYT", "AKST": "AKST", "WIT": "WIT", "WIB": "WIB", "UYST": "UYST", "BT": "BT", "SRT": "SRT", "MEZ": "MEZ", "CHADT": "CHADT", "HAST": "HAST", "TMST": "TMST", "GYT": "GYT", "VET": "VET", "HAT": "HAT", "EAT": "EAT", "AWST": "AWST", "BOT": "BOT", "WESZ": "WESZ", "AEDT": "AEDT", "ChST": "ChST", "EDT": "EDT", "ADT": "ADT", "AKDT": "AKDT", "AWDT": "AWDT"},
+ timezones: map[string]string{"WAT": "WAT", "WEZ": "WEZ", "OEZ": "OEZ", "ChST": "ChST", "GYT": "GYT", "CHAST": "CHAST", "CHADT": "CHADT", "HKST": "HKST", "AWST": "AWST", "HAT": "HAT", "EAT": "EAT", "BT": "BT", "MDT": "MDT", "CDT": "CDT", "HKT": "HKT", "WART": "WART", "PDT": "PDT", "MEZ": "MEZ", "HNT": "HNT", "SGT": "SGT", "ECT": "ECT", "WITA": "WITA", "MESZ": "MESZ", "CLT": "CLT", "MYT": "MYT", "∅∅∅": "∅∅∅", "WARST": "WARST", "SRT": "SRT", "MST": "MST", "WAST": "WAST", "OESZ": "OESZ", "CAT": "CAT", "GMT": "GMT", "CLST": "CLST", "AEDT": "AEDT", "ACDT": "ACDT", "NZST": "NZST", "SAST": "SAST", "WIT": "WIT", "AST": "AST", "ACWDT": "ACWDT", "AWDT": "AWDT", "ART": "ART", "UYST": "UYST", "LHST": "LHST", "JDT": "JDT", "TMT": "TMT", "HADT": "HADT", "NZDT": "NZDT", "TMST": "TMST", "UYT": "UYT", "LHDT": "LHDT", "CST": "CST", "ACWST": "ACWST", "HAST": "HAST", "ACST": "ACST", "GFT": "GFT", "ARST": "ARST", "JST": "JST", "ADT": "ADT", "BOT": "BOT", "AKDT": "AKDT", "IST": "IST", "WIB": "WIB", "VET": "VET", "AKST": "AKST", "EDT": "EDT", "WESZ": "WESZ", "AEST": "AEST", "EST": "EST", "PST": "PST", "COT": "COT", "COST": "COST"},
}
}
diff --git a/ti_ER/ti_ER_test.go b/ti_ER/ti_ER_test.go
new file mode 100644
index 00000000..3d7ce4b9
--- /dev/null
+++ b/ti_ER/ti_ER_test.go
@@ -0,0 +1,1120 @@
+package ti_ER
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ti_ER"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ti_ET/ti_ET.go b/ti_ET/ti_ET.go
index 84cd2787..703f362c 100644
--- a/ti_ET/ti_ET.go
+++ b/ti_ET/ti_ET.go
@@ -58,7 +58,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ዓ/ዓ", "ዓ/ም"},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"WAST": "WAST", "PDT": "PDT", "ACST": "ACST", "PST": "PST", "∅∅∅": "∅∅∅", "UYST": "UYST", "WEZ": "WEZ", "BT": "BT", "SRT": "SRT", "CDT": "CDT", "COT": "COT", "ADT": "ADT", "SGT": "SGT", "NZST": "NZST", "NZDT": "NZDT", "WESZ": "WESZ", "VET": "VET", "GMT": "GMT", "HAT": "HAT", "EST": "EST", "EDT": "EDT", "HADT": "HADT", "ACWST": "ACWST", "AEDT": "AEDT", "MDT": "MDT", "CAT": "CAT", "AKDT": "AKDT", "LHST": "LHST", "LHDT": "LHDT", "GYT": "GYT", "JST": "JST", "BOT": "BOT", "HKST": "HKST", "WIT": "WIT", "WIB": "WIB", "AWST": "AWST", "UYT": "UYT", "CHAST": "CHAST", "SAST": "SAST", "GFT": "GFT", "MYT": "MYT", "CHADT": "CHADT", "ARST": "ARST", "AKST": "AKST", "AWDT": "AWDT", "CLT": "CLT", "OESZ": "OESZ", "ACDT": "ACDT", "JDT": "JDT", "AEST": "AEST", "ChST": "ChST", "AST": "AST", "HKT": "HKT", "WITA": "WITA", "CST": "CST", "MEZ": "MEZ", "ACWDT": "ACWDT", "CLST": "CLST", "HAST": "HAST", "OEZ": "OEZ", "MST": "MST", "WARST": "WARST", "IST": "IST", "EAT": "EAT", "ECT": "ECT", "ART": "ART", "TMST": "TMST", "MESZ": "MESZ", "COST": "COST", "WAT": "WAT", "WART": "WART", "HNT": "HNT", "TMT": "TMT"},
+ timezones: map[string]string{"MYT": "MYT", "UYST": "UYST", "∅∅∅": "∅∅∅", "GFT": "GFT", "AWST": "AWST", "WITA": "WITA", "CLT": "CLT", "ACWDT": "ACWDT", "HAST": "HAST", "NZDT": "NZDT", "COT": "COT", "CAT": "CAT", "ADT": "ADT", "ART": "ART", "HADT": "HADT", "SAST": "SAST", "WIT": "WIT", "WARST": "WARST", "TMT": "TMT", "ChST": "ChST", "OEZ": "OEZ", "BT": "BT", "ACWST": "ACWST", "HNT": "HNT", "GMT": "GMT", "CDT": "CDT", "CHAST": "CHAST", "AST": "AST", "AKST": "AKST", "PST": "PST", "MEZ": "MEZ", "OESZ": "OESZ", "CLST": "CLST", "WEZ": "WEZ", "SGT": "SGT", "AEST": "AEST", "HKT": "HKT", "BOT": "BOT", "UYT": "UYT", "SRT": "SRT", "ARST": "ARST", "GYT": "GYT", "EAT": "EAT", "CST": "CST", "CHADT": "CHADT", "VET": "VET", "MESZ": "MESZ", "TMST": "TMST", "LHDT": "LHDT", "MST": "MST", "ECT": "ECT", "PDT": "PDT", "NZST": "NZST", "HAT": "HAT", "WIB": "WIB", "JST": "JST", "IST": "IST", "WAT": "WAT", "WAST": "WAST", "HKST": "HKST", "AWDT": "AWDT", "JDT": "JDT", "EDT": "EDT", "AEDT": "AEDT", "LHST": "LHST", "ACST": "ACST", "ACDT": "ACDT", "EST": "EST", "MDT": "MDT", "WART": "WART", "AKDT": "AKDT", "WESZ": "WESZ", "COST": "COST"},
}
}
diff --git a/ti_ET/ti_ET_test.go b/ti_ET/ti_ET_test.go
new file mode 100644
index 00000000..51928f66
--- /dev/null
+++ b/ti_ET/ti_ET_test.go
@@ -0,0 +1,1120 @@
+package ti_ET
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ti_ET"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/tk/tk.go b/tk/tk.go
index 005e5111..c0a933ff 100644
--- a/tk/tk.go
+++ b/tk/tk.go
@@ -66,7 +66,7 @@ func New() locales.Translator {
daysAbbreviated: []string{"ýb", "db", "sb", "çb", "pb", "an", "şb"},
daysNarrow: []string{"Ý", "D", "S", "Ç", "P", "A", "Ş"},
daysWide: []string{"ýekşenbe", "duşenbe", "sişenbe", "çarşenbe", "penşenbe", "anna", "şenbe"},
- timezones: map[string]string{"WESZ": "Günbatar Ýewropa, tomusky wagt", "ACWST": "Merkezi Awstraliýa, günbatar tarap, standart wagt", "WAT": "Günbatar Afrika, standart wagt", "BT": "Butan", "WIT": "Gündogar Indoneziýa", "TMT": "Türkmenistan, standart wagt", "CLT": "Çili, standart wagt", "AEDT": "Gündogar Awstraliýa, tomusky wagt", "ACST": "Merkezi Awstraliýa, standart wagt", "BOT": "Boliwiýa", "CHADT": "Çatem, tomusky wagt", "LHDT": "Lord-Hau, tomusky wagt", "WAST": "Günbatar Afrika, tomusky wagt", "GMT": "Grinwiç boýunça orta wagt", "PDT": "Ýuwaş umman, tomusky wagt", "AWDT": "Günbatar Awstraliýa, tomusky wagt", "SRT": "Surinam", "UYT": "Urugwaý, standart wagt", "EDT": "Günorta Amerika, tomusky wagt", "COST": "Kolumbiýa, tomusky wagt", "AST": "Atlantika, standart wagt", "HAT": "Nýufaundlend, tomusky wagt", "TMST": "Türkmenistan, tomusky wagt", "JDT": "Ýaponiýa, tomusky wagt", "HADT": "Gawaý-Aleut, tomusky wagt", "WART": "Günbatar Argentina, standart wagt", "AKST": "Alýaska, standart wagt", "LHST": "Lord-Hau, standart wagt", "NZDT": "Täze Zelandiýa, tomusky wagt", "JST": "Ýaponiýa, standart wagt", "CHAST": "Çatem, standart wagt", "CAT": "Merkezi Afrika", "EST": "Günorta Amerika, standart wagt", "SGT": "Singapur, standart wagt", "WIB": "Günbatar Indoneziýa", "OEZ": "Gündogar Ýewropa, standart wagt", "∅∅∅": "Amazonka, tomusky wagt", "SAST": "Günorta Afrika, standart wagt", "HNT": "Nýufaundlend, standart wagt", "ACDT": "Merkezi Awstraliýa, tomusky wagt", "VET": "Wenesuela", "AWST": "Günbatar Awstraliýa, standart wagt", "NZST": "Täze Zelandiýa, standart wagt", "OESZ": "Gündogar Ýewropa, tomusky wagt", "MYT": "Malaýziýa", "AKDT": "Alýaska, tomusky wagt", "ART": "Argentina, standart wagt", "CLST": "Çili, tomusky wagt", "ACWDT": "Merkezi Awstraliýa, günbatar tarap, tomusky wagt", "WITA": "Merkezi Indoneziýa", "EAT": "Gündogar Afrika", "MST": "MST", "WARST": "Günbatar Argentina, tomusky wagt", "GFT": "Fransuz Gwiana", "PST": "Ýuwaş umman, standart wagt", "COT": "Kolumbiýa, standart wagt", "CDT": "Merkezi Amerika, tomusky wagt", "AEST": "Gündogar Awstraliýa, standart wagt", "MEZ": "Merkezi Ýewropa, standart wagt", "UYST": "Urugwaý, tomusky wagt", "WEZ": "Günbatar Ýewropa, standart wagt", "HKT": "Gonkong, standart wagt", "GYT": "Gaýana", "CST": "Merkezi Amerika, standart wagt", "MESZ": "Merkezi Ýewropa, tomusky wagt", "HAST": "Gawaý-Aleut, standart wagt", "MDT": "MDT", "ARST": "Argentina, tomusky wagt", "ECT": "Ekwador", "HKST": "Gonkong, tomusky wagt", "IST": "Hindistan", "ChST": "Çamorro", "ADT": "Atlantika, tomusky wagt"},
+ timezones: map[string]string{"ART": "Argentina, standart wagt", "PST": "Ýuwaş umman, standart wagt", "WAT": "Günbatar Afrika, standart wagt", "CLST": "Çili, tomusky wagt", "WART": "Günbatar Argentina, standart wagt", "AWDT": "Günbatar Awstraliýa, tomusky wagt", "TMT": "Türkmenistan, standart wagt", "OESZ": "Gündogar Ýewropa, tomusky wagt", "BT": "Butan", "WARST": "Günbatar Argentina, tomusky wagt", "∅∅∅": "Azor adalary, tomusky wagt", "BOT": "Boliwiýa", "EDT": "Günorta Amerika, tomusky wagt", "COT": "Kolumbiýa, standart wagt", "CDT": "Merkezi Amerika, tomusky wagt", "CHAST": "Çatem, standart wagt", "LHDT": "Lord-Hau, tomusky wagt", "HAST": "Gawaý-Aleut, standart wagt", "GMT": "Grinwiç boýunça orta wagt", "UYST": "Urugwaý, tomusky wagt", "ADT": "Atlantika, tomusky wagt", "JDT": "Ýaponiýa, tomusky wagt", "VET": "Wenesuela", "HADT": "Gawaý-Aleut, tomusky wagt", "WESZ": "Günbatar Ýewropa, tomusky wagt", "MYT": "Malaýziýa", "UYT": "Urugwaý, standart wagt", "AWST": "Günbatar Awstraliýa, standart wagt", "WAST": "Günbatar Afrika, tomusky wagt", "HAT": "Nýufaundlend, tomusky wagt", "OEZ": "Gündogar Ýewropa, standart wagt", "AEDT": "Gündogar Awstraliýa, tomusky wagt", "ChST": "Çamorro", "EAT": "Gündogar Afrika", "ACDT": "Merkezi Awstraliýa, tomusky wagt", "NZST": "Täze Zelandiýa, standart wagt", "AKDT": "Alýaska, tomusky wagt", "IST": "Hindistan", "NZDT": "Täze Zelandiýa, tomusky wagt", "SGT": "Singapur, standart wagt", "WIT": "Gündogar Indoneziýa", "MST": "MST", "SAST": "Günorta Afrika, standart wagt", "ACWDT": "Merkezi Awstraliýa, günbatar tarap, tomusky wagt", "HNT": "Nýufaundlend, standart wagt", "AEST": "Gündogar Awstraliýa, standart wagt", "SRT": "Surinam", "AST": "Atlantika, standart wagt", "LHST": "Lord-Hau, standart wagt", "ACST": "Merkezi Awstraliýa, standart wagt", "PDT": "Ýuwaş umman, tomusky wagt", "ECT": "Ekwador", "ACWST": "Merkezi Awstraliýa, günbatar tarap, standart wagt", "WITA": "Merkezi Indoneziýa", "MESZ": "Merkezi Ýewropa, tomusky wagt", "TMST": "Türkmenistan, tomusky wagt", "COST": "Kolumbiýa, tomusky wagt", "WIB": "Günbatar Indoneziýa", "HKST": "Gonkong, tomusky wagt", "GYT": "Gaýana", "MDT": "MDT", "CHADT": "Çatem, tomusky wagt", "ARST": "Argentina, tomusky wagt", "JST": "Ýaponiýa, standart wagt", "EST": "Günorta Amerika, standart wagt", "WEZ": "Günbatar Ýewropa, standart wagt", "GFT": "Fransuz Gwiana", "AKST": "Alýaska, standart wagt", "MEZ": "Merkezi Ýewropa, standart wagt", "CAT": "Merkezi Afrika", "CLT": "Çili, standart wagt", "CST": "Merkezi Amerika, standart wagt", "HKT": "Gonkong, standart wagt"},
}
}
diff --git a/tk/tk_test.go b/tk/tk_test.go
new file mode 100644
index 00000000..489eb98b
--- /dev/null
+++ b/tk/tk_test.go
@@ -0,0 +1,1120 @@
+package tk
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "tk"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/tk_TM/tk_TM.go b/tk_TM/tk_TM.go
index 989140fe..83ba46d8 100644
--- a/tk_TM/tk_TM.go
+++ b/tk_TM/tk_TM.go
@@ -66,7 +66,7 @@ func New() locales.Translator {
daysAbbreviated: []string{"ýb", "db", "sb", "çb", "pb", "an", "şb"},
daysNarrow: []string{"Ý", "D", "S", "Ç", "P", "A", "Ş"},
daysWide: []string{"ýekşenbe", "duşenbe", "sişenbe", "çarşenbe", "penşenbe", "anna", "şenbe"},
- timezones: map[string]string{"PDT": "Ýuwaş umman, tomusky wagt", "ACWDT": "Merkezi Awstraliýa, günbatar tarap, tomusky wagt", "MDT": "Daglyk ýeri, tomusky wagt (ABŞ)", "WESZ": "Günbatar Ýewropa, tomusky wagt", "EDT": "Günorta Amerika, tomusky wagt", "CAT": "Merkezi Afrika", "ADT": "Atlantika, tomusky wagt", "EAT": "Gündogar Afrika", "UYT": "Urugwaý, standart wagt", "CHADT": "Çatem, tomusky wagt", "EST": "Günorta Amerika, standart wagt", "SGT": "Singapur, standart wagt", "OESZ": "Gündogar Ýewropa, tomusky wagt", "ART": "Argentina, standart wagt", "TMT": "Türkmenistan, standart wagt", "AEDT": "Gündogar Awstraliýa, tomusky wagt", "ECT": "Ekwador", "WAST": "Günbatar Afrika, tomusky wagt", "AKST": "Alýaska, standart wagt", "NZST": "Täze Zelandiýa, standart wagt", "BOT": "Boliwiýa", "AEST": "Gündogar Awstraliýa, standart wagt", "HAST": "Gawaý-Aleut, standart wagt", "HADT": "Gawaý-Aleut, tomusky wagt", "WART": "Günbatar Argentina, standart wagt", "HNT": "Nýufaundlend, standart wagt", "LHST": "Lord-Hau, standart wagt", "MYT": "Malaýziýa", "MEZ": "Merkezi Ýewropa, standart wagt", "CHAST": "Çatem, standart wagt", "BT": "Butan", "WITA": "Merkezi Indoneziýa", "LHDT": "Lord-Hau, tomusky wagt", "JST": "Ýaponiýa, standart wagt", "CST": "Merkezi Amerika, standart wagt", "ARST": "Argentina, tomusky wagt", "SRT": "Surinam", "MST": "Daglyk ýeri, standart wagt (ABŞ)", "WEZ": "Günbatar Ýewropa, standart wagt", "GMT": "Grinwiç boýunça orta wagt", "IST": "Hindistan", "ACST": "Merkezi Awstraliýa, standart wagt", "TMST": "Türkmenistan, tomusky wagt", "PST": "Ýuwaş umman, standart wagt", "ACWST": "Merkezi Awstraliýa, günbatar tarap, standart wagt", "ChST": "Çamorro", "COST": "Kolumbiýa, tomusky wagt", "GFT": "Fransuz Gwiana", "GYT": "Gaýana", "NZDT": "Täze Zelandiýa, tomusky wagt", "CLT": "Çili, standart wagt", "CLST": "Çili, tomusky wagt", "WAT": "Günbatar Afrika, standart wagt", "WIB": "Günbatar Indoneziýa", "AWST": "Günbatar Awstraliýa, standart wagt", "AWDT": "Günbatar Awstraliýa, tomusky wagt", "UYST": "Urugwaý, tomusky wagt", "AST": "Atlantika, standart wagt", "WARST": "Günbatar Argentina, tomusky wagt", "CDT": "Merkezi Amerika, tomusky wagt", "HKST": "Gonkong, tomusky wagt", "SAST": "Günorta Afrika, standart wagt", "OEZ": "Gündogar Ýewropa, standart wagt", "HAT": "Nýufaundlend, tomusky wagt", "MESZ": "Merkezi Ýewropa, tomusky wagt", "JDT": "Ýaponiýa, tomusky wagt", "COT": "Kolumbiýa, standart wagt", "HKT": "Gonkong, standart wagt", "WIT": "Gündogar Indoneziýa", "VET": "Wenesuela", "∅∅∅": "Braziliýa, tomusky wagt", "ACDT": "Merkezi Awstraliýa, tomusky wagt", "AKDT": "Alýaska, tomusky wagt"},
+ timezones: map[string]string{"CAT": "Merkezi Afrika", "MDT": "Daglyk ýeri, tomusky wagt (ABŞ)", "WART": "Günbatar Argentina, standart wagt", "EDT": "Günorta Amerika, tomusky wagt", "WESZ": "Günbatar Ýewropa, tomusky wagt", "LHST": "Lord-Hau, standart wagt", "ACDT": "Merkezi Awstraliýa, tomusky wagt", "ACWST": "Merkezi Awstraliýa, günbatar tarap, standart wagt", "ARST": "Argentina, tomusky wagt", "TMT": "Türkmenistan, standart wagt", "MST": "Daglyk ýeri, standart wagt (ABŞ)", "CDT": "Merkezi Amerika, tomusky wagt", "ECT": "Ekwador", "PDT": "Ýuwaş umman, tomusky wagt", "EST": "Günorta Amerika, standart wagt", "ACWDT": "Merkezi Awstraliýa, günbatar tarap, tomusky wagt", "AWST": "Günbatar Awstraliýa, standart wagt", "TMST": "Türkmenistan, tomusky wagt", "GYT": "Gaýana", "UYT": "Urugwaý, standart wagt", "UYST": "Urugwaý, tomusky wagt", "CHAST": "Çatem, standart wagt", "AKST": "Alýaska, standart wagt", "WITA": "Merkezi Indoneziýa", "BOT": "Boliwiýa", "HADT": "Gawaý-Aleut, tomusky wagt", "WAST": "Günbatar Afrika, tomusky wagt", "OESZ": "Gündogar Ýewropa, tomusky wagt", "WIT": "Gündogar Indoneziýa", "ACST": "Merkezi Awstraliýa, standart wagt", "WARST": "Günbatar Argentina, tomusky wagt", "AST": "Atlantika, standart wagt", "CLT": "Çili, standart wagt", "NZST": "Täze Zelandiýa, standart wagt", "COT": "Kolumbiýa, standart wagt", "AEST": "Gündogar Awstraliýa, standart wagt", "AKDT": "Alýaska, tomusky wagt", "AWDT": "Günbatar Awstraliýa, tomusky wagt", "NZDT": "Täze Zelandiýa, tomusky wagt", "OEZ": "Gündogar Ýewropa, standart wagt", "MYT": "Malaýziýa", "MESZ": "Merkezi Ýewropa, tomusky wagt", "WEZ": "Günbatar Ýewropa, standart wagt", "LHDT": "Lord-Hau, tomusky wagt", "JST": "Ýaponiýa, standart wagt", "MEZ": "Merkezi Ýewropa, standart wagt", "WIB": "Günbatar Indoneziýa", "CLST": "Çili, tomusky wagt", "HKT": "Gonkong, standart wagt", "SAST": "Günorta Afrika, standart wagt", "HAST": "Gawaý-Aleut, standart wagt", "HNT": "Nýufaundlend, standart wagt", "GFT": "Fransuz Gwiana", "ADT": "Atlantika, tomusky wagt", "PST": "Ýuwaş umman, standart wagt", "HAT": "Nýufaundlend, tomusky wagt", "COST": "Kolumbiýa, tomusky wagt", "EAT": "Gündogar Afrika", "∅∅∅": "Braziliýa, tomusky wagt", "CHADT": "Çatem, tomusky wagt", "VET": "Wenesuela", "JDT": "Ýaponiýa, tomusky wagt", "IST": "Hindistan", "SGT": "Singapur, standart wagt", "AEDT": "Gündogar Awstraliýa, tomusky wagt", "BT": "Butan", "CST": "Merkezi Amerika, standart wagt", "SRT": "Surinam", "ART": "Argentina, standart wagt", "WAT": "Günbatar Afrika, standart wagt", "GMT": "Grinwiç boýunça orta wagt", "ChST": "Çamorro", "HKST": "Gonkong, tomusky wagt"},
}
}
diff --git a/tk_TM/tk_TM_test.go b/tk_TM/tk_TM_test.go
new file mode 100644
index 00000000..8ac02016
--- /dev/null
+++ b/tk_TM/tk_TM_test.go
@@ -0,0 +1,1120 @@
+package tk_TM
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "tk_TM"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/to/to.go b/to/to.go
index 2796bd3a..efbf052a 100644
--- a/to/to.go
+++ b/to/to.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"KM", "TS"},
erasNarrow: []string{"", ""},
erasWide: []string{"ki muʻa", "taʻu ʻo Sīsū"},
- timezones: map[string]string{"JDT": "houa fakasiapani taimi liliu", "NZST": "houa fakanuʻusila taimi totonu", "WIB": "houa fakaʻinitonisia-hihifo", "OEZ": "houa fakaʻeulope-hahake taimi totonu", "MST": "houa fakaʻamelika-tokelau moʻunga taimi totonu", "IST": "houa fakaʻinitia", "LHST": "houa fakamotuʻeikihoue taimi totonu", "WEZ": "houa fakaʻeulope-hihifo taimi totonu", "GMT": "houa fakakiliniuisi mālie", "AKST": "houa fakaʻalasika taimi totonu", "CDT": "houa fakaʻamelika-tokelau loto taimi liliu", "BOT": "houa fakapolīvia", "UYST": "houa fakaʻulukuai taimi liliu", "PST": "houa fakaʻamelika-tokelau pasifika taimi totonu", "AWST": "houa fakaʻaositelēlia-hihifo taimi totonu", "CLST": "houa fakasili taimi liliu", "HAT": "houa fakafonuaʻilofoʻou taimi liliu", "TMST": "houa fakatūkimenisitani taimi liliu", "TMT": "houa fakatūkimenisitani taimi totonu", "JST": "houa fakasiapani taimi totonu", "SRT": "houa fakasuliname", "VET": "houa fakavenesuela", "AEDT": "houa fakaʻaositelēlia-hahake taimi liliu", "WARST": "houa fakaʻasenitina-hihifo taimi liliu", "WIT": "houa fakaʻinitonisia-hahake", "GYT": "houa fakakuiana", "ECT": "houa fakaʻekuetoa", "SGT": "houa fakasingapoa", "WAST": "houa fakaʻafelika-hihifo taimi liliu", "ChST": "houa fakakamolo", "EDT": "houa fakaʻamelika-tokelau hahake taimi liliu", "HAST": "houa fakahauaʻi taimi totonu", "HKST": "houa fakahongi-kongi taimi liliu", "ART": "houa fakaʻasenitina taimi totonu", "CST": "houa fakaʻamelika-tokelau loto taimi totonu", "MEZ": "houa fakaʻeulope-loto taimi totonu", "ACWST": "houa fakaʻaositelēlia-loto-hihifo taimi totonu", "LHDT": "houa fakamotuʻeikihoue taimi liliu", "EST": "houa fakaʻamelika-tokelau hahake taimi totonu", "COST": "houa fakakolomipia taimi liliu", "ARST": "houa fakaʻasenitina taimi liliu", "ACDT": "houa fakaʻaositelēlia-loto taimi liliu", "NZDT": "houa fakanuʻusila taimi liliu", "ACWDT": "houa fakaʻaositelēlia-loto-hihifo taimi liliu", "AST": "houa fakaʻamelika-tokelau ʻatalanitiki taimi totonu", "CLT": "houa fakasili taimi totonu", "ADT": "houa fakaʻamelika-tokelau ʻatalanitiki taimi liliu", "GFT": "houa fakakuiana-fakafalanisē", "∅∅∅": "houa fakapalāsila taimi liliu", "MYT": "houa fakamaleisia", "CHADT": "houa fakasatihami taimi liliu", "HKT": "houa fakahongi-kongi taimi totonu", "WART": "houa fakaʻasenitina-hihifo taimi totonu", "BT": "houa fakapūtani", "WITA": "houa fakaʻinitonisia-loto", "HNT": "houa fakafonuaʻilofoʻou taimi totonu", "EAT": "houa fakaʻafelika-hahake", "PDT": "houa fakaʻamelika-tokelau pasifika taimi liliu", "UYT": "houa fakaʻulukuai taimi totonu", "HADT": "houa fakahauaʻi taimi liliu", "WAT": "houa fakaʻafelika-hihifo taimi totonu", "ACST": "houa fakaʻaositelēlia-loto taimi totonu", "AKDT": "houa fakaʻalasika taimi liliu", "AWDT": "houa fakaʻaositelēlia-hihifo taimi liliu", "MESZ": "houa fakaʻeulope-loto taimi liliu", "CAT": "houa fakaʻafelika-loto", "OESZ": "houa fakaʻeulope-hahake taimi liliu", "COT": "houa fakakolomipia taimi totonu", "CHAST": "houa fakasatihami taimi totonu", "AEST": "houa fakaʻaositelēlia-hahake taimi totonu", "MDT": "houa fakaʻamelika-tokelau moʻunga taimi liliu", "WESZ": "houa fakaʻeulope-hihifo taimi liliu", "SAST": "houa fakaʻafelika-tonga"},
+ timezones: map[string]string{"ACDT": "houa fakaʻaositelēlia-loto taimi liliu", "ADT": "houa fakaʻamelika-tokelau ʻatalanitiki taimi liliu", "AKST": "houa fakaʻalasika taimi totonu", "WAT": "houa fakaʻafelika-hihifo taimi totonu", "HNT": "houa fakafonuaʻilofoʻou taimi totonu", "HAT": "houa fakafonuaʻilofoʻou taimi liliu", "TMST": "houa fakatūkimenisitani taimi liliu", "CLT": "houa fakasili taimi totonu", "AWDT": "houa fakaʻaositelēlia-hihifo taimi liliu", "WAST": "houa fakaʻafelika-hihifo taimi liliu", "EAT": "houa fakaʻafelika-hahake", "HKST": "houa fakahongi-kongi taimi liliu", "VET": "houa fakavenesuela", "NZDT": "houa fakanuʻusila taimi liliu", "TMT": "houa fakatūkimenisitani taimi totonu", "UYT": "houa fakaʻulukuai taimi totonu", "MDT": "houa fakaʻamelika-tokelau moʻunga taimi liliu", "ACWDT": "houa fakaʻaositelēlia-loto-hihifo taimi liliu", "WITA": "houa fakaʻinitonisia-loto", "WEZ": "houa fakaʻeulope-hihifo taimi totonu", "AEST": "houa fakaʻaositelēlia-hahake taimi totonu", "AWST": "houa fakaʻaositelēlia-hihifo taimi totonu", "HAST": "houa fakahauaʻi taimi totonu", "OESZ": "houa fakaʻeulope-hahake taimi liliu", "ECT": "houa fakaʻekuetoa", "AEDT": "houa fakaʻaositelēlia-hahake taimi liliu", "MYT": "houa fakamaleisia", "CST": "houa fakaʻamelika-tokelau loto taimi totonu", "JDT": "houa fakasiapani taimi liliu", "LHDT": "houa fakamotuʻeikihoue taimi liliu", "CHADT": "houa fakasatihami taimi liliu", "AST": "houa fakaʻamelika-tokelau ʻatalanitiki taimi totonu", "PST": "houa fakaʻamelika-tokelau pasifika taimi totonu", "PDT": "houa fakaʻamelika-tokelau pasifika taimi liliu", "COST": "houa fakakolomipia taimi liliu", "WART": "houa fakaʻasenitina-hihifo taimi totonu", "WIT": "houa fakaʻinitonisia-hahake", "ACWST": "houa fakaʻaositelēlia-loto-hihifo taimi totonu", "AKDT": "houa fakaʻalasika taimi liliu", "EDT": "houa fakaʻamelika-tokelau hahake taimi liliu", "HADT": "houa fakahauaʻi taimi liliu", "MST": "houa fakaʻamelika-tokelau moʻunga taimi totonu", "ARST": "houa fakaʻasenitina taimi liliu", "COT": "houa fakakolomipia taimi totonu", "CDT": "houa fakaʻamelika-tokelau loto taimi liliu", "GYT": "houa fakakuiana", "GFT": "houa fakakuiana-fakafalanisē", "HKT": "houa fakahongi-kongi taimi totonu", "IST": "houa fakaʻinitia", "BOT": "houa fakapolīvia", "CAT": "houa fakaʻafelika-loto", "ChST": "houa fakakamolo", "WESZ": "houa fakaʻeulope-hihifo taimi liliu", "ACST": "houa fakaʻaositelēlia-loto taimi totonu", "OEZ": "houa fakaʻeulope-hahake taimi totonu", "LHST": "houa fakamotuʻeikihoue taimi totonu", "UYST": "houa fakaʻulukuai taimi liliu", "WARST": "houa fakaʻasenitina-hihifo taimi liliu", "CHAST": "houa fakasatihami taimi totonu", "ART": "houa fakaʻasenitina taimi totonu", "MESZ": "houa fakaʻeulope-loto taimi liliu", "GMT": "houa fakakiliniuisi mālie", "SGT": "houa fakasingapoa", "NZST": "houa fakanuʻusila taimi totonu", "CLST": "houa fakasili taimi liliu", "EST": "houa fakaʻamelika-tokelau hahake taimi totonu", "MEZ": "houa fakaʻeulope-loto taimi totonu", "WIB": "houa fakaʻinitonisia-hihifo", "BT": "houa fakapūtani", "SRT": "houa fakasuliname", "JST": "houa fakasiapani taimi totonu", "SAST": "houa fakaʻafelika-tonga", "∅∅∅": "houa fakapelū taimi liliu"},
}
}
diff --git a/to/to_test.go b/to/to_test.go
new file mode 100644
index 00000000..93818676
--- /dev/null
+++ b/to/to_test.go
@@ -0,0 +1,1120 @@
+package to
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "to"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/to_TO/to_TO.go b/to_TO/to_TO.go
index 27b6d6d7..68b94322 100644
--- a/to_TO/to_TO.go
+++ b/to_TO/to_TO.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"KM", "TS"},
erasNarrow: []string{"", ""},
erasWide: []string{"ki muʻa", "taʻu ʻo Sīsū"},
- timezones: map[string]string{"COT": "houa fakakolomipia taimi totonu", "ECT": "houa fakaʻekuetoa", "WARST": "houa fakaʻasenitina-hihifo taimi liliu", "BOT": "houa fakapolīvia", "UYST": "houa fakaʻulukuai taimi liliu", "CLST": "houa fakasili taimi liliu", "SAST": "houa fakaʻafelika-tonga", "GYT": "houa fakakuiana", "MYT": "houa fakamaleisia", "JST": "houa fakasiapani taimi totonu", "BT": "houa fakapūtani", "ACDT": "houa fakaʻaositelēlia-loto taimi liliu", "LHST": "houa fakamotuʻeikihoue taimi totonu", "WEZ": "houa fakaʻeulope-hihifo taimi totonu", "AEST": "houa fakaʻaositelēlia-hahake taimi totonu", "IST": "houa fakaʻinitia", "MDT": "houa fakamakau taimi liliu", "ART": "houa fakaʻasenitina taimi totonu", "ARST": "houa fakaʻasenitina taimi liliu", "WIB": "houa fakaʻinitonisia-hihifo", "NZST": "houa fakanuʻusila taimi totonu", "CAT": "houa fakaʻafelika-loto", "WAST": "houa fakaʻafelika-hihifo taimi liliu", "HNT": "houa fakafonuaʻilofoʻou taimi totonu", "MESZ": "houa fakaʻeulope-loto taimi liliu", "LHDT": "houa fakamotuʻeikihoue taimi liliu", "VET": "houa fakavenesuela", "EST": "houa fakaʻamelika-tokelau hahake taimi totonu", "EDT": "houa fakaʻamelika-tokelau hahake taimi liliu", "WITA": "houa fakaʻinitonisia-loto", "AWDT": "houa fakaʻaositelēlia-hihifo taimi liliu", "GFT": "houa fakakuiana-fakafalanisē", "EAT": "houa fakaʻafelika-hahake", "MEZ": "houa fakaʻeulope-loto taimi totonu", "CDT": "houa fakaʻamelika-tokelau loto taimi liliu", "CHADT": "houa fakasatihami taimi liliu", "∅∅∅": "houa fakapalāsila taimi liliu", "HKST": "houa fakahongi-kongi taimi liliu", "OEZ": "houa fakaʻeulope-hahake taimi totonu", "OESZ": "houa fakaʻeulope-hahake taimi liliu", "CST": "houa fakaʻamelika-tokelau loto taimi totonu", "ADT": "houa fakaʻamelika-tokelau ʻatalanitiki taimi liliu", "WART": "houa fakaʻasenitina-hihifo taimi totonu", "HKT": "houa fakahongi-kongi taimi totonu", "TMT": "houa fakatūkimenisitani taimi totonu", "ChST": "houa fakakamolo", "SGT": "houa fakasingapoa", "WAT": "houa fakaʻafelika-hihifo taimi totonu", "MST": "houa fakamakau taimi totonu", "CLT": "houa fakasili taimi totonu", "JDT": "houa fakasiapani taimi liliu", "AWST": "houa fakaʻaositelēlia-hihifo taimi totonu", "UYT": "houa fakaʻulukuai taimi totonu", "NZDT": "houa fakanuʻusila taimi liliu", "TMST": "houa fakatūkimenisitani taimi liliu", "AKST": "houa fakaʻalasika taimi totonu", "ACWDT": "houa fakaʻaositelēlia-loto-hihifo taimi liliu", "WIT": "houa fakaʻinitonisia-hahake", "HAT": "houa fakafonuaʻilofoʻou taimi liliu", "ACST": "houa fakaʻaositelēlia-loto taimi totonu", "SRT": "houa fakasuliname", "COST": "houa fakakolomipia taimi liliu", "AST": "houa fakaʻamelika-tokelau ʻatalanitiki taimi totonu", "HAST": "houa fakahauaʻi taimi totonu", "HADT": "houa fakahauaʻi taimi liliu", "PST": "houa fakaʻamelika-tokelau pasifika taimi totonu", "PDT": "houa fakaʻamelika-tokelau pasifika taimi liliu", "WESZ": "houa fakaʻeulope-hihifo taimi liliu", "ACWST": "houa fakaʻaositelēlia-loto-hihifo taimi totonu", "GMT": "houa fakakiliniuisi mālie", "AKDT": "houa fakaʻalasika taimi liliu", "CHAST": "houa fakasatihami taimi totonu", "AEDT": "houa fakaʻaositelēlia-hahake taimi liliu"},
+ timezones: map[string]string{"COST": "houa fakakolomipia taimi liliu", "CHAST": "houa fakasatihami taimi totonu", "AST": "houa fakaʻamelika-tokelau ʻatalanitiki taimi totonu", "AWDT": "houa fakaʻaositelēlia-hihifo taimi liliu", "UYST": "houa fakaʻulukuai taimi liliu", "BT": "houa fakapūtani", "GFT": "houa fakakuiana-fakafalanisē", "JST": "houa fakasiapani taimi totonu", "IST": "houa fakaʻinitia", "MESZ": "houa fakaʻeulope-loto taimi liliu", "WAT": "houa fakaʻafelika-hihifo taimi totonu", "WEZ": "houa fakaʻeulope-hihifo taimi totonu", "WESZ": "houa fakaʻeulope-hihifo taimi liliu", "WARST": "houa fakaʻasenitina-hihifo taimi liliu", "MST": "houa fakamakau taimi totonu", "ADT": "houa fakaʻamelika-tokelau ʻatalanitiki taimi liliu", "SAST": "houa fakaʻafelika-tonga", "SRT": "houa fakasuliname", "EST": "houa fakaʻamelika-tokelau hahake taimi totonu", "OEZ": "houa fakaʻeulope-hahake taimi totonu", "EAT": "houa fakaʻafelika-hahake", "MDT": "houa fakamakau taimi liliu", "HKST": "houa fakahongi-kongi taimi liliu", "AWST": "houa fakaʻaositelēlia-hihifo taimi totonu", "CHADT": "houa fakasatihami taimi liliu", "JDT": "houa fakasiapani taimi liliu", "GMT": "houa fakakiliniuisi mālie", "CLT": "houa fakasili taimi totonu", "ECT": "houa fakaʻekuetoa", "NZDT": "houa fakanuʻusila taimi liliu", "EDT": "houa fakaʻamelika-tokelau hahake taimi liliu", "ACDT": "houa fakaʻaositelēlia-loto taimi liliu", "NZST": "houa fakanuʻusila taimi totonu", "LHST": "houa fakamotuʻeikihoue taimi totonu", "ACST": "houa fakaʻaositelēlia-loto taimi totonu", "AEST": "houa fakaʻaositelēlia-hahake taimi totonu", "VET": "houa fakavenesuela", "HAST": "houa fakahauaʻi taimi totonu", "PST": "houa fakaʻamelika-tokelau pasifika taimi totonu", "SGT": "houa fakasingapoa", "OESZ": "houa fakaʻeulope-hahake taimi liliu", "AEDT": "houa fakaʻaositelēlia-hahake taimi liliu", "∅∅∅": "houa fakaʻāsolesi taimi liliu", "WAST": "houa fakaʻafelika-hihifo taimi liliu", "HNT": "houa fakafonuaʻilofoʻou taimi totonu", "TMST": "houa fakatūkimenisitani taimi liliu", "UYT": "houa fakaʻulukuai taimi totonu", "ACWST": "houa fakaʻaositelēlia-loto-hihifo taimi totonu", "ART": "houa fakaʻasenitina taimi totonu", "BOT": "houa fakapolīvia", "ARST": "houa fakaʻasenitina taimi liliu", "HADT": "houa fakahauaʻi taimi liliu", "WIB": "houa fakaʻinitonisia-hihifo", "TMT": "houa fakatūkimenisitani taimi totonu", "ChST": "houa fakakamolo", "WITA": "houa fakaʻinitonisia-loto", "AKST": "houa fakaʻalasika taimi totonu", "AKDT": "houa fakaʻalasika taimi liliu", "HKT": "houa fakahongi-kongi taimi totonu", "COT": "houa fakakolomipia taimi totonu", "WIT": "houa fakaʻinitonisia-hahake", "CST": "houa fakaʻamelika-tokelau loto taimi totonu", "CDT": "houa fakaʻamelika-tokelau loto taimi liliu", "WART": "houa fakaʻasenitina-hihifo taimi totonu", "ACWDT": "houa fakaʻaositelēlia-loto-hihifo taimi liliu", "MEZ": "houa fakaʻeulope-loto taimi totonu", "CAT": "houa fakaʻafelika-loto", "GYT": "houa fakakuiana", "CLST": "houa fakasili taimi liliu", "MYT": "houa fakamaleisia", "PDT": "houa fakaʻamelika-tokelau pasifika taimi liliu", "HAT": "houa fakafonuaʻilofoʻou taimi liliu", "LHDT": "houa fakamotuʻeikihoue taimi liliu"},
}
}
diff --git a/to_TO/to_TO_test.go b/to_TO/to_TO_test.go
new file mode 100644
index 00000000..2fac3a8e
--- /dev/null
+++ b/to_TO/to_TO_test.go
@@ -0,0 +1,1120 @@
+package to_TO
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "to_TO"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/tr/tr.go b/tr/tr.go
index b134018b..ebf46ee3 100644
--- a/tr/tr.go
+++ b/tr/tr.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"MÖ", "MS"},
erasNarrow: []string{"", ""},
erasWide: []string{"Milattan Önce", "Milattan Sonra"},
- timezones: map[string]string{"ECT": "Ekvador Saati", "WIB": "Batı Endonezya Saati", "AEDT": "Doğu Avustralya Yaz Saati", "NZST": "Yeni Zelanda Standart Saati", "WITA": "Orta Endonezya Saati", "AKST": "Alaska Standart Saati", "AWDT": "Batı Avustralya Yaz Saati", "UYT": "Uruguay Standart Saati", "SGT": "Singapur Standart Saati", "ACST": "Orta Avustralya Standart Saati", "WEZ": "Batı Avrupa Standart Saati", "WESZ": "Batı Avrupa Yaz Saati", "TMST": "Türkmenistan Yaz Saati", "ARST": "Arjantin Yaz Saati", "JST": "Japonya Standart Saati", "JDT": "Japonya Yaz Saati", "EDT": "Kuzey Amerika Doğu Yaz Saati", "WART": "Batı Arjantin Standart Saati", "WAST": "Batı Afrika Yaz Saati", "OESZ": "Doğu Avrupa Yaz Saati", "BOT": "Bolivya Saati", "CAT": "Orta Afrika Saati", "HKST": "Hong Kong Yaz Saati", "TMT": "Türkmenistan Standart Saati", "MDT": "Makao Yaz Saati", "MEZ": "Orta Avrupa Standart Saati", "ACWST": "İçbatı Avustralya Standart Saati", "HADT": "Hawaii-Aleut Yaz Saati", "MST": "Makao Standart Saati", "PST": "Kuzey Amerika Pasifik Standart Saati", "LHDT": "Lord Howe Yaz Saati", "EAT": "Doğu Afrika Saati", "GYT": "Guyana Saati", "CHADT": "Chatham Yaz Saati", "WARST": "Batı Arjantin Yaz Saati", "WIT": "Doğu Endonezya Saati", "ART": "Arjantin Standart Saati", "AWST": "Batı Avustralya Standart Saati", "MESZ": "Orta Avrupa Yaz Saati", "HAST": "Hawaii-Aleut Standart Saati", "OEZ": "Doğu Avrupa Standart Saati", "GMT": "Greenwich Ortalama Saati", "MYT": "Malezya Saati", "CST": "Kuzey Amerika Merkezi Standart Saati", "CDT": "Kuzey Amerika Merkezi Yaz Saati", "CLST": "Şili Yaz Saati", "ACWDT": "İçbatı Avustralya Yaz Saati", "BT": "Bhutan Saati", "HAT": "Newfoundland Yaz Saati", "SRT": "Surinam Saati", "AKDT": "Alaska Yaz Saati", "NZDT": "Yeni Zelanda Yaz Saati", "VET": "Venezuela Saati", "ADT": "Atlantik Yaz Saati", "HKT": "Hong Kong Standart Saati", "IST": "Hindistan Standart Saati", "UYST": "Uruguay Yaz Saati", "COT": "Kolombiya Standart Saati", "GFT": "Fransız Guyanası Saati", "CHAST": "Chatham Standart Saati", "AEST": "Doğu Avustralya Standart Saati", "∅∅∅": "Brasilia Yaz Saati", "EST": "Kuzey Amerika Doğu Standart Saati", "AST": "Atlantik Standart Saati", "HNT": "Newfoundland Standart Saati", "CLT": "Şili Standart Saati", "COST": "Kolombiya Yaz Saati", "SAST": "Güney Afrika Standart Saati", "PDT": "Kuzey Amerika Pasifik Yaz Saati", "LHST": "Lord Howe Standart Saati", "WAT": "Batı Afrika Standart Saati", "ACDT": "Orta Avustralya Yaz Saati", "ChST": "Chamorro Saati"},
+ timezones: map[string]string{"HNT": "Newfoundland Standart Saati", "CLST": "Şili Yaz Saati", "ACDT": "Orta Avustralya Yaz Saati", "ECT": "Ekvador Saati", "HADT": "Hawaii-Aleut Yaz Saati", "HKST": "Hong Kong Yaz Saati", "GMT": "Greenwich Ortalama Saati", "AEST": "Doğu Avustralya Standart Saati", "WIT": "Doğu Endonezya Saati", "ACWST": "İçbatı Avustralya Standart Saati", "JDT": "Japonya Yaz Saati", "PST": "Kuzey Amerika Pasifik Standart Saati", "LHST": "Lord Howe Standart Saati", "MDT": "Kuzey Amerika Dağ Yaz Saati", "ACWDT": "İçbatı Avustralya Yaz Saati", "WAT": "Batı Afrika Standart Saati", "MYT": "Malezya Saati", "CHADT": "Chatham Yaz Saati", "VET": "Venezuela Saati", "AKST": "Alaska Standart Saati", "PDT": "Kuzey Amerika Pasifik Yaz Saati", "CAT": "Orta Afrika Saati", "AST": "Atlantik Standart Saati", "NZST": "Yeni Zelanda Standart Saati", "NZDT": "Yeni Zelanda Yaz Saati", "HAT": "Newfoundland Yaz Saati", "SGT": "Singapur Standart Saati", "COST": "Kolombiya Yaz Saati", "CLT": "Şili Standart Saati", "UYST": "Uruguay Yaz Saati", "SAST": "Güney Afrika Standart Saati", "BOT": "Bolivya Saati", "COT": "Kolombiya Standart Saati", "WIB": "Batı Endonezya Saati", "GYT": "Guyana Saati", "ACST": "Orta Avustralya Standart Saati", "SRT": "Surinam Saati", "GFT": "Fransız Guyanası Saati", "EST": "Kuzey Amerika Doğu Standart Saati", "HAST": "Hawaii-Aleut Standart Saati", "CST": "Kuzey Amerika Merkezi Standart Saati", "CHAST": "Chatham Standart Saati", "AWST": "Batı Avustralya Standart Saati", "ARST": "Arjantin Yaz Saati", "WITA": "Orta Endonezya Saati", "IST": "Hindistan Standart Saati", "WESZ": "Batı Avrupa Yaz Saati", "OESZ": "Doğu Avrupa Yaz Saati", "AEDT": "Doğu Avustralya Yaz Saati", "ChST": "Chamorro Saati", "∅∅∅": "Brasilia Yaz Saati", "AKDT": "Alaska Yaz Saati", "LHDT": "Lord Howe Yaz Saati", "CDT": "Kuzey Amerika Merkezi Yaz Saati", "WEZ": "Batı Avrupa Standart Saati", "UYT": "Uruguay Standart Saati", "MEZ": "Orta Avrupa Standart Saati", "ART": "Arjantin Standart Saati", "EDT": "Kuzey Amerika Doğu Yaz Saati", "MESZ": "Orta Avrupa Yaz Saati", "TMT": "Türkmenistan Standart Saati", "TMST": "Türkmenistan Yaz Saati", "MST": "Kuzey Amerika Dağ Standart Saati", "HKT": "Hong Kong Standart Saati", "JST": "Japonya Standart Saati", "WAST": "Batı Afrika Yaz Saati", "BT": "Bhutan Saati", "WART": "Batı Arjantin Standart Saati", "WARST": "Batı Arjantin Yaz Saati", "ADT": "Atlantik Yaz Saati", "AWDT": "Batı Avustralya Yaz Saati", "OEZ": "Doğu Avrupa Standart Saati", "EAT": "Doğu Afrika Saati"},
}
}
diff --git a/tr/tr_test.go b/tr/tr_test.go
new file mode 100644
index 00000000..10c9e2e0
--- /dev/null
+++ b/tr/tr_test.go
@@ -0,0 +1,1120 @@
+package tr
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "tr"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/tr_CY/tr_CY.go b/tr_CY/tr_CY.go
index 38db3ab3..2c472db2 100644
--- a/tr_CY/tr_CY.go
+++ b/tr_CY/tr_CY.go
@@ -48,7 +48,7 @@ func New() locales.Translator {
locale: "tr_CY",
pluralsCardinal: []locales.PluralRule{2, 6},
pluralsOrdinal: []locales.PluralRule{6},
- pluralsRange: []locales.PluralRule{2, 6},
+ pluralsRange: []locales.PluralRule{6, 2},
decimal: ",",
group: ".",
minus: "-",
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"MÖ", "MS"},
erasNarrow: []string{"", ""},
erasWide: []string{"Milattan Önce", "Milattan Sonra"},
- timezones: map[string]string{"ACWST": "İçbatı Avustralya Standart Saati", "HKST": "Hong Kong Yaz Saati", "GMT": "Greenwich Ortalama Saati", "HAT": "Newfoundland Yaz Saati", "GFT": "Fransız Guyanası Saati", "AWDT": "Batı Avustralya Yaz Saati", "LHST": "Lord Howe Standart Saati", "MEZ": "Orta Avrupa Standart Saati", "WITA": "Orta Endonezya Saati", "MST": "Makao Standart Saati", "ACDT": "Orta Avustralya Yaz Saati", "∅∅∅": "Amazon Yaz Saati", "WESZ": "Batı Avrupa Yaz Saati", "BT": "Bhutan Saati", "SGT": "Singapur Standart Saati", "WIT": "Doğu Endonezya Saati", "ART": "Arjantin Standart Saati", "JST": "Japonya Standart Saati", "JDT": "Japonya Yaz Saati", "AKDT": "Alaska Yaz Saati", "EST": "Kuzey Amerika Doğu Standart Saati", "HNT": "Newfoundland Standart Saati", "PST": "Kuzey Amerika Pasifik Standart Saati", "AEDT": "Doğu Avustralya Yaz Saati", "CHADT": "Chatham Yaz Saati", "HADT": "Hawaii-Aleut Yaz Saati", "WAT": "Batı Afrika Standart Saati", "MESZ": "Orta Avrupa Yaz Saati", "ChST": "Chamorro Saati", "ECT": "Ekvador Saati", "HAST": "Hawaii-Aleut Standart Saati", "OESZ": "Doğu Avrupa Yaz Saati", "ACST": "Orta Avustralya Standart Saati", "SRT": "Surinam Saati", "AWST": "Batı Avustralya Standart Saati", "LHDT": "Lord Howe Yaz Saati", "COT": "Kolombiya Standart Saati", "CLT": "Şili Standart Saati", "CLST": "Şili Yaz Saati", "ACWDT": "İçbatı Avustralya Yaz Saati", "EDT": "Kuzey Amerika Doğu Yaz Saati", "AST": "Atlantik Standart Saati", "TMST": "Türkmenistan Yaz Saati", "VET": "Venezuela Saati", "NZST": "Yeni Zelanda Standart Saati", "CHAST": "Chatham Standart Saati", "WIB": "Batı Endonezya Saati", "IST": "Hindistan Standart Saati", "EAT": "Doğu Afrika Saati", "AKST": "Alaska Standart Saati", "GYT": "Guyana Saati", "CDT": "Kuzey Amerika Merkezi Yaz Saati", "WAST": "Batı Afrika Yaz Saati", "WART": "Batı Arjantin Standart Saati", "PDT": "Kuzey Amerika Pasifik Yaz Saati", "MYT": "Malezya Saati", "BOT": "Bolivya Saati", "UYST": "Uruguay Yaz Saati", "WEZ": "Batı Avrupa Standart Saati", "CAT": "Orta Afrika Saati", "MDT": "Makao Yaz Saati", "SAST": "Güney Afrika Standart Saati", "ARST": "Arjantin Yaz Saati", "AEST": "Doğu Avustralya Standart Saati", "NZDT": "Yeni Zelanda Yaz Saati", "UYT": "Uruguay Standart Saati", "COST": "Kolombiya Yaz Saati", "ADT": "Atlantik Yaz Saati", "HKT": "Hong Kong Standart Saati", "WARST": "Batı Arjantin Yaz Saati", "OEZ": "Doğu Avrupa Standart Saati", "TMT": "Türkmenistan Standart Saati", "CST": "Kuzey Amerika Merkezi Standart Saati"},
+ timezones: map[string]string{"HNT": "Newfoundland Standart Saati", "ACST": "Orta Avustralya Standart Saati", "∅∅∅": "Azorlar Yaz Saati", "HADT": "Hawaii-Aleut Yaz Saati", "NZST": "Yeni Zelanda Standart Saati", "HAT": "Newfoundland Yaz Saati", "CDT": "Kuzey Amerika Merkezi Yaz Saati", "AST": "Atlantik Standart Saati", "ADT": "Atlantik Yaz Saati", "EST": "Kuzey Amerika Doğu Standart Saati", "LHST": "Lord Howe Standart Saati", "LHDT": "Lord Howe Yaz Saati", "ECT": "Ekvador Saati", "VET": "Venezuela Saati", "JST": "Japonya Standart Saati", "IST": "Hindistan Standart Saati", "CLT": "Şili Standart Saati", "CHADT": "Chatham Yaz Saati", "AWST": "Batı Avustralya Standart Saati", "WITA": "Orta Endonezya Saati", "AKST": "Alaska Standart Saati", "WESZ": "Batı Avrupa Yaz Saati", "TMST": "Türkmenistan Yaz Saati", "GMT": "Greenwich Ortalama Saati", "CST": "Kuzey Amerika Merkezi Standart Saati", "HKST": "Hong Kong Yaz Saati", "PDT": "Kuzey Amerika Pasifik Yaz Saati", "SAST": "Güney Afrika Standart Saati", "WART": "Batı Arjantin Standart Saati", "TMT": "Türkmenistan Standart Saati", "ARST": "Arjantin Yaz Saati", "HAST": "Hawaii-Aleut Standart Saati", "WAST": "Batı Afrika Yaz Saati", "GYT": "Guyana Saati", "WARST": "Batı Arjantin Yaz Saati", "ACDT": "Orta Avustralya Yaz Saati", "GFT": "Fransız Guyanası Saati", "MDT": "Makao Yaz Saati", "HKT": "Hong Kong Standart Saati", "PST": "Kuzey Amerika Pasifik Standart Saati", "COT": "Kolombiya Standart Saati", "CLST": "Şili Yaz Saati", "SGT": "Singapur Standart Saati", "COST": "Kolombiya Yaz Saati", "WAT": "Batı Afrika Standart Saati", "AEST": "Doğu Avustralya Standart Saati", "AWDT": "Batı Avustralya Yaz Saati", "MESZ": "Orta Avrupa Yaz Saati", "CAT": "Orta Afrika Saati", "UYT": "Uruguay Standart Saati", "UYST": "Uruguay Yaz Saati", "WIT": "Doğu Endonezya Saati", "EDT": "Kuzey Amerika Doğu Yaz Saati", "WIB": "Batı Endonezya Saati", "ChST": "Chamorro Saati", "MYT": "Malezya Saati", "MST": "Makao Standart Saati", "ART": "Arjantin Standart Saati", "OESZ": "Doğu Avrupa Yaz Saati", "EAT": "Doğu Afrika Saati", "BT": "Bhutan Saati", "SRT": "Surinam Saati", "ACWST": "İçbatı Avustralya Standart Saati", "JDT": "Japonya Yaz Saati", "MEZ": "Orta Avrupa Standart Saati", "ACWDT": "İçbatı Avustralya Yaz Saati", "BOT": "Bolivya Saati", "WEZ": "Batı Avrupa Standart Saati", "AEDT": "Doğu Avustralya Yaz Saati", "CHAST": "Chatham Standart Saati", "AKDT": "Alaska Yaz Saati", "NZDT": "Yeni Zelanda Yaz Saati", "OEZ": "Doğu Avrupa Standart Saati"},
}
}
diff --git a/tr_CY/tr_CY_test.go b/tr_CY/tr_CY_test.go
new file mode 100644
index 00000000..f9564a8d
--- /dev/null
+++ b/tr_CY/tr_CY_test.go
@@ -0,0 +1,1120 @@
+package tr_CY
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "tr_CY"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/tr_TR/tr_TR.go b/tr_TR/tr_TR.go
index 461f055e..c5e243fe 100644
--- a/tr_TR/tr_TR.go
+++ b/tr_TR/tr_TR.go
@@ -73,7 +73,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"MÖ", "MS"},
erasNarrow: []string{"", ""},
erasWide: []string{"Milattan Önce", "Milattan Sonra"},
- timezones: map[string]string{"CDT": "Kuzey Amerika Merkezi Yaz Saati", "PDT": "Kuzey Amerika Pasifik Yaz Saati", "MDT": "Kuzey Amerika Dağ Yaz Saati", "ECT": "Ekvador Saati", "GFT": "Fransız Guyanası Saati", "CST": "Kuzey Amerika Merkezi Standart Saati", "NZST": "Yeni Zelanda Standart Saati", "AEST": "Doğu Avustralya Standart Saati", "CHAST": "Chatham Standart Saati", "MESZ": "Orta Avrupa Yaz Saati", "AEDT": "Doğu Avustralya Yaz Saati", "ChST": "Chamorro Saati", "EDT": "Kuzey Amerika Doğu Yaz Saati", "HAT": "Newfoundland Yaz Saati", "IST": "Hindistan Standart Saati", "UYT": "Uruguay Standart Saati", "AKST": "Alaska Standart Saati", "BOT": "Bolivya Saati", "CAT": "Orta Afrika Saati", "HAST": "Hawaii-Aleut Standart Saati", "OESZ": "Doğu Avrupa Yaz Saati", "WIB": "Batı Endonezya Saati", "ACST": "Orta Avustralya Standart Saati", "AWST": "Batı Avustralya Standart Saati", "TMST": "Türkmenistan Yaz Saati", "AWDT": "Batı Avustralya Yaz Saati", "ACWDT": "İçbatı Avustralya Yaz Saati", "MST": "Kuzey Amerika Dağ Standart Saati", "PST": "Kuzey Amerika Pasifik Standart Saati", "MEZ": "Orta Avrupa Standart Saati", "ADT": "Atlantik Yaz Saati", "ART": "Arjantin Standart Saati", "SRT": "Surinam Saati", "CLT": "Şili Standart Saati", "WEZ": "Batı Avrupa Standart Saati", "EST": "Kuzey Amerika Doğu Standart Saati", "BT": "Bhutan Saati", "WARST": "Batı Arjantin Yaz Saati", "HNT": "Newfoundland Standart Saati", "UYST": "Uruguay Yaz Saati", "COT": "Kolombiya Standart Saati", "COST": "Kolombiya Yaz Saati", "WAT": "Batı Afrika Standart Saati", "OEZ": "Doğu Avrupa Standart Saati", "NZDT": "Yeni Zelanda Yaz Saati", "JST": "Japonya Standart Saati", "CHADT": "Chatham Yaz Saati", "VET": "Venezuela Saati", "HKST": "Hong Kong Yaz Saati", "ARST": "Arjantin Yaz Saati", "LHDT": "Lord Howe Yaz Saati", "GYT": "Guyana Saati", "ACWST": "İçbatı Avustralya Standart Saati", "CLST": "Şili Yaz Saati", "GMT": "Greenwich Ortalama Saati", "LHST": "Lord Howe Standart Saati", "SAST": "Güney Afrika Standart Saati", "WIT": "Doğu Endonezya Saati", "ACDT": "Orta Avustralya Yaz Saati", "∅∅∅": "Azorlar Yaz Saati", "SGT": "Singapur Standart Saati", "JDT": "Japonya Yaz Saati", "AKDT": "Alaska Yaz Saati", "HADT": "Hawaii-Aleut Yaz Saati", "HKT": "Hong Kong Standart Saati", "TMT": "Türkmenistan Standart Saati", "MYT": "Malezya Saati", "WAST": "Batı Afrika Yaz Saati", "WART": "Batı Arjantin Standart Saati", "WITA": "Orta Endonezya Saati", "EAT": "Doğu Afrika Saati", "WESZ": "Batı Avrupa Yaz Saati", "AST": "Atlantik Standart Saati"},
+ timezones: map[string]string{"BOT": "Bolivya Saati", "AWST": "Batı Avustralya Standart Saati", "TMT": "Türkmenistan Standart Saati", "HNT": "Newfoundland Standart Saati", "AEST": "Doğu Avustralya Standart Saati", "GYT": "Guyana Saati", "BT": "Bhutan Saati", "NZDT": "Yeni Zelanda Yaz Saati", "WIB": "Batı Endonezya Saati", "WAST": "Batı Afrika Yaz Saati", "WEZ": "Batı Avrupa Standart Saati", "ChST": "Chamorro Saati", "HKST": "Hong Kong Yaz Saati", "ACWDT": "İçbatı Avustralya Yaz Saati", "MDT": "Kuzey Amerika Dağ Yaz Saati", "WARST": "Batı Arjantin Yaz Saati", "CHAST": "Chatham Standart Saati", "AKST": "Alaska Standart Saati", "OEZ": "Doğu Avrupa Standart Saati", "UYT": "Uruguay Standart Saati", "LHDT": "Lord Howe Yaz Saati", "ADT": "Atlantik Yaz Saati", "ART": "Arjantin Standart Saati", "EST": "Kuzey Amerika Doğu Standart Saati", "GFT": "Fransız Guyanası Saati", "TMST": "Türkmenistan Yaz Saati", "WAT": "Batı Afrika Standart Saati", "HAT": "Newfoundland Yaz Saati", "GMT": "Greenwich Ortalama Saati", "VET": "Venezuela Saati", "CLT": "Şili Standart Saati", "ECT": "Ekvador Saati", "JST": "Japonya Standart Saati", "AKDT": "Alaska Yaz Saati", "NZST": "Yeni Zelanda Standart Saati", "PDT": "Kuzey Amerika Pasifik Yaz Saati", "∅∅∅": "Amazon Yaz Saati", "SGT": "Singapur Standart Saati", "WITA": "Orta Endonezya Saati", "COST": "Kolombiya Yaz Saati", "OESZ": "Doğu Avrupa Yaz Saati", "LHST": "Lord Howe Standart Saati", "CLST": "Şili Yaz Saati", "CDT": "Kuzey Amerika Merkezi Yaz Saati", "EAT": "Doğu Afrika Saati", "JDT": "Japonya Yaz Saati", "AST": "Atlantik Standart Saati", "AWDT": "Batı Avustralya Yaz Saati", "HADT": "Hawaii-Aleut Yaz Saati", "CAT": "Orta Afrika Saati", "UYST": "Uruguay Yaz Saati", "CST": "Kuzey Amerika Merkezi Standart Saati", "HAST": "Hawaii-Aleut Standart Saati", "ACST": "Orta Avustralya Standart Saati", "WART": "Batı Arjantin Standart Saati", "HKT": "Hong Kong Standart Saati", "SAST": "Güney Afrika Standart Saati", "COT": "Kolombiya Standart Saati", "AEDT": "Doğu Avustralya Yaz Saati", "MST": "Kuzey Amerika Dağ Standart Saati", "ACDT": "Orta Avustralya Yaz Saati", "ARST": "Arjantin Yaz Saati", "MESZ": "Orta Avrupa Yaz Saati", "CHADT": "Chatham Yaz Saati", "ACWST": "İçbatı Avustralya Standart Saati", "EDT": "Kuzey Amerika Doğu Yaz Saati", "PST": "Kuzey Amerika Pasifik Standart Saati", "MEZ": "Orta Avrupa Standart Saati", "WIT": "Doğu Endonezya Saati", "IST": "Hindistan Standart Saati", "WESZ": "Batı Avrupa Yaz Saati", "MYT": "Malezya Saati", "SRT": "Surinam Saati"},
}
}
diff --git a/tr_TR/tr_TR_test.go b/tr_TR/tr_TR_test.go
new file mode 100644
index 00000000..10e00a2c
--- /dev/null
+++ b/tr_TR/tr_TR_test.go
@@ -0,0 +1,1120 @@
+package tr_TR
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "tr_TR"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/twq/twq.go b/twq/twq.go
index 6a5ccc4d..773de614 100644
--- a/twq/twq.go
+++ b/twq/twq.go
@@ -61,7 +61,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"IJ", "IZ"},
erasNarrow: []string{"", ""},
erasWide: []string{"Isaa jine", "Isaa zamanoo"},
- timezones: map[string]string{"MYT": "MYT", "MST": "MST", "ADT": "ADT", "HAST": "HAST", "HKT": "HKT", "WITA": "WITA", "AKST": "AKST", "AWST": "AWST", "ACWST": "ACWST", "BT": "BT", "HKST": "HKST", "WART": "WART", "OESZ": "OESZ", "PDT": "PDT", "UYST": "UYST", "CHADT": "CHADT", "CLST": "CLST", "CAT": "CAT", "EDT": "EDT", "UYT": "UYT", "ACWDT": "ACWDT", "HADT": "HADT", "SAST": "SAST", "WIB": "WIB", "LHDT": "LHDT", "MEZ": "MEZ", "NZDT": "NZDT", "WAT": "WAT", "GMT": "GMT", "HNT": "HNT", "JST": "JST", "∅∅∅": "∅∅∅", "WIT": "WIT", "MESZ": "MESZ", "MDT": "MDT", "IST": "IST", "SRT": "SRT", "JDT": "JDT", "BOT": "BOT", "AEDT": "AEDT", "EAT": "EAT", "ARST": "ARST", "PST": "PST", "AWDT": "AWDT", "CST": "CST", "SGT": "SGT", "WARST": "WARST", "AKDT": "AKDT", "COT": "COT", "HAT": "HAT", "ACDT": "ACDT", "ART": "ART", "VET": "VET", "WEZ": "WEZ", "ECT": "ECT", "TMST": "TMST", "AEST": "AEST", "EST": "EST", "WAST": "WAST", "GFT": "GFT", "TMT": "TMT", "WESZ": "WESZ", "ChST": "ChST", "OEZ": "OEZ", "CDT": "CDT", "CLT": "CLT", "AST": "AST", "ACST": "ACST", "LHST": "LHST", "NZST": "NZST", "CHAST": "CHAST", "COST": "COST", "GYT": "GYT"},
+ timezones: map[string]string{"CLST": "CLST", "MESZ": "MESZ", "IST": "IST", "HNT": "HNT", "CLT": "CLT", "ACST": "ACST", "ECT": "ECT", "ARST": "ARST", "CHAST": "CHAST", "PDT": "PDT", "SAST": "SAST", "WEZ": "WEZ", "AST": "AST", "HAST": "HAST", "CDT": "CDT", "AWDT": "AWDT", "ART": "ART", "AKDT": "AKDT", "PST": "PST", "COST": "COST", "OESZ": "OESZ", "MYT": "MYT", "UYT": "UYT", "∅∅∅": "∅∅∅", "BT": "BT", "VET": "VET", "AKST": "AKST", "NZDT": "NZDT", "WAT": "WAT", "LHDT": "LHDT", "EAT": "EAT", "EDT": "EDT", "TMT": "TMT", "CHADT": "CHADT", "WITA": "WITA", "NZST": "NZST", "AWST": "AWST", "AEDT": "AEDT", "CST": "CST", "ACWST": "ACWST", "ACWDT": "ACWDT", "WARST": "WARST", "HADT": "HADT", "BOT": "BOT", "WIB": "WIB", "ChST": "ChST", "GMT": "GMT", "UYST": "UYST", "WART": "WART", "CAT": "CAT", "WAST": "WAST", "SGT": "SGT", "MST": "MST", "WIT": "WIT", "SRT": "SRT", "WESZ": "WESZ", "HAT": "HAT", "LHST": "LHST", "MDT": "MDT", "HKT": "HKT", "HKST": "HKST", "OEZ": "OEZ", "GFT": "GFT", "MEZ": "MEZ", "COT": "COT", "ACDT": "ACDT", "JST": "JST", "EST": "EST", "TMST": "TMST", "AEST": "AEST", "GYT": "GYT", "JDT": "JDT", "ADT": "ADT"},
}
}
diff --git a/twq/twq_test.go b/twq/twq_test.go
new file mode 100644
index 00000000..b1554226
--- /dev/null
+++ b/twq/twq_test.go
@@ -0,0 +1,1120 @@
+package twq
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "twq"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/twq_NE/twq_NE.go b/twq_NE/twq_NE.go
index 4ec2893c..75241189 100644
--- a/twq_NE/twq_NE.go
+++ b/twq_NE/twq_NE.go
@@ -61,7 +61,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"IJ", "IZ"},
erasNarrow: []string{"", ""},
erasWide: []string{"Isaa jine", "Isaa zamanoo"},
- timezones: map[string]string{"MEZ": "MEZ", "TMT": "TMT", "ARST": "ARST", "ACWDT": "ACWDT", "HNT": "HNT", "∅∅∅": "∅∅∅", "MDT": "MDT", "CDT": "CDT", "ChST": "ChST", "ADT": "ADT", "IST": "IST", "GMT": "GMT", "WARST": "WARST", "WAT": "WAT", "HAST": "HAST", "WART": "WART", "JST": "JST", "ACWST": "ACWST", "CAT": "CAT", "SGT": "SGT", "GFT": "GFT", "GYT": "GYT", "AEDT": "AEDT", "EAT": "EAT", "MYT": "MYT", "OESZ": "OESZ", "JDT": "JDT", "AKDT": "AKDT", "CHAST": "CHAST", "AEST": "AEST", "EST": "EST", "WIB": "WIB", "ACST": "ACST", "AST": "AST", "HADT": "HADT", "LHST": "LHST", "UYST": "UYST", "PST": "PST", "CLST": "CLST", "WIT": "WIT", "TMST": "TMST", "ART": "ART", "PDT": "PDT", "LHDT": "LHDT", "CST": "CST", "NZDT": "NZDT", "WAST": "WAST", "BT": "BT", "MST": "MST", "ACDT": "ACDT", "HKT": "HKT", "OEZ": "OEZ", "COT": "COT", "AKST": "AKST", "AWDT": "AWDT", "CHADT": "CHADT", "CLT": "CLT", "WEZ": "WEZ", "HAT": "HAT", "SRT": "SRT", "WESZ": "WESZ", "SAST": "SAST", "NZST": "NZST", "VET": "VET", "EDT": "EDT", "COST": "COST", "HKST": "HKST", "AWST": "AWST", "UYT": "UYT", "BOT": "BOT", "ECT": "ECT", "WITA": "WITA", "MESZ": "MESZ"},
+ timezones: map[string]string{"MST": "MST", "AWST": "AWST", "OEZ": "OEZ", "GYT": "GYT", "EAT": "EAT", "CDT": "CDT", "PST": "PST", "MYT": "MYT", "ARST": "ARST", "JST": "JST", "WITA": "WITA", "MEZ": "MEZ", "CLST": "CLST", "WARST": "WARST", "TMT": "TMT", "TMST": "TMST", "WAT": "WAT", "AEDT": "AEDT", "GMT": "GMT", "CLT": "CLT", "GFT": "GFT", "CHAST": "CHAST", "WIB": "WIB", "HAT": "HAT", "COST": "COST", "ECT": "ECT", "NZST": "NZST", "ChST": "ChST", "LHST": "LHST", "MDT": "MDT", "∅∅∅": "∅∅∅", "CST": "CST", "AKST": "AKST", "SGT": "SGT", "BT": "BT", "SRT": "SRT", "HKST": "HKST", "EST": "EST", "WEZ": "WEZ", "ACDT": "ACDT", "ADT": "ADT", "BOT": "BOT", "AKDT": "AKDT", "PDT": "PDT", "MESZ": "MESZ", "WESZ": "WESZ", "HNT": "HNT", "LHDT": "LHDT", "JDT": "JDT", "WAST": "WAST", "COT": "COT", "OESZ": "OESZ", "AEST": "AEST", "AST": "AST", "ART": "ART", "EDT": "EDT", "HADT": "HADT", "UYT": "UYT", "WIT": "WIT", "ACWDT": "ACWDT", "AWDT": "AWDT", "SAST": "SAST", "HAST": "HAST", "ACST": "ACST", "WART": "WART", "HKT": "HKT", "IST": "IST", "CAT": "CAT", "UYST": "UYST", "CHADT": "CHADT", "VET": "VET", "ACWST": "ACWST", "NZDT": "NZDT"},
}
}
diff --git a/twq_NE/twq_NE_test.go b/twq_NE/twq_NE_test.go
new file mode 100644
index 00000000..96bec05e
--- /dev/null
+++ b/twq_NE/twq_NE_test.go
@@ -0,0 +1,1120 @@
+package twq_NE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "twq_NE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/tzm/tzm.go b/tzm/tzm.go
index 8208ff92..20b46423 100644
--- a/tzm/tzm.go
+++ b/tzm/tzm.go
@@ -65,7 +65,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ZƐ", "ḌƐ"},
erasNarrow: []string{"", ""},
erasWide: []string{"Zdat Ɛisa (TAƔ)", "Ḍeffir Ɛisa (TAƔ)"},
- timezones: map[string]string{"ARST": "ARST", "CHAST": "CHAST", "WARST": "WARST", "MDT": "MDT", "UYST": "UYST", "MEZ": "MEZ", "ECT": "ECT", "HNT": "HNT", "JDT": "JDT", "CST": "CST", "HKST": "HKST", "WAST": "WAST", "WIT": "WIT", "EAT": "EAT", "LHST": "LHST", "WAT": "WAT", "HAT": "HAT", "GMT": "GMT", "AKST": "AKST", "AEDT": "AEDT", "BT": "BT", "WITA": "WITA", "OEZ": "OEZ", "JST": "JST", "PST": "PST", "EST": "EST", "AEST": "AEST", "HKT": "HKT", "SAST": "SAST", "MESZ": "MESZ", "CLT": "CLT", "ACWST": "ACWST", "AST": "AST", "ADT": "ADT", "TMST": "TMST", "COT": "COT", "WART": "WART", "UYT": "UYT", "CDT": "CDT", "NZST": "NZST", "TMT": "TMT", "GYT": "GYT", "MYT": "MYT", "SRT": "SRT", "AKDT": "AKDT", "SGT": "SGT", "IST": "IST", "ACST": "ACST", "LHDT": "LHDT", "BOT": "BOT", "WEZ": "WEZ", "PDT": "PDT", "VET": "VET", "ACWDT": "ACWDT", "GFT": "GFT", "OESZ": "OESZ", "ChST": "ChST", "HAST": "HAST", "HADT": "HADT", "ART": "ART", "MST": "MST", "AWDT": "AWDT", "CHADT": "CHADT", "CLST": "CLST", "CAT": "CAT", "COST": "COST", "∅∅∅": "∅∅∅", "ACDT": "ACDT", "AWST": "AWST", "NZDT": "NZDT", "WESZ": "WESZ", "EDT": "EDT", "WIB": "WIB"},
+ timezones: map[string]string{"OEZ": "OEZ", "CST": "CST", "WAT": "WAT", "GMT": "GMT", "ACDT": "ACDT", "WIB": "WIB", "AEST": "AEST", "MDT": "MDT", "CHAST": "CHAST", "EDT": "EDT", "MST": "MST", "IST": "IST", "WEZ": "WEZ", "HNT": "HNT", "HAT": "HAT", "ACWST": "ACWST", "EST": "EST", "NZST": "NZST", "GYT": "GYT", "CDT": "CDT", "ADT": "ADT", "MEZ": "MEZ", "OESZ": "OESZ", "COT": "COT", "COST": "COST", "BOT": "BOT", "TMT": "TMT", "JDT": "JDT", "AKST": "AKST", "WESZ": "WESZ", "UYT": "UYT", "SRT": "SRT", "ACST": "ACST", "ARST": "ARST", "SAST": "SAST", "PDT": "PDT", "UYST": "UYST", "GFT": "GFT", "CHADT": "CHADT", "VET": "VET", "AWST": "AWST", "WITA": "WITA", "SGT": "SGT", "AEDT": "AEDT", "ChST": "ChST", "WART": "WART", "PST": "PST", "∅∅∅": "∅∅∅", "WARST": "WARST", "ECT": "ECT", "AWDT": "AWDT", "AKDT": "AKDT", "MESZ": "MESZ", "HADT": "HADT", "BT": "BT", "HKST": "HKST", "ART": "ART", "AST": "AST", "MYT": "MYT", "CLST": "CLST", "HKT": "HKT", "HAST": "HAST", "NZDT": "NZDT", "WAST": "WAST", "LHST": "LHST", "CLT": "CLT", "WIT": "WIT", "EAT": "EAT", "ACWDT": "ACWDT", "TMST": "TMST", "LHDT": "LHDT", "JST": "JST", "CAT": "CAT"},
}
}
diff --git a/tzm/tzm_test.go b/tzm/tzm_test.go
new file mode 100644
index 00000000..0ce2e4ee
--- /dev/null
+++ b/tzm/tzm_test.go
@@ -0,0 +1,1120 @@
+package tzm
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "tzm"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/tzm_MA/tzm_MA.go b/tzm_MA/tzm_MA.go
index a1b7c5eb..ec8aeabf 100644
--- a/tzm_MA/tzm_MA.go
+++ b/tzm_MA/tzm_MA.go
@@ -65,7 +65,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ZƐ", "ḌƐ"},
erasNarrow: []string{"", ""},
erasWide: []string{"Zdat Ɛisa (TAƔ)", "Ḍeffir Ɛisa (TAƔ)"},
- timezones: map[string]string{"IST": "IST", "OESZ": "OESZ", "SRT": "SRT", "GYT": "GYT", "COST": "COST", "ACWDT": "ACWDT", "AST": "AST", "GFT": "GFT", "EAT": "EAT", "ACST": "ACST", "PDT": "PDT", "NZDT": "NZDT", "WEZ": "WEZ", "WIB": "WIB", "JDT": "JDT", "MESZ": "MESZ", "AEDT": "AEDT", "WIT": "WIT", "TMST": "TMST", "CHAST": "CHAST", "CHADT": "CHADT", "ECT": "ECT", "ART": "ART", "UYT": "UYT", "AEST": "AEST", "HAST": "HAST", "SGT": "SGT", "CST": "CST", "MEZ": "MEZ", "WESZ": "WESZ", "OEZ": "OEZ", "GMT": "GMT", "∅∅∅": "∅∅∅", "PST": "PST", "ChST": "ChST", "SAST": "SAST", "HNT": "HNT", "LHDT": "LHDT", "BT": "BT", "WITA": "WITA", "MYT": "MYT", "CLST": "CLST", "VET": "VET", "HAT": "HAT", "ACDT": "ACDT", "UYST": "UYST", "HKST": "HKST", "COT": "COT", "ADT": "ADT", "JST": "JST", "AWDT": "AWDT", "CDT": "CDT", "NZST": "NZST", "HKT": "HKT", "WARST": "WARST", "MDT": "MDT", "ARST": "ARST", "TMT": "TMT", "AWST": "AWST", "CLT": "CLT", "LHST": "LHST", "BOT": "BOT", "WART": "WART", "MST": "MST", "CAT": "CAT", "EST": "EST", "WAT": "WAT", "AKST": "AKST", "AKDT": "AKDT", "ACWST": "ACWST", "EDT": "EDT", "HADT": "HADT", "WAST": "WAST"},
+ timezones: map[string]string{"CST": "CST", "MEZ": "MEZ", "HAT": "HAT", "UYT": "UYT", "HKST": "HKST", "GFT": "GFT", "∅∅∅": "∅∅∅", "COST": "COST", "ChST": "ChST", "CLST": "CLST", "CDT": "CDT", "MST": "MST", "HKT": "HKT", "SAST": "SAST", "ARST": "ARST", "WESZ": "WESZ", "ACDT": "ACDT", "MDT": "MDT", "AWDT": "AWDT", "ART": "ART", "WAT": "WAT", "UYST": "UYST", "CAT": "CAT", "HAST": "HAST", "WIB": "WIB", "TMT": "TMT", "CHAST": "CHAST", "PDT": "PDT", "BT": "BT", "AKDT": "AKDT", "GYT": "GYT", "ACWDT": "ACWDT", "NZST": "NZST", "HNT": "HNT", "WAST": "WAST", "CLT": "CLT", "WITA": "WITA", "JDT": "JDT", "AST": "AST", "TMST": "TMST", "WIT": "WIT", "SRT": "SRT", "ECT": "ECT", "AWST": "AWST", "SGT": "SGT", "GMT": "GMT", "WART": "WART", "HADT": "HADT", "BOT": "BOT", "OEZ": "OEZ", "EAT": "EAT", "LHST": "LHST", "VET": "VET", "JST": "JST", "NZDT": "NZDT", "EST": "EST", "COT": "COT", "ACWST": "ACWST", "PST": "PST", "IST": "IST", "EDT": "EDT", "WEZ": "WEZ", "ACST": "ACST", "MESZ": "MESZ", "MYT": "MYT", "WARST": "WARST", "CHADT": "CHADT", "AKST": "AKST", "ADT": "ADT", "LHDT": "LHDT", "OESZ": "OESZ", "AEST": "AEST", "AEDT": "AEDT"},
}
}
diff --git a/tzm_MA/tzm_MA_test.go b/tzm_MA/tzm_MA_test.go
new file mode 100644
index 00000000..4b50adf4
--- /dev/null
+++ b/tzm_MA/tzm_MA_test.go
@@ -0,0 +1,1120 @@
+package tzm_MA
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "tzm_MA"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ug/ug.go b/ug/ug.go
index bf6f2410..14aac27d 100644
--- a/ug/ug.go
+++ b/ug/ug.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BCE", "مىلادىيە"},
erasNarrow: []string{"BCE", "مىلادىيە"},
erasWide: []string{"مىلادىيەدىن بۇرۇن", "مىلادىيە"},
- timezones: map[string]string{"EST": "شەرقىي قىسىم ئۆلچەملىك ۋاقتى", "AST": "ئاتلانتىك ئوكيان ئۆلچەملىك ۋاقتى", "HADT": "ھاۋاي-ئالېيۇت يازلىق ۋاقتى", "WIB": "غەربىي ھىندونېزىيە ۋاقتى", "ART": "ئارگېنتىنا ئۆلچەملىك ۋاقتى", "ARST": "ئارگېنتىنا يازلىق ۋاقتى", "ACDT": "ئاۋسترالىيە ئوتتۇرا قىسىم يازلىق ۋاقتى", "CHAST": "چاتام ئۆلچەملىك ۋاقتى", "HNT": "نىۋفوئۇنلاند ئۆلچەملىك ۋاقتى", "GMT": "گىرىنۋىچ ۋاقتى", "TMT": "تۈركمەنىستان ئۆلچەملىك ۋاقتى", "VET": "ۋېنېزۇئېلا ۋاقتى", "ACWST": "ئاۋستىرالىيە ئوتتۇرا غەربىي قىسىم ئۆلچەملىك ۋاقتى", "HKT": "شياڭگاڭ ئۆلچەملىك ۋاقتى", "OESZ": "شەرقىي ياۋروپا يازلىق ۋاقتى", "WEZ": "غەربىي ياۋروپا ئۆلچەملىك ۋاقتى", "ECT": "ئېكۋادور ۋاقتى", "AEDT": "ئاۋسترالىيە شەرقىي قىسىم يازلىق ۋاقتى", "COT": "كولومبىيە ئۆلچەملىك ۋاقتى", "IST": "ھىندىستان ئۆلچەملىك ۋاقتى", "AKDT": "ئالياسكا يازلىق ۋاقتى", "PDT": "تىنچ ئوكيان يازلىق ۋاقتى", "MEZ": "ئوتتۇرا ياۋروپا ئۆلچەملىك ۋاقتى", "MESZ": "ئوتتۇرا ياۋروپا يازلىق ۋاقتى", "OEZ": "شەرقىي ياۋروپا ئۆلچەملىك ۋاقتى", "AKST": "ئالياسكا ئۆلچەملىك ۋاقتى", "CAT": "ئوتتۇرا ئافرىقا ۋاقتى", "COST": "كولومبىيە يازلىق ۋاقتى", "HKST": "شياڭگاڭ يازلىق ۋاقتى", "LHST": "لورد-خاي ئۆلچەملىك ۋاقتى", "LHDT": "لورد-خاي يازلىق ۋاقتى", "ChST": "چاموررو ئۆلچەملىك ۋاقتى", "CHADT": "چاتام يازلىق ۋاقتى", "CLST": "چىلى يازلىق ۋاقتى", "WART": "غەربىي ئارگېنتىنا ئۆلچەملىك ۋاقتى", "JDT": "ياپونىيە يازلىق ۋاقتى", "ACWDT": "ئاۋسترالىيە ئوتتۇرا غەربىي قىسىم يازلىق ۋاقتى", "ADT": "ئاتلانتىك ئوكيان يازلىق ۋاقتى", "WAT": "غەربىي ئافرىقا ئۆلچەملىك ۋاقتى", "GFT": "فىرانسىيەگە قاراشلىق گىۋىيانا ۋاقتى", "WITA": "ئوتتۇرا ھىندونېزىيە ۋاقتى", "EDT": "شەرقىي قىسىم يازلىق ۋاقتى", "MYT": "مالايشىيا ۋاقتى", "JST": "ياپونىيە ئۆلچەملىك ۋاقتى", "BOT": "بولىۋىيە ۋاقتى", "UYT": "ئۇرۇگۋاي ئۆلچەملىك ۋاقتى", "SGT": "سىنگاپور ۋاقتى", "AWST": "ئاۋسترالىيە غەربىي قىسىم ئۆلچەملىك ۋاقتى", "CDT": "ئوتتۇرا قىسىم يازلىق ۋاقتى", "NZDT": "يېڭى زېلاندىيە يازلىق ۋاقتى", "CLT": "چىلى ئۆلچەملىك ۋاقتى", "WESZ": "غەربىي ياۋروپا يازلىق ۋاقتى", "SAST": "جەنۇبىي ئافرىقا ئۆلچەملىك ۋاقتى", "∅∅∅": "ئامازون يازلىق ۋاقتى", "MST": "ئاۋمېن ئۆلچەملىك ۋاقتى", "UYST": "ئۇرۇگۋاي يازلىق ۋاقتى", "WAST": "غەربىي ئافرىقا يازلىق ۋاقتى", "GYT": "گىۋىيانا ۋاقتى", "AWDT": "ئاۋسترالىيە غەربىي قىسىم يازلىق ۋاقتى", "HAST": "ھاۋاي-ئالېيۇت ئۆلچەملىك ۋاقتى", "BT": "بۇتان ۋاقتى", "HAT": "نىۋفوئۇنلاند يازلىق ۋاقتى", "WIT": "شەرقىي ھىندونېزىيە ۋاقتى", "SRT": "سۇرىنام ۋاقتى", "AEST": "ئاۋسترالىيە شەرقىي قىسىم ئۆلچەملىك ۋاقتى", "PST": "تىنچ ئوكيان ئۆلچەملىك ۋاقتى", "CST": "ئوتتۇرا قىسىم ئۆلچەملىك ۋاقتى", "NZST": "يېڭى زېلاندىيە ئۆلچەملىك ۋاقتى", "WARST": "غەربىي ئارگېنتىنا يازلىق ۋاقتى", "TMST": "تۈركمەنىستان يازلىق ۋاقتى", "EAT": "شەرقىي ئافرىقا ۋاقتى", "MDT": "ئاۋمېن يازلىق ۋاقتى", "ACST": "ئاۋسترالىيە ئوتتۇرا قىسىم ئۆلچەملىك ۋاقتى"},
+ timezones: map[string]string{"ACST": "ئاۋسترالىيە ئوتتۇرا قىسىم ئۆلچەملىك ۋاقتى", "CHADT": "چاتام يازلىق ۋاقتى", "HKST": "شياڭگاڭ يازلىق ۋاقتى", "EDT": "شەرقىي قىسىم يازلىق ۋاقتى", "GYT": "گىۋىيانا ۋاقتى", "OEZ": "شەرقىي ياۋروپا ئۆلچەملىك ۋاقتى", "MST": "تاغ ئۆلچەملىك ۋاقتى", "EAT": "شەرقىي ئافرىقا ۋاقتى", "LHST": "لورد-خاي ئۆلچەملىك ۋاقتى", "COST": "كولومبىيە يازلىق ۋاقتى", "WESZ": "غەربىي ياۋروپا يازلىق ۋاقتى", "MESZ": "ئوتتۇرا ياۋروپا يازلىق ۋاقتى", "BOT": "بولىۋىيە ۋاقتى", "NZST": "يېڭى زېلاندىيە ئۆلچەملىك ۋاقتى", "NZDT": "يېڭى زېلاندىيە يازلىق ۋاقتى", "AWST": "ئاۋسترالىيە غەربىي قىسىم ئۆلچەملىك ۋاقتى", "AST": "ئاتلانتىك ئوكيان ئۆلچەملىك ۋاقتى", "UYST": "ئۇرۇگۋاي يازلىق ۋاقتى", "SRT": "سۇرىنام ۋاقتى", "VET": "ۋېنېزۇئېلا ۋاقتى", "WITA": "ئوتتۇرا ھىندونېزىيە ۋاقتى", "PDT": "تىنچ ئوكيان يازلىق ۋاقتى", "HNT": "نىۋفوئۇنلاند ئۆلچەملىك ۋاقتى", "MDT": "تاغ يازلىق ۋاقتى", "CLT": "چىلى ئۆلچەملىك ۋاقتى", "AEDT": "ئاۋسترالىيە شەرقىي قىسىم يازلىق ۋاقتى", "GMT": "گىرىنۋىچ ۋاقتى", "ARST": "ئارگېنتىنا يازلىق ۋاقتى", "HADT": "ھاۋاي-ئالېيۇت يازلىق ۋاقتى", "HAT": "نىۋفوئۇنلاند يازلىق ۋاقتى", "SGT": "سىنگاپور ۋاقتى", "CHAST": "چاتام ئۆلچەملىك ۋاقتى", "ART": "ئارگېنتىنا ئۆلچەملىك ۋاقتى", "ChST": "چاموررو ئۆلچەملىك ۋاقتى", "WARST": "غەربىي ئارگېنتىنا يازلىق ۋاقتى", "ACDT": "ئاۋسترالىيە ئوتتۇرا قىسىم يازلىق ۋاقتى", "AKST": "ئالياسكا ئۆلچەملىك ۋاقتى", "EST": "شەرقىي قىسىم ئۆلچەملىك ۋاقتى", "MYT": "مالايشىيا ۋاقتى", "JDT": "ياپونىيە يازلىق ۋاقتى", "WEZ": "غەربىي ياۋروپا ئۆلچەملىك ۋاقتى", "WIB": "غەربىي ھىندونېزىيە ۋاقتى", "LHDT": "لورد-خاي يازلىق ۋاقتى", "∅∅∅": "بىرازىلىيە يازلىق ۋاقتى", "OESZ": "شەرقىي ياۋروپا يازلىق ۋاقتى", "ACWDT": "ئاۋسترالىيە ئوتتۇرا غەربىي قىسىم يازلىق ۋاقتى", "CAT": "ئوتتۇرا ئافرىقا ۋاقتى", "TMT": "تۈركمەنىستان ئۆلچەملىك ۋاقتى", "AWDT": "ئاۋسترالىيە غەربىي قىسىم يازلىق ۋاقتى", "PST": "تىنچ ئوكيان ئۆلچەملىك ۋاقتى", "MEZ": "ئوتتۇرا ياۋروپا ئۆلچەملىك ۋاقتى", "SAST": "جەنۇبىي ئافرىقا ئۆلچەملىك ۋاقتى", "COT": "كولومبىيە ئۆلچەملىك ۋاقتى", "TMST": "تۈركمەنىستان يازلىق ۋاقتى", "CDT": "ئوتتۇرا قىسىم يازلىق ۋاقتى", "ECT": "ئېكۋادور ۋاقتى", "AEST": "ئاۋسترالىيە شەرقىي قىسىم ئۆلچەملىك ۋاقتى", "AKDT": "ئالياسكا يازلىق ۋاقتى", "WIT": "شەرقىي ھىندونېزىيە ۋاقتى", "WART": "غەربىي ئارگېنتىنا ئۆلچەملىك ۋاقتى", "WAT": "غەربىي ئافرىقا ئۆلچەملىك ۋاقتى", "WAST": "غەربىي ئافرىقا يازلىق ۋاقتى", "BT": "بۇتان ۋاقتى", "CST": "ئوتتۇرا قىسىم ئۆلچەملىك ۋاقتى", "GFT": "فىرانسىيەگە قاراشلىق گىۋىيانا ۋاقتى", "HKT": "شياڭگاڭ ئۆلچەملىك ۋاقتى", "ACWST": "ئاۋستىرالىيە ئوتتۇرا غەربىي قىسىم ئۆلچەملىك ۋاقتى", "ADT": "ئاتلانتىك ئوكيان يازلىق ۋاقتى", "CLST": "چىلى يازلىق ۋاقتى", "UYT": "ئۇرۇگۋاي ئۆلچەملىك ۋاقتى", "IST": "ھىندىستان ئۆلچەملىك ۋاقتى", "JST": "ياپونىيە ئۆلچەملىك ۋاقتى", "HAST": "ھاۋاي-ئالېيۇت ئۆلچەملىك ۋاقتى"},
}
}
diff --git a/ug/ug_test.go b/ug/ug_test.go
new file mode 100644
index 00000000..565a0181
--- /dev/null
+++ b/ug/ug_test.go
@@ -0,0 +1,1120 @@
+package ug
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ug"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ug_CN/ug_CN.go b/ug_CN/ug_CN.go
index 3299a0d7..c4afc79d 100644
--- a/ug_CN/ug_CN.go
+++ b/ug_CN/ug_CN.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BCE", "مىلادىيە"},
erasNarrow: []string{"BCE", "مىلادىيە"},
erasWide: []string{"مىلادىيەدىن بۇرۇن", "مىلادىيە"},
- timezones: map[string]string{"JDT": "ياپونىيە يازلىق ۋاقتى", "SRT": "سۇرىنام ۋاقتى", "AWST": "ئاۋسترالىيە غەربىي قىسىم ئۆلچەملىك ۋاقتى", "NZST": "يېڭى زېلاندىيە ئۆلچەملىك ۋاقتى", "IST": "ھىندىستان ئۆلچەملىك ۋاقتى", "ART": "ئارگېنتىنا ئۆلچەملىك ۋاقتى", "NZDT": "يېڭى زېلاندىيە يازلىق ۋاقتى", "HKT": "شياڭگاڭ ئۆلچەملىك ۋاقتى", "WIB": "غەربىي ھىندونېزىيە ۋاقتى", "ACWDT": "ئاۋسترالىيە ئوتتۇرا غەربىي قىسىم يازلىق ۋاقتى", "AEST": "ئاۋسترالىيە شەرقىي قىسىم ئۆلچەملىك ۋاقتى", "AST": "ئاتلانتىك ئوكيان ئۆلچەملىك ۋاقتى", "MESZ": "ئوتتۇرا ياۋروپا يازلىق ۋاقتى", "ChST": "چاموررو ئۆلچەملىك ۋاقتى", "MST": "تاغ ئۆلچەملىك ۋاقتى", "TMT": "تۈركمەنىستان ئۆلچەملىك ۋاقتى", "TMST": "تۈركمەنىستان يازلىق ۋاقتى", "PST": "تىنچ ئوكيان ئۆلچەملىك ۋاقتى", "BOT": "بولىۋىيە ۋاقتى", "MDT": "تاغ يازلىق ۋاقتى", "CLT": "چىلى ئۆلچەملىك ۋاقتى", "ARST": "ئارگېنتىنا يازلىق ۋاقتى", "UYT": "ئۇرۇگۋاي ئۆلچەملىك ۋاقتى", "EST": "شەرقىي قىسىم ئۆلچەملىك ۋاقتى", "WITA": "ئوتتۇرا ھىندونېزىيە ۋاقتى", "SGT": "سىنگاپور ۋاقتى", "ACDT": "ئاۋسترالىيە ئوتتۇرا قىسىم يازلىق ۋاقتى", "CST": "ئوتتۇرا قىسىم ئۆلچەملىك ۋاقتى", "ECT": "ئېكۋادور ۋاقتى", "HAST": "ھاۋاي-ئالېيۇت ئۆلچەملىك ۋاقتى", "CLST": "چىلى يازلىق ۋاقتى", "WEZ": "غەربىي ياۋروپا ئۆلچەملىك ۋاقتى", "OEZ": "شەرقىي ياۋروپا ئۆلچەملىك ۋاقتى", "CHADT": "چاتام يازلىق ۋاقتى", "WAST": "غەربىي ئافرىقا يازلىق ۋاقتى", "PDT": "تىنچ ئوكيان يازلىق ۋاقتى", "VET": "ۋېنېزۇئېلا ۋاقتى", "SAST": "جەنۇبىي ئافرىقا ئۆلچەملىك ۋاقتى", "WAT": "غەربىي ئافرىقا ئۆلچەملىك ۋاقتى", "GMT": "گىرىنۋىچ ۋاقتى", "AWDT": "ئاۋسترالىيە غەربىي قىسىم يازلىق ۋاقتى", "CDT": "ئوتتۇرا قىسىم يازلىق ۋاقتى", "CHAST": "چاتام ئۆلچەملىك ۋاقتى", "COT": "كولومبىيە ئۆلچەملىك ۋاقتى", "GFT": "فىرانسىيەگە قاراشلىق گىۋىيانا ۋاقتى", "LHDT": "لورد-خاي يازلىق ۋاقتى", "GYT": "گىۋىيانا ۋاقتى", "MYT": "مالايشىيا ۋاقتى", "AKDT": "ئالياسكا يازلىق ۋاقتى", "UYST": "ئۇرۇگۋاي يازلىق ۋاقتى", "ADT": "ئاتلانتىك ئوكيان يازلىق ۋاقتى", "HADT": "ھاۋاي-ئالېيۇت يازلىق ۋاقتى", "HKST": "شياڭگاڭ يازلىق ۋاقتى", "HNT": "نىۋفوئۇنلاند ئۆلچەملىك ۋاقتى", "AKST": "ئالياسكا ئۆلچەملىك ۋاقتى", "WART": "غەربىي ئارگېنتىنا ئۆلچەملىك ۋاقتى", "WARST": "غەربىي ئارگېنتىنا يازلىق ۋاقتى", "BT": "بۇتان ۋاقتى", "EDT": "شەرقىي قىسىم يازلىق ۋاقتى", "HAT": "نىۋفوئۇنلاند يازلىق ۋاقتى", "OESZ": "شەرقىي ياۋروپا يازلىق ۋاقتى", "EAT": "شەرقىي ئافرىقا ۋاقتى", "LHST": "لورد-خاي ئۆلچەملىك ۋاقتى", "MEZ": "ئوتتۇرا ياۋروپا ئۆلچەملىك ۋاقتى", "AEDT": "ئاۋسترالىيە شەرقىي قىسىم يازلىق ۋاقتى", "CAT": "ئوتتۇرا ئافرىقا ۋاقتى", "COST": "كولومبىيە يازلىق ۋاقتى", "WIT": "شەرقىي ھىندونېزىيە ۋاقتى", "ACST": "ئاۋسترالىيە ئوتتۇرا قىسىم ئۆلچەملىك ۋاقتى", "JST": "ياپونىيە ئۆلچەملىك ۋاقتى", "WESZ": "غەربىي ياۋروپا يازلىق ۋاقتى", "ACWST": "ئاۋستىرالىيە ئوتتۇرا غەربىي قىسىم ئۆلچەملىك ۋاقتى", "∅∅∅": "بىرازىلىيە يازلىق ۋاقتى"},
+ timezones: map[string]string{"CDT": "ئوتتۇرا قىسىم يازلىق ۋاقتى", "MEZ": "ئوتتۇرا ياۋروپا ئۆلچەملىك ۋاقتى", "TMST": "تۈركمەنىستان يازلىق ۋاقتى", "SGT": "سىنگاپور ۋاقتى", "AST": "ئاتلانتىك ئوكيان ئۆلچەملىك ۋاقتى", "GMT": "گىرىنۋىچ ۋاقتى", "AEDT": "ئاۋسترالىيە شەرقىي قىسىم يازلىق ۋاقتى", "WART": "غەربىي ئارگېنتىنا ئۆلچەملىك ۋاقتى", "CHAST": "چاتام ئۆلچەملىك ۋاقتى", "MESZ": "ئوتتۇرا ياۋروپا يازلىق ۋاقتى", "AWST": "ئاۋسترالىيە غەربىي قىسىم ئۆلچەملىك ۋاقتى", "HADT": "ھاۋاي-ئالېيۇت يازلىق ۋاقتى", "ADT": "ئاتلانتىك ئوكيان يازلىق ۋاقتى", "WEZ": "غەربىي ياۋروپا ئۆلچەملىك ۋاقتى", "CLST": "چىلى يازلىق ۋاقتى", "EAT": "شەرقىي ئافرىقا ۋاقتى", "LHDT": "لورد-خاي يازلىق ۋاقتى", "ACST": "ئاۋسترالىيە ئوتتۇرا قىسىم ئۆلچەملىك ۋاقتى", "JST": "ياپونىيە ئۆلچەملىك ۋاقتى", "LHST": "لورد-خاي ئۆلچەملىك ۋاقتى", "PDT": "تىنچ ئوكيان يازلىق ۋاقتى", "UYT": "ئۇرۇگۋاي ئۆلچەملىك ۋاقتى", "HKST": "شياڭگاڭ يازلىق ۋاقتى", "ACWST": "ئاۋستىرالىيە ئوتتۇرا غەربىي قىسىم ئۆلچەملىك ۋاقتى", "MYT": "مالايشىيا ۋاقتى", "WITA": "ئوتتۇرا ھىندونېزىيە ۋاقتى", "ART": "ئارگېنتىنا ئۆلچەملىك ۋاقتى", "ARST": "ئارگېنتىنا يازلىق ۋاقتى", "AEST": "ئاۋسترالىيە شەرقىي قىسىم ئۆلچەملىك ۋاقتى", "NZST": "يېڭى زېلاندىيە ئۆلچەملىك ۋاقتى", "NZDT": "يېڭى زېلاندىيە يازلىق ۋاقتى", "GYT": "گىۋىيانا ۋاقتى", "UYST": "ئۇرۇگۋاي يازلىق ۋاقتى", "WIT": "شەرقىي ھىندونېزىيە ۋاقتى", "BT": "بۇتان ۋاقتى", "VET": "ۋېنېزۇئېلا ۋاقتى", "JDT": "ياپونىيە يازلىق ۋاقتى", "∅∅∅": "بىرازىلىيە يازلىق ۋاقتى", "WAT": "غەربىي ئافرىقا ئۆلچەملىك ۋاقتى", "SRT": "سۇرىنام ۋاقتى", "BOT": "بولىۋىيە ۋاقتى", "SAST": "جەنۇبىي ئافرىقا ئۆلچەملىك ۋاقتى", "OEZ": "شەرقىي ياۋروپا ئۆلچەملىك ۋاقتى", "WARST": "غەربىي ئارگېنتىنا يازلىق ۋاقتى", "GFT": "فىرانسىيەگە قاراشلىق گىۋىيانا ۋاقتى", "AWDT": "ئاۋسترالىيە غەربىي قىسىم يازلىق ۋاقتى", "ChST": "چاموررو ئۆلچەملىك ۋاقتى", "MDT": "تاغ يازلىق ۋاقتى", "HAST": "ھاۋاي-ئالېيۇت ئۆلچەملىك ۋاقتى", "PST": "تىنچ ئوكيان ئۆلچەملىك ۋاقتى", "COT": "كولومبىيە ئۆلچەملىك ۋاقتى", "WESZ": "غەربىي ياۋروپا يازلىق ۋاقتى", "EST": "شەرقىي قىسىم ئۆلچەملىك ۋاقتى", "CAT": "ئوتتۇرا ئافرىقا ۋاقتى", "WAST": "غەربىي ئافرىقا يازلىق ۋاقتى", "AKST": "ئالياسكا ئۆلچەملىك ۋاقتى", "ACWDT": "ئاۋسترالىيە ئوتتۇرا غەربىي قىسىم يازلىق ۋاقتى", "EDT": "شەرقىي قىسىم يازلىق ۋاقتى", "CST": "ئوتتۇرا قىسىم ئۆلچەملىك ۋاقتى", "ACDT": "ئاۋسترالىيە ئوتتۇرا قىسىم يازلىق ۋاقتى", "HKT": "شياڭگاڭ ئۆلچەملىك ۋاقتى", "CHADT": "چاتام يازلىق ۋاقتى", "ECT": "ئېكۋادور ۋاقتى", "WIB": "غەربىي ھىندونېزىيە ۋاقتى", "HNT": "نىۋفوئۇنلاند ئۆلچەملىك ۋاقتى", "OESZ": "شەرقىي ياۋروپا يازلىق ۋاقتى", "TMT": "تۈركمەنىستان ئۆلچەملىك ۋاقتى", "HAT": "نىۋفوئۇنلاند يازلىق ۋاقتى", "CLT": "چىلى ئۆلچەملىك ۋاقتى", "MST": "تاغ ئۆلچەملىك ۋاقتى", "AKDT": "ئالياسكا يازلىق ۋاقتى", "IST": "ھىندىستان ئۆلچەملىك ۋاقتى", "COST": "كولومبىيە يازلىق ۋاقتى"},
}
}
diff --git a/ug_CN/ug_CN_test.go b/ug_CN/ug_CN_test.go
new file mode 100644
index 00000000..e40143e6
--- /dev/null
+++ b/ug_CN/ug_CN_test.go
@@ -0,0 +1,1120 @@
+package ug_CN
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ug_CN"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/uk/uk.go b/uk/uk.go
index 688cb2cd..1b0e4e00 100644
--- a/uk/uk.go
+++ b/uk/uk.go
@@ -47,7 +47,7 @@ func New() locales.Translator {
locale: "uk",
pluralsCardinal: []locales.PluralRule{2, 4, 5, 6},
pluralsOrdinal: []locales.PluralRule{4, 6},
- pluralsRange: []locales.PluralRule{4, 5, 6, 2},
+ pluralsRange: []locales.PluralRule{2, 4, 5, 6},
decimal: ",",
group: " ",
minus: "-",
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"до н. е.", "н. е."},
erasNarrow: []string{"до н.е.", "н.е."},
erasWide: []string{"до нашої ери", "нашої ери"},
- timezones: map[string]string{"ACWDT": "за літнім центральнозахідним австралійським часом", "HKST": "за літнім часом у Гонконзі", "WART": "за стандартним західноаргентинським часом", "WIT": "за східноіндонезійським часом", "TMT": "за стандартним часом у Туркменістані", "PST": "за північноамериканським тихоокеанським стандартним часом", "MYT": "за часом у Малайзії", "MDT": "за північноамериканським гірським літнім часом", "SGT": "за часом у Сінгапурі", "OESZ": "за східноєвропейським літнім часом", "GFT": "за часом Французької Гвіани", "ACST": "за стандартним центральноавстралійським часом", "WEZ": "за західноєвропейським стандартним часом", "IST": "за індійським стандартним часом", "HNT": "за стандартним часом у Ньюфаундленд", "ART": "за стандартним аргентинським часом", "JDT": "за японським літнім часом", "NZST": "за стандартним часом у Новій Зеландії", "UYST": "за літнім часом в Уругваї", "COT": "за стандартним колумбійським часом", "ARST": "за літнім аргентинським часом", "VET": "за часом у Венесуелі", "EDT": "за північноамериканським східним літнім часом", "AWDT": "за літнім західноавстралійським часом", "NZDT": "за літнім часом у Новій Зеландії", "ECT": "за часом в Еквадорі", "EAT": "за східноафриканським часом", "MEZ": "за центральноєвропейським стандартним часом", "MESZ": "за центральноєвропейським літнім часом", "AEDT": "за літнім східноавстралійським часом", "ChST": "за часом на Північних Маріанських островах", "HAT": "за літнім часом у Ньюфаундленд", "JST": "за японським стандартним часом", "WESZ": "за західноєвропейським літнім часом", "CHADT": "за літнім часом на архіпелазі Чатем", "EST": "за північноамериканським східним стандартним часом", "ADT": "за атлантичним літнім часом", "HAST": "за стандартним гавайсько-алеутським часом", "ACDT": "за літнім центральноавстралійським часом", "TMST": "за літнім часом у Туркменістані", "AKDT": "за літнім часом на Алясці", "LHDT": "за літнім часом на острові Лорд-Хау", "GYT": "за часом у Гаяні", "MST": "за північноамериканським гірським стандартним часом", "CAT": "за центральноафриканським часом", "HKT": "за стандартним часом у Гонконзі", "SAST": "за південноафриканським часом", "AKST": "за стандартним часом на Алясці", "LHST": "за стандартним часом на острові Лорд-Хау", "CST": "за північноамериканським центральним стандартним часом", "BOT": "за болівійським часом", "ACWST": "за стандартним центральнозахідним австралійським часом", "CLST": "за літнім чилійським часом", "COST": "за літнім колумбійським часом", "WAT": "за західноафриканським стандартним часом", "WARST": "за літнім за західноаргентинським часом", "AWST": "за стандартним західноавстралійським часом", "UYT": "за стандартним часом в Уругваї", "WAST": "за західноафриканським літнім часом", "BT": "за часом у Бутані", "SRT": "за часом у Суринамі", "∅∅∅": "за літнім бразильським часом", "HADT": "за літнім гавайсько-алеутським часом", "OEZ": "за східноєвропейським стандартним часом", "CDT": "за північноамериканським центральним літнім часом", "AEST": "за стандартним східноавстралійським часом", "CHAST": "за стандартним часом на архіпелазі Чатем", "CLT": "за стандартним чилійським часом", "AST": "за атлантичним стандартним часом", "GMT": "за Гринвічем", "WITA": "за центральноіндонезійським часом", "WIB": "за західноіндонезійським часом", "PDT": "за північноамериканським тихоокеанським літнім часом"},
+ timezones: map[string]string{"ACWDT": "за літнім центральнозахідним австралійським часом", "EDT": "за північноамериканським східним літнім часом", "∅∅∅": "за літнім часом на Амазонці", "ChST": "за часом на Північних Маріанських островах", "UYT": "за стандартним часом в Уругваї", "MST": "MST", "CHADT": "за літнім часом на архіпелазі Чатем", "WAT": "за західноафриканським стандартним часом", "ACST": "за стандартним центральноавстралійським часом", "AST": "за атлантичним стандартним часом", "AWDT": "за літнім західноавстралійським часом", "COT": "за стандартним колумбійським часом", "COST": "за літнім колумбійським часом", "HKT": "за стандартним часом у Гонконзі", "ART": "за стандартним аргентинським часом", "NZDT": "за літнім часом у Новій Зеландії", "PST": "за північноамериканським тихоокеанським стандартним часом", "CDT": "за північноамериканським центральним літнім часом", "AEST": "за стандартним східноавстралійським часом", "GYT": "за часом у Гаяні", "AWST": "за стандартним західноавстралійським часом", "SAST": "за південноафриканським часом", "HADT": "за літнім гавайсько-алеутським часом", "WAST": "за західноафриканським літнім часом", "WESZ": "за західноєвропейським літнім часом", "SGT": "за часом у Сінгапурі", "WIT": "за східноіндонезійським часом", "WART": "за стандартним західноаргентинським часом", "MDT": "MDT", "ADT": "за атлантичним літнім часом", "NZST": "за стандартним часом у Новій Зеландії", "WEZ": "за західноєвропейським стандартним часом", "HAT": "за літнім часом у Ньюфаундленд", "BT": "за часом у Бутані", "AKST": "за стандартним часом на Алясці", "AEDT": "за літнім східноавстралійським часом", "LHST": "за стандартним часом на острові Лорд-Хау", "VET": "за часом у Венесуелі", "TMT": "за стандартним часом у Туркменістані", "OESZ": "за східноєвропейським літнім часом", "MYT": "за часом у Малайзії", "JDT": "за японським літнім часом", "ACDT": "за літнім центральноавстралійським часом", "IST": "за індійським стандартним часом", "WIB": "за західноіндонезійським часом", "SRT": "за часом у Суринамі", "WITA": "за центральноіндонезійським часом", "CLT": "за стандартним чилійським часом", "CLST": "за літнім чилійським часом", "WARST": "за літнім за західноаргентинським часом", "GFT": "за часом Французької Гвіани", "ECT": "за часом в Еквадорі", "EST": "за північноамериканським східним стандартним часом", "TMST": "за літнім часом у Туркменістані", "OEZ": "за східноєвропейським стандартним часом", "CST": "за північноамериканським центральним стандартним часом", "HKST": "за літнім часом у Гонконзі", "CHAST": "за стандартним часом на архіпелазі Чатем", "JST": "за японським стандартним часом", "ARST": "за літнім аргентинським часом", "BOT": "за болівійським часом", "LHDT": "за літнім часом на острові Лорд-Хау", "AKDT": "за літнім часом на Алясці", "PDT": "за північноамериканським тихоокеанським літнім часом", "CAT": "за центральноафриканським часом", "UYST": "за літнім часом в Уругваї", "EAT": "за східноафриканським часом", "ACWST": "за стандартним центральнозахідним австралійським часом", "MESZ": "за центральноєвропейським літнім часом", "GMT": "за Гринвічем", "MEZ": "за центральноєвропейським стандартним часом", "HAST": "за стандартним гавайсько-алеутським часом", "HNT": "за стандартним часом у Ньюфаундленд"},
}
}
@@ -100,8 +100,8 @@ func (uk *uk) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
n := math.Abs(num)
i := int64(n)
- iMod100 := i % 100
iMod10 := i % 10
+ iMod100 := i % 100
if v == 0 && iMod10 == 1 && iMod100 != 11 {
return locales.PluralRuleOne
@@ -118,8 +118,8 @@ func (uk *uk) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
func (uk *uk) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
n := math.Abs(num)
- nMod10 := math.Mod(n, 10)
nMod100 := math.Mod(n, 100)
+ nMod10 := math.Mod(n, 10)
if nMod10 == 3 && nMod100 != 13 {
return locales.PluralRuleFew
diff --git a/uk/uk_test.go b/uk/uk_test.go
new file mode 100644
index 00000000..6f92d850
--- /dev/null
+++ b/uk/uk_test.go
@@ -0,0 +1,1120 @@
+package uk
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "uk"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/uk_UA/uk_UA.go b/uk_UA/uk_UA.go
index 376dbd63..bfd4de24 100644
--- a/uk_UA/uk_UA.go
+++ b/uk_UA/uk_UA.go
@@ -47,7 +47,7 @@ func New() locales.Translator {
locale: "uk_UA",
pluralsCardinal: []locales.PluralRule{2, 4, 5, 6},
pluralsOrdinal: []locales.PluralRule{4, 6},
- pluralsRange: []locales.PluralRule{2, 4, 5, 6},
+ pluralsRange: []locales.PluralRule{5, 6, 2, 4},
decimal: ",",
group: " ",
minus: "-",
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"до н. е.", "н. е."},
erasNarrow: []string{"до н.е.", "н.е."},
erasWide: []string{"до нашої ери", "нашої ери"},
- timezones: map[string]string{"HKST": "за літнім часом у Гонконзі", "WARST": "за літнім за західноаргентинським часом", "EAT": "за східноафриканським часом", "MST": "MST", "PST": "за північноамериканським тихоокеанським стандартним часом", "EST": "за північноамериканським східним стандартним часом", "ECT": "за часом в Еквадорі", "AST": "за атлантичним стандартним часом", "HKT": "за стандартним часом у Гонконзі", "UYT": "за стандартним часом в Уругваї", "CLST": "за літнім чилійським часом", "HAST": "за стандартним гавайсько-алеутським часом", "TMST": "за літнім часом у Туркменістані", "AKDT": "за літнім часом на Алясці", "PDT": "за північноамериканським тихоокеанським літнім часом", "LHDT": "за літнім часом на острові Лорд-Хау", "SRT": "за часом у Суринамі", "BT": "за часом у Бутані", "AKST": "за стандартним часом на Алясці", "AWDT": "за літнім західноавстралійським часом", "MESZ": "за центральноєвропейським літнім часом", "SGT": "за часом у Сінгапурі", "GFT": "за часом Французької Гвіани", "HADT": "за літнім гавайсько-алеутським часом", "WART": "за стандартним західноаргентинським часом", "ARST": "за літнім аргентинським часом", "UYST": "за літнім часом в Уругваї", "ACWDT": "за літнім центральнозахідним австралійським часом", "IST": "за індійським стандартним часом", "LHST": "за стандартним часом на острові Лорд-Хау", "JDT": "за японським літнім часом", "CDT": "за північноамериканським центральним літнім часом", "ACWST": "за стандартним центральнозахідним австралійським часом", "HAT": "за літнім часом у Ньюфаундленд", "CST": "за північноамериканським центральним стандартним часом", "NZST": "за стандартним часом у Новій Зеландії", "WEZ": "за західноєвропейським стандартним часом", "COST": "за літнім колумбійським часом", "WITA": "за центральноіндонезійським часом", "SAST": "за південноафриканським часом", "WAT": "за західноафриканським стандартним часом", "WIB": "за західноіндонезійським часом", "ACST": "за стандартним центральноавстралійським часом", "TMT": "за стандартним часом у Туркменістані", "BOT": "за болівійським часом", "ACDT": "за літнім центральноавстралійським часом", "AWST": "за стандартним західноавстралійським часом", "GYT": "за часом у Гаяні", "MYT": "за часом у Малайзії", "COT": "за стандартним колумбійським часом", "ADT": "за атлантичним літнім часом", "WIT": "за східноіндонезійським часом", "WESZ": "за західноєвропейським літнім часом", "WAST": "за західноафриканським літнім часом", "GMT": "за Гринвічем", "HNT": "за стандартним часом у Ньюфаундленд", "VET": "за часом у Венесуелі", "EDT": "за північноамериканським східним літнім часом", "OEZ": "за східноєвропейським стандартним часом", "ART": "за стандартним аргентинським часом", "MEZ": "за центральноєвропейським стандартним часом", "CLT": "за стандартним чилійським часом", "JST": "за японським стандартним часом", "AEST": "за стандартним східноавстралійським часом", "CHADT": "за літнім часом на архіпелазі Чатем", "ChST": "за часом на Північних Маріанських островах", "CHAST": "за стандартним часом на архіпелазі Чатем", "CAT": "за центральноафриканським часом", "∅∅∅": "за літнім бразильським часом", "OESZ": "за східноєвропейським літнім часом", "MDT": "MDT", "NZDT": "за літнім часом у Новій Зеландії", "AEDT": "за літнім східноавстралійським часом"},
+ timezones: map[string]string{"LHST": "за стандартним часом на острові Лорд-Хау", "LHDT": "за літнім часом на острові Лорд-Хау", "SGT": "за часом у Сінгапурі", "GMT": "за Гринвічем", "ACST": "за стандартним центральноавстралійським часом", "ACWDT": "за літнім центральнозахідним австралійським часом", "EST": "за північноамериканським східним стандартним часом", "PDT": "за північноамериканським тихоокеанським літнім часом", "CAT": "за центральноафриканським часом", "HAT": "за літнім часом у Ньюфаундленд", "COST": "за літнім колумбійським часом", "OESZ": "за східноєвропейським літнім часом", "BT": "за часом у Бутані", "CLT": "за стандартним чилійським часом", "HAST": "за стандартним гавайсько-алеутським часом", "WAT": "за західноафриканським стандартним часом", "WIB": "за західноіндонезійським часом", "ChST": "за часом на Північних Маріанських островах", "UYST": "за літнім часом в Уругваї", "CDT": "за північноамериканським центральним літнім часом", "WART": "за стандартним західноаргентинським часом", "WAST": "за західноафриканським літнім часом", "AEDT": "за літнім східноавстралійським часом", "∅∅∅": "за літнім бразильським часом", "CST": "за північноамериканським центральним стандартним часом", "ADT": "за атлантичним літнім часом", "GYT": "за часом у Гаяні", "WARST": "за літнім за західноаргентинським часом", "AWST": "за стандартним західноавстралійським часом", "BOT": "за болівійським часом", "AST": "за атлантичним стандартним часом", "WEZ": "за західноєвропейським стандартним часом", "CLST": "за літнім чилійським часом", "SAST": "за південноафриканським часом", "MESZ": "за центральноєвропейським літнім часом", "NZST": "за стандартним часом у Новій Зеландії", "NZDT": "за літнім часом у Новій Зеландії", "WESZ": "за західноєвропейським літнім часом", "TMST": "за літнім часом у Туркменістані", "MDT": "за північноамериканським гірським літнім часом", "UYT": "за стандартним часом в Уругваї", "CHAST": "за стандартним часом на архіпелазі Чатем", "AKDT": "за літнім часом на Алясці", "AWDT": "за літнім західноавстралійським часом", "CHADT": "за літнім часом на архіпелазі Чатем", "AKST": "за стандартним часом на Алясці", "JDT": "за японським літнім часом", "HNT": "за стандартним часом у Ньюфаундленд", "MST": "за північноамериканським гірським стандартним часом", "GFT": "за часом Французької Гвіани", "ECT": "за часом в Еквадорі", "ARST": "за літнім аргентинським часом", "PST": "за північноамериканським тихоокеанським стандартним часом", "COT": "за стандартним колумбійським часом", "MYT": "за часом у Малайзії", "MEZ": "за центральноєвропейським стандартним часом", "HADT": "за літнім гавайсько-алеутським часом", "HKT": "за стандартним часом у Гонконзі", "ART": "за стандартним аргентинським часом", "JST": "за японським стандартним часом", "TMT": "за стандартним часом у Туркменістані", "OEZ": "за східноєвропейським стандартним часом", "AEST": "за стандартним східноавстралійським часом", "SRT": "за часом у Суринамі", "ACWST": "за стандартним центральнозахідним австралійським часом", "EAT": "за східноафриканським часом", "WIT": "за східноіндонезійським часом", "ACDT": "за літнім центральноавстралійським часом", "HKST": "за літнім часом у Гонконзі", "VET": "за часом у Венесуелі", "WITA": "за центральноіндонезійським часом", "IST": "за індійським стандартним часом", "EDT": "за північноамериканським східним літнім часом"},
}
}
@@ -100,8 +100,8 @@ func (uk *uk_UA) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
n := math.Abs(num)
i := int64(n)
- iMod100 := i % 100
iMod10 := i % 10
+ iMod100 := i % 100
if v == 0 && iMod10 == 1 && iMod100 != 11 {
return locales.PluralRuleOne
diff --git a/uk_UA/uk_UA_test.go b/uk_UA/uk_UA_test.go
new file mode 100644
index 00000000..f223174f
--- /dev/null
+++ b/uk_UA/uk_UA_test.go
@@ -0,0 +1,1120 @@
+package uk_UA
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "uk_UA"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ur/ur.go b/ur/ur.go
index 77779064..fb155624 100644
--- a/ur/ur.go
+++ b/ur/ur.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"قبل مسیح", "عیسوی"},
erasNarrow: []string{"", ""},
erasWide: []string{"قبل مسیح", "عیسوی"},
- timezones: map[string]string{"MDT": "MDT", "JST": "جاپان سٹینڈرڈ ٹائم", "HAST": "ہوائی الیوٹیئن اسٹینڈرڈ ٹائم", "JDT": "جاپان ڈے لائٹ ٹائم", "NZST": "نیوزی لینڈ کا معیاری وقت", "EST": "ایسٹرن اسٹینڈرڈ ٹائم", "COST": "کولمبیا کا موسم گرما کا وقت", "HKT": "ہانگ کانگ سٹینڈرڈ ٹائم", "AKST": "الاسکا اسٹینڈرڈ ٹائم", "UYST": "یوروگوئے کا موسم گرما کا وقت", "VET": "وینزوئیلا کا وقت", "WIT": "مشرقی انڈونیشیا ٹائم", "IST": "ہندوستان کا معیاری وقت", "ART": "ارجنٹینا سٹینڈرڈ ٹائم", "ACWDT": "آسٹریلین سنٹرل ویسٹرن ڈے لائٹ ٹائم", "AEST": "آسٹریلین ایسٹرن اسٹینڈرڈ ٹائم", "HADT": "ہوائی الیوٹیئن ڈے لائٹ ٹائم", "GMT": "گرین وچ کا اصل وقت", "WAT": "مغربی افریقہ سٹینڈرڈ ٹائم", "OEZ": "مشرقی یورپ کا معیاری وقت", "TMT": "ترکمانستان کا معیاری وقت", "MYT": "ملیشیا ٹائم", "AWDT": "آسٹریلین ویسٹرن ڈے لائٹ ٹائم", "CHAST": "چیتھم اسٹینڈرڈ ٹائم", "AST": "اٹلانٹک اسٹینڈرڈ ٹائم", "CDT": "سنٹرل ڈے لائٹ ٹائم", "MESZ": "وسطی یورپ کا موسم گرما کا وقت", "WEZ": "مغربی یورپ کا معیاری وقت", "AKDT": "الاسکا ڈے لائٹ ٹائم", "BOT": "بولیویا کا وقت", "CHADT": "چیتھم ڈے لائٹ ٹائم", "WARST": "مغربی ارجنٹینا کا موسم گرما کا وقت", "GYT": "گیانا کا وقت", "AEDT": "آسٹریلین ایسٹرن ڈے لائٹ ٹائم", "CLST": "چلی کا موسم گرما کا وقت", "CAT": "وسطی افریقہ ٹائم", "HNT": "نیو فاؤنڈ لینڈ اسٹینڈرڈ ٹائم", "TMST": "ترکمانستان کا موسم گرما کا وقت", "EAT": "مشرقی افریقہ ٹائم", "LHDT": "لارڈ ہووے ڈے لائٹ ٹائم", "AWST": "آسٹریلیا ویسٹرن اسٹینڈرڈ ٹائم", "NZDT": "نیوزی لینڈ ڈے لائٹ ٹائم", "GFT": "فرینچ گیانا کا وقت", "MEZ": "وسطی یورپ کا معیاری وقت", "ADT": "اٹلانٹک ڈے لائٹ ٹائم", "SGT": "سنگاپور سٹینڈرڈ ٹائم", "HKST": "ہانگ کانگ سمر ٹائم", "PDT": "پیسفک ڈے لائٹ ٹائم", "WESZ": "مغربی یورپ کا موسم گرما کا وقت", "ECT": "ایکواڈور کا وقت", "WAST": "مغربی افریقہ سمر ٹائم", "WITA": "وسطی انڈونیشیا ٹائم", "CST": "سنٹرل اسٹینڈرڈ ٹائم", "ChST": "چامورو سٹینڈرڈ ٹائم", "ACWST": "آسٹریلین سنٹرل ویسٹرن اسٹینڈرڈ ٹائم", "COT": "کولمبیا کا معیاری وقت", "HAT": "نیو فاؤنڈ لینڈ ڈے لائٹ ٹائم", "∅∅∅": "امیزون کا موسم گرما کا وقت", "ACST": "آسٹریلین سنٹرل اسٹینڈرڈ ٹائم", "CLT": "چلی کا معیاری وقت", "MST": "MST", "PST": "پیسفک اسٹینڈرڈ ٹائم", "UYT": "یوروگوئے کا معیاری وقت", "SAST": "جنوبی افریقہ سٹینڈرڈ ٹائم", "OESZ": "مشرقی یورپ کا موسم گرما کا وقت", "ARST": "ارجنٹینا سمر ٹائم", "ACDT": "آسٹریلین سنٹرل ڈے لائٹ ٹائم", "LHST": "لارڈ ہووے اسٹینڈرڈ ٹائم", "SRT": "سورینام کا وقت", "BT": "بھوٹان کا وقت", "EDT": "ایسٹرن ڈے لائٹ ٹائم", "WART": "مغربی ارجنٹینا کا معیاری وقت", "WIB": "مغربی انڈونیشیا ٹائم"},
+ timezones: map[string]string{"IST": "ہندوستان کا معیاری وقت", "EDT": "ایسٹرن ڈے لائٹ ٹائم", "AEST": "آسٹریلین ایسٹرن اسٹینڈرڈ ٹائم", "ACWST": "آسٹریلین سنٹرل ویسٹرن اسٹینڈرڈ ٹائم", "WIB": "مغربی انڈونیشیا ٹائم", "MDT": "ماؤنٹین ڈے لائٹ ٹائم", "CLT": "چلی کا معیاری وقت", "ECT": "ایکواڈور کا وقت", "MESZ": "وسطی یورپ کا موسم گرما کا وقت", "HADT": "ہوائی الیوٹیئن ڈے لائٹ ٹائم", "ARST": "ارجنٹینا سمر ٹائم", "BOT": "بولیویا کا وقت", "CAT": "وسطی افریقہ ٹائم", "GYT": "گیانا کا وقت", "CST": "سنٹرل اسٹینڈرڈ ٹائم", "HKT": "ہانگ کانگ سٹینڈرڈ ٹائم", "WITA": "وسطی انڈونیشیا ٹائم", "WAST": "مغربی افریقہ سمر ٹائم", "HNT": "نیو فاؤنڈ لینڈ اسٹینڈرڈ ٹائم", "HKST": "ہانگ کانگ سمر ٹائم", "PDT": "پیسفک ڈے لائٹ ٹائم", "PST": "پیسفک اسٹینڈرڈ ٹائم", "MEZ": "وسطی یورپ کا معیاری وقت", "MST": "ماؤنٹین اسٹینڈرڈ ٹائم", "ACST": "آسٹریلین سنٹرل اسٹینڈرڈ ٹائم", "AKST": "الاسکا اسٹینڈرڈ ٹائم", "WESZ": "مغربی یورپ کا موسم گرما کا وقت", "HAST": "ہوائی الیوٹیئن اسٹینڈرڈ ٹائم", "WAT": "مغربی افریقہ سٹینڈرڈ ٹائم", "HAT": "نیو فاؤنڈ لینڈ ڈے لائٹ ٹائم", "COT": "کولمبیا کا معیاری وقت", "AEDT": "آسٹریلین ایسٹرن ڈے لائٹ ٹائم", "EAT": "مشرقی افریقہ ٹائم", "SRT": "سورینام کا وقت", "JDT": "جاپان ڈے لائٹ ٹائم", "ART": "ارجنٹینا سٹینڈرڈ ٹائم", "JST": "جاپان سٹینڈرڈ ٹائم", "GMT": "گرین وچ کا اصل وقت", "CLST": "چلی کا موسم گرما کا وقت", "UYT": "یوروگوئے کا معیاری وقت", "ACDT": "آسٹریلین سنٹرل ڈے لائٹ ٹائم", "CHADT": "چیتھم ڈے لائٹ ٹائم", "AWST": "آسٹریلیا ویسٹرن اسٹینڈرڈ ٹائم", "WEZ": "مغربی یورپ کا معیاری وقت", "GFT": "فرینچ گیانا کا وقت", "CHAST": "چیتھم اسٹینڈرڈ ٹائم", "VET": "وینزوئیلا کا وقت", "∅∅∅": "امیزون کا موسم گرما کا وقت", "CDT": "سنٹرل ڈے لائٹ ٹائم", "WART": "مغربی ارجنٹینا کا معیاری وقت", "OEZ": "مشرقی یورپ کا معیاری وقت", "ACWDT": "آسٹریلین سنٹرل ویسٹرن ڈے لائٹ ٹائم", "SAST": "جنوبی افریقہ سٹینڈرڈ ٹائم", "EST": "ایسٹرن اسٹینڈرڈ ٹائم", "NZST": "نیوزی لینڈ کا معیاری وقت", "COST": "کولمبیا کا موسم گرما کا وقت", "BT": "بھوٹان کا وقت", "UYST": "یوروگوئے کا موسم گرما کا وقت", "AST": "اٹلانٹک اسٹینڈرڈ ٹائم", "WARST": "مغربی ارجنٹینا کا موسم گرما کا وقت", "OESZ": "مشرقی یورپ کا موسم گرما کا وقت", "LHDT": "لارڈ ہووے ڈے لائٹ ٹائم", "ADT": "اٹلانٹک ڈے لائٹ ٹائم", "TMT": "ترکمانستان کا معیاری وقت", "SGT": "سنگاپور سٹینڈرڈ ٹائم", "ChST": "چامورو سٹینڈرڈ ٹائم", "LHST": "لارڈ ہووے اسٹینڈرڈ ٹائم", "AKDT": "الاسکا ڈے لائٹ ٹائم", "NZDT": "نیوزی لینڈ ڈے لائٹ ٹائم", "TMST": "ترکمانستان کا موسم گرما کا وقت", "WIT": "مشرقی انڈونیشیا ٹائم", "MYT": "ملیشیا ٹائم", "AWDT": "آسٹریلین ویسٹرن ڈے لائٹ ٹائم"},
}
}
diff --git a/ur/ur_test.go b/ur/ur_test.go
new file mode 100644
index 00000000..5f8c39a1
--- /dev/null
+++ b/ur/ur_test.go
@@ -0,0 +1,1120 @@
+package ur
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ur"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ur_IN/ur_IN.go b/ur_IN/ur_IN.go
index 0bb45e65..ce56a295 100644
--- a/ur_IN/ur_IN.go
+++ b/ur_IN/ur_IN.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"قبل مسیح", "عیسوی"},
erasNarrow: []string{"", ""},
erasWide: []string{"قبل مسیح", "عیسوی"},
- timezones: map[string]string{"MST": "MST", "BOT": "بولیویا ٹائم", "ECT": "ایکواڈور ٹائم", "BT": "بھوٹان ٹائم", "TMST": "ترکمانستان سمر ٹائم", "ACST": "آسٹریلین سنٹرل اسٹینڈرڈ ٹائم", "JST": "جاپان سٹینڈرڈ ٹائم", "AKDT": "الاسکا ڈے لائٹ ٹائم", "NZST": "نیوزی لینڈ سٹینڈرڈ ٹائم", "NZDT": "نیوزی لینڈ ڈے لائٹ ٹائم", "HAST": "ہوائی الیوٹیئن اسٹینڈرڈ ٹائم", "WART": "مغربی ارجنٹینا سٹینڈرڈ ٹائم", "WAT": "مغربی افریقہ سٹینڈرڈ ٹائم", "TMT": "ترکمانستان سٹینڈرڈ ٹائم", "MYT": "ملیشیا ٹائم", "SRT": "سورینام ٹائم", "CDT": "سنٹرل ڈے لائٹ ٹائم", "ARST": "ارجنٹینا سمر ٹائم", "CST": "سنٹرل اسٹینڈرڈ ٹائم", "CHADT": "چیتھم ڈے لائٹ ٹائم", "SAST": "جنوبی افریقہ سٹینڈرڈ ٹائم", "EDT": "ایسٹرن ڈے لائٹ ٹائم", "HKST": "ہانگ کانگ سمر ٹائم", "WARST": "مغربی ارجنٹینا سمر ٹائم", "GYT": "گیانا ٹائم", "AKST": "الاسکا اسٹینڈرڈ ٹائم", "WEZ": "مغربی یورپ کا معیاری وقت", "ACWDT": "آسٹریلین سنٹرل ویسٹرن ڈے لائٹ ٹائم", "AEST": "آسٹریلین ایسٹرن اسٹینڈرڈ ٹائم", "WAST": "مغربی افریقہ سمر ٹائم", "WIT": "مشرقی انڈونیشیا ٹائم", "MEZ": "وسطی یورپ کا معیاری وقت", "ADT": "اٹلانٹک ڈے لائٹ ٹائم", "HNT": "نیو فاؤنڈ لینڈ اسٹینڈرڈ ٹائم", "HAT": "نیو فاؤنڈ لینڈ ڈے لائٹ ٹائم", "OEZ": "مشرقی یورپ کا معیاری وقت", "LHST": "لارڈ ہووے اسٹینڈرڈ ٹائم", "AWDT": "آسٹریلین ویسٹرن ڈے لائٹ ٹائم", "CLST": "چلی سمر ٹائم", "EST": "ایسٹرن اسٹینڈرڈ ٹائم", "PDT": "پیسفک ڈے لائٹ ٹائم", "AWST": "آسٹریلیا ویسٹرن اسٹینڈرڈ ٹائم", "COST": "کولمبیا سمر ٹائم", "GFT": "فرینچ گیانا ٹائم", "MESZ": "وسطی یورپ کا موسم گرما کا وقت", "IST": "انڈیا سٹینڈرڈ ٹائم", "OESZ": "مشرقی یورپ کا موسم گرما کا وقت", "ACDT": "آسٹریلین سنٹرل ڈے لائٹ ٹائم", "UYT": "یوروگوئے سٹینڈرڈ ٹائم", "CLT": "چلی سٹینڈرڈ ٹائم", "CAT": "وسطی افریقہ ٹائم", "AST": "اٹلانٹک اسٹینڈرڈ ٹائم", "MDT": "MDT", "SGT": "سنگاپور سٹینڈرڈ ٹائم", "GMT": "گرین وچ مین ٹائم", "ART": "ارجنٹینا سٹینڈرڈ ٹائم", "∅∅∅": "ایمیزون سمر ٹائم", "ChST": "چامورو سٹینڈرڈ ٹائم", "WESZ": "مغربی یورپ کا موسم گرما کا وقت", "HADT": "ہوائی الیوٹیئن ڈے لائٹ ٹائم", "COT": "کولمبیا سٹینڈرڈ ٹائم", "WITA": "وسطی انڈونیشیا ٹائم", "WIB": "مغربی انڈونیشیا ٹائم", "LHDT": "لارڈ ہووے ڈے لائٹ ٹائم", "UYST": "یوروگوئے سمر ٹائم", "AEDT": "آسٹریلین ایسٹرن ڈے لائٹ ٹائم", "ACWST": "آسٹریلین سنٹرل ویسٹرن اسٹینڈرڈ ٹائم", "HKT": "ہانگ کانگ سٹینڈرڈ ٹائم", "EAT": "مشرقی افریقہ ٹائم", "JDT": "جاپان ڈے لائٹ ٹائم", "PST": "پیسفک اسٹینڈرڈ ٹائم", "CHAST": "چیتھم اسٹینڈرڈ ٹائم", "VET": "وینزوئیلا ٹائم"},
+ timezones: map[string]string{"HKT": "ہانگ کانگ سٹینڈرڈ ٹائم", "EST": "ایسٹرن اسٹینڈرڈ ٹائم", "WIB": "مغربی انڈونیشیا ٹائم", "AEDT": "آسٹریلین ایسٹرن ڈے لائٹ ٹائم", "EDT": "ایسٹرن ڈے لائٹ ٹائم", "PDT": "پیسفک ڈے لائٹ ٹائم", "MYT": "ملیشیا ٹائم", "∅∅∅": "ازوریس کا موسم گرما کا وقت", "WITA": "وسطی انڈونیشیا ٹائم", "HNT": "نیو فاؤنڈ لینڈ اسٹینڈرڈ ٹائم", "EAT": "مشرقی افریقہ ٹائم", "LHST": "لارڈ ہووے اسٹینڈرڈ ٹائم", "CLST": "چلی سمر ٹائم", "UYT": "یوروگوئے سٹینڈرڈ ٹائم", "ADT": "اٹلانٹک ڈے لائٹ ٹائم", "AWDT": "آسٹریلین ویسٹرن ڈے لائٹ ٹائم", "JST": "جاپان سٹینڈرڈ ٹائم", "WEZ": "مغربی یورپ کا معیاری وقت", "VET": "وینزوئیلا ٹائم", "ACWST": "آسٹریلین سنٹرل ویسٹرن اسٹینڈرڈ ٹائم", "HAT": "نیو فاؤنڈ لینڈ ڈے لائٹ ٹائم", "OEZ": "مشرقی یورپ کا معیاری وقت", "CHADT": "چیتھم ڈے لائٹ ٹائم", "IST": "انڈیا سٹینڈرڈ ٹائم", "MEZ": "وسطی یورپ کا معیاری وقت", "COT": "کولمبیا سٹینڈرڈ ٹائم", "OESZ": "مشرقی یورپ کا موسم گرما کا وقت", "GYT": "گیانا ٹائم", "LHDT": "لارڈ ہووے ڈے لائٹ ٹائم", "WARST": "مغربی ارجنٹینا سمر ٹائم", "ECT": "ایکواڈور ٹائم", "AST": "اٹلانٹک اسٹینڈرڈ ٹائم", "AWST": "آسٹریلیا ویسٹرن اسٹینڈرڈ ٹائم", "ACDT": "آسٹریلین سنٹرل ڈے لائٹ ٹائم", "SRT": "سورینام ٹائم", "GFT": "فرینچ گیانا ٹائم", "MST": "MST", "ACWDT": "آسٹریلین سنٹرل ویسٹرن ڈے لائٹ ٹائم", "NZDT": "نیوزی لینڈ ڈے لائٹ ٹائم", "WAST": "مغربی افریقہ سمر ٹائم", "COST": "کولمبیا سمر ٹائم", "TMST": "ترکمانستان سمر ٹائم", "GMT": "گرین وچ مین ٹائم", "ChST": "چامورو سٹینڈرڈ ٹائم", "JDT": "جاپان ڈے لائٹ ٹائم", "SAST": "جنوبی افریقہ سٹینڈرڈ ٹائم", "TMT": "ترکمانستان سٹینڈرڈ ٹائم", "AKST": "الاسکا اسٹینڈرڈ ٹائم", "ARST": "ارجنٹینا سمر ٹائم", "CLT": "چلی سٹینڈرڈ ٹائم", "WIT": "مشرقی انڈونیشیا ٹائم", "AKDT": "الاسکا ڈے لائٹ ٹائم", "ART": "ارجنٹینا سٹینڈرڈ ٹائم", "MESZ": "وسطی یورپ کا موسم گرما کا وقت", "CAT": "وسطی افریقہ ٹائم", "UYST": "یوروگوئے سمر ٹائم", "CST": "سنٹرل اسٹینڈرڈ ٹائم", "NZST": "نیوزی لینڈ سٹینڈرڈ ٹائم", "SGT": "سنگاپور سٹینڈرڈ ٹائم", "CDT": "سنٹرل ڈے لائٹ ٹائم", "WART": "مغربی ارجنٹینا سٹینڈرڈ ٹائم", "MDT": "MDT", "HKST": "ہانگ کانگ سمر ٹائم", "HADT": "ہوائی الیوٹیئن ڈے لائٹ ٹائم", "AEST": "آسٹریلین ایسٹرن اسٹینڈرڈ ٹائم", "ACST": "آسٹریلین سنٹرل اسٹینڈرڈ ٹائم", "PST": "پیسفک اسٹینڈرڈ ٹائم", "HAST": "ہوائی الیوٹیئن اسٹینڈرڈ ٹائم", "WAT": "مغربی افریقہ سٹینڈرڈ ٹائم", "BT": "بھوٹان ٹائم", "CHAST": "چیتھم اسٹینڈرڈ ٹائم", "BOT": "بولیویا ٹائم", "WESZ": "مغربی یورپ کا موسم گرما کا وقت"},
}
}
diff --git a/ur_IN/ur_IN_test.go b/ur_IN/ur_IN_test.go
new file mode 100644
index 00000000..361d2233
--- /dev/null
+++ b/ur_IN/ur_IN_test.go
@@ -0,0 +1,1120 @@
+package ur_IN
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ur_IN"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/ur_PK/ur_PK.go b/ur_PK/ur_PK.go
index d47a25e0..b8a4306e 100644
--- a/ur_PK/ur_PK.go
+++ b/ur_PK/ur_PK.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"قبل مسیح", "عیسوی"},
erasNarrow: []string{"", ""},
erasWide: []string{"قبل مسیح", "عیسوی"},
- timezones: map[string]string{"LHDT": "لارڈ ہووے ڈے لائٹ ٹائم", "CHADT": "چیتھم ڈے لائٹ ٹائم", "COST": "کولمبیا کا موسم گرما کا وقت", "ACDT": "آسٹریلین سنٹرل ڈے لائٹ ٹائم", "PST": "پیسفک اسٹینڈرڈ ٹائم", "MEZ": "وسطی یورپ کا معیاری وقت", "MESZ": "وسطی یورپ کا موسم گرما کا وقت", "HNT": "نیو فاؤنڈ لینڈ اسٹینڈرڈ ٹائم", "SRT": "سورینام کا وقت", "∅∅∅": "ازوریس کا موسم گرما کا وقت", "WEZ": "مغربی یورپ کا معیاری وقت", "WESZ": "مغربی یورپ کا موسم گرما کا وقت", "OESZ": "مشرقی یورپ کا موسم گرما کا وقت", "WITA": "وسطی انڈونیشیا ٹائم", "TMST": "ترکمانستان کا موسم گرما کا وقت", "AKDT": "الاسکا ڈے لائٹ ٹائم", "LHST": "لارڈ ہووے اسٹینڈرڈ ٹائم", "OEZ": "مشرقی یورپ کا معیاری وقت", "GYT": "گیانا کا وقت", "ChST": "چامورو سٹینڈرڈ ٹائم", "ART": "ارجنٹینا سٹینڈرڈ ٹائم", "AKST": "الاسکا اسٹینڈرڈ ٹائم", "AWST": "آسٹریلیا ویسٹرن اسٹینڈرڈ ٹائم", "CLT": "چلی کا معیاری وقت", "HADT": "ہوائی الیوٹیئن ڈے لائٹ ٹائم", "IST": "ہندوستان کا معیاری وقت", "HAT": "نیو فاؤنڈ لینڈ ڈے لائٹ ٹائم", "WIT": "مشرقی انڈونیشیا ٹائم", "JDT": "جاپان ڈے لائٹ ٹائم", "CST": "سنٹرل اسٹینڈرڈ ٹائم", "EST": "ایسٹرن اسٹینڈرڈ ٹائم", "ADT": "اٹلانٹک ڈے لائٹ ٹائم", "EAT": "مشرقی افریقہ ٹائم", "NZDT": "نیوزی لینڈ ڈے لائٹ ٹائم", "AEST": "آسٹریلین ایسٹرن اسٹینڈرڈ ٹائم", "AEDT": "آسٹریلین ایسٹرن ڈے لائٹ ٹائم", "ECT": "ایکواڈور کا وقت", "WART": "مغربی ارجنٹینا کا معیاری وقت", "AST": "اٹلانٹک اسٹینڈرڈ ٹائم", "GMT": "گرین وچ کا اصل وقت", "UYST": "یوروگوئے کا موسم گرما کا وقت", "MST": "ماؤنٹین اسٹینڈرڈ ٹائم", "CLST": "چلی کا موسم گرما کا وقت", "SAST": "جنوبی افریقہ سٹینڈرڈ ٹائم", "WAT": "مغربی افریقہ سٹینڈرڈ ٹائم", "WIB": "مغربی انڈونیشیا ٹائم", "ACST": "آسٹریلین سنٹرل اسٹینڈرڈ ٹائم", "NZST": "نیوزی لینڈ کا معیاری وقت", "CAT": "وسطی افریقہ ٹائم", "COT": "کولمبیا کا معیاری وقت", "VET": "وینزوئیلا کا وقت", "GFT": "فرینچ گیانا کا وقت", "BOT": "بولیویا کا وقت", "HAST": "ہوائی الیوٹیئن اسٹینڈرڈ ٹائم", "SGT": "سنگاپور سٹینڈرڈ ٹائم", "HKT": "ہانگ کانگ سٹینڈرڈ ٹائم", "HKST": "ہانگ کانگ سمر ٹائم", "ARST": "ارجنٹینا سمر ٹائم", "PDT": "پیسفک ڈے لائٹ ٹائم", "CDT": "سنٹرل ڈے لائٹ ٹائم", "UYT": "یوروگوئے کا معیاری وقت", "ACWST": "آسٹریلین سنٹرل ویسٹرن اسٹینڈرڈ ٹائم", "EDT": "ایسٹرن ڈے لائٹ ٹائم", "TMT": "ترکمانستان کا معیاری وقت", "AWDT": "آسٹریلین ویسٹرن ڈے لائٹ ٹائم", "JST": "جاپان سٹینڈرڈ ٹائم", "ACWDT": "آسٹریلین سنٹرل ویسٹرن ڈے لائٹ ٹائم", "MDT": "ماؤنٹین ڈے لائٹ ٹائم", "CHAST": "چیتھم اسٹینڈرڈ ٹائم", "BT": "بھوٹان کا وقت", "WARST": "مغربی ارجنٹینا کا موسم گرما کا وقت", "MYT": "ملیشیا ٹائم", "WAST": "مغربی افریقہ سمر ٹائم"},
+ timezones: map[string]string{"AKDT": "الاسکا ڈے لائٹ ٹائم", "AWDT": "آسٹریلین ویسٹرن ڈے لائٹ ٹائم", "HADT": "ہوائی الیوٹیئن ڈے لائٹ ٹائم", "WESZ": "مغربی یورپ کا موسم گرما کا وقت", "ChST": "چامورو سٹینڈرڈ ٹائم", "CLST": "چلی کا موسم گرما کا وقت", "WIB": "مغربی انڈونیشیا ٹائم", "CDT": "سنٹرل ڈے لائٹ ٹائم", "AKST": "الاسکا اسٹینڈرڈ ٹائم", "IST": "ہندوستان کا معیاری وقت", "∅∅∅": "امیزون کا موسم گرما کا وقت", "WAST": "مغربی افریقہ سمر ٹائم", "MDT": "ماؤنٹین ڈے لائٹ ٹائم", "NZST": "نیوزی لینڈ کا معیاری وقت", "NZDT": "نیوزی لینڈ ڈے لائٹ ٹائم", "EDT": "ایسٹرن ڈے لائٹ ٹائم", "UYT": "یوروگوئے کا معیاری وقت", "JST": "جاپان سٹینڈرڈ ٹائم", "ACWST": "آسٹریلین سنٹرل ویسٹرن اسٹینڈرڈ ٹائم", "ARST": "ارجنٹینا سمر ٹائم", "BOT": "بولیویا کا وقت", "HAST": "ہوائی الیوٹیئن اسٹینڈرڈ ٹائم", "CAT": "وسطی افریقہ ٹائم", "COT": "کولمبیا کا معیاری وقت", "PST": "پیسفک اسٹینڈرڈ ٹائم", "MST": "ماؤنٹین اسٹینڈرڈ ٹائم", "GFT": "فرینچ گیانا کا وقت", "ADT": "اٹلانٹک ڈے لائٹ ٹائم", "ART": "ارجنٹینا سٹینڈرڈ ٹائم", "AEST": "آسٹریلین ایسٹرن اسٹینڈرڈ ٹائم", "WITA": "وسطی انڈونیشیا ٹائم", "SAST": "جنوبی افریقہ سٹینڈرڈ ٹائم", "PDT": "پیسفک ڈے لائٹ ٹائم", "GMT": "گرین وچ کا اصل وقت", "ACST": "آسٹریلین سنٹرل اسٹینڈرڈ ٹائم", "HNT": "نیو فاؤنڈ لینڈ اسٹینڈرڈ ٹائم", "GYT": "گیانا کا وقت", "WIT": "مشرقی انڈونیشیا ٹائم", "ECT": "ایکواڈور کا وقت", "VET": "وینزوئیلا کا وقت", "AWST": "آسٹریلیا ویسٹرن اسٹینڈرڈ ٹائم", "MESZ": "وسطی یورپ کا موسم گرما کا وقت", "TMST": "ترکمانستان کا موسم گرما کا وقت", "HKT": "ہانگ کانگ سٹینڈرڈ ٹائم", "TMT": "ترکمانستان کا معیاری وقت", "OEZ": "مشرقی یورپ کا معیاری وقت", "EAT": "مشرقی افریقہ ٹائم", "EST": "ایسٹرن اسٹینڈرڈ ٹائم", "MYT": "ملیشیا ٹائم", "CLT": "چلی کا معیاری وقت", "CHAST": "چیتھم اسٹینڈرڈ ٹائم", "JDT": "جاپان ڈے لائٹ ٹائم", "LHDT": "لارڈ ہووے ڈے لائٹ ٹائم", "WART": "مغربی ارجنٹینا کا معیاری وقت", "WARST": "مغربی ارجنٹینا کا موسم گرما کا وقت", "SRT": "سورینام کا وقت", "AST": "اٹلانٹک اسٹینڈرڈ ٹائم", "WAT": "مغربی افریقہ سٹینڈرڈ ٹائم", "WEZ": "مغربی یورپ کا معیاری وقت", "HAT": "نیو فاؤنڈ لینڈ ڈے لائٹ ٹائم", "OESZ": "مشرقی یورپ کا موسم گرما کا وقت", "AEDT": "آسٹریلین ایسٹرن ڈے لائٹ ٹائم", "BT": "بھوٹان کا وقت", "LHST": "لارڈ ہووے اسٹینڈرڈ ٹائم", "MEZ": "وسطی یورپ کا معیاری وقت", "CST": "سنٹرل اسٹینڈرڈ ٹائم", "ACDT": "آسٹریلین سنٹرل ڈے لائٹ ٹائم", "CHADT": "چیتھم ڈے لائٹ ٹائم", "ACWDT": "آسٹریلین سنٹرل ویسٹرن ڈے لائٹ ٹائم", "SGT": "سنگاپور سٹینڈرڈ ٹائم", "COST": "کولمبیا کا موسم گرما کا وقت", "UYST": "یوروگوئے کا موسم گرما کا وقت", "HKST": "ہانگ کانگ سمر ٹائم"},
}
}
diff --git a/ur_PK/ur_PK_test.go b/ur_PK/ur_PK_test.go
new file mode 100644
index 00000000..fe27e393
--- /dev/null
+++ b/ur_PK/ur_PK_test.go
@@ -0,0 +1,1120 @@
+package ur_PK
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ur_PK"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/uz/uz.go b/uz/uz.go
index bb26badf..8d1728ac 100644
--- a/uz/uz.go
+++ b/uz/uz.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"", ""},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"ACWDT": "Markaziy Avstraliya g‘arbiy yozgi vaqti", "WARST": "Gʻarbiy Argentina yozgi vaqti", "HAT": "Nyufaundlend yozgi vaqti", "ARST": "Argentina yozgi vaqti", "IST": "Hindiston vaqti", "AEDT": "Sharqiy Avstraliya yozgi vaqti", "ChST": "Chamorro standart vaqti", "COST": "Kolumbiya yozgi vaqti", "HADT": "Gavayi-aleut yozgi vaqti", "SRT": "Surinam vaqti", "AEST": "Sharqiy Avstraliya standart vaqti", "MESZ": "Markaziy Yevropa yozgi vaqti", "JST": "Yaponiya standart vaqti", "AKDT": "Alyaska yozgi vaqti", "UYT": "Urugvay standart vaqti", "CLST": "Chili yozgi vaqti", "WEZ": "G‘arbiy Yevropa standart vaqti", "COT": "Kolumbiya standart vaqti", "WART": "Gʻarbiy Argentina standart vaqti", "OESZ": "Sharqiy Yevropa yozgi vaqti", "BOT": "Boliviya vaqti", "AST": "Atlantika standart vaqti", "HKT": "Gonkong standart vaqti", "WIB": "Gʻarbiy Indoneziya vaqti", "ART": "Argentina standart vaqti", "CAT": "Markaziy Afrika vaqti", "SGT": "Singapur vaqti", "AWST": "G‘arbiy Avstraliya standart vaqti", "JDT": "Yaponiya yozgi vaqti", "SAST": "Janubiy Afrika standart vaqti", "MDT": "MDT", "WESZ": "G‘arbiy Yevropa yozgi vaqti", "NZST": "Yangi Zelandiya standart vaqti", "EST": "Sharqiy Amerika standart vaqti", "HKST": "Gonkong yozgi vaqti", "AWDT": "G‘arbiy Avstraliya yozgi vaqti", "PST": "Shimoliy Amerika Tinch okeani standart vaqti", "MEZ": "Markaziy Yevropa standart vaqti", "ECT": "Ekvador vaqti", "HAST": "Gavayi-aleut standart vaqti", "UYST": "Urugvay yozgi vaqti", "CDT": "Markaziy Amerika yozgi vaqti", "CLT": "Chili standart vaqti", "ACWST": "Markaziy Avstraliya g‘arbiy standart vaqti", "EAT": "Sharqiy Afrika vaqti", "MST": "MST", "BT": "Butan vaqti", "HNT": "Nyufaundlend standart vaqti", "∅∅∅": "Amazonka yozgi vaqti", "ACST": "Markaziy Avstraliya standart vaqti", "CHAST": "Chatem standart vaqti", "TMST": "Turkmaniston yozgi vaqti", "LHST": "Lord-Xau standart vaqti", "GYT": "Gayana vaqti", "AKST": "Alyaska standart vaqti", "PDT": "Shimoliy Amerika Tinch okeani yozgi vaqti", "NZDT": "Yangi Zelandiya yozgi vaqti", "GFT": "Fransuz Gvianasi vaqti", "WIT": "Sharqiy Indoneziya vaqti", "CST": "Markaziy Amerika standart vaqti", "WAST": "Gʻarbiy Afrika yozgi vaqti", "OEZ": "Sharqiy Yevropa standart vaqti", "ACDT": "Markaziy Avstraliya yozgi vaqti", "TMT": "Turkmaniston standart vaqti", "LHDT": "Lord-Xau yozgi vaqti", "MYT": "Malayziya vaqti", "VET": "Venesuela vaqti", "GMT": "Grinvich o‘rtacha vaqti", "WITA": "Markaziy Indoneziya vaqti", "ADT": "Atlantika yozgi vaqti", "WAT": "Gʻarbiy Afrika standart vaqti", "CHADT": "Chatem yozgi vaqti", "EDT": "Sharqiy Amerika yozgi vaqti"},
+ timezones: map[string]string{"WARST": "Gʻarbiy Argentina yozgi vaqti", "MST": "MST", "EST": "Sharqiy Amerika standart vaqti", "PDT": "Shimoliy Amerika Tinch okeani yozgi vaqti", "NZDT": "Yangi Zelandiya yozgi vaqti", "UYT": "Urugvay standart vaqti", "EAT": "Sharqiy Afrika vaqti", "AWST": "G‘arbiy Avstraliya standart vaqti", "WEZ": "G‘arbiy Yevropa standart vaqti", "AEST": "Sharqiy Avstraliya standart vaqti", "UYST": "Urugvay yozgi vaqti", "ACST": "Markaziy Avstraliya standart vaqti", "ACDT": "Markaziy Avstraliya yozgi vaqti", "CHAST": "Chatem standart vaqti", "ACWST": "Markaziy Avstraliya g‘arbiy standart vaqti", "COT": "Kolumbiya standart vaqti", "SRT": "Surinam vaqti", "WAST": "Gʻarbiy Afrika yozgi vaqti", "BT": "Butan vaqti", "JDT": "Yaponiya yozgi vaqti", "TMST": "Turkmaniston yozgi vaqti", "GMT": "Grinvich o‘rtacha vaqti", "GYT": "Gayana vaqti", "COST": "Kolumbiya yozgi vaqti", "CST": "Markaziy Amerika standart vaqti", "AKST": "Alyaska standart vaqti", "PST": "Shimoliy Amerika Tinch okeani standart vaqti", "BOT": "Boliviya vaqti", "SAST": "Janubiy Afrika standart vaqti", "WAT": "Gʻarbiy Afrika standart vaqti", "HNT": "Nyufaundlend standart vaqti", "AEDT": "Sharqiy Avstraliya yozgi vaqti", "LHDT": "Lord-Xau yozgi vaqti", "WIT": "Sharqiy Indoneziya vaqti", "∅∅∅": "Azor orollari yozgi vaqti", "HKST": "Gonkong yozgi vaqti", "MDT": "MDT", "CAT": "Markaziy Afrika vaqti", "OEZ": "Sharqiy Yevropa standart vaqti", "HKT": "Gonkong standart vaqti", "CHADT": "Chatem yozgi vaqti", "ADT": "Atlantika yozgi vaqti", "WIB": "Gʻarbiy Indoneziya vaqti", "LHST": "Lord-Xau standart vaqti", "CLST": "Chili yozgi vaqti", "AKDT": "Alyaska yozgi vaqti", "EDT": "Sharqiy Amerika yozgi vaqti", "HADT": "Gavayi-aleut yozgi vaqti", "HAT": "Nyufaundlend yozgi vaqti", "ChST": "Chamorro standart vaqti", "VET": "Venesuela vaqti", "WITA": "Markaziy Indoneziya vaqti", "IST": "Hindiston vaqti", "OESZ": "Sharqiy Yevropa yozgi vaqti", "CDT": "Markaziy Amerika yozgi vaqti", "ACWDT": "Markaziy Avstraliya g‘arbiy yozgi vaqti", "GFT": "Fransuz Gvianasi vaqti", "ECT": "Ekvador vaqti", "HAST": "Gavayi-aleut standart vaqti", "TMT": "Turkmaniston standart vaqti", "MYT": "Malayziya vaqti", "WART": "Gʻarbiy Argentina standart vaqti", "AWDT": "G‘arbiy Avstraliya yozgi vaqti", "ART": "Argentina standart vaqti", "MEZ": "Markaziy Yevropa standart vaqti", "MESZ": "Markaziy Yevropa yozgi vaqti", "NZST": "Yangi Zelandiya standart vaqti", "CLT": "Chili standart vaqti", "AST": "Atlantika standart vaqti", "ARST": "Argentina yozgi vaqti", "JST": "Yaponiya standart vaqti", "WESZ": "G‘arbiy Yevropa yozgi vaqti", "SGT": "Singapur vaqti"},
}
}
diff --git a/uz/uz_test.go b/uz/uz_test.go
new file mode 100644
index 00000000..c79fd707
--- /dev/null
+++ b/uz/uz_test.go
@@ -0,0 +1,1120 @@
+package uz
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "uz"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/uz_Arab/uz_Arab.go b/uz_Arab/uz_Arab.go
index f6722d3f..9cecf6ea 100644
--- a/uz_Arab/uz_Arab.go
+++ b/uz_Arab/uz_Arab.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ق.م.", "م."},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"MDT": "Shimoliy Amerika togʻ yozgi vaqti", "CAT": "Markaziy Afrika vaqti", "AEST": "Sharqiy Avstraliya standart vaqti", "HADT": "Gavayi-aleut yozgi vaqti", "WIB": "Gʻarbiy Indoneziya vaqti", "WEZ": "G‘arbiy Yevropa standart vaqti", "COST": "Kolumbiya yozgi vaqti", "AST": "Atlantika standart vaqti", "ADT": "Atlantika yozgi vaqti", "HKT": "Gonkong standart vaqti", "AKDT": "Alyaska yozgi vaqti", "CHADT": "Chatem yozgi vaqti", "CLT": "Chili standart vaqti", "OESZ": "Sharqiy Yevropa yozgi vaqti", "WAST": "Gʻarbiy Afrika yozgi vaqti", "HAT": "Nyufaundlend yozgi vaqti", "NZST": "Yangi Zelandiya standart vaqti", "BOT": "Boliviya vaqti", "MST": "Shimoliy Amerika togʻ standart vaqti", "PDT": "Shimoliy Amerika Tinch okeani yozgi vaqti", "ACWDT": "Markaziy Avstraliya g‘arbiy yozgi vaqti", "EST": "Sharqiy Amerika standart vaqti", "EDT": "Sharqiy Amerika yozgi vaqti", "HKST": "Gonkong yozgi vaqti", "WITA": "Markaziy Indoneziya vaqti", "GMT": "Grinvich o‘rtacha vaqti", "JDT": "Yaponiya yozgi vaqti", "CDT": "Markaziy Amerika yozgi vaqti", "CHAST": "Chatem standart vaqti", "AEDT": "Sharqiy Avstraliya yozgi vaqti", "ChST": "Chamorro standart vaqti", "ECT": "Ekvador vaqti", "PST": "Shimoliy Amerika Tinch okeani standart vaqti", "LHST": "Lord-Xau standart vaqti", "UYST": "Urugvay yozgi vaqti", "TMST": "Turkmaniston yozgi vaqti", "JST": "Yaponiya standart vaqti", "SRT": "Surinam vaqti", "WARST": "Gʻarbiy Argentina yozgi vaqti", "GYT": "Gayana vaqti", "WAT": "Gʻarbiy Afrika standart vaqti", "HAST": "Gavayi-aleut standart vaqti", "WIT": "Sharqiy Indoneziya vaqti", "MESZ": "Markaziy Yevropa yozgi vaqti", "WESZ": "G‘arbiy Yevropa yozgi vaqti", "COT": "Kolumbiya standart vaqti", "CLST": "Chili yozgi vaqti", "HNT": "Nyufaundlend standart vaqti", "ACDT": "Markaziy Avstraliya yozgi vaqti", "AKST": "Alyaska standart vaqti", "CST": "Markaziy Amerika standart vaqti", "MEZ": "Markaziy Yevropa standart vaqti", "AWDT": "G‘arbiy Avstraliya yozgi vaqti", "NZDT": "Yangi Zelandiya yozgi vaqti", "EAT": "Sharqiy Afrika vaqti", "SGT": "Singapur vaqti", "SAST": "Janubiy Afrika standart vaqti", "MYT": "Malayziya vaqti", "AWST": "G‘arbiy Avstraliya standart vaqti", "LHDT": "Lord-Xau yozgi vaqti", "BT": "Butan vaqti", "WART": "Gʻarbiy Argentina standart vaqti", "OEZ": "Sharqiy Yevropa standart vaqti", "TMT": "Turkmaniston standart vaqti", "ACST": "Markaziy Avstraliya standart vaqti", "UYT": "Urugvay standart vaqti", "VET": "Venesuela vaqti", "ACWST": "Markaziy Avstraliya g‘arbiy standart vaqti", "ART": "Argentina standart vaqti", "ARST": "Argentina yozgi vaqti", "∅∅∅": "Azor orollari yozgi vaqti", "IST": "Hindiston vaqti", "GFT": "Fransuz Gvianasi vaqti"},
+ timezones: map[string]string{"AKDT": "Alyaska yozgi vaqti", "WESZ": "G‘arbiy Yevropa yozgi vaqti", "HAT": "Nyufaundlend yozgi vaqti", "GFT": "Fransuz Gvianasi vaqti", "CHADT": "Chatem yozgi vaqti", "AWST": "G‘arbiy Avstraliya standart vaqti", "ART": "Argentina standart vaqti", "EST": "Sharqiy Amerika standart vaqti", "COT": "Kolumbiya standart vaqti", "LHDT": "Lord-Xau yozgi vaqti", "UYT": "Urugvay standart vaqti", "MST": "MST", "ECT": "Ekvador vaqti", "PDT": "Shimoliy Amerika Tinch okeani yozgi vaqti", "TMST": "Turkmaniston yozgi vaqti", "LHST": "Lord-Xau standart vaqti", "WITA": "Markaziy Indoneziya vaqti", "NZST": "Yangi Zelandiya standart vaqti", "IST": "Hindiston vaqti", "EDT": "Sharqiy Amerika yozgi vaqti", "MESZ": "Markaziy Yevropa yozgi vaqti", "TMT": "Turkmaniston standart vaqti", "AEDT": "Sharqiy Avstraliya yozgi vaqti", "CST": "Markaziy Amerika standart vaqti", "ACWDT": "Markaziy Avstraliya g‘arbiy yozgi vaqti", "CAT": "Markaziy Afrika vaqti", "EAT": "Sharqiy Afrika vaqti", "MYT": "Malayziya vaqti", "CLT": "Chili standart vaqti", "ACDT": "Markaziy Avstraliya yozgi vaqti", "HAST": "Gavayi-aleut standart vaqti", "HADT": "Gavayi-aleut yozgi vaqti", "SGT": "Singapur vaqti", "WIT": "Sharqiy Indoneziya vaqti", "OESZ": "Sharqiy Yevropa yozgi vaqti", "WART": "Gʻarbiy Argentina standart vaqti", "HKT": "Gonkong standart vaqti", "PST": "Shimoliy Amerika Tinch okeani standart vaqti", "WAT": "Gʻarbiy Afrika standart vaqti", "SRT": "Surinam vaqti", "GYT": "Gayana vaqti", "VET": "Venesuela vaqti", "AKST": "Alyaska standart vaqti", "ARST": "Argentina yozgi vaqti", "MEZ": "Markaziy Yevropa standart vaqti", "∅∅∅": "Amazonka yozgi vaqti", "WEZ": "G‘arbiy Yevropa standart vaqti", "OEZ": "Sharqiy Yevropa standart vaqti", "BT": "Butan vaqti", "HKST": "Gonkong yozgi vaqti", "AST": "Atlantika standart vaqti", "CLST": "Chili yozgi vaqti", "UYST": "Urugvay yozgi vaqti", "HNT": "Nyufaundlend standart vaqti", "COST": "Kolumbiya yozgi vaqti", "WIB": "Gʻarbiy Indoneziya vaqti", "AEST": "Sharqiy Avstraliya standart vaqti", "ACST": "Markaziy Avstraliya standart vaqti", "CHAST": "Chatem standart vaqti", "ACWST": "Markaziy Avstraliya g‘arbiy standart vaqti", "AWDT": "G‘arbiy Avstraliya yozgi vaqti", "JST": "Yaponiya standart vaqti", "BOT": "Boliviya vaqti", "ChST": "Chamorro standart vaqti", "MDT": "MDT", "ADT": "Atlantika yozgi vaqti", "JDT": "Yaponiya yozgi vaqti", "WAST": "Gʻarbiy Afrika yozgi vaqti", "GMT": "Grinvich o‘rtacha vaqti", "CDT": "Markaziy Amerika yozgi vaqti", "SAST": "Janubiy Afrika standart vaqti", "NZDT": "Yangi Zelandiya yozgi vaqti", "WARST": "Gʻarbiy Argentina yozgi vaqti"},
}
}
diff --git a/uz_Arab/uz_Arab_test.go b/uz_Arab/uz_Arab_test.go
new file mode 100644
index 00000000..2c9400ae
--- /dev/null
+++ b/uz_Arab/uz_Arab_test.go
@@ -0,0 +1,1120 @@
+package uz_Arab
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "uz_Arab"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/uz_Arab_AF/uz_Arab_AF.go b/uz_Arab_AF/uz_Arab_AF.go
index 02d1d481..1e8b77c5 100644
--- a/uz_Arab_AF/uz_Arab_AF.go
+++ b/uz_Arab_AF/uz_Arab_AF.go
@@ -47,7 +47,7 @@ func New() locales.Translator {
locale: "uz_Arab_AF",
pluralsCardinal: []locales.PluralRule{2, 6},
pluralsOrdinal: []locales.PluralRule{6},
- pluralsRange: []locales.PluralRule{6, 2},
+ pluralsRange: []locales.PluralRule{2, 6},
decimal: "٫",
group: "٬",
minus: "-",
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"", ""},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"CDT": "Markaziy Amerika yozgi vaqti", "CAT": "Markaziy Afrika vaqti", "WIT": "Sharqiy Indoneziya vaqti", "GMT": "Grinvich o‘rtacha vaqti", "GFT": "Fransuz Gvianasi vaqti", "EAT": "Sharqiy Afrika vaqti", "PST": "Shimoliy Amerika Tinch okeani standart vaqti", "SAST": "Janubiy Afrika standart vaqti", "JDT": "Yaponiya yozgi vaqti", "WESZ": "G‘arbiy Yevropa yozgi vaqti", "AEDT": "Sharqiy Avstraliya yozgi vaqti", "AKDT": "Alyaska yozgi vaqti", "COT": "Kolumbiya standart vaqti", "HAST": "Gavayi-aleut standart vaqti", "AST": "Atlantika standart vaqti", "WAT": "Gʻarbiy Afrika standart vaqti", "WITA": "Markaziy Indoneziya vaqti", "OESZ": "Sharqiy Yevropa yozgi vaqti", "∅∅∅": "Amazonka yozgi vaqti", "JST": "Yaponiya standart vaqti", "AKST": "Alyaska standart vaqti", "UYT": "Urugvay standart vaqti", "CHADT": "Chatem yozgi vaqti", "CHAST": "Chatem standart vaqti", "ADT": "Atlantika yozgi vaqti", "WARST": "Gʻarbiy Argentina yozgi vaqti", "WIB": "Gʻarbiy Indoneziya vaqti", "OEZ": "Sharqiy Yevropa standart vaqti", "NZST": "Yangi Zelandiya standart vaqti", "WEZ": "G‘arbiy Yevropa standart vaqti", "LHDT": "Lord-Xau yozgi vaqti", "NZDT": "Yangi Zelandiya yozgi vaqti", "BOT": "Boliviya vaqti", "COST": "Kolumbiya yozgi vaqti", "ECT": "Ekvador vaqti", "TMT": "Turkmaniston standart vaqti", "CST": "Markaziy Amerika standart vaqti", "LHST": "Lord-Xau standart vaqti", "VET": "Venesuela vaqti", "WART": "Gʻarbiy Argentina standart vaqti", "IST": "Hindiston vaqti", "HNT": "Nyufaundlend standart vaqti", "TMST": "Turkmaniston yozgi vaqti", "MYT": "Malayziya vaqti", "AEST": "Sharqiy Avstraliya standart vaqti", "HADT": "Gavayi-aleut yozgi vaqti", "MDT": "MDT", "SRT": "Surinam vaqti", "AWST": "G‘arbiy Avstraliya standart vaqti", "MESZ": "Markaziy Yevropa yozgi vaqti", "UYST": "Urugvay yozgi vaqti", "ChST": "Chamorro standart vaqti", "SGT": "Singapur vaqti", "ACDT": "Markaziy Avstraliya yozgi vaqti", "ART": "Argentina standart vaqti", "GYT": "Gayana vaqti", "CLST": "Chili yozgi vaqti", "ACWDT": "Markaziy Avstraliya g‘arbiy yozgi vaqti", "HKT": "Gonkong standart vaqti", "HAT": "Nyufaundlend yozgi vaqti", "MST": "MST", "PDT": "Shimoliy Amerika Tinch okeani yozgi vaqti", "ACWST": "Markaziy Avstraliya g‘arbiy standart vaqti", "HKST": "Gonkong yozgi vaqti", "CLT": "Chili standart vaqti", "EST": "Sharqiy Amerika standart vaqti", "EDT": "Sharqiy Amerika yozgi vaqti", "MEZ": "Markaziy Yevropa standart vaqti", "WAST": "Gʻarbiy Afrika yozgi vaqti", "BT": "Butan vaqti", "ACST": "Markaziy Avstraliya standart vaqti", "ARST": "Argentina yozgi vaqti", "AWDT": "G‘arbiy Avstraliya yozgi vaqti"},
+ timezones: map[string]string{"UYT": "Urugvay standart vaqti", "BT": "Butan vaqti", "ART": "Argentina standart vaqti", "ARST": "Argentina yozgi vaqti", "CAT": "Markaziy Afrika vaqti", "WAT": "Gʻarbiy Afrika standart vaqti", "WESZ": "G‘arbiy Yevropa yozgi vaqti", "AEDT": "Sharqiy Avstraliya yozgi vaqti", "LHST": "Lord-Xau standart vaqti", "CDT": "Markaziy Amerika yozgi vaqti", "ECT": "Ekvador vaqti", "AWDT": "G‘arbiy Avstraliya yozgi vaqti", "MYT": "Malayziya vaqti", "ACDT": "Markaziy Avstraliya yozgi vaqti", "NZDT": "Yangi Zelandiya yozgi vaqti", "WITA": "Markaziy Indoneziya vaqti", "HAST": "Gavayi-aleut standart vaqti", "WAST": "Gʻarbiy Afrika yozgi vaqti", "LHDT": "Lord-Xau yozgi vaqti", "MDT": "Shimoliy Amerika togʻ yozgi vaqti", "WARST": "Gʻarbiy Argentina yozgi vaqti", "WIB": "Gʻarbiy Indoneziya vaqti", "OESZ": "Sharqiy Yevropa yozgi vaqti", "HKST": "Gonkong yozgi vaqti", "EST": "Sharqiy Amerika standart vaqti", "SRT": "Surinam vaqti", "HKT": "Gonkong standart vaqti", "ACWDT": "Markaziy Avstraliya g‘arbiy yozgi vaqti", "HADT": "Gavayi-aleut yozgi vaqti", "EDT": "Sharqiy Amerika yozgi vaqti", "AKDT": "Alyaska yozgi vaqti", "ADT": "Atlantika yozgi vaqti", "AWST": "G‘arbiy Avstraliya standart vaqti", "SAST": "Janubiy Afrika standart vaqti", "COST": "Kolumbiya yozgi vaqti", "GYT": "Gayana vaqti", "ChST": "Chamorro standart vaqti", "WIT": "Sharqiy Indoneziya vaqti", "CST": "Markaziy Amerika standart vaqti", "TMST": "Turkmaniston yozgi vaqti", "JST": "Yaponiya standart vaqti", "MESZ": "Markaziy Yevropa yozgi vaqti", "PST": "Shimoliy Amerika Tinch okeani standart vaqti", "MST": "Shimoliy Amerika togʻ standart vaqti", "ACST": "Markaziy Avstraliya standart vaqti", "WART": "Gʻarbiy Argentina standart vaqti", "MEZ": "Markaziy Yevropa standart vaqti", "CLT": "Chili standart vaqti", "CHADT": "Chatem yozgi vaqti", "ACWST": "Markaziy Avstraliya g‘arbiy standart vaqti", "NZST": "Yangi Zelandiya standart vaqti", "JDT": "Yaponiya yozgi vaqti", "AST": "Atlantika standart vaqti", "PDT": "Shimoliy Amerika Tinch okeani yozgi vaqti", "SGT": "Singapur vaqti", "OEZ": "Sharqiy Yevropa standart vaqti", "AEST": "Sharqiy Avstraliya standart vaqti", "VET": "Venesuela vaqti", "IST": "Hindiston vaqti", "HAT": "Nyufaundlend yozgi vaqti", "CLST": "Chili yozgi vaqti", "EAT": "Sharqiy Afrika vaqti", "BOT": "Boliviya vaqti", "GFT": "Fransuz Gvianasi vaqti", "CHAST": "Chatem standart vaqti", "AKST": "Alyaska standart vaqti", "COT": "Kolumbiya standart vaqti", "TMT": "Turkmaniston standart vaqti", "HNT": "Nyufaundlend standart vaqti", "∅∅∅": "Braziliya yozgi vaqti", "WEZ": "G‘arbiy Yevropa standart vaqti", "GMT": "Grinvich o‘rtacha vaqti", "UYST": "Urugvay yozgi vaqti"},
}
}
diff --git a/uz_Arab_AF/uz_Arab_AF_test.go b/uz_Arab_AF/uz_Arab_AF_test.go
new file mode 100644
index 00000000..2597b9d4
--- /dev/null
+++ b/uz_Arab_AF/uz_Arab_AF_test.go
@@ -0,0 +1,1120 @@
+package uz_Arab_AF
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "uz_Arab_AF"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/uz_Cyrl/uz_Cyrl.go b/uz_Cyrl/uz_Cyrl.go
index 2c121bcf..f05fda66 100644
--- a/uz_Cyrl/uz_Cyrl.go
+++ b/uz_Cyrl/uz_Cyrl.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"М.А.", "Э"},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"BT": "Бутан вақти", "TMT": "Туркманистон стандарт вақти", "UYST": "Уругвай ёзги вақти", "WEZ": "Ғарбий Европа стандарт вақти", "AST": "Атлантика стандарт вақти", "SGT": "Сингапур вақти", "WAST": "Ғарбий Африка ёзги вақти", "EAT": "Шарқий Африка вақти", "MST": "MST", "PST": "Шимолий Америка тинч океани стандарт вақти", "AEDT": "Шарқий Австралия кундузги вақти", "ChST": "Каморро вақти", "WART": "Ғарбий Аргентина стандарт вақти", "∅∅∅": "Амазонка ёзги вақти", "AKDT": "Аляска кундузги вақти", "AWST": "Ғарбий Австралия стандарт вақти", "MEZ": "Марказий Европа стандарт вақти", "CHAST": "Чатхам стандарт вақти", "WITA": "Марказий Индонезия вақти", "IST": "Ҳиндистон вақти", "ACDT": "Марказий Австралия кундузги вақти", "AKST": "Аляска стандарт вақти", "NZST": "Янги Зеландия стандарт вақти", "CAT": "Марказий Африка вақти", "MDT": "MDT", "EDT": "Шимолий Америка шарқий кундузги вақти", "ECT": "Эквадор вақти", "OEZ": "Шарқий Европа стандарт вақти", "OESZ": "Шарқий Европа ёзги вақти", "CST": "Шимолий Америка марказий стандарт вақти", "MESZ": "Марказий Европа ёзги вақти", "CLT": "Чили стандарт вақти", "WIB": "Ғарбий Индонезия вақти", "VET": "Венесуэла вақти", "ACWDT": "Марказий Австралия Ғарбий кундузги вақти", "HAST": "Гавайи-алеут стандарт вақти", "GFT": "Француз Гвианаси вақти", "COT": "Колумбия стандарт вақти", "ADT": "Атлантика кундузги вақти", "ART": "Аргентина стандарт вақти", "ARST": "Аргентина ёзги вақти", "CDT": "Шимолий Америка марказий кундузги вақти", "WESZ": "Ғарбий Европа ёзги вақти", "GMT": "Гринвич вақти", "TMST": "Туркманистон ёзги вақти", "ACST": "Марказий Австралия стандарт вақти", "ACWST": "Марказий Австралия Ғарбий стандарт вақти", "COST": "Колумбия ёзги вақти", "CLST": "Чили ёзги вақти", "HAT": "Ньюфаундленд кундузги вақти", "SRT": "Суринам вақти", "LHDT": "Лорд Хове кундузги вақти", "CHADT": "Чатхам кундузги вақти", "EST": "Шимолий Америка шарқий стандарт вақти", "NZDT": "Янги Зеландия кундузги вақти", "AEST": "Шарқий Австралия стандарт вақти", "WAT": "Ғарбий Африка стандарт вақти", "HKST": "Гонконг ёзги вақти", "BOT": "Боливия вақти", "HADT": "Гавайи-алеут кундузги вақти", "HNT": "Ньюфаундленд стандарт вақти", "GYT": "Гайана вақти", "JST": "Япония стандарт вақти", "JDT": "Япония кундузги вақти", "UYT": "Уругвай стандарт вақти", "WARST": "Ғарбий Аргентина ёзги вақти", "SAST": "Жанубий Африка вақти", "HKT": "Гонконг стандарт вақти", "WIT": "Шарқий Индонезия вақти", "MYT": "Малайзия вақти", "PDT": "Шимолий Америка тинч океани кундузги вақти", "AWDT": "Ғарбий Австралия кундузги вақти", "LHST": "Лорд Хове стандарт вақти"},
+ timezones: map[string]string{"HKT": "Гонконг стандарт вақти", "ARST": "Аргентина ёзги вақти", "TMST": "Туркманистон ёзги вақти", "UYT": "Уругвай стандарт вақти", "BT": "Бутан вақти", "AWST": "Ғарбий Австралия стандарт вақти", "CLT": "Чили стандарт вақти", "EDT": "Шимолий Америка шарқий кундузги вақти", "WEZ": "Ғарбий Европа стандарт вақти", "COT": "Колумбия стандарт вақти", "LHST": "Лорд Хове стандарт вақти", "JDT": "Япония кундузги вақти", "AWDT": "Ғарбий Австралия кундузги вақти", "BOT": "Боливия вақти", "PST": "Шимолий Америка тинч океани стандарт вақти", "ACDT": "Марказий Австралия кундузги вақти", "WARST": "Ғарбий Аргентина ёзги вақти", "NZDT": "Янги Зеландия кундузги вақти", "TMT": "Туркманистон стандарт вақти", "OEZ": "Шарқий Европа стандарт вақти", "JST": "Япония стандарт вақти", "AKDT": "Аляска кундузги вақти", "ADT": "Атлантика кундузги вақти", "ART": "Аргентина стандарт вақти", "NZST": "Янги Зеландия стандарт вақти", "CAT": "Марказий Африка вақти", "WAT": "Ғарбий Африка стандарт вақти", "AST": "Атлантика стандарт вақти", "WESZ": "Ғарбий Европа ёзги вақти", "ChST": "Каморро вақти", "ACST": "Марказий Австралия стандарт вақти", "SRT": "Суринам вақти", "GFT": "Француз Гвианаси вақти", "ACWDT": "Марказий Австралия Ғарбий кундузги вақти", "WAST": "Ғарбий Африка ёзги вақти", "ACWST": "Марказий Австралия Ғарбий стандарт вақти", "EST": "Шимолий Америка шарқий стандарт вақти", "MEZ": "Марказий Европа стандарт вақти", "HADT": "Гавайи-алеут кундузги вақти", "SGT": "Сингапур вақти", "LHDT": "Лорд Хове кундузги вақти", "∅∅∅": "Азор ёзги вақти", "PDT": "Шимолий Америка тинч океани кундузги вақти", "MESZ": "Марказий Европа ёзги вақти", "OESZ": "Шарқий Европа ёзги вақти", "AEDT": "Шарқий Австралия кундузги вақти", "MYT": "Малайзия вақти", "CST": "Шимолий Америка марказий стандарт вақти", "ECT": "Эквадор вақти", "AKST": "Аляска стандарт вақти", "WART": "Ғарбий Аргентина стандарт вақти", "CHAST": "Чатхам стандарт вақти", "VET": "Венесуэла вақти", "HNT": "Ньюфаундленд стандарт вақти", "UYST": "Уругвай ёзги вақти", "MST": "MST", "HAST": "Гавайи-алеут стандарт вақти", "COST": "Колумбия ёзги вақти", "GMT": "Гринвич вақти", "AEST": "Шарқий Австралия стандарт вақти", "WIT": "Шарқий Индонезия вақти", "HKST": "Гонконг ёзги вақти", "SAST": "Жанубий Африка вақти", "EAT": "Шарқий Африка вақти", "CDT": "Шимолий Америка марказий кундузги вақти", "CHADT": "Чатхам кундузги вақти", "MDT": "MDT", "WITA": "Марказий Индонезия вақти", "IST": "Ҳиндистон вақти", "WIB": "Ғарбий Индонезия вақти", "HAT": "Ньюфаундленд кундузги вақти", "GYT": "Гайана вақти", "CLST": "Чили ёзги вақти"},
}
}
diff --git a/uz_Cyrl/uz_Cyrl_test.go b/uz_Cyrl/uz_Cyrl_test.go
new file mode 100644
index 00000000..9ee22c1d
--- /dev/null
+++ b/uz_Cyrl/uz_Cyrl_test.go
@@ -0,0 +1,1120 @@
+package uz_Cyrl
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "uz_Cyrl"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/uz_Cyrl_UZ/uz_Cyrl_UZ.go b/uz_Cyrl_UZ/uz_Cyrl_UZ.go
index e5a10dc8..b5c509bf 100644
--- a/uz_Cyrl_UZ/uz_Cyrl_UZ.go
+++ b/uz_Cyrl_UZ/uz_Cyrl_UZ.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"", ""},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"WITA": "Markaziy Indoneziya vaqti", "PDT": "Shimoliy Amerika Tinch okeani yozgi vaqti", "AWST": "G‘arbiy Avstraliya standart vaqti", "WESZ": "G‘arbiy Yevropa yozgi vaqti", "UYST": "Urugvay yozgi vaqti", "ChST": "Chamorro standart vaqti", "WAST": "Gʻarbiy Afrika yozgi vaqti", "ART": "Argentina standart vaqti", "AKDT": "Alyaska yozgi vaqti", "LHDT": "Lord-Xau yozgi vaqti", "BOT": "Boliviya vaqti", "UYT": "Urugvay standart vaqti", "AEDT": "Sharqiy Avstraliya yozgi vaqti", "HAST": "Gavayi-aleut standart vaqti", "BT": "Butan vaqti", "HADT": "Gavayi-aleut yozgi vaqti", "HKT": "Gonkong standart vaqti", "ACDT": "Markaziy Avstraliya yozgi vaqti", "JST": "Yaponiya standart vaqti", "ACWST": "Markaziy Avstraliya g‘arbiy standart vaqti", "EST": "Sharqiy Amerika standart vaqti", "COT": "Kolumbiya standart vaqti", "EAT": "Sharqiy Afrika vaqti", "CDT": "Markaziy Amerika yozgi vaqti", "AEST": "Sharqiy Avstraliya standart vaqti", "HKST": "Gonkong yozgi vaqti", "OEZ": "Sharqiy Yevropa standart vaqti", "ARST": "Argentina yozgi vaqti", "LHST": "Lord-Xau standart vaqti", "WEZ": "G‘arbiy Yevropa standart vaqti", "CHAST": "Chatem standart vaqti", "HNT": "Nyufaundlend standart vaqti", "WIT": "Sharqiy Indoneziya vaqti", "MDT": "MDT", "CHADT": "Chatem yozgi vaqti", "ACST": "Markaziy Avstraliya standart vaqti", "∅∅∅": "Amazonka yozgi vaqti", "TMST": "Turkmaniston yozgi vaqti", "ACWDT": "Markaziy Avstraliya g‘arbiy yozgi vaqti", "CLST": "Chili yozgi vaqti", "ADT": "Atlantika yozgi vaqti", "EDT": "Sharqiy Amerika yozgi vaqti", "SGT": "Singapur vaqti", "WART": "Gʻarbiy Argentina standart vaqti", "GMT": "Grinvich o‘rtacha vaqti", "HAT": "Nyufaundlend yozgi vaqti", "MYT": "Malayziya vaqti", "MEZ": "Markaziy Yevropa standart vaqti", "VET": "Venesuela vaqti", "TMT": "Turkmaniston standart vaqti", "GYT": "Gayana vaqti", "CLT": "Chili standart vaqti", "AST": "Atlantika standart vaqti", "IST": "Hindiston vaqti", "GFT": "Fransuz Gvianasi vaqti", "AKST": "Alyaska standart vaqti", "NZST": "Yangi Zelandiya standart vaqti", "NZDT": "Yangi Zelandiya yozgi vaqti", "MESZ": "Markaziy Yevropa yozgi vaqti", "COST": "Kolumbiya yozgi vaqti", "WAT": "Gʻarbiy Afrika standart vaqti", "WIB": "Gʻarbiy Indoneziya vaqti", "MST": "MST", "AWDT": "G‘arbiy Avstraliya yozgi vaqti", "JDT": "Yaponiya yozgi vaqti", "SRT": "Surinam vaqti", "WARST": "Gʻarbiy Argentina yozgi vaqti", "PST": "Shimoliy Amerika Tinch okeani standart vaqti", "ECT": "Ekvador vaqti", "SAST": "Janubiy Afrika standart vaqti", "CAT": "Markaziy Afrika vaqti", "OESZ": "Sharqiy Yevropa yozgi vaqti", "CST": "Markaziy Amerika standart vaqti"},
+ timezones: map[string]string{"ChST": "Chamorro standart vaqti", "CHAST": "Chatem standart vaqti", "ACWST": "Markaziy Avstraliya g‘arbiy standart vaqti", "HADT": "Gavayi-aleut yozgi vaqti", "NZST": "Yangi Zelandiya standart vaqti", "IST": "Hindiston vaqti", "ACST": "Markaziy Avstraliya standart vaqti", "MST": "MST", "AKST": "Alyaska standart vaqti", "OESZ": "Sharqiy Yevropa yozgi vaqti", "MYT": "Malayziya vaqti", "CLT": "Chili standart vaqti", "ART": "Argentina standart vaqti", "PDT": "Shimoliy Amerika Tinch okeani yozgi vaqti", "NZDT": "Yangi Zelandiya yozgi vaqti", "WEZ": "G‘arbiy Yevropa standart vaqti", "OEZ": "Sharqiy Yevropa standart vaqti", "MDT": "MDT", "AST": "Atlantika standart vaqti", "LHST": "Lord-Xau standart vaqti", "CLST": "Chili yozgi vaqti", "BT": "Butan vaqti", "LHDT": "Lord-Xau yozgi vaqti", "AWDT": "G‘arbiy Avstraliya yozgi vaqti", "JDT": "Yaponiya yozgi vaqti", "PST": "Shimoliy Amerika Tinch okeani standart vaqti", "HAST": "Gavayi-aleut standart vaqti", "AEDT": "Sharqiy Avstraliya yozgi vaqti", "WARST": "Gʻarbiy Argentina yozgi vaqti", "CAT": "Markaziy Afrika vaqti", "GMT": "Grinvich o‘rtacha vaqti", "EAT": "Sharqiy Afrika vaqti", "∅∅∅": "Azor orollari yozgi vaqti", "AWST": "G‘arbiy Avstraliya standart vaqti", "ACWDT": "Markaziy Avstraliya g‘arbiy yozgi vaqti", "TMT": "Turkmaniston standart vaqti", "TMST": "Turkmaniston yozgi vaqti", "GFT": "Fransuz Gvianasi vaqti", "VET": "Venesuela vaqti", "AKDT": "Alyaska yozgi vaqti", "MEZ": "Markaziy Yevropa standart vaqti", "WAST": "Gʻarbiy Afrika yozgi vaqti", "JST": "Yaponiya standart vaqti", "UYST": "Urugvay yozgi vaqti", "CST": "Markaziy Amerika standart vaqti", "MESZ": "Markaziy Yevropa yozgi vaqti", "EST": "Sharqiy Amerika standart vaqti", "ACDT": "Markaziy Avstraliya yozgi vaqti", "WART": "Gʻarbiy Argentina standart vaqti", "ECT": "Ekvador vaqti", "ADT": "Atlantika yozgi vaqti", "WAT": "Gʻarbiy Afrika standart vaqti", "HKST": "Gonkong yozgi vaqti", "WITA": "Markaziy Indoneziya vaqti", "HNT": "Nyufaundlend standart vaqti", "COST": "Kolumbiya yozgi vaqti", "GYT": "Gayana vaqti", "HKT": "Gonkong standart vaqti", "CHADT": "Chatem yozgi vaqti", "SGT": "Singapur vaqti", "WIB": "Gʻarbiy Indoneziya vaqti", "AEST": "Sharqiy Avstraliya standart vaqti", "BOT": "Boliviya vaqti", "WESZ": "G‘arbiy Yevropa yozgi vaqti", "SAST": "Janubiy Afrika standart vaqti", "HAT": "Nyufaundlend yozgi vaqti", "COT": "Kolumbiya standart vaqti", "WIT": "Sharqiy Indoneziya vaqti", "SRT": "Surinam vaqti", "ARST": "Argentina yozgi vaqti", "EDT": "Sharqiy Amerika yozgi vaqti", "UYT": "Urugvay standart vaqti", "CDT": "Markaziy Amerika yozgi vaqti"},
}
}
diff --git a/uz_Cyrl_UZ/uz_Cyrl_UZ_test.go b/uz_Cyrl_UZ/uz_Cyrl_UZ_test.go
new file mode 100644
index 00000000..88b8fec3
--- /dev/null
+++ b/uz_Cyrl_UZ/uz_Cyrl_UZ_test.go
@@ -0,0 +1,1120 @@
+package uz_Cyrl_UZ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "uz_Cyrl_UZ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/uz_Latn/uz_Latn.go b/uz_Latn/uz_Latn.go
index cc74c82f..09c282fe 100644
--- a/uz_Latn/uz_Latn.go
+++ b/uz_Latn/uz_Latn.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"", ""},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"WARST": "Gʻarbiy Argentina yozgi vaqti", "IST": "Hindiston vaqti", "PST": "Shimoliy Amerika Tinch okeani standart vaqti", "GYT": "Gayana vaqti", "VET": "Venesuela vaqti", "ACWST": "Markaziy Avstraliya g‘arbiy standart vaqti", "AKST": "Alyaska standart vaqti", "HAST": "Gavayi-aleut standart vaqti", "HADT": "Gavayi-aleut yozgi vaqti", "WAT": "Gʻarbiy Afrika standart vaqti", "HAT": "Nyufaundlend yozgi vaqti", "ACDT": "Markaziy Avstraliya yozgi vaqti", "ART": "Argentina standart vaqti", "SRT": "Surinam vaqti", "WESZ": "G‘arbiy Yevropa yozgi vaqti", "WIB": "Gʻarbiy Indoneziya vaqti", "HNT": "Nyufaundlend standart vaqti", "WIT": "Sharqiy Indoneziya vaqti", "MDT": "MDT", "AWDT": "G‘arbiy Avstraliya yozgi vaqti", "NZDT": "Yangi Zelandiya yozgi vaqti", "CAT": "Markaziy Afrika vaqti", "EDT": "Sharqiy Amerika yozgi vaqti", "BT": "Butan vaqti", "AEST": "Sharqiy Avstraliya standart vaqti", "WART": "Gʻarbiy Argentina standart vaqti", "MST": "MST", "ACST": "Markaziy Avstraliya standart vaqti", "CST": "Markaziy Amerika standart vaqti", "BOT": "Boliviya vaqti", "ACWDT": "Markaziy Avstraliya g‘arbiy yozgi vaqti", "CHAST": "Chatem standart vaqti", "COST": "Kolumbiya yozgi vaqti", "GMT": "Grinvich o‘rtacha vaqti", "AKDT": "Alyaska yozgi vaqti", "UYST": "Urugvay yozgi vaqti", "AST": "Atlantika standart vaqti", "ADT": "Atlantika yozgi vaqti", "SGT": "Singapur vaqti", "GFT": "Fransuz Gvianasi vaqti", "EAT": "Sharqiy Afrika vaqti", "ARST": "Argentina yozgi vaqti", "TMST": "Turkmaniston yozgi vaqti", "OEZ": "Sharqiy Yevropa standart vaqti", "WITA": "Markaziy Indoneziya vaqti", "AEDT": "Sharqiy Avstraliya yozgi vaqti", "OESZ": "Sharqiy Yevropa yozgi vaqti", "TMT": "Turkmaniston standart vaqti", "LHDT": "Lord-Xau yozgi vaqti", "MYT": "Malayziya vaqti", "ChST": "Chamorro standart vaqti", "CDT": "Markaziy Amerika yozgi vaqti", "MEZ": "Markaziy Yevropa standart vaqti", "HKT": "Gonkong standart vaqti", "HKST": "Gonkong yozgi vaqti", "SAST": "Janubiy Afrika standart vaqti", "WAST": "Gʻarbiy Afrika yozgi vaqti", "AWST": "G‘arbiy Avstraliya standart vaqti", "LHST": "Lord-Xau standart vaqti", "MESZ": "Markaziy Yevropa yozgi vaqti", "JDT": "Yaponiya yozgi vaqti", "WEZ": "G‘arbiy Yevropa standart vaqti", "CHADT": "Chatem yozgi vaqti", "ECT": "Ekvador vaqti", "∅∅∅": "Braziliya yozgi vaqti", "JST": "Yaponiya standart vaqti", "CLST": "Chili yozgi vaqti", "EST": "Sharqiy Amerika standart vaqti", "COT": "Kolumbiya standart vaqti", "PDT": "Shimoliy Amerika Tinch okeani yozgi vaqti", "NZST": "Yangi Zelandiya standart vaqti", "UYT": "Urugvay standart vaqti", "CLT": "Chili standart vaqti"},
+ timezones: map[string]string{"NZDT": "Yangi Zelandiya yozgi vaqti", "GMT": "Grinvich o‘rtacha vaqti", "COST": "Kolumbiya yozgi vaqti", "CLST": "Chili yozgi vaqti", "AKDT": "Alyaska yozgi vaqti", "ACWDT": "Markaziy Avstraliya g‘arbiy yozgi vaqti", "ARST": "Argentina yozgi vaqti", "HAST": "Gavayi-aleut standart vaqti", "WAST": "Gʻarbiy Afrika yozgi vaqti", "WART": "Gʻarbiy Argentina standart vaqti", "WARST": "Gʻarbiy Argentina yozgi vaqti", "SAST": "Janubiy Afrika standart vaqti", "EDT": "Sharqiy Amerika yozgi vaqti", "WIT": "Sharqiy Indoneziya vaqti", "BT": "Butan vaqti", "CDT": "Markaziy Amerika yozgi vaqti", "VET": "Venesuela vaqti", "AWST": "G‘arbiy Avstraliya standart vaqti", "EST": "Sharqiy Amerika standart vaqti", "∅∅∅": "Amazonka yozgi vaqti", "SGT": "Singapur vaqti", "OEZ": "Sharqiy Yevropa standart vaqti", "ART": "Argentina standart vaqti", "MESZ": "Markaziy Yevropa yozgi vaqti", "TMT": "Turkmaniston standart vaqti", "UYST": "Urugvay yozgi vaqti", "AKST": "Alyaska standart vaqti", "WAT": "Gʻarbiy Afrika standart vaqti", "LHDT": "Lord-Xau yozgi vaqti", "ADT": "Atlantika yozgi vaqti", "PST": "Shimoliy Amerika Tinch okeani standart vaqti", "EAT": "Sharqiy Afrika vaqti", "HKT": "Gonkong standart vaqti", "HKST": "Gonkong yozgi vaqti", "ACWST": "Markaziy Avstraliya g‘arbiy standart vaqti", "WITA": "Markaziy Indoneziya vaqti", "PDT": "Shimoliy Amerika Tinch okeani yozgi vaqti", "WEZ": "G‘arbiy Yevropa standart vaqti", "JDT": "Yaponiya yozgi vaqti", "HADT": "Gavayi-aleut yozgi vaqti", "MST": "Shimoliy Amerika togʻ standart vaqti", "AEST": "Sharqiy Avstraliya standart vaqti", "ACDT": "Markaziy Avstraliya yozgi vaqti", "MDT": "Shimoliy Amerika togʻ yozgi vaqti", "CST": "Markaziy Amerika standart vaqti", "ECT": "Ekvador vaqti", "AST": "Atlantika standart vaqti", "NZST": "Yangi Zelandiya standart vaqti", "IST": "Hindiston vaqti", "MEZ": "Markaziy Yevropa standart vaqti", "WESZ": "G‘arbiy Yevropa yozgi vaqti", "JST": "Yaponiya standart vaqti", "AWDT": "G‘arbiy Avstraliya yozgi vaqti", "GYT": "Gayana vaqti", "GFT": "Fransuz Gvianasi vaqti", "BOT": "Boliviya vaqti", "HNT": "Nyufaundlend standart vaqti", "OESZ": "Sharqiy Yevropa yozgi vaqti", "CHAST": "Chatem standart vaqti", "COT": "Kolumbiya standart vaqti", "UYT": "Urugvay standart vaqti", "SRT": "Surinam vaqti", "TMST": "Turkmaniston yozgi vaqti", "ChST": "Chamorro standart vaqti", "LHST": "Lord-Xau standart vaqti", "ACST": "Markaziy Avstraliya standart vaqti", "CLT": "Chili standart vaqti", "CHADT": "Chatem yozgi vaqti", "WIB": "Gʻarbiy Indoneziya vaqti", "CAT": "Markaziy Afrika vaqti", "HAT": "Nyufaundlend yozgi vaqti", "AEDT": "Sharqiy Avstraliya yozgi vaqti", "MYT": "Malayziya vaqti"},
}
}
diff --git a/uz_Latn/uz_Latn_test.go b/uz_Latn/uz_Latn_test.go
new file mode 100644
index 00000000..0c813d2a
--- /dev/null
+++ b/uz_Latn/uz_Latn_test.go
@@ -0,0 +1,1120 @@
+package uz_Latn
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "uz_Latn"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/uz_Latn_UZ/uz_Latn_UZ.go b/uz_Latn_UZ/uz_Latn_UZ.go
index d494d8b5..80dc5349 100644
--- a/uz_Latn_UZ/uz_Latn_UZ.go
+++ b/uz_Latn_UZ/uz_Latn_UZ.go
@@ -47,7 +47,7 @@ func New() locales.Translator {
locale: "uz_Latn_UZ",
pluralsCardinal: []locales.PluralRule{2, 6},
pluralsOrdinal: []locales.PluralRule{6},
- pluralsRange: []locales.PluralRule{2, 6},
+ pluralsRange: []locales.PluralRule{6, 2},
decimal: "٫",
group: "٬",
minus: "-",
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"", ""},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"GYT": "Gayana vaqti", "CDT": "Markaziy Amerika yozgi vaqti", "MESZ": "Markaziy Yevropa yozgi vaqti", "VET": "Venesuela vaqti", "CAT": "Markaziy Afrika vaqti", "MDT": "MDT", "OESZ": "Sharqiy Yevropa yozgi vaqti", "GMT": "Grinvich o‘rtacha vaqti", "HAT": "Nyufaundlend yozgi vaqti", "AKST": "Alyaska standart vaqti", "AKDT": "Alyaska yozgi vaqti", "PDT": "Shimoliy Amerika Tinch okeani yozgi vaqti", "JDT": "Yaponiya yozgi vaqti", "WIB": "Gʻarbiy Indoneziya vaqti", "AWDT": "G‘arbiy Avstraliya yozgi vaqti", "JST": "Yaponiya standart vaqti", "AEDT": "Sharqiy Avstraliya yozgi vaqti", "CHADT": "Chatem yozgi vaqti", "EDT": "Sharqiy Amerika yozgi vaqti", "COST": "Kolumbiya yozgi vaqti", "HKST": "Gonkong yozgi vaqti", "∅∅∅": "Amazonka yozgi vaqti", "TMST": "Turkmaniston yozgi vaqti", "SRT": "Surinam vaqti", "BOT": "Boliviya vaqti", "EST": "Sharqiy Amerika standart vaqti", "HNT": "Nyufaundlend standart vaqti", "AEST": "Sharqiy Avstraliya standart vaqti", "ADT": "Atlantika yozgi vaqti", "MST": "MST", "ChST": "Chamorro standart vaqti", "HADT": "Gavayi-aleut yozgi vaqti", "SGT": "Singapur vaqti", "WART": "Gʻarbiy Argentina standart vaqti", "NZST": "Yangi Zelandiya standart vaqti", "CHAST": "Chatem standart vaqti", "COT": "Kolumbiya standart vaqti", "ECT": "Ekvador vaqti", "SAST": "Janubiy Afrika standart vaqti", "WAT": "Gʻarbiy Afrika standart vaqti", "WAST": "Gʻarbiy Afrika yozgi vaqti", "WESZ": "G‘arbiy Yevropa yozgi vaqti", "ACDT": "Markaziy Avstraliya yozgi vaqti", "UYT": "Urugvay standart vaqti", "HAST": "Gavayi-aleut standart vaqti", "WIT": "Sharqiy Indoneziya vaqti", "BT": "Butan vaqti", "WEZ": "G‘arbiy Yevropa standart vaqti", "EAT": "Sharqiy Afrika vaqti", "LHST": "Lord-Xau standart vaqti", "HKT": "Gonkong standart vaqti", "WITA": "Markaziy Indoneziya vaqti", "AWST": "G‘arbiy Avstraliya standart vaqti", "MEZ": "Markaziy Yevropa standart vaqti", "ARST": "Argentina yozgi vaqti", "CST": "Markaziy Amerika standart vaqti", "NZDT": "Yangi Zelandiya yozgi vaqti", "CLT": "Chili standart vaqti", "AST": "Atlantika standart vaqti", "MYT": "Malayziya vaqti", "OEZ": "Sharqiy Yevropa standart vaqti", "GFT": "Fransuz Gvianasi vaqti", "TMT": "Turkmaniston standart vaqti", "PST": "Shimoliy Amerika Tinch okeani standart vaqti", "LHDT": "Lord-Xau yozgi vaqti", "WARST": "Gʻarbiy Argentina yozgi vaqti", "IST": "Hindiston vaqti", "UYST": "Urugvay yozgi vaqti", "ART": "Argentina standart vaqti", "ACWDT": "Markaziy Avstraliya g‘arbiy yozgi vaqti", "ACWST": "Markaziy Avstraliya g‘arbiy standart vaqti", "CLST": "Chili yozgi vaqti", "ACST": "Markaziy Avstraliya standart vaqti"},
+ timezones: map[string]string{"PDT": "Shimoliy Amerika Tinch okeani yozgi vaqti", "NZDT": "Yangi Zelandiya yozgi vaqti", "GYT": "Gayana vaqti", "CLT": "Chili standart vaqti", "∅∅∅": "Braziliya yozgi vaqti", "SRT": "Surinam vaqti", "WIB": "Gʻarbiy Indoneziya vaqti", "TMT": "Turkmaniston standart vaqti", "MST": "Shimoliy Amerika togʻ standart vaqti", "GFT": "Fransuz Gvianasi vaqti", "CHADT": "Chatem yozgi vaqti", "JDT": "Yaponiya yozgi vaqti", "WEZ": "G‘arbiy Yevropa standart vaqti", "COT": "Kolumbiya standart vaqti", "CDT": "Markaziy Amerika yozgi vaqti", "HKT": "Gonkong standart vaqti", "ACWDT": "Markaziy Avstraliya g‘arbiy yozgi vaqti", "WITA": "Markaziy Indoneziya vaqti", "EDT": "Sharqiy Amerika yozgi vaqti", "MDT": "Shimoliy Amerika togʻ yozgi vaqti", "UYT": "Urugvay standart vaqti", "MEZ": "Markaziy Yevropa standart vaqti", "HAST": "Gavayi-aleut standart vaqti", "NZST": "Yangi Zelandiya standart vaqti", "HNT": "Nyufaundlend standart vaqti", "AEDT": "Sharqiy Avstraliya yozgi vaqti", "ADT": "Atlantika yozgi vaqti", "AEST": "Sharqiy Avstraliya standart vaqti", "EAT": "Sharqiy Afrika vaqti", "VET": "Venesuela vaqti", "ACWST": "Markaziy Avstraliya g‘arbiy standart vaqti", "ARST": "Argentina yozgi vaqti", "OEZ": "Sharqiy Yevropa standart vaqti", "GMT": "Grinvich o‘rtacha vaqti", "CLST": "Chili yozgi vaqti", "CHAST": "Chatem standart vaqti", "JST": "Yaponiya standart vaqti", "WESZ": "G‘arbiy Yevropa yozgi vaqti", "OESZ": "Sharqiy Yevropa yozgi vaqti", "WIT": "Sharqiy Indoneziya vaqti", "ACST": "Markaziy Avstraliya standart vaqti", "HADT": "Gavayi-aleut yozgi vaqti", "HAT": "Nyufaundlend yozgi vaqti", "AKST": "Alyaska standart vaqti", "AKDT": "Alyaska yozgi vaqti", "ART": "Argentina standart vaqti", "BOT": "Boliviya vaqti", "ACDT": "Markaziy Avstraliya yozgi vaqti", "SAST": "Janubiy Afrika standart vaqti", "MESZ": "Markaziy Yevropa yozgi vaqti", "TMST": "Turkmaniston yozgi vaqti", "LHST": "Lord-Xau standart vaqti", "SGT": "Singapur vaqti", "COST": "Kolumbiya yozgi vaqti", "MYT": "Malayziya vaqti", "WARST": "Gʻarbiy Argentina yozgi vaqti", "AWDT": "G‘arbiy Avstraliya yozgi vaqti", "IST": "Hindiston vaqti", "CAT": "Markaziy Afrika vaqti", "WAT": "Gʻarbiy Afrika standart vaqti", "ChST": "Chamorro standart vaqti", "UYST": "Urugvay yozgi vaqti", "CST": "Markaziy Amerika standart vaqti", "AST": "Atlantika standart vaqti", "EST": "Sharqiy Amerika standart vaqti", "ECT": "Ekvador vaqti", "WAST": "Gʻarbiy Afrika yozgi vaqti", "BT": "Butan vaqti", "LHDT": "Lord-Xau yozgi vaqti", "WART": "Gʻarbiy Argentina standart vaqti", "HKST": "Gonkong yozgi vaqti", "AWST": "G‘arbiy Avstraliya standart vaqti", "PST": "Shimoliy Amerika Tinch okeani standart vaqti"},
}
}
diff --git a/uz_Latn_UZ/uz_Latn_UZ_test.go b/uz_Latn_UZ/uz_Latn_UZ_test.go
new file mode 100644
index 00000000..496cd1a4
--- /dev/null
+++ b/uz_Latn_UZ/uz_Latn_UZ_test.go
@@ -0,0 +1,1120 @@
+package uz_Latn_UZ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "uz_Latn_UZ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vai/vai.go b/vai/vai.go
index 67bcc9ef..37054e45 100644
--- a/vai/vai.go
+++ b/vai/vai.go
@@ -56,7 +56,7 @@ func New() locales.Translator {
currencyNegativeSuffix: ")",
monthsWide: []string{"", "ꖨꕪꖃ ꔞꕮ", "ꕒꕡꖝꖕ", "ꕾꖺ", "ꖢꖕ", "ꖑꕱ", "6", "7", "ꗛꔕ", "ꕢꕌ", "ꕭꖃ", "ꔞꘋꕔꕿ ꕸꖃꗏ", "ꖨꕪꕱ ꗏꕮ"},
daysWide: []string{"ꕞꕌꔵ", "ꗳꗡꘉ", "ꕚꕞꕚ", "ꕉꕞꕒ", "ꕉꔤꕆꕢ", "ꕉꔤꕀꕮ", "ꔻꔬꔳ"},
- timezones: map[string]string{"UYT": "UYT", "UYST": "UYST", "COT": "COT", "WIT": "WIT", "PST": "PST", "CHADT": "CHADT", "BT": "BT", "WARST": "WARST", "ACST": "ACST", "ACWST": "ACWST", "ACWDT": "ACWDT", "CHAST": "CHAST", "CAT": "CAT", "AEDT": "AEDT", "ChST": "ChST", "TMST": "TMST", "GYT": "GYT", "AST": "AST", "HAT": "HAT", "ART": "ART", "MYT": "MYT", "NZDT": "NZDT", "MDT": "MDT", "ECT": "ECT", "WAST": "WAST", "ARST": "ARST", "JDT": "JDT", "MEZ": "MEZ", "WEZ": "WEZ", "AEST": "AEST", "EDT": "EDT", "HKST": "HKST", "MST": "MST", "HAST": "HAST", "TMT": "TMT", "AWST": "AWST", "∅∅∅": "∅∅∅", "COST": "COST", "OESZ": "OESZ", "ACDT": "ACDT", "SRT": "SRT", "CDT": "CDT", "VET": "VET", "WIB": "WIB", "NZST": "NZST", "SGT": "SGT", "EAT": "EAT", "PDT": "PDT", "AWDT": "AWDT", "JST": "JST", "CLT": "CLT", "ADT": "ADT", "WAT": "WAT", "AKST": "AKST", "HADT": "HADT", "HKT": "HKT", "WITA": "WITA", "AKDT": "AKDT", "LHDT": "LHDT", "MESZ": "MESZ", "CLST": "CLST", "SAST": "SAST", "OEZ": "OEZ", "HNT": "HNT", "LHST": "LHST", "CST": "CST", "BOT": "BOT", "WESZ": "WESZ", "IST": "IST", "EST": "EST", "WART": "WART", "GMT": "GMT", "GFT": "GFT"},
+ timezones: map[string]string{"ACDT": "ACDT", "CHADT": "CHADT", "EDT": "EDT", "TMST": "TMST", "CAT": "CAT", "WAST": "WAST", "LHST": "LHST", "MYT": "MYT", "CLT": "CLT", "AKDT": "AKDT", "ART": "ART", "PST": "PST", "MESZ": "MESZ", "MST": "MST", "NZST": "NZST", "ACWST": "ACWST", "BOT": "BOT", "COST": "COST", "AEDT": "AEDT", "LHDT": "LHDT", "ACST": "ACST", "ECT": "ECT", "EAT": "EAT", "BT": "BT", "WARST": "WARST", "WIB": "WIB", "TMT": "TMT", "OEZ": "OEZ", "OESZ": "OESZ", "ChST": "ChST", "AST": "AST", "ARST": "ARST", "SAST": "SAST", "HAT": "HAT", "SGT": "SGT", "AKST": "AKST", "WEZ": "WEZ", "HNT": "HNT", "MDT": "MDT", "VET": "VET", "WESZ": "WESZ", "UYT": "UYT", "JDT": "JDT", "GYT": "GYT", "UYST": "UYST", "WART": "WART", "HADT": "HADT", "WIT": "WIT", "WITA": "WITA", "ADT": "ADT", "HAST": "HAST", "COT": "COT", "CLST": "CLST", "∅∅∅": "∅∅∅", "HKST": "HKST", "MEZ": "MEZ", "WAT": "WAT", "JST": "JST", "NZDT": "NZDT", "EST": "EST", "PDT": "PDT", "CDT": "CDT", "AWDT": "AWDT", "GMT": "GMT", "HKT": "HKT", "GFT": "GFT", "ACWDT": "ACWDT", "IST": "IST", "AEST": "AEST", "CST": "CST", "SRT": "SRT", "CHAST": "CHAST", "AWST": "AWST"},
}
}
@@ -102,7 +102,7 @@ func (vai *vai) MonthAbbreviated(month time.Month) string {
// MonthsAbbreviated returns the locales abbreviated months
func (vai *vai) MonthsAbbreviated() []string {
- return vai.monthsAbbreviated[1:]
+ return nil
}
// MonthNarrow returns the locales narrow month given the 'month' provided
@@ -112,7 +112,7 @@ func (vai *vai) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (vai *vai) MonthsNarrow() []string {
- return vai.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/vai/vai_test.go b/vai/vai_test.go
new file mode 100644
index 00000000..cbb914eb
--- /dev/null
+++ b/vai/vai_test.go
@@ -0,0 +1,1120 @@
+package vai
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "vai"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vai_Latn/vai_Latn.go b/vai_Latn/vai_Latn.go
index dde3f8b5..57aef9fd 100644
--- a/vai_Latn/vai_Latn.go
+++ b/vai_Latn/vai_Latn.go
@@ -56,7 +56,7 @@ func New() locales.Translator {
currencyNegativeSuffix: ")",
monthsWide: []string{"", "luukao kemã", "ɓandaɓu", "vɔɔ", "fulu", "goo", "6", "7", "kɔnde", "saah", "galo", "kenpkato ɓololɔ", "luukao lɔma"},
daysWide: []string{"lahadi", "tɛɛnɛɛ", "talata", "alaba", "aimisa", "aijima", "siɓiti"},
- timezones: map[string]string{"ACST": "ACST", "ACDT": "ACDT", "CLST": "CLST", "WESZ": "WESZ", "CHAST": "CHAST", "WIT": "WIT", "OESZ": "OESZ", "∅∅∅": "∅∅∅", "ECT": "ECT", "BT": "BT", "WIB": "WIB", "IST": "IST", "TMST": "TMST", "ACWDT": "ACWDT", "HAST": "HAST", "GMT": "GMT", "COST": "COST", "SAST": "SAST", "PST": "PST", "MYT": "MYT", "BOT": "BOT", "WEZ": "WEZ", "AST": "AST", "ART": "ART", "AKDT": "AKDT", "EDT": "EDT", "OEZ": "OEZ", "JDT": "JDT", "LHDT": "LHDT", "WAT": "WAT", "WARST": "WARST", "WITA": "WITA", "SRT": "SRT", "AWST": "AWST", "UYT": "UYT", "ACWST": "ACWST", "HKT": "HKT", "MST": "MST", "TMT": "TMT", "LHST": "LHST", "MEZ": "MEZ", "UYST": "UYST", "WART": "WART", "VET": "VET", "EAT": "EAT", "MDT": "MDT", "PDT": "PDT", "CDT": "CDT", "SGT": "SGT", "HKST": "HKST", "AKST": "AKST", "AEDT": "AEDT", "HNT": "HNT", "GYT": "GYT", "AEST": "AEST", "CHADT": "CHADT", "HADT": "HADT", "AWDT": "AWDT", "MESZ": "MESZ", "NZST": "NZST", "CLT": "CLT", "ChST": "ChST", "CAT": "CAT", "ARST": "ARST", "ADT": "ADT", "COT": "COT", "WAST": "WAST", "HAT": "HAT", "GFT": "GFT", "JST": "JST", "CST": "CST", "NZDT": "NZDT", "EST": "EST"},
+ timezones: map[string]string{"MESZ": "MESZ", "BOT": "BOT", "SAST": "SAST", "OESZ": "OESZ", "ACWST": "ACWST", "MEZ": "MEZ", "CDT": "CDT", "HKST": "HKST", "LHDT": "LHDT", "∅∅∅": "∅∅∅", "SGT": "SGT", "WITA": "WITA", "HADT": "HADT", "IST": "IST", "WIB": "WIB", "WEZ": "WEZ", "AEST": "AEST", "SRT": "SRT", "ART": "ART", "WART": "WART", "GMT": "GMT", "AEDT": "AEDT", "MDT": "MDT", "HKT": "HKT", "CHAST": "CHAST", "ChST": "ChST", "LHST": "LHST", "GFT": "GFT", "EAT": "EAT", "EST": "EST", "COST": "COST", "CHADT": "CHADT", "HAST": "HAST", "NZDT": "NZDT", "COT": "COT", "MST": "MST", "WIT": "WIT", "CST": "CST", "WAT": "WAT", "WESZ": "WESZ", "MYT": "MYT", "ACDT": "ACDT", "NZST": "NZST", "TMST": "TMST", "WAST": "WAST", "ARST": "ARST", "JDT": "JDT", "PST": "PST", "WARST": "WARST", "JST": "JST", "ADT": "ADT", "GYT": "GYT", "UYT": "UYT", "BT": "BT", "HAT": "HAT", "UYST": "UYST", "ECT": "ECT", "EDT": "EDT", "AST": "AST", "TMT": "TMT", "CLT": "CLT", "AWST": "AWST", "AKST": "AKST", "PDT": "PDT", "AWDT": "AWDT", "AKDT": "AKDT", "ACWDT": "ACWDT", "CLST": "CLST", "HNT": "HNT", "CAT": "CAT", "OEZ": "OEZ", "ACST": "ACST", "VET": "VET"},
}
}
@@ -102,7 +102,7 @@ func (vai *vai_Latn) MonthAbbreviated(month time.Month) string {
// MonthsAbbreviated returns the locales abbreviated months
func (vai *vai_Latn) MonthsAbbreviated() []string {
- return vai.monthsAbbreviated[1:]
+ return nil
}
// MonthNarrow returns the locales narrow month given the 'month' provided
@@ -112,7 +112,7 @@ func (vai *vai_Latn) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (vai *vai_Latn) MonthsNarrow() []string {
- return vai.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/vai_Latn/vai_Latn_test.go b/vai_Latn/vai_Latn_test.go
new file mode 100644
index 00000000..5feb87f2
--- /dev/null
+++ b/vai_Latn/vai_Latn_test.go
@@ -0,0 +1,1120 @@
+package vai_Latn
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "vai_Latn"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vai_Latn_LR/vai_Latn_LR.go b/vai_Latn_LR/vai_Latn_LR.go
index 70047391..5a5ac5c7 100644
--- a/vai_Latn_LR/vai_Latn_LR.go
+++ b/vai_Latn_LR/vai_Latn_LR.go
@@ -56,7 +56,7 @@ func New() locales.Translator {
currencyNegativeSuffix: ")",
monthsWide: []string{"", "ꖨꕪꖃ ꔞꕮ", "ꕒꕡꖝꖕ", "ꕾꖺ", "ꖢꖕ", "ꖑꕱ", "6", "7", "ꗛꔕ", "ꕢꕌ", "ꕭꖃ", "ꔞꘋꕔꕿ ꕸꖃꗏ", "ꖨꕪꕱ ꗏꕮ"},
daysWide: []string{"ꕞꕌꔵ", "ꗳꗡꘉ", "ꕚꕞꕚ", "ꕉꕞꕒ", "ꕉꔤꕆꕢ", "ꕉꔤꕀꕮ", "ꔻꔬꔳ"},
- timezones: map[string]string{"∅∅∅": "∅∅∅", "WAT": "WAT", "BT": "BT", "IST": "IST", "UYST": "UYST", "WEZ": "WEZ", "COT": "COT", "GMT": "GMT", "JDT": "JDT", "PDT": "PDT", "MEZ": "MEZ", "AEST": "AEST", "EST": "EST", "WARST": "WARST", "ARST": "ARST", "CDT": "CDT", "WESZ": "WESZ", "WAST": "WAST", "JST": "JST", "AKDT": "AKDT", "CHAST": "CHAST", "EDT": "EDT", "ECT": "ECT", "OESZ": "OESZ", "ART": "ART", "MESZ": "MESZ", "ACWST": "ACWST", "HNT": "HNT", "HADT": "HADT", "SGT": "SGT", "WITA": "WITA", "GYT": "GYT", "NZDT": "NZDT", "LHST": "LHST", "CAT": "CAT", "AST": "AST", "MDT": "MDT", "MYT": "MYT", "CLST": "CLST", "COST": "COST", "SAST": "SAST", "HKST": "HKST", "WIT": "WIT", "WIB": "WIB", "TMST": "TMST", "HKT": "HKT", "MST": "MST", "AKST": "AKST", "ChST": "ChST", "ADT": "ADT", "HAT": "HAT", "TMT": "TMT", "PST": "PST", "AWST": "AWST", "GFT": "GFT", "CST": "CST", "BOT": "BOT", "HAST": "HAST", "EAT": "EAT", "ACST": "ACST", "CLT": "CLT", "VET": "VET", "AEDT": "AEDT", "CHADT": "CHADT", "WART": "WART", "ACDT": "ACDT", "SRT": "SRT", "AWDT": "AWDT", "UYT": "UYT", "OEZ": "OEZ", "LHDT": "LHDT", "NZST": "NZST", "ACWDT": "ACWDT"},
+ timezones: map[string]string{"EAT": "EAT", "SRT": "SRT", "AST": "AST", "ARST": "ARST", "TMST": "TMST", "WAT": "WAT", "WAST": "WAST", "WIT": "WIT", "LHDT": "LHDT", "GFT": "GFT", "MDT": "MDT", "OEZ": "OEZ", "ChST": "ChST", "UYT": "UYT", "CHAST": "CHAST", "WESZ": "WESZ", "COST": "COST", "CST": "CST", "AWST": "AWST", "SGT": "SGT", "COT": "COT", "WIB": "WIB", "AKST": "AKST", "AWDT": "AWDT", "UYST": "UYST", "ACDT": "ACDT", "WART": "WART", "ADT": "ADT", "ACWDT": "ACWDT", "PDT": "PDT", "LHST": "LHST", "JST": "JST", "NZDT": "NZDT", "CAT": "CAT", "OESZ": "OESZ", "GMT": "GMT", "AEDT": "AEDT", "GYT": "GYT", "CLT": "CLT", "HKST": "HKST", "ACWST": "ACWST", "EDT": "EDT", "HAST": "HAST", "WEZ": "WEZ", "HNT": "HNT", "CLST": "CLST", "WARST": "WARST", "ART": "ART", "CHADT": "CHADT", "WITA": "WITA", "SAST": "SAST", "NZST": "NZST", "TMT": "TMT", "HAT": "HAT", "CDT": "CDT", "EST": "EST", "MST": "MST", "HKT": "HKT", "IST": "IST", "HADT": "HADT", "AEST": "AEST", "BT": "BT", "AKDT": "AKDT", "ACST": "ACST", "∅∅∅": "∅∅∅", "ECT": "ECT", "BOT": "BOT", "PST": "PST", "MESZ": "MESZ", "VET": "VET", "JDT": "JDT", "MEZ": "MEZ", "MYT": "MYT"},
}
}
@@ -102,7 +102,7 @@ func (vai *vai_Latn_LR) MonthAbbreviated(month time.Month) string {
// MonthsAbbreviated returns the locales abbreviated months
func (vai *vai_Latn_LR) MonthsAbbreviated() []string {
- return vai.monthsAbbreviated[1:]
+ return nil
}
// MonthNarrow returns the locales narrow month given the 'month' provided
@@ -112,7 +112,7 @@ func (vai *vai_Latn_LR) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (vai *vai_Latn_LR) MonthsNarrow() []string {
- return vai.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/vai_Latn_LR/vai_Latn_LR_test.go b/vai_Latn_LR/vai_Latn_LR_test.go
new file mode 100644
index 00000000..a7e9720b
--- /dev/null
+++ b/vai_Latn_LR/vai_Latn_LR_test.go
@@ -0,0 +1,1120 @@
+package vai_Latn_LR
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "vai_Latn_LR"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vai_Vaii/vai_Vaii.go b/vai_Vaii/vai_Vaii.go
index a0fdb075..f458ba5f 100644
--- a/vai_Vaii/vai_Vaii.go
+++ b/vai_Vaii/vai_Vaii.go
@@ -56,7 +56,7 @@ func New() locales.Translator {
currencyNegativeSuffix: ")",
monthsWide: []string{"", "ꖨꕪꖃ ꔞꕮ", "ꕒꕡꖝꖕ", "ꕾꖺ", "ꖢꖕ", "ꖑꕱ", "6", "7", "ꗛꔕ", "ꕢꕌ", "ꕭꖃ", "ꔞꘋꕔꕿ ꕸꖃꗏ", "ꖨꕪꕱ ꗏꕮ"},
daysWide: []string{"ꕞꕌꔵ", "ꗳꗡꘉ", "ꕚꕞꕚ", "ꕉꕞꕒ", "ꕉꔤꕆꕢ", "ꕉꔤꕀꕮ", "ꔻꔬꔳ"},
- timezones: map[string]string{"TMST": "TMST", "SGT": "SGT", "NZST": "NZST", "UYST": "UYST", "MESZ": "MESZ", "WESZ": "WESZ", "∅∅∅": "∅∅∅", "TMT": "TMT", "CLST": "CLST", "ECT": "ECT", "GYT": "GYT", "JDT": "JDT", "ARST": "ARST", "AWDT": "AWDT", "VET": "VET", "WART": "WART", "WAT": "WAT", "ART": "ART", "EDT": "EDT", "IST": "IST", "ACDT": "ACDT", "UYT": "UYT", "CLT": "CLT", "HADT": "HADT", "GMT": "GMT", "MDT": "MDT", "HAST": "HAST", "OESZ": "OESZ", "NZDT": "NZDT", "LHDT": "LHDT", "CHAST": "CHAST", "CAT": "CAT", "WARST": "WARST", "GFT": "GFT", "CST": "CST", "CHADT": "CHADT", "SRT": "SRT", "AKST": "AKST", "PDT": "PDT", "CDT": "CDT", "ADT": "ADT", "SAST": "SAST", "MYT": "MYT", "LHST": "LHST", "WEZ": "WEZ", "ACWST": "ACWST", "HAT": "HAT", "ACST": "ACST", "AEDT": "AEDT", "ChST": "ChST", "EST": "EST", "BT": "BT", "MST": "MST", "AWST": "AWST", "AKDT": "AKDT", "PST": "PST", "MEZ": "MEZ", "COT": "COT", "WITA": "WITA", "OEZ": "OEZ", "ACWDT": "ACWDT", "WIB": "WIB", "JST": "JST", "EAT": "EAT", "AEST": "AEST", "AST": "AST", "HKT": "HKT", "HKST": "HKST", "WIT": "WIT", "BOT": "BOT", "COST": "COST", "WAST": "WAST", "HNT": "HNT"},
+ timezones: map[string]string{"COT": "COT", "NZDT": "NZDT", "GMT": "GMT", "GYT": "GYT", "LHDT": "LHDT", "CDT": "CDT", "HADT": "HADT", "MYT": "MYT", "HKST": "HKST", "CHAST": "CHAST", "EAT": "EAT", "WAT": "WAT", "HKT": "HKT", "PST": "PST", "HAST": "HAST", "∅∅∅": "∅∅∅", "HNT": "HNT", "ChST": "ChST", "ARST": "ARST", "TMST": "TMST", "TMT": "TMT", "IST": "IST", "WEZ": "WEZ", "AEST": "AEST", "AKST": "AKST", "AWDT": "AWDT", "WIT": "WIT", "CLT": "CLT", "ACWDT": "ACWDT", "NZST": "NZST", "OESZ": "OESZ", "ACDT": "ACDT", "SRT": "SRT", "JDT": "JDT", "AEDT": "AEDT", "GFT": "GFT", "ECT": "ECT", "JST": "JST", "MEZ": "MEZ", "MESZ": "MESZ", "COST": "COST", "LHST": "LHST", "MDT": "MDT", "ACST": "ACST", "PDT": "PDT", "WESZ": "WESZ", "WIB": "WIB", "CLST": "CLST", "UYT": "UYT", "WARST": "WARST", "VET": "VET", "AKDT": "AKDT", "EST": "EST", "CAT": "CAT", "WART": "WART", "CHADT": "CHADT", "BOT": "BOT", "HAT": "HAT", "SGT": "SGT", "BT": "BT", "AWST": "AWST", "ADT": "ADT", "ART": "ART", "OEZ": "OEZ", "AST": "AST", "WITA": "WITA", "SAST": "SAST", "EDT": "EDT", "WAST": "WAST", "MST": "MST", "UYST": "UYST", "CST": "CST", "ACWST": "ACWST"},
}
}
@@ -102,7 +102,7 @@ func (vai *vai_Vaii) MonthAbbreviated(month time.Month) string {
// MonthsAbbreviated returns the locales abbreviated months
func (vai *vai_Vaii) MonthsAbbreviated() []string {
- return vai.monthsAbbreviated[1:]
+ return nil
}
// MonthNarrow returns the locales narrow month given the 'month' provided
@@ -112,7 +112,7 @@ func (vai *vai_Vaii) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (vai *vai_Vaii) MonthsNarrow() []string {
- return vai.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/vai_Vaii/vai_Vaii_test.go b/vai_Vaii/vai_Vaii_test.go
new file mode 100644
index 00000000..53054e77
--- /dev/null
+++ b/vai_Vaii/vai_Vaii_test.go
@@ -0,0 +1,1120 @@
+package vai_Vaii
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "vai_Vaii"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vai_Vaii_LR/vai_Vaii_LR.go b/vai_Vaii_LR/vai_Vaii_LR.go
index f146b7af..a86f540e 100644
--- a/vai_Vaii_LR/vai_Vaii_LR.go
+++ b/vai_Vaii_LR/vai_Vaii_LR.go
@@ -56,7 +56,7 @@ func New() locales.Translator {
currencyNegativeSuffix: ")",
monthsWide: []string{"", "ꖨꕪꖃ ꔞꕮ", "ꕒꕡꖝꖕ", "ꕾꖺ", "ꖢꖕ", "ꖑꕱ", "6", "7", "ꗛꔕ", "ꕢꕌ", "ꕭꖃ", "ꔞꘋꕔꕿ ꕸꖃꗏ", "ꖨꕪꕱ ꗏꕮ"},
daysWide: []string{"ꕞꕌꔵ", "ꗳꗡꘉ", "ꕚꕞꕚ", "ꕉꕞꕒ", "ꕉꔤꕆꕢ", "ꕉꔤꕀꕮ", "ꔻꔬꔳ"},
- timezones: map[string]string{"WEZ": "WEZ", "COT": "COT", "COST": "COST", "EDT": "EDT", "EAT": "EAT", "CHAST": "CHAST", "UYT": "UYT", "AEST": "AEST", "WIB": "WIB", "NZST": "NZST", "AKDT": "AKDT", "PDT": "PDT", "MESZ": "MESZ", "SGT": "SGT", "ACDT": "ACDT", "GMT": "GMT", "HNT": "HNT", "GYT": "GYT", "∅∅∅": "∅∅∅", "ADT": "ADT", "JDT": "JDT", "NZDT": "NZDT", "MEZ": "MEZ", "TMST": "TMST", "MYT": "MYT", "ACWST": "ACWST", "ACWDT": "ACWDT", "CAT": "CAT", "HAST": "HAST", "CST": "CST", "WITA": "WITA", "MST": "MST", "AWDT": "AWDT", "HKT": "HKT", "HKST": "HKST", "WIT": "WIT", "CHADT": "CHADT", "AWST": "AWST", "LHDT": "LHDT", "CLT": "CLT", "IST": "IST", "ACST": "ACST", "WAT": "WAT", "HAT": "HAT", "ART": "ART", "JST": "JST", "PST": "PST", "CDT": "CDT", "HADT": "HADT", "SAST": "SAST", "WARST": "WARST", "GFT": "GFT", "OEZ": "OEZ", "ARST": "ARST", "TMT": "TMT", "BT": "BT", "WART": "WART", "VET": "VET", "ChST": "ChST", "ECT": "ECT", "AKST": "AKST", "UYST": "UYST", "OESZ": "OESZ", "MDT": "MDT", "SRT": "SRT", "AST": "AST", "WAST": "WAST", "AEDT": "AEDT", "CLST": "CLST", "WESZ": "WESZ", "EST": "EST", "LHST": "LHST", "BOT": "BOT"},
+ timezones: map[string]string{"WARST": "WARST", "CHAST": "CHAST", "PST": "PST", "WIB": "WIB", "WITA": "WITA", "GMT": "GMT", "MYT": "MYT", "UYT": "UYT", "WIT": "WIT", "GFT": "GFT", "HKT": "HKT", "HKST": "HKST", "IST": "IST", "TMT": "TMT", "OEZ": "OEZ", "AEDT": "AEDT", "MST": "MST", "MDT": "MDT", "ART": "ART", "EST": "EST", "EAT": "EAT", "LHDT": "LHDT", "AKST": "AKST", "JDT": "JDT", "WAT": "WAT", "COST": "COST", "ACWST": "ACWST", "NZST": "NZST", "HNT": "HNT", "AEST": "AEST", "CST": "CST", "ACDT": "ACDT", "HADT": "HADT", "TMST": "TMST", "VET": "VET", "ACWDT": "ACWDT", "PDT": "PDT", "BOT": "BOT", "HAT": "HAT", "∅∅∅": "∅∅∅", "EDT": "EDT", "CLT": "CLT", "MEZ": "MEZ", "UYST": "UYST", "CDT": "CDT", "ECT": "ECT", "AWDT": "AWDT", "COT": "COT", "ChST": "ChST", "GYT": "GYT", "SRT": "SRT", "ARST": "ARST", "NZDT": "NZDT", "WEZ": "WEZ", "CHADT": "CHADT", "AKDT": "AKDT", "ADT": "ADT", "SAST": "SAST", "SGT": "SGT", "BT": "BT", "CLST": "CLST", "AWST": "AWST", "JST": "JST", "HAST": "HAST", "CAT": "CAT", "WAST": "WAST", "LHST": "LHST", "ACST": "ACST", "WART": "WART", "AST": "AST", "MESZ": "MESZ", "WESZ": "WESZ", "OESZ": "OESZ"},
}
}
@@ -102,7 +102,7 @@ func (vai *vai_Vaii_LR) MonthAbbreviated(month time.Month) string {
// MonthsAbbreviated returns the locales abbreviated months
func (vai *vai_Vaii_LR) MonthsAbbreviated() []string {
- return vai.monthsAbbreviated[1:]
+ return nil
}
// MonthNarrow returns the locales narrow month given the 'month' provided
@@ -112,7 +112,7 @@ func (vai *vai_Vaii_LR) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (vai *vai_Vaii_LR) MonthsNarrow() []string {
- return vai.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/vai_Vaii_LR/vai_Vaii_LR_test.go b/vai_Vaii_LR/vai_Vaii_LR_test.go
new file mode 100644
index 00000000..a5b1258b
--- /dev/null
+++ b/vai_Vaii_LR/vai_Vaii_LR_test.go
@@ -0,0 +1,1120 @@
+package vai_Vaii_LR
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "vai_Vaii_LR"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vi/vi.go b/vi/vi.go
index b4b856d7..c5889cd3 100644
--- a/vi/vi.go
+++ b/vi/vi.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"tr. CN", "sau CN"},
erasNarrow: []string{"tr. CN", "sau CN"},
erasWide: []string{"tr. CN", "sau CN"},
- timezones: map[string]string{"CDT": "Giờ ban ngày miền trung", "AEST": "Giờ Chuẩn Miền Đông Nước Úc", "AEDT": "Giờ Mùa Hè Miền Đông Nước Úc", "EAT": "Giờ Đông Phi", "WAST": "Giờ Mùa Hè Tây Phi", "WIB": "Giờ Miền Tây Indonesia", "MYT": "Giờ Malaysia", "CAT": "Giờ Trung Phi", "ADT": "Giờ Mùa hè Đại Tây Dương", "HAST": "Giờ Chuẩn Hawaii-Aleutian", "LHDT": "Giờ Mùa Hè Lord Howe", "GYT": "Giờ Guyana", "CHAST": "Giờ Chuẩn Chatham", "ECT": "Giờ Ecuador", "TMST": "Giờ Mùa Hè Turkmenistan", "JST": "Giờ Chuẩn Nhật Bản", "SRT": "Giờ Suriname", "ACWDT": "Giờ Mùa Hè Miền Trung Tây Nước Úc", "MST": "Giờ chuẩn miền núi", "IST": "Giờ Chuẩn Ấn Độ", "GMT": "Giờ Trung bình Greenwich", "EST": "Giờ chuẩn miền đông", "WIT": "Giờ Miền Đông Indonesia", "OEZ": "Giờ Chuẩn Đông Âu", "OESZ": "Giờ Mùa Hè Đông Âu", "GFT": "Giờ Guiana thuộc Pháp", "JDT": "Giờ Mùa Hè Nhật Bản", "NZST": "Giờ Chuẩn New Zealand", "UYST": "Giờ Mùa Hè Uruguay", "MDT": "Giờ ban ngày miền núi", "WAT": "Giờ Chuẩn Tây Phi", "BT": "Giờ Bhutan", "MESZ": "Giờ Mùa Hè Trung Âu", "COT": "Giờ Chuẩn Colombia", "HKT": "Giờ Chuẩn Hồng Kông", "HAT": "Giờ Mùa Hè Newfoundland", "MEZ": "Giờ Chuẩn Trung Âu", "∅∅∅": "Giờ Mùa Hè Brasilia", "SGT": "Giờ Singapore", "AKDT": "Giờ Mùa Hè Alaska", "ChST": "Giờ Chamorro", "HNT": "Giờ Chuẩn Newfoundland", "ART": "Giờ Chuẩn Argentina", "CHADT": "Giờ Mùa Hè Chatham", "TMT": "Giờ Chuẩn Turkmenistan", "ACST": "Giờ Chuẩn Miền Trung Nước Úc", "HKST": "Giờ Mùa Hè Hồng Kông", "WITA": "Giờ Miền Trung Indonesia", "AKST": "Giờ Chuẩn Alaska", "PDT": "Giờ ban ngày Thái Bình Dương", "CLT": "Giờ Chuẩn Chile", "ACWST": "Giờ Chuẩn Miền Trung Tây Nước Úc", "SAST": "Giờ Chuẩn Nam Phi", "COST": "Giờ Mùa Hè Colombia", "AST": "Giờ Chuẩn Đại Tây Dương", "AWST": "Giờ Chuẩn Miền Tây Nước Úc", "AWDT": "Giờ Mùa Hè Miền Tây Nước Úc", "CST": "Giờ chuẩn miền trung", "CLST": "Giờ Mùa Hè Chile", "WESZ": "Giờ Mùa hè Tây Âu", "WART": "Giờ chuẩn miền mây Argentina", "ARST": "Giờ Mùa Hè Argentina", "PST": "Giờ chuẩn Thái Bình Dương", "NZDT": "Giờ Mùa Hè New Zealand", "BOT": "Giờ Bolivia", "WEZ": "Giờ Chuẩn Tây Âu", "HADT": "Giờ Mùa Hè Hawaii-Aleutian", "ACDT": "Giờ Mùa Hè Miền Trung Nước Úc", "UYT": "Giờ Chuẩn Uruguay", "VET": "Giờ Venezuela", "EDT": "Giờ ban ngày miền đông", "LHST": "Giờ Chuẩn Lord Howe", "WARST": "Giờ mùa hè miền tây Argentina"},
+ timezones: map[string]string{"ARST": "Giờ Mùa Hè Argentina", "IST": "Giờ Chuẩn Ấn Độ", "OEZ": "Giờ Chuẩn Đông Âu", "CST": "Giờ chuẩn miền trung", "ACDT": "Giờ Mùa Hè Miền Trung Nước Úc", "HKST": "Giờ Mùa Hè Hồng Kông", "ACWST": "Giờ Chuẩn Miền Trung Tây Nước Úc", "WITA": "Giờ Miền Trung Indonesia", "WESZ": "Giờ Mùa hè Tây Âu", "COST": "Giờ Mùa Hè Colombia", "WIB": "Giờ Miền Tây Indonesia", "ACST": "Giờ Chuẩn Miền Trung Nước Úc", "ADT": "Giờ Mùa hè Đại Tây Dương", "SAST": "Giờ Chuẩn Nam Phi", "PDT": "Giờ ban ngày Thái Bình Dương", "HADT": "Giờ Mùa Hè Hawaii-Aleutian", "WAT": "Giờ Chuẩn Tây Phi", "ChST": "Giờ Chamorro", "LHST": "Giờ Chuẩn Lord Howe", "CLST": "Giờ Mùa Hè Chile", "CHADT": "Giờ Mùa Hè Chatham", "AWDT": "Giờ Mùa Hè Miền Tây Nước Úc", "HAST": "Giờ Chuẩn Hawaii-Aleutian", "WART": "Giờ chuẩn miền mây Argentina", "AST": "Giờ Chuẩn Đại Tây Dương", "WIT": "Giờ Miền Đông Indonesia", "MYT": "Giờ Malaysia", "CAT": "Giờ Trung Phi", "NZDT": "Giờ Mùa Hè New Zealand", "BOT": "Giờ Bolivia", "ART": "Giờ Chuẩn Argentina", "WAST": "Giờ Mùa Hè Tây Phi", "HNT": "Giờ Chuẩn Newfoundland", "AWST": "Giờ Chuẩn Miền Tây Nước Úc", "MESZ": "Giờ Mùa Hè Trung Âu", "COT": "Giờ Chuẩn Colombia", "AEST": "Giờ Chuẩn Miền Đông Nước Úc", "GYT": "Giờ Guyana", "AKST": "Giờ Chuẩn Alaska", "UYST": "Giờ Mùa Hè Uruguay", "BT": "Giờ Bhutan", "PST": "Giờ chuẩn Thái Bình Dương", "TMST": "Giờ Mùa Hè Turkmenistan", "LHDT": "Giờ Mùa Hè Lord Howe", "SRT": "Giờ Suriname", "VET": "Giờ Venezuela", "OESZ": "Giờ Mùa Hè Đông Âu", "EAT": "Giờ Đông Phi", "WEZ": "Giờ Chuẩn Tây Âu", "JDT": "Giờ Mùa Hè Nhật Bản", "GMT": "Giờ Trung bình Greenwich", "CDT": "Giờ ban ngày miền trung", "WARST": "Giờ mùa hè miền tây Argentina", "CHAST": "Giờ Chuẩn Chatham", "MEZ": "Giờ Chuẩn Trung Âu", "CLT": "Giờ Chuẩn Chile", "GFT": "Giờ Guiana thuộc Pháp", "AKDT": "Giờ Mùa Hè Alaska", "ACWDT": "Giờ Mùa Hè Miền Trung Tây Nước Úc", "JST": "Giờ Chuẩn Nhật Bản", "HAT": "Giờ Mùa Hè Newfoundland", "SGT": "Giờ Singapore", "HKT": "Giờ Chuẩn Hồng Kông", "MST": "Giờ Chuẩn Ma Cao", "MDT": "Giờ Mùa Hè Ma Cao", "ECT": "Giờ Ecuador", "EDT": "Giờ ban ngày miền đông", "NZST": "Giờ Chuẩn New Zealand", "TMT": "Giờ Chuẩn Turkmenistan", "AEDT": "Giờ Mùa Hè Miền Đông Nước Úc", "∅∅∅": "Giờ Mùa Hè Azores", "UYT": "Giờ Chuẩn Uruguay", "EST": "Giờ chuẩn miền đông"},
}
}
diff --git a/vi/vi_test.go b/vi/vi_test.go
new file mode 100644
index 00000000..b4e5deae
--- /dev/null
+++ b/vi/vi_test.go
@@ -0,0 +1,1120 @@
+package vi
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "vi"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vi_VN/vi_VN.go b/vi_VN/vi_VN.go
index fdc5dcbc..3edefeb5 100644
--- a/vi_VN/vi_VN.go
+++ b/vi_VN/vi_VN.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"tr. CN", "sau CN"},
erasNarrow: []string{"tr. CN", "sau CN"},
erasWide: []string{"tr. CN", "sau CN"},
- timezones: map[string]string{"CHAST": "Giờ Chuẩn Chatham", "WITA": "Giờ Miền Trung Indonesia", "TMT": "Giờ Chuẩn Turkmenistan", "JDT": "Giờ Mùa Hè Nhật Bản", "MEZ": "Giờ Chuẩn Trung Âu", "CHADT": "Giờ Mùa Hè Chatham", "OESZ": "Giờ Mùa Hè Đông Âu", "IST": "Giờ Chuẩn Ấn Độ", "ACST": "Giờ Chuẩn Miền Trung Nước Úc", "NZST": "Giờ Chuẩn New Zealand", "UYST": "Giờ Mùa Hè Uruguay", "AEDT": "Giờ Mùa Hè Miền Đông Nước Úc", "HAT": "Giờ Mùa Hè Newfoundland", "TMST": "Giờ Mùa Hè Turkmenistan", "EAT": "Giờ Đông Phi", "AKST": "Giờ Chuẩn Alaska", "AEST": "Giờ Chuẩn Miền Đông Nước Úc", "ECT": "Giờ Ecuador", "CAT": "Giờ Trung Phi", "AST": "Giờ Chuẩn Đại Tây Dương", "WARST": "Giờ mùa hè miền tây Argentina", "WIB": "Giờ Miền Tây Indonesia", "LHST": "Giờ Chuẩn Lord Howe", "WESZ": "Giờ Mùa hè Tây Âu", "HAST": "Giờ Chuẩn Hawaii-Aleutian", "GFT": "Giờ Guiana thuộc Pháp", "PDT": "Giờ ban ngày Thái Bình Dương", "UYT": "Giờ Chuẩn Uruguay", "ChST": "Giờ Chamorro", "ART": "Giờ Chuẩn Argentina", "HADT": "Giờ Mùa Hè Hawaii-Aleutian", "MST": "Giờ Chuẩn Ma Cao", "PST": "Giờ chuẩn Thái Bình Dương", "WEZ": "Giờ Chuẩn Tây Âu", "COST": "Giờ Mùa Hè Colombia", "OEZ": "Giờ Chuẩn Đông Âu", "ACDT": "Giờ Mùa Hè Miền Trung Nước Úc", "ARST": "Giờ Mùa Hè Argentina", "JST": "Giờ Chuẩn Nhật Bản", "NZDT": "Giờ Mùa Hè New Zealand", "MYT": "Giờ Malaysia", "MESZ": "Giờ Mùa Hè Trung Âu", "BOT": "Giờ Bolivia", "VET": "Giờ Venezuela", "WART": "Giờ chuẩn miền mây Argentina", "GMT": "Giờ Trung bình Greenwich", "WIT": "Giờ Miền Đông Indonesia", "AKDT": "Giờ Mùa Hè Alaska", "CST": "Giờ chuẩn miền trung", "ACWST": "Giờ Chuẩn Miền Trung Tây Nước Úc", "ACWDT": "Giờ Mùa Hè Miền Trung Tây Nước Úc", "EST": "Giờ chuẩn miền đông", "EDT": "Giờ ban ngày miền đông", "ADT": "Giờ Mùa hè Đại Tây Dương", "WAT": "Giờ Chuẩn Tây Phi", "SAST": "Giờ Chuẩn Nam Phi", "HNT": "Giờ Chuẩn Newfoundland", "SRT": "Giờ Suriname", "CLST": "Giờ Mùa Hè Chile", "SGT": "Giờ Singapore", "∅∅∅": "Giờ Mùa Hè Amazon", "CDT": "Giờ ban ngày miền trung", "CLT": "Giờ Chuẩn Chile", "COT": "Giờ Chuẩn Colombia", "BT": "Giờ Bhutan", "HKT": "Giờ Chuẩn Hồng Kông", "HKST": "Giờ Mùa Hè Hồng Kông", "AWST": "Giờ Chuẩn Miền Tây Nước Úc", "AWDT": "Giờ Mùa Hè Miền Tây Nước Úc", "LHDT": "Giờ Mùa Hè Lord Howe", "GYT": "Giờ Guyana", "WAST": "Giờ Mùa Hè Tây Phi", "MDT": "Giờ Mùa Hè Ma Cao"},
+ timezones: map[string]string{"WARST": "Giờ mùa hè miền tây Argentina", "EST": "Giờ chuẩn miền đông", "HAT": "Giờ Mùa Hè Newfoundland", "TMT": "Giờ Chuẩn Turkmenistan", "UYST": "Giờ Mùa Hè Uruguay", "CDT": "Giờ ban ngày miền trung", "HKT": "Giờ Chuẩn Hồng Kông", "MEZ": "Giờ Chuẩn Trung Âu", "NZST": "Giờ Chuẩn New Zealand", "NZDT": "Giờ Mùa Hè New Zealand", "VET": "Giờ Venezuela", "WESZ": "Giờ Mùa hè Tây Âu", "CST": "Giờ chuẩn miền trung", "ACST": "Giờ Chuẩn Miền Trung Nước Úc", "∅∅∅": "Giờ Mùa Hè Azores", "AST": "Giờ Chuẩn Đại Tây Dương", "PDT": "Giờ ban ngày Thái Bình Dương", "SRT": "Giờ Suriname", "AWDT": "Giờ Mùa Hè Miền Tây Nước Úc", "WITA": "Giờ Miền Trung Indonesia", "COT": "Giờ Chuẩn Colombia", "CAT": "Giờ Trung Phi", "ECT": "Giờ Ecuador", "JST": "Giờ Chuẩn Nhật Bản", "ADT": "Giờ Mùa hè Đại Tây Dương", "EAT": "Giờ Đông Phi", "COST": "Giờ Mùa Hè Colombia", "WAST": "Giờ Mùa Hè Tây Phi", "OESZ": "Giờ Mùa Hè Đông Âu", "ART": "Giờ Chuẩn Argentina", "ACWST": "Giờ Chuẩn Miền Trung Tây Nước Úc", "PST": "Giờ chuẩn Thái Bình Dương", "SAST": "Giờ Chuẩn Nam Phi", "HNT": "Giờ Chuẩn Newfoundland", "LHDT": "Giờ Mùa Hè Lord Howe", "WAT": "Giờ Chuẩn Tây Phi", "GFT": "Giờ Guiana thuộc Pháp", "CHADT": "Giờ Mùa Hè Chatham", "ARST": "Giờ Mùa Hè Argentina", "AKDT": "Giờ Mùa Hè Alaska", "HAST": "Giờ Chuẩn Hawaii-Aleutian", "MYT": "Giờ Malaysia", "AKST": "Giờ Chuẩn Alaska", "ACWDT": "Giờ Mùa Hè Miền Trung Tây Nước Úc", "TMST": "Giờ Mùa Hè Turkmenistan", "WEZ": "Giờ Chuẩn Tây Âu", "ChST": "Giờ Chamorro", "BT": "Giờ Bhutan", "MST": "Giờ Chuẩn Ma Cao", "MESZ": "Giờ Mùa Hè Trung Âu", "SGT": "Giờ Singapore", "GMT": "Giờ Trung bình Greenwich", "WIT": "Giờ Miền Đông Indonesia", "MDT": "Giờ Mùa Hè Ma Cao", "HKST": "Giờ Mùa Hè Hồng Kông", "EDT": "Giờ ban ngày miền đông", "LHST": "Giờ Chuẩn Lord Howe", "AWST": "Giờ Chuẩn Miền Tây Nước Úc", "JDT": "Giờ Mùa Hè Nhật Bản", "IST": "Giờ Chuẩn Ấn Độ", "WIB": "Giờ Miền Tây Indonesia", "CLT": "Giờ Chuẩn Chile", "CHAST": "Giờ Chuẩn Chatham", "BOT": "Giờ Bolivia", "GYT": "Giờ Guyana", "AEDT": "Giờ Mùa Hè Miền Đông Nước Úc", "UYT": "Giờ Chuẩn Uruguay", "ACDT": "Giờ Mùa Hè Miền Trung Nước Úc", "WART": "Giờ chuẩn miền mây Argentina", "AEST": "Giờ Chuẩn Miền Đông Nước Úc", "HADT": "Giờ Mùa Hè Hawaii-Aleutian", "OEZ": "Giờ Chuẩn Đông Âu", "CLST": "Giờ Mùa Hè Chile"},
}
}
diff --git a/vi_VN/vi_VN_test.go b/vi_VN/vi_VN_test.go
new file mode 100644
index 00000000..8840e405
--- /dev/null
+++ b/vi_VN/vi_VN_test.go
@@ -0,0 +1,1120 @@
+package vi_VN
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "vi_VN"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vo/vo.go b/vo/vo.go
index 73969723..5ece4356 100644
--- a/vo/vo.go
+++ b/vo/vo.go
@@ -57,7 +57,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"b. t. kr.", "p. t. kr."},
erasNarrow: []string{"", ""},
erasWide: []string{"b. t. kr.", "p. t. kr."},
- timezones: map[string]string{"ACST": "ACST", "CST": "CST", "CDT": "CDT", "AST": "AST", "ACDT": "ACDT", "SRT": "SRT", "NZST": "NZST", "EST": "EST", "CAT": "CAT", "WART": "WART", "GMT": "GMT", "PDT": "PDT", "LHST": "LHST", "HADT": "HADT", "HNT": "HNT", "MST": "MST", "AKST": "AKST", "WEZ": "WEZ", "EDT": "EDT", "COT": "COT", "OESZ": "OESZ", "AWST": "AWST", "MEZ": "MEZ", "CLT": "CLT", "ADT": "ADT", "HAT": "HAT", "ACWDT": "ACWDT", "AEST": "AEST", "VET": "VET", "SGT": "SGT", "WAT": "WAT", "HKST": "HKST", "ART": "ART", "EAT": "EAT", "LHDT": "LHDT", "MESZ": "MESZ", "HAST": "HAST", "GYT": "GYT", "BT": "BT", "HKT": "HKT", "ECT": "ECT", "WAST": "WAST", "WIT": "WIT", "∅∅∅": "∅∅∅", "PST": "PST", "CHAST": "CHAST", "WIB": "WIB", "IST": "IST", "TMST": "TMST", "JST": "JST", "AKDT": "AKDT", "AEDT": "AEDT", "WESZ": "WESZ", "COST": "COST", "WITA": "WITA", "TMT": "TMT", "MYT": "MYT", "BOT": "BOT", "ACWST": "ACWST", "OEZ": "OEZ", "GFT": "GFT", "ARST": "ARST", "JDT": "JDT", "CHADT": "CHADT", "CLST": "CLST", "MDT": "MDT", "UYT": "UYT", "UYST": "UYST", "AWDT": "AWDT", "NZDT": "NZDT", "ChST": "ChST", "WARST": "WARST", "SAST": "SAST"},
+ timezones: map[string]string{"AWDT": "AWDT", "OESZ": "OESZ", "AEST": "AEST", "ARST": "ARST", "IST": "IST", "AEDT": "AEDT", "GFT": "GFT", "CHAST": "CHAST", "SAST": "SAST", "HAT": "HAT", "CST": "CST", "SRT": "SRT", "GYT": "GYT", "UYT": "UYT", "MDT": "MDT", "AKST": "AKST", "ART": "ART", "MESZ": "MESZ", "TMT": "TMT", "VET": "VET", "OEZ": "OEZ", "CDT": "CDT", "EDT": "EDT", "WIB": "WIB", "WESZ": "WESZ", "HNT": "HNT", "SGT": "SGT", "PDT": "PDT", "COT": "COT", "WAST": "WAST", "MST": "MST", "JDT": "JDT", "NZDT": "NZDT", "EST": "EST", "BT": "BT", "ACDT": "ACDT", "ECT": "ECT", "AST": "AST", "ACWDT": "ACWDT", "TMST": "TMST", "CLST": "CLST", "ChST": "ChST", "WIT": "WIT", "WARST": "WARST", "ADT": "ADT", "HAST": "HAST", "PST": "PST", "WAT": "WAT", "WEZ": "WEZ", "CHADT": "CHADT", "HADT": "HADT", "MEZ": "MEZ", "∅∅∅": "∅∅∅", "UYST": "UYST", "HKST": "HKST", "WITA": "WITA", "COST": "COST", "LHST": "LHST", "ACST": "ACST", "AKDT": "AKDT", "ACWST": "ACWST", "BOT": "BOT", "CAT": "CAT", "NZST": "NZST", "EAT": "EAT", "LHDT": "LHDT", "WART": "WART", "MYT": "MYT", "HKT": "HKT", "JST": "JST", "AWST": "AWST", "GMT": "GMT", "CLT": "CLT"},
}
}
diff --git a/vo/vo_test.go b/vo/vo_test.go
new file mode 100644
index 00000000..274d5c08
--- /dev/null
+++ b/vo/vo_test.go
@@ -0,0 +1,1120 @@
+package vo
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "vo"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vo_001/vo_001.go b/vo_001/vo_001.go
index 17016644..7fa2bdbe 100644
--- a/vo_001/vo_001.go
+++ b/vo_001/vo_001.go
@@ -57,7 +57,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"b. t. kr.", "p. t. kr."},
erasNarrow: []string{"", ""},
erasWide: []string{"b. t. kr.", "p. t. kr."},
- timezones: map[string]string{"CDT": "CDT", "AEDT": "AEDT", "WESZ": "WESZ", "IST": "IST", "ART": "ART", "TMST": "TMST", "AST": "AST", "HAT": "HAT", "GYT": "GYT", "CHAST": "CHAST", "VET": "VET", "WAST": "WAST", "AWST": "AWST", "CLT": "CLT", "TMT": "TMT", "MYT": "MYT", "WARST": "WARST", "MESZ": "MESZ", "AEST": "AEST", "ACWST": "ACWST", "BT": "BT", "WART": "WART", "WITA": "WITA", "LHDT": "LHDT", "SRT": "SRT", "WEZ": "WEZ", "EST": "EST", "WAT": "WAT", "JDT": "JDT", "AKDT": "AKDT", "BOT": "BOT", "UYT": "UYT", "SGT": "SGT", "LHST": "LHST", "MST": "MST", "CHADT": "CHADT", "ACWDT": "ACWDT", "COST": "COST", "HNT": "HNT", "JST": "JST", "ChST": "ChST", "CLST": "CLST", "∅∅∅": "∅∅∅", "ARST": "ARST", "UYST": "UYST", "CST": "CST", "HKT": "HKT", "GFT": "GFT", "GMT": "GMT", "WIB": "WIB", "PST": "PST", "MEZ": "MEZ", "CAT": "CAT", "HKST": "HKST", "PDT": "PDT", "OEZ": "OEZ", "ACST": "ACST", "EDT": "EDT", "WIT": "WIT", "COT": "COT", "AWDT": "AWDT", "MDT": "MDT", "HADT": "HADT", "EAT": "EAT", "HAST": "HAST", "SAST": "SAST", "OESZ": "OESZ", "ACDT": "ACDT", "AKST": "AKST", "NZST": "NZST", "ECT": "ECT", "ADT": "ADT", "NZDT": "NZDT"},
+ timezones: map[string]string{"∅∅∅": "∅∅∅", "AWST": "AWST", "AST": "AST", "PST": "PST", "UYT": "UYT", "HAT": "HAT", "OEZ": "OEZ", "CHAST": "CHAST", "NZDT": "NZDT", "CAT": "CAT", "GYT": "GYT", "WARST": "WARST", "WITA": "WITA", "MEZ": "MEZ", "HADT": "HADT", "EST": "EST", "HNT": "HNT", "AKST": "AKST", "LHST": "LHST", "CST": "CST", "HAST": "HAST", "COST": "COST", "AEDT": "AEDT", "UYST": "UYST", "BOT": "BOT", "SGT": "SGT", "WAST": "WAST", "MYT": "MYT", "BT": "BT", "HKT": "HKT", "JDT": "JDT", "COT": "COT", "TMT": "TMT", "WAT": "WAT", "EAT": "EAT", "AWDT": "AWDT", "JST": "JST", "ACWDT": "ACWDT", "ChST": "ChST", "CLT": "CLT", "ECT": "ECT", "VET": "VET", "MDT": "MDT", "PDT": "PDT", "ADT": "ADT", "ACWST": "ACWST", "IST": "IST", "WEZ": "WEZ", "WIT": "WIT", "CDT": "CDT", "MST": "MST", "ART": "ART", "ARST": "ARST", "NZST": "NZST", "SAST": "SAST", "HKST": "HKST", "OESZ": "OESZ", "SRT": "SRT", "ACDT": "ACDT", "WART": "WART", "AKDT": "AKDT", "MESZ": "MESZ", "GMT": "GMT", "CLST": "CLST", "ACST": "ACST", "EDT": "EDT", "WIB": "WIB", "WESZ": "WESZ", "AEST": "AEST", "GFT": "GFT", "CHADT": "CHADT", "TMST": "TMST", "LHDT": "LHDT"},
}
}
diff --git a/vo_001/vo_001_test.go b/vo_001/vo_001_test.go
new file mode 100644
index 00000000..798c30eb
--- /dev/null
+++ b/vo_001/vo_001_test.go
@@ -0,0 +1,1120 @@
+package vo_001
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "vo_001"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vun/vun.go b/vun/vun.go
index e8c9e26b..0382b9db 100644
--- a/vun/vun.go
+++ b/vun/vun.go
@@ -59,7 +59,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"KK", "BK"},
erasNarrow: []string{"", ""},
erasWide: []string{"Kabla ya Kristu", "Baada ya Kristu"},
- timezones: map[string]string{"CAT": "CAT", "LHDT": "LHDT", "CLT": "CLT", "VET": "VET", "EST": "EST", "EDT": "EDT", "COST": "COST", "AST": "AST", "OESZ": "OESZ", "MST": "MST", "∅∅∅": "∅∅∅", "WEZ": "WEZ", "CLST": "CLST", "LHST": "LHST", "UYST": "UYST", "CHAST": "CHAST", "ECT": "ECT", "SGT": "SGT", "WAT": "WAT", "MDT": "MDT", "NZST": "NZST", "AEDT": "AEDT", "AWST": "AWST", "CST": "CST", "MESZ": "MESZ", "COT": "COT", "WIB": "WIB", "ACDT": "ACDT", "JDT": "JDT", "AEST": "AEST", "ChST": "ChST", "SAST": "SAST", "WARST": "WARST", "WITA": "WITA", "PST": "PST", "AWDT": "AWDT", "MEZ": "MEZ", "WESZ": "WESZ", "AKDT": "AKDT", "GYT": "GYT", "NZDT": "NZDT", "UYT": "UYT", "WAST": "WAST", "BT": "BT", "ACST": "ACST", "ADT": "ADT", "HKT": "HKT", "HKST": "HKST", "GFT": "GFT", "EAT": "EAT", "MYT": "MYT", "JST": "JST", "ACWST": "ACWST", "HAST": "HAST", "BOT": "BOT", "HNT": "HNT", "SRT": "SRT", "CHADT": "CHADT", "HADT": "HADT", "TMST": "TMST", "CDT": "CDT", "ACWDT": "ACWDT", "IST": "IST", "HAT": "HAT", "ART": "ART", "ARST": "ARST", "OEZ": "OEZ", "GMT": "GMT", "WIT": "WIT", "TMT": "TMT", "AKST": "AKST", "PDT": "PDT", "WART": "WART"},
+ timezones: map[string]string{"COST": "COST", "LHDT": "LHDT", "JDT": "JDT", "ACWDT": "ACWDT", "AWDT": "AWDT", "OESZ": "OESZ", "GMT": "GMT", "ChST": "ChST", "UYT": "UYT", "WART": "WART", "WARST": "WARST", "CHAST": "CHAST", "NZDT": "NZDT", "HKST": "HKST", "MESZ": "MESZ", "SGT": "SGT", "MDT": "MDT", "∅∅∅": "∅∅∅", "ACST": "ACST", "WIT": "WIT", "BT": "BT", "CST": "CST", "VET": "VET", "AKST": "AKST", "IST": "IST", "MEZ": "MEZ", "HAST": "HAST", "LHST": "LHST", "EST": "EST", "EAT": "EAT", "MYT": "MYT", "JST": "JST", "ADT": "ADT", "TMT": "TMT", "GYT": "GYT", "UYST": "UYST", "SRT": "SRT", "HADT": "HADT", "EDT": "EDT", "WEZ": "WEZ", "WESZ": "WESZ", "OEZ": "OEZ", "AEST": "AEST", "CLT": "CLT", "CDT": "CDT", "ACDT": "ACDT", "ART": "ART", "CAT": "CAT", "MST": "MST", "GFT": "GFT", "AKDT": "AKDT", "WITA": "WITA", "WAST": "WAST", "AEDT": "AEDT", "HKT": "HKT", "AWST": "AWST", "SAST": "SAST", "PST": "PST", "HAT": "HAT", "AST": "AST", "PDT": "PDT", "WIB": "WIB", "TMST": "TMST", "WAT": "WAT", "COT": "COT", "ECT": "ECT", "NZST": "NZST", "HNT": "HNT", "CLST": "CLST", "ACWST": "ACWST", "ARST": "ARST", "BOT": "BOT", "CHADT": "CHADT"},
}
}
diff --git a/vun/vun_test.go b/vun/vun_test.go
new file mode 100644
index 00000000..0b94dbcc
--- /dev/null
+++ b/vun/vun_test.go
@@ -0,0 +1,1120 @@
+package vun
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "vun"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vun_TZ/vun_TZ.go b/vun_TZ/vun_TZ.go
index 6196fd61..fe0d0f1a 100644
--- a/vun_TZ/vun_TZ.go
+++ b/vun_TZ/vun_TZ.go
@@ -59,7 +59,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"KK", "BK"},
erasNarrow: []string{"", ""},
erasWide: []string{"Kabla ya Kristu", "Baada ya Kristu"},
- timezones: map[string]string{"IST": "IST", "WITA": "WITA", "ACDT": "ACDT", "ART": "ART", "CLST": "CLST", "AKST": "AKST", "AKDT": "AKDT", "CHAST": "CHAST", "JDT": "JDT", "MEZ": "MEZ", "MESZ": "MESZ", "ADT": "ADT", "SGT": "SGT", "HAT": "HAT", "HNT": "HNT", "WIT": "WIT", "SRT": "SRT", "UYST": "UYST", "HADT": "HADT", "WAST": "WAST", "WART": "WART", "PDT": "PDT", "UYT": "UYT", "CLT": "CLT", "COST": "COST", "AST": "AST", "HKT": "HKT", "OESZ": "OESZ", "MYT": "MYT", "JST": "JST", "CDT": "CDT", "MST": "MST", "∅∅∅": "∅∅∅", "GYT": "GYT", "NZST": "NZST", "CHADT": "CHADT", "HAST": "HAST", "SAST": "SAST", "WIB": "WIB", "LHST": "LHST", "CST": "CST", "ACST": "ACST", "AWDT": "AWDT", "COT": "COT", "BT": "BT", "HKST": "HKST", "OEZ": "OEZ", "GMT": "GMT", "GFT": "GFT", "ARST": "ARST", "LHDT": "LHDT", "VET": "VET", "TMST": "TMST", "PST": "PST", "NZDT": "NZDT", "AWST": "AWST", "WESZ": "WESZ", "ACWDT": "ACWDT", "WAT": "WAT", "ChST": "ChST", "CAT": "CAT", "EAT": "EAT", "MDT": "MDT", "TMT": "TMT", "BOT": "BOT", "WEZ": "WEZ", "ACWST": "ACWST", "AEDT": "AEDT", "EDT": "EDT", "WARST": "WARST", "AEST": "AEST", "EST": "EST", "ECT": "ECT"},
+ timezones: map[string]string{"CST": "CST", "HKT": "HKT", "HNT": "HNT", "CLT": "CLT", "WART": "WART", "COST": "COST", "CDT": "CDT", "WITA": "WITA", "PST": "PST", "HAT": "HAT", "AEST": "AEST", "LHST": "LHST", "ARST": "ARST", "PDT": "PDT", "HADT": "HADT", "ACWST": "ACWST", "AWDT": "AWDT", "EAT": "EAT", "JDT": "JDT", "NZST": "NZST", "TMST": "TMST", "CAT": "CAT", "AEDT": "AEDT", "ChST": "ChST", "TMT": "TMT", "VET": "VET", "MEZ": "MEZ", "SGT": "SGT", "COT": "COT", "WESZ": "WESZ", "OESZ": "OESZ", "∅∅∅": "∅∅∅", "AKDT": "AKDT", "AST": "AST", "EDT": "EDT", "WIB": "WIB", "UYT": "UYT", "UYST": "UYST", "WEZ": "WEZ", "MST": "MST", "MESZ": "MESZ", "MYT": "MYT", "CHAST": "CHAST", "HKST": "HKST", "WAST": "WAST", "OEZ": "OEZ", "ECT": "ECT", "ACST": "ACST", "ACDT": "ACDT", "CHADT": "CHADT", "ART": "ART", "EST": "EST", "BOT": "BOT", "GYT": "GYT", "MDT": "MDT", "WAT": "WAT", "JST": "JST", "AKST": "AKST", "ADT": "ADT", "NZDT": "NZDT", "SAST": "SAST", "IST": "IST", "WIT": "WIT", "SRT": "SRT", "CLST": "CLST", "BT": "BT", "WARST": "WARST", "GFT": "GFT", "ACWDT": "ACWDT", "AWST": "AWST", "GMT": "GMT", "LHDT": "LHDT", "HAST": "HAST"},
}
}
diff --git a/vun_TZ/vun_TZ_test.go b/vun_TZ/vun_TZ_test.go
new file mode 100644
index 00000000..65f3dc0d
--- /dev/null
+++ b/vun_TZ/vun_TZ_test.go
@@ -0,0 +1,1120 @@
+package vun_TZ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "vun_TZ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/wae/wae.go b/wae/wae.go
index 3118aeaf..8308f34f 100644
--- a/wae/wae.go
+++ b/wae/wae.go
@@ -67,7 +67,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"v. Chr.", "n. Chr"},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"JDT": "JDT", "CDT": "CDT", "BT": "BT", "WAT": "WAT", "OESZ": "Ošteuropäiši Summerzit", "MYT": "MYT", "CLT": "CLT", "ACST": "ACST", "TMST": "TMST", "NZDT": "NZDT", "BOT": "BOT", "∅∅∅": "∅∅∅", "CAT": "CAT", "ARST": "ARST", "PST": "PST", "WIB": "WIB", "IST": "IST", "PDT": "PDT", "GYT": "GYT", "AEDT": "AEDT", "MST": "MST", "VET": "VET", "WEZ": "Wešteuropäiši Standardzit", "SRT": "SRT", "UYST": "UYST", "ACWDT": "ACWDT", "HKST": "HKST", "GMT": "GMT", "GFT": "GFT", "WITA": "WITA", "CHAST": "CHAST", "CLST": "CLST", "WESZ": "Wešteuropäiši Summerzit", "EDT": "EDT", "ChST": "ChST", "HADT": "HADT", "LHDT": "LHDT", "ECT": "ECT", "SGT": "SGT", "AWST": "AWST", "HKT": "HKT", "WART": "WART", "ACDT": "ACDT", "TMT": "TMT", "EAT": "EAT", "NZST": "NZST", "CST": "CST", "WARST": "WARST", "HAT": "HAT", "MESZ": "Mitteleuropäiši Summerzit", "AWDT": "AWDT", "AKST": "AKST", "AST": "Atlantiši Standardzit", "SAST": "SAST", "WAST": "WAST", "HNT": "HNT", "AKDT": "AKDT", "MEZ": "Mitteleuropäiši Standardzit", "AEST": "AEST", "CHADT": "CHADT", "OEZ": "Ošteuropäiši Standardzit", "LHST": "LHST", "EST": "EST", "ADT": "Atlantiši Summerzit", "JST": "JST", "UYT": "UYT", "MDT": "MDT", "ACWST": "ACWST", "COT": "COT", "COST": "COST", "HAST": "HAST", "WIT": "WIT", "ART": "ART"},
+ timezones: map[string]string{"WART": "WART", "CAT": "CAT", "COST": "COST", "OESZ": "Ošteuropäiši Summerzit", "AEDT": "AEDT", "HAST": "HAST", "NZST": "NZST", "WARST": "WARST", "JST": "JST", "AST": "Atlantiši Standardzit", "HAT": "HAT", "CLST": "CLST", "ACST": "ACST", "TMST": "TMST", "MST": "MST", "SAST": "SAST", "GMT": "GMT", "VET": "VET", "JDT": "JDT", "ARST": "ARST", "PDT": "PDT", "WIB": "WIB", "LHST": "LHST", "SRT": "SRT", "CHADT": "CHADT", "OEZ": "Ošteuropäiši Standardzit", "GYT": "GYT", "BT": "BT", "MYT": "MYT", "WESZ": "Wešteuropäiši Summerzit", "CHAST": "CHAST", "ACWST": "ACWST", "NZDT": "NZDT", "CLT": "CLT", "UYST": "UYST", "HKT": "HKT", "MEZ": "Mitteleuropäiši Standardzit", "AWST": "AWST", "BOT": "BOT", "PST": "PST", "IST": "IST", "EDT": "EDT", "WEZ": "Wešteuropäiši Standardzit", "GFT": "GFT", "EST": "EST", "ChST": "ChST", "WAT": "WAT", "WIT": "WIT", "ADT": "Atlantiši Summerzit", "COT": "COT", "WAST": "WAST", "UYT": "UYT", "ECT": "ECT", "AKDT": "AKDT", "TMT": "TMT", "HNT": "HNT", "AEST": "AEST", "∅∅∅": "∅∅∅", "HADT": "HADT", "MESZ": "Mitteleuropäiši Summerzit", "AKST": "AKST", "ACWDT": "ACWDT", "AWDT": "AWDT", "SGT": "SGT", "CST": "CST", "CDT": "CDT", "HKST": "HKST", "ACDT": "ACDT", "WITA": "WITA", "ART": "ART", "EAT": "EAT", "LHDT": "LHDT", "MDT": "MDT"},
}
}
diff --git a/wae/wae_test.go b/wae/wae_test.go
new file mode 100644
index 00000000..67ee9a4c
--- /dev/null
+++ b/wae/wae_test.go
@@ -0,0 +1,1120 @@
+package wae
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "wae"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/wae_CH/wae_CH.go b/wae_CH/wae_CH.go
index c650bf6d..7b2fb81e 100644
--- a/wae_CH/wae_CH.go
+++ b/wae_CH/wae_CH.go
@@ -67,7 +67,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"v. Chr.", "n. Chr"},
erasNarrow: []string{"", ""},
erasWide: []string{"", ""},
- timezones: map[string]string{"ACDT": "ACDT", "AEDT": "AEDT", "COT": "COT", "COST": "COST", "ARST": "ARST", "LHDT": "LHDT", "AEST": "AEST", "CAT": "CAT", "AST": "Atlantiši Standardzit", "NZDT": "NZDT", "CHADT": "CHADT", "CLT": "CLT", "VET": "VET", "WEZ": "Wešteuropäiši Standardzit", "WESZ": "Wešteuropäiši Summerzit", "GMT": "GMT", "EAT": "EAT", "MST": "MST", "ECT": "ECT", "WART": "WART", "AWST": "AWST", "NZST": "NZST", "UYST": "UYST", "ChST": "ChST", "WAST": "WAST", "OEZ": "Ošteuropäiši Standardzit", "UYT": "UYT", "MESZ": "Mitteleuropäiši Summerzit", "JDT": "JDT", "CST": "CST", "AWDT": "AWDT", "MYT": "MYT", "WIB": "WIB", "MEZ": "Mitteleuropäiši Standardzit", "WAT": "WAT", "GFT": "GFT", "CDT": "CDT", "ACWDT": "ACWDT", "IST": "IST", "SRT": "SRT", "HADT": "HADT", "HAT": "HAT", "TMST": "TMST", "JST": "JST", "HKST": "HKST", "ACST": "ACST", "BT": "BT", "WIT": "WIT", "PDT": "PDT", "SGT": "SGT", "HAST": "HAST", "GYT": "GYT", "PST": "PST", "BOT": "BOT", "WARST": "WARST", "HNT": "HNT", "WITA": "WITA", "MDT": "MDT", "LHST": "LHST", "AKDT": "AKDT", "ACWST": "ACWST", "∅∅∅": "∅∅∅", "EST": "EST", "TMT": "TMT", "AKST": "AKST", "HKT": "HKT", "OESZ": "Ošteuropäiši Summerzit", "SAST": "SAST", "ART": "ART", "CHAST": "CHAST", "CLST": "CLST", "EDT": "EDT", "ADT": "Atlantiši Summerzit"},
+ timezones: map[string]string{"GYT": "GYT", "CHADT": "CHADT", "SAST": "SAST", "UYST": "UYST", "EAT": "EAT", "ACST": "ACST", "ACDT": "ACDT", "CST": "CST", "GFT": "GFT", "BOT": "BOT", "WIT": "WIT", "MESZ": "Mitteleuropäiši Summerzit", "LHST": "LHST", "MST": "MST", "AWST": "AWST", "AWDT": "AWDT", "JST": "JST", "EST": "EST", "TMST": "TMST", "AEST": "AEST", "AEDT": "AEDT", "LHDT": "LHDT", "TMT": "TMT", "MYT": "MYT", "HKST": "HKST", "ADT": "Atlantiši Summerzit", "NZST": "NZST", "WEZ": "Wešteuropäiši Standardzit", "WESZ": "Wešteuropäiši Summerzit", "HNT": "HNT", "ChST": "ChST", "JDT": "JDT", "EDT": "EDT", "HAT": "HAT", "CLST": "CLST", "∅∅∅": "∅∅∅", "AKST": "AKST", "OEZ": "Ošteuropäiši Standardzit", "CDT": "CDT", "PST": "PST", "NZDT": "NZDT", "BT": "BT", "CLT": "CLT", "UYT": "UYT", "ECT": "ECT", "VET": "VET", "ART": "ART", "CAT": "CAT", "WART": "WART", "AST": "Atlantiši Standardzit", "WITA": "WITA", "AKDT": "AKDT", "WIB": "WIB", "MDT": "MDT", "CHAST": "CHAST", "ACWST": "ACWST", "PDT": "PDT", "HADT": "HADT", "WAST": "WAST", "COT": "COT", "COST": "COST", "GMT": "GMT", "WARST": "WARST", "SRT": "SRT", "HKT": "HKT", "ACWDT": "ACWDT", "HAST": "HAST", "WAT": "WAT", "OESZ": "Ošteuropäiši Summerzit", "ARST": "ARST", "IST": "IST", "MEZ": "Mitteleuropäiši Standardzit", "SGT": "SGT"},
}
}
diff --git a/wae_CH/wae_CH_test.go b/wae_CH/wae_CH_test.go
new file mode 100644
index 00000000..8496b5bd
--- /dev/null
+++ b/wae_CH/wae_CH_test.go
@@ -0,0 +1,1120 @@
+package wae_CH
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "wae_CH"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/xog/xog.go b/xog/xog.go
index 2a99b56d..8f7a238f 100644
--- a/xog/xog.go
+++ b/xog/xog.go
@@ -63,7 +63,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"AZ", "AF"},
erasNarrow: []string{"", ""},
erasWide: []string{"Kulisto nga azilawo", "Kulisto nga affile"},
- timezones: map[string]string{"CLT": "CLT", "LHDT": "LHDT", "CDT": "CDT", "AEST": "AEST", "ART": "ART", "AWST": "AWST", "SRT": "SRT", "NZDT": "NZDT", "CHADT": "CHADT", "COST": "COST", "ARST": "ARST", "AKDT": "AKDT", "ChST": "ChST", "WESZ": "WESZ", "HNT": "HNT", "PDT": "PDT", "UYST": "UYST", "ACWST": "ACWST", "CLST": "CLST", "VET": "VET", "COT": "COT", "WIT": "WIT", "WIB": "WIB", "MEZ": "MEZ", "MST": "MST", "LHST": "LHST", "UYT": "UYT", "CST": "CST", "AEDT": "AEDT", "∅∅∅": "∅∅∅", "CAT": "CAT", "SAST": "SAST", "GFT": "GFT", "EAT": "EAT", "PST": "PST", "BOT": "BOT", "EDT": "EDT", "BT": "BT", "WART": "WART", "OEZ": "OEZ", "WAT": "WAT", "WEZ": "WEZ", "SGT": "SGT", "HKT": "HKT", "MESZ": "MESZ", "MDT": "MDT", "ACDT": "ACDT", "MYT": "MYT", "ACST": "ACST", "WITA": "WITA", "HAST": "HAST", "HADT": "HADT", "AST": "AST", "WARST": "WARST", "OESZ": "OESZ", "TMT": "TMT", "GYT": "GYT", "EST": "EST", "AKST": "AKST", "JDT": "JDT", "GMT": "GMT", "AWDT": "AWDT", "JST": "JST", "NZST": "NZST", "ACWDT": "ACWDT", "HAT": "HAT", "WAST": "WAST", "HKST": "HKST", "IST": "IST", "ADT": "ADT", "ECT": "ECT", "TMST": "TMST", "CHAST": "CHAST"},
+ timezones: map[string]string{"AKDT": "AKDT", "AST": "AST", "HAST": "HAST", "LHST": "LHST", "WART": "WART", "SRT": "SRT", "TMST": "TMST", "WAST": "WAST", "HNT": "HNT", "AEST": "AEST", "WIT": "WIT", "AWDT": "AWDT", "PST": "PST", "PDT": "PDT", "BOT": "BOT", "LHDT": "LHDT", "ACDT": "ACDT", "CHAST": "CHAST", "JST": "JST", "ACWST": "ACWST", "WAT": "WAT", "MYT": "MYT", "ACWDT": "ACWDT", "ART": "ART", "COST": "COST", "AKST": "AKST", "EDT": "EDT", "WIB": "WIB", "CDT": "CDT", "AWST": "AWST", "WEZ": "WEZ", "WESZ": "WESZ", "GYT": "GYT", "GMT": "GMT", "CLT": "CLT", "CHADT": "CHADT", "ECT": "ECT", "IST": "IST", "SAST": "SAST", "EST": "EST", "TMT": "TMT", "CAT": "CAT", "SGT": "SGT", "CLST": "CLST", "HADT": "HADT", "OESZ": "OESZ", "UYT": "UYT", "VET": "VET", "NZST": "NZST", "MDT": "MDT", "∅∅∅": "∅∅∅", "WARST": "WARST", "HKT": "HKT", "WITA": "WITA", "MESZ": "MESZ", "COT": "COT", "ChST": "ChST", "EAT": "EAT", "ADT": "ADT", "MEZ": "MEZ", "HAT": "HAT", "CST": "CST", "GFT": "GFT", "JDT": "JDT", "ARST": "ARST", "OEZ": "OEZ", "BT": "BT", "ACST": "ACST", "NZDT": "NZDT", "AEDT": "AEDT", "UYST": "UYST", "MST": "MST", "HKST": "HKST"},
}
}
diff --git a/xog/xog_test.go b/xog/xog_test.go
new file mode 100644
index 00000000..47a38a3e
--- /dev/null
+++ b/xog/xog_test.go
@@ -0,0 +1,1120 @@
+package xog
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "xog"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/xog_UG/xog_UG.go b/xog_UG/xog_UG.go
index d9697376..78a47903 100644
--- a/xog_UG/xog_UG.go
+++ b/xog_UG/xog_UG.go
@@ -63,7 +63,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"AZ", "AF"},
erasNarrow: []string{"", ""},
erasWide: []string{"Kulisto nga azilawo", "Kulisto nga affile"},
- timezones: map[string]string{"HADT": "HADT", "CHADT": "CHADT", "EDT": "EDT", "MST": "MST", "MYT": "MYT", "CAT": "CAT", "WIT": "WIT", "∅∅∅": "∅∅∅", "ACDT": "ACDT", "SGT": "SGT", "AKDT": "AKDT", "MEZ": "MEZ", "CLST": "CLST", "WART": "WART", "AWDT": "AWDT", "JDT": "JDT", "GYT": "GYT", "PDT": "PDT", "ECT": "ECT", "AST": "AST", "WARST": "WARST", "SAST": "SAST", "HAT": "HAT", "MDT": "MDT", "WITA": "WITA", "CHAST": "CHAST", "ACWDT": "ACWDT", "COST": "COST", "EST": "EST", "PST": "PST", "AEST": "AEST", "ADT": "ADT", "HAST": "HAST", "BT": "BT", "HKT": "HKT", "EAT": "EAT", "CST": "CST", "NZDT": "NZDT", "GFT": "GFT", "TMST": "TMST", "UYT": "UYT", "HKST": "HKST", "WAT": "WAT", "GMT": "GMT", "TMT": "TMT", "LHDT": "LHDT", "OESZ": "OESZ", "NZST": "NZST", "CLT": "CLT", "WEZ": "WEZ", "WESZ": "WESZ", "HNT": "HNT", "WIB": "WIB", "SRT": "SRT", "AKST": "AKST", "VET": "VET", "ACST": "ACST", "ARST": "ARST", "CDT": "CDT", "IST": "IST", "OEZ": "OEZ", "ACWST": "ACWST", "COT": "COT", "WAST": "WAST", "JST": "JST", "MESZ": "MESZ", "LHST": "LHST", "BOT": "BOT", "UYST": "UYST", "AEDT": "AEDT", "ChST": "ChST", "ART": "ART", "AWST": "AWST"},
+ timezones: map[string]string{"ARST": "ARST", "∅∅∅": "∅∅∅", "SGT": "SGT", "COT": "COT", "AEDT": "AEDT", "GYT": "GYT", "JST": "JST", "CAT": "CAT", "ECT": "ECT", "MYT": "MYT", "JDT": "JDT", "WESZ": "WESZ", "ACDT": "ACDT", "GFT": "GFT", "ACWDT": "ACWDT", "BOT": "BOT", "ChST": "ChST", "WARST": "WARST", "OESZ": "OESZ", "ACWST": "ACWST", "AWST": "AWST", "PST": "PST", "HAST": "HAST", "HADT": "HADT", "WEZ": "WEZ", "OEZ": "OEZ", "AEST": "AEST", "LHST": "LHST", "CLT": "CLT", "ACST": "ACST", "CHAST": "CHAST", "AWDT": "AWDT", "NZDT": "NZDT", "CHADT": "CHADT", "AKST": "AKST", "ADT": "ADT", "WAT": "WAT", "HKST": "HKST", "ART": "ART", "SAST": "SAST", "HNT": "HNT", "HAT": "HAT", "MDT": "MDT", "UYT": "UYT", "WART": "WART", "AKDT": "AKDT", "TMST": "TMST", "WAST": "WAST", "WIT": "WIT", "HKT": "HKT", "BT": "BT", "MST": "MST", "EDT": "EDT", "WIB": "WIB", "LHDT": "LHDT", "VET": "VET", "AST": "AST", "EST": "EST", "MEZ": "MEZ", "NZST": "NZST", "COST": "COST", "CDT": "CDT", "SRT": "SRT", "MESZ": "MESZ", "GMT": "GMT", "EAT": "EAT", "CLST": "CLST", "WITA": "WITA", "IST": "IST", "PDT": "PDT", "TMT": "TMT", "UYST": "UYST", "CST": "CST"},
}
}
diff --git a/xog_UG/xog_UG_test.go b/xog_UG/xog_UG_test.go
new file mode 100644
index 00000000..3bc5ee1f
--- /dev/null
+++ b/xog_UG/xog_UG_test.go
@@ -0,0 +1,1120 @@
+package xog_UG
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "xog_UG"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/yav/yav.go b/yav/yav.go
index 8b315489..c59d90bc 100644
--- a/yav/yav.go
+++ b/yav/yav.go
@@ -66,7 +66,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"k.Y.", "+J.C."},
erasNarrow: []string{"", ""},
erasWide: []string{"katikupíen Yésuse", "ékélémkúnupíén n"},
- timezones: map[string]string{"MEZ": "MEZ", "WESZ": "WESZ", "WIB": "WIB", "CHADT": "CHADT", "ART": "ART", "SGT": "SGT", "WART": "WART", "WAT": "WAT", "TMST": "TMST", "UYST": "UYST", "NZST": "NZST", "NZDT": "NZDT", "BOT": "BOT", "BT": "BT", "OEZ": "OEZ", "MDT": "MDT", "AKDT": "AKDT", "AEST": "AEST", "COT": "COT", "WAST": "WAST", "HAT": "HAT", "MST": "MST", "VET": "VET", "HADT": "HADT", "IST": "IST", "SRT": "SRT", "AKST": "AKST", "PST": "PST", "AWDT": "AWDT", "ChST": "ChST", "EST": "EST", "AST": "AST", "EAT": "EAT", "JST": "JST", "∅∅∅": "∅∅∅", "MESZ": "MESZ", "CLT": "CLT", "HKST": "HKST", "PDT": "PDT", "CST": "CST", "CHAST": "CHAST", "AEDT": "AEDT", "COST": "COST", "HAST": "HAST", "WITA": "WITA", "CDT": "CDT", "EDT": "EDT", "ADT": "ADT", "GMT": "GMT", "ACST": "ACST", "MYT": "MYT", "ACWDT": "ACWDT", "WARST": "WARST", "SAST": "SAST", "HKT": "HKT", "HNT": "HNT", "ACWST": "ACWST", "JDT": "JDT", "AWST": "AWST", "LHST": "LHST", "CLST": "CLST", "UYT": "UYT", "ACDT": "ACDT", "ARST": "ARST", "GYT": "GYT", "LHDT": "LHDT", "OESZ": "OESZ", "TMT": "TMT", "WEZ": "WEZ", "CAT": "CAT", "ECT": "ECT", "GFT": "GFT", "WIT": "WIT"},
+ timezones: map[string]string{"LHDT": "LHDT", "CST": "CST", "AWDT": "AWDT", "PST": "PST", "COT": "COT", "ACWDT": "ACWDT", "NZDT": "NZDT", "CLT": "CLT", "CLST": "CLST", "∅∅∅": "∅∅∅", "VET": "VET", "ECT": "ECT", "ART": "ART", "JDT": "JDT", "SRT": "SRT", "ACDT": "ACDT", "ADT": "ADT", "PDT": "PDT", "OESZ": "OESZ", "HADT": "HADT", "WAT": "WAT", "CDT": "CDT", "WART": "WART", "JST": "JST", "AKST": "AKST", "EAT": "EAT", "TMST": "TMST", "WESZ": "WESZ", "HNT": "HNT", "ChST": "ChST", "ARST": "ARST", "MESZ": "MESZ", "WAST": "WAST", "MDT": "MDT", "WIB": "WIB", "HAT": "HAT", "AEDT": "AEDT", "HAST": "HAST", "BOT": "BOT", "SAST": "SAST", "CAT": "CAT", "ACST": "ACST", "MST": "MST", "HKST": "HKST", "WITA": "WITA", "UYST": "UYST", "ACWST": "ACWST", "SGT": "SGT", "UYT": "UYT", "WEZ": "WEZ", "IST": "IST", "GYT": "GYT", "AEST": "AEST", "BT": "BT", "GFT": "GFT", "CHADT": "CHADT", "AWST": "AWST", "NZST": "NZST", "LHST": "LHST", "CHAST": "CHAST", "AKDT": "AKDT", "OEZ": "OEZ", "MYT": "MYT", "EDT": "EDT", "COST": "COST", "TMT": "TMT", "WIT": "WIT", "WARST": "WARST", "AST": "AST", "MEZ": "MEZ", "EST": "EST", "HKT": "HKT", "GMT": "GMT"},
}
}
@@ -122,7 +122,7 @@ func (yav *yav) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (yav *yav) MonthsNarrow() []string {
- return yav.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/yav/yav_test.go b/yav/yav_test.go
new file mode 100644
index 00000000..e603f0b2
--- /dev/null
+++ b/yav/yav_test.go
@@ -0,0 +1,1120 @@
+package yav
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "yav"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/yav_CM/yav_CM.go b/yav_CM/yav_CM.go
index 22e421ef..a6b7ec5b 100644
--- a/yav_CM/yav_CM.go
+++ b/yav_CM/yav_CM.go
@@ -66,7 +66,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"k.Y.", "+J.C."},
erasNarrow: []string{"", ""},
erasWide: []string{"katikupíen Yésuse", "ékélémkúnupíén n"},
- timezones: map[string]string{"HADT": "HADT", "GFT": "GFT", "WITA": "WITA", "TMST": "TMST", "AKDT": "AKDT", "BOT": "BOT", "AST": "AST", "HKST": "HKST", "UYT": "UYT", "MEZ": "MEZ", "CHAST": "CHAST", "ECT": "ECT", "MDT": "MDT", "MYT": "MYT", "AWST": "AWST", "GYT": "GYT", "UYST": "UYST", "CHADT": "CHADT", "CLST": "CLST", "VET": "VET", "SAST": "SAST", "GMT": "GMT", "AEST": "AEST", "SGT": "SGT", "LHDT": "LHDT", "HAT": "HAT", "OESZ": "OESZ", "TMT": "TMT", "ChST": "ChST", "EDT": "EDT", "HAST": "HAST", "HNT": "HNT", "ACWST": "ACWST", "EST": "EST", "WAT": "WAT", "ACST": "ACST", "SRT": "SRT", "CLT": "CLT", "CAT": "CAT", "MST": "MST", "LHST": "LHST", "ART": "ART", "JST": "JST", "IST": "IST", "CST": "CST", "AEDT": "AEDT", "WESZ": "WESZ", "ADT": "ADT", "BT": "BT", "WIB": "WIB", "ACDT": "ACDT", "ACWDT": "ACWDT", "∅∅∅": "∅∅∅", "WARST": "WARST", "WEZ": "WEZ", "COT": "COT", "COST": "COST", "WAST": "WAST", "JDT": "JDT", "HKT": "HKT", "OEZ": "OEZ", "NZST": "NZST", "CDT": "CDT", "WIT": "WIT", "AKST": "AKST", "AWDT": "AWDT", "PDT": "PDT", "WART": "WART", "EAT": "EAT", "NZDT": "NZDT", "MESZ": "MESZ", "ARST": "ARST", "PST": "PST"},
+ timezones: map[string]string{"MST": "MST", "ADT": "ADT", "HAT": "HAT", "OEZ": "OEZ", "WIT": "WIT", "HKST": "HKST", "ACWST": "ACWST", "CLST": "CLST", "∅∅∅": "∅∅∅", "AWST": "AWST", "ARST": "ARST", "MEZ": "MEZ", "MESZ": "MESZ", "PST": "PST", "WAT": "WAT", "COST": "COST", "OESZ": "OESZ", "AEST": "AEST", "ACDT": "ACDT", "AST": "AST", "WESZ": "WESZ", "UYST": "UYST", "AWDT": "AWDT", "NZST": "NZST", "HADT": "HADT", "CDT": "CDT", "SRT": "SRT", "CHADT": "CHADT", "WITA": "WITA", "IST": "IST", "HAST": "HAST", "SGT": "SGT", "UYT": "UYT", "LHST": "LHST", "ACWDT": "ACWDT", "TMST": "TMST", "CAT": "CAT", "BT": "BT", "CST": "CST", "AEDT": "AEDT", "CHAST": "CHAST", "AKST": "AKST", "PDT": "PDT", "GYT": "GYT", "LHDT": "LHDT", "WART": "WART", "GFT": "GFT", "HKT": "HKT", "VET": "VET", "ART": "ART", "WAST": "WAST", "WEZ": "WEZ", "EAT": "EAT", "MYT": "MYT", "WARST": "WARST", "ECT": "ECT", "JDT": "JDT", "NZDT": "NZDT", "HNT": "HNT", "COT": "COT", "MDT": "MDT", "CLT": "CLT", "ACST": "ACST", "JST": "JST", "BOT": "BOT", "EST": "EST", "ChST": "ChST", "AKDT": "AKDT", "SAST": "SAST", "WIB": "WIB", "TMT": "TMT", "GMT": "GMT", "EDT": "EDT"},
}
}
@@ -122,7 +122,7 @@ func (yav *yav_CM) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (yav *yav_CM) MonthsNarrow() []string {
- return yav.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/yav_CM/yav_CM_test.go b/yav_CM/yav_CM_test.go
new file mode 100644
index 00000000..030467dc
--- /dev/null
+++ b/yav_CM/yav_CM_test.go
@@ -0,0 +1,1120 @@
+package yav_CM
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "yav_CM"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/yi/yi.go b/yi/yi.go
index 49f6058e..36b793ab 100644
--- a/yi/yi.go
+++ b/yi/yi.go
@@ -69,7 +69,7 @@ func New() locales.Translator {
daysWide: []string{"זונטיק", "מאָנטיק", "דינסטיק", "מיטוואך", "דאנערשטיק", "פֿרײַטיק", "שבת"},
periodsAbbreviated: []string{"פֿאַרמיטאָג", "נאָכמיטאָג"},
periodsWide: []string{"פֿאַרמיטאָג", "נאָכמיטאָג"},
- timezones: map[string]string{"ADT": "ADT", "SGT": "SGT", "WAST": "WAST", "HKT": "HKT", "IST": "IST", "OEZ": "OEZ", "WEZ": "WEZ", "WIB": "WIB", "HADT": "HADT", "SAST": "SAST", "AKDT": "AKDT", "PDT": "PDT", "LHST": "LHST", "NZDT": "NZDT", "ChST": "ChST", "GFT": "GFT", "WITA": "WITA", "MDT": "MDT", "GYT": "GYT", "VET": "VET", "AST": "AST", "HAST": "HAST", "HKST": "HKST", "WIT": "WIT", "AWDT": "AWDT", "CHADT": "CHADT", "WART": "WART", "GMT": "GMT", "HNT": "HNT", "TMST": "TMST", "CLST": "CLST", "AEDT": "AEDT", "ARST": "ARST", "JDT": "JDT", "COST": "COST", "ART": "ART", "BOT": "BOT", "UYT": "UYT", "UYST": "UYST", "ECT": "ECT", "∅∅∅": "∅∅∅", "HAT": "HAT", "MST": "MST", "AWST": "AWST", "MYT": "MYT", "TMT": "TMT", "MESZ": "MESZ", "CLT": "CLT", "EST": "EST", "BT": "BT", "AKST": "AKST", "CDT": "CDT", "WARST": "WARST", "OESZ": "OESZ", "ACST": "ACST", "WAT": "WAT", "MEZ": "MEZ", "NZST": "NZST", "ACWDT": "ACWDT", "AEST": "AEST", "CHAST": "CHAST", "EDT": "EDT", "JST": "JST", "WESZ": "WESZ", "CAT": "CAT", "EAT": "EAT", "ACDT": "ACDT", "SRT": "SRT", "PST": "PST", "LHDT": "LHDT", "CST": "CST", "ACWST": "ACWST", "COT": "COT"},
+ timezones: map[string]string{"WAT": "WAT", "WEZ": "WEZ", "COST": "COST", "OESZ": "OESZ", "UYT": "UYT", "CST": "CST", "SRT": "SRT", "AKDT": "AKDT", "ADT": "ADT", "AWDT": "AWDT", "ART": "ART", "NZST": "NZST", "EST": "EST", "EDT": "EDT", "UYST": "UYST", "EAT": "EAT", "CDT": "CDT", "SAST": "SAST", "CAT": "CAT", "GMT": "GMT", "CLST": "CLST", "WARST": "WARST", "HKST": "HKST", "LHST": "LHST", "PST": "PST", "WAST": "WAST", "WIT": "WIT", "HKT": "HKT", "VET": "VET", "ARST": "ARST", "PDT": "PDT", "HADT": "HADT", "SGT": "SGT", "ACST": "ACST", "HNT": "HNT", "JST": "JST", "WITA": "WITA", "AEDT": "AEDT", "MST": "MST", "MDT": "MDT", "ECT": "ECT", "MESZ": "MESZ", "CLT": "CLT", "ACDT": "ACDT", "JDT": "JDT", "ACWDT": "ACWDT", "WIB": "WIB", "WESZ": "WESZ", "CHAST": "CHAST", "IST": "IST", "AST": "AST", "AWST": "AWST", "ChST": "ChST", "GYT": "GYT", "AKST": "AKST", "MEZ": "MEZ", "COT": "COT", "MYT": "MYT", "GFT": "GFT", "ACWST": "ACWST", "TMT": "TMT", "HAT": "HAT", "WART": "WART", "NZDT": "NZDT", "HAST": "HAST", "∅∅∅": "∅∅∅", "BT": "BT", "LHDT": "LHDT", "CHADT": "CHADT", "BOT": "BOT", "TMST": "TMST", "OEZ": "OEZ", "AEST": "AEST"},
}
}
@@ -133,7 +133,7 @@ func (yi *yi) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (yi *yi) MonthsNarrow() []string {
- return yi.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/yi/yi_test.go b/yi/yi_test.go
new file mode 100644
index 00000000..1b5cdaa9
--- /dev/null
+++ b/yi/yi_test.go
@@ -0,0 +1,1120 @@
+package yi
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "yi"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/yi_001/yi_001.go b/yi_001/yi_001.go
index 60e2a62a..2bdcb8c0 100644
--- a/yi_001/yi_001.go
+++ b/yi_001/yi_001.go
@@ -69,7 +69,7 @@ func New() locales.Translator {
daysWide: []string{"זונטיק", "מאָנטיק", "דינסטיק", "מיטוואך", "דאנערשטיק", "פֿרײַטיק", "שבת"},
periodsAbbreviated: []string{"פֿאַרמיטאָג", "נאָכמיטאָג"},
periodsWide: []string{"פֿאַרמיטאָג", "נאָכמיטאָג"},
- timezones: map[string]string{"CAT": "CAT", "WARST": "WARST", "TMST": "TMST", "MST": "MST", "BOT": "BOT", "HKST": "HKST", "GFT": "GFT", "VET": "VET", "ACWDT": "ACWDT", "OESZ": "OESZ", "MDT": "MDT", "WEZ": "WEZ", "AEDT": "AEDT", "MYT": "MYT", "JDT": "JDT", "AKDT": "AKDT", "∅∅∅": "∅∅∅", "EDT": "EDT", "COST": "COST", "AST": "AST", "WIB": "WIB", "NZST": "NZST", "AWDT": "AWDT", "UYT": "UYT", "WESZ": "WESZ", "WITA": "WITA", "WIT": "WIT", "GMT": "GMT", "ACDT": "ACDT", "PDT": "PDT", "CHADT": "CHADT", "EST": "EST", "IST": "IST", "OEZ": "OEZ", "HNT": "HNT", "CHAST": "CHAST", "HADT": "HADT", "SAST": "SAST", "JST": "JST", "AWST": "AWST", "MESZ": "MESZ", "HAT": "HAT", "ACST": "ACST", "ChST": "ChST", "COT": "COT", "HKT": "HKT", "GYT": "GYT", "ECT": "ECT", "NZDT": "NZDT", "ACWST": "ACWST", "WART": "WART", "ART": "ART", "ARST": "ARST", "PST": "PST", "CLT": "CLT", "HAST": "HAST", "BT": "BT", "SRT": "SRT", "CST": "CST", "LHDT": "LHDT", "CLST": "CLST", "ADT": "ADT", "SGT": "SGT", "WAT": "WAT", "TMT": "TMT", "AKST": "AKST", "WAST": "WAST", "EAT": "EAT", "CDT": "CDT", "UYST": "UYST", "LHST": "LHST", "MEZ": "MEZ", "AEST": "AEST"},
+ timezones: map[string]string{"COST": "COST", "CLST": "CLST", "UYST": "UYST", "AWST": "AWST", "NZDT": "NZDT", "SGT": "SGT", "LHST": "LHST", "VET": "VET", "EDT": "EDT", "TMT": "TMT", "CLT": "CLT", "CST": "CST", "HAT": "HAT", "GYT": "GYT", "ADT": "ADT", "ACWDT": "ACWDT", "PST": "PST", "CAT": "CAT", "COT": "COT", "WESZ": "WESZ", "ChST": "ChST", "HKT": "HKT", "WITA": "WITA", "NZST": "NZST", "BOT": "BOT", "MST": "MST", "WARST": "WARST", "HAST": "HAST", "BT": "BT", "MDT": "MDT", "ART": "ART", "HADT": "HADT", "HNT": "HNT", "ECT": "ECT", "SAST": "SAST", "WIB": "WIB", "AST": "AST", "WEZ": "WEZ", "JST": "JST", "CHAST": "CHAST", "ARST": "ARST", "TMST": "TMST", "MYT": "MYT", "OEZ": "OEZ", "CHADT": "CHADT", "MESZ": "MESZ", "WAT": "WAT", "LHDT": "LHDT", "WART": "WART", "JDT": "JDT", "EST": "EST", "OESZ": "OESZ", "∅∅∅": "∅∅∅", "AEDT": "AEDT", "UYT": "UYT", "ACDT": "ACDT", "ACWST": "ACWST", "IST": "IST", "PDT": "PDT", "GMT": "GMT", "CDT": "CDT", "SRT": "SRT", "AWDT": "AWDT", "MEZ": "MEZ", "WAST": "WAST", "ACST": "ACST", "HKST": "HKST", "AKST": "AKST", "AKDT": "AKDT", "AEST": "AEST", "EAT": "EAT", "WIT": "WIT", "GFT": "GFT"},
}
}
@@ -133,7 +133,7 @@ func (yi *yi_001) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (yi *yi_001) MonthsNarrow() []string {
- return yi.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/yi_001/yi_001_test.go b/yi_001/yi_001_test.go
new file mode 100644
index 00000000..d76c9bb3
--- /dev/null
+++ b/yi_001/yi_001_test.go
@@ -0,0 +1,1120 @@
+package yi_001
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "yi_001"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/yo/yo.go b/yo/yo.go
index 95e44e11..e35e2393 100644
--- a/yo/yo.go
+++ b/yo/yo.go
@@ -61,7 +61,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"SK", "LK"},
erasNarrow: []string{"", ""},
erasWide: []string{"Saju Kristi", "Lehin Kristi"},
- timezones: map[string]string{"NZST": "NZST", "EST": "EST", "HKST": "HKST", "WAST": "WAST", "PDT": "PDT", "VET": "VET", "COT": "COT", "WIB": "WIB", "UYT": "UYT", "CLT": "CLT", "GYT": "GYT", "SRT": "SRT", "NZDT": "NZDT", "WESZ": "WESZ", "COST": "COST", "WAT": "WAT", "WITA": "WITA", "TMT": "TMT", "ADT": "ADT", "HAST": "HAST", "GMT": "GMT", "AEST": "AEST", "AWST": "AWST", "CHAST": "CHAST", "ECT": "ECT", "OEZ": "OEZ", "∅∅∅": "∅∅∅", "ACDT": "ACDT", "ChST": "ChST", "CAT": "CAT", "HKT": "HKT", "PST": "PST", "MESZ": "MESZ", "CHADT": "CHADT", "TMST": "TMST", "LHDT": "LHDT", "BOT": "BOT", "MEZ": "MEZ", "WEZ": "WEZ", "IST": "IST", "OESZ": "OESZ", "EAT": "EAT", "WARST": "WARST", "BT": "BT", "ACWST": "ACWST", "AKDT": "AKDT", "AWDT": "AWDT", "ACWDT": "ACWDT", "HADT": "HADT", "WART": "WART", "SAST": "SAST", "GFT": "GFT", "AKST": "AKST", "CST": "CST", "CLST": "CLST", "MYT": "MYT", "JST": "JST", "UYST": "UYST", "CDT": "CDT", "SGT": "SGT", "WIT": "WIT", "ACST": "ACST", "LHST": "LHST", "HNT": "HNT", "MDT": "MDT", "JDT": "JDT", "AEDT": "AEDT", "AST": "AST", "MST": "MST", "EDT": "EDT", "HAT": "HAT", "ART": "ART", "ARST": "ARST"},
+ timezones: map[string]string{"AEST": "AEST", "EAT": "EAT", "CST": "CST", "ACST": "ACST", "ECT": "ECT", "AWDT": "AWDT", "PDT": "PDT", "BOT": "BOT", "GYT": "GYT", "AKST": "AKST", "OESZ": "OESZ", "ACDT": "ACDT", "EDT": "EDT", "GMT": "GMT", "UYST": "UYST", "ARST": "ARST", "WITA": "WITA", "AST": "AST", "WEZ": "WEZ", "ChST": "ChST", "OEZ": "OEZ", "MYT": "MYT", "WARST": "WARST", "MDT": "MDT", "HKT": "HKT", "WIB": "WIB", "SAST": "SAST", "WAST": "WAST", "COST": "COST", "TMST": "TMST", "WAT": "WAT", "WIT": "WIT", "LHST": "LHST", "JDT": "JDT", "ACWST": "ACWST", "NZDT": "NZDT", "SRT": "SRT", "CDT": "CDT", "∅∅∅": "∅∅∅", "PST": "PST", "UYT": "UYT", "HAST": "HAST", "WART": "WART", "GFT": "GFT", "AWST": "AWST", "ADT": "ADT", "CHADT": "CHADT", "MEZ": "MEZ", "MESZ": "MESZ", "HADT": "HADT", "CAT": "CAT", "VET": "VET", "MST": "MST", "ACWDT": "ACWDT", "ART": "ART", "HNT": "HNT", "HAT": "HAT", "AKDT": "AKDT", "EST": "EST", "LHDT": "LHDT", "WESZ": "WESZ", "CHAST": "CHAST", "JST": "JST", "TMT": "TMT", "SGT": "SGT", "CLT": "CLT", "COT": "COT", "AEDT": "AEDT", "CLST": "CLST", "BT": "BT", "HKST": "HKST", "NZST": "NZST", "IST": "IST"},
}
}
@@ -117,7 +117,7 @@ func (yo *yo) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (yo *yo) MonthsNarrow() []string {
- return yo.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/yo/yo_test.go b/yo/yo_test.go
new file mode 100644
index 00000000..eb7a5289
--- /dev/null
+++ b/yo/yo_test.go
@@ -0,0 +1,1120 @@
+package yo
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "yo"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/yo_BJ/yo_BJ.go b/yo_BJ/yo_BJ.go
index d1abe333..a1316d96 100644
--- a/yo_BJ/yo_BJ.go
+++ b/yo_BJ/yo_BJ.go
@@ -61,7 +61,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"SK", "LK"},
erasNarrow: []string{"", ""},
erasWide: []string{"Saju Kristi", "Lehin Kristi"},
- timezones: map[string]string{"EAT": "EAT", "LHDT": "LHDT", "WITA": "WITA", "TMT": "TMT", "MYT": "MYT", "ACST": "ACST", "PST": "PST", "MEZ": "MEZ", "UYT": "UYT", "EST": "EST", "ECT": "ECT", "BT": "BT", "SRT": "SRT", "ADT": "ADT", "IST": "IST", "UYST": "UYST", "ACWST": "ACWST", "ACWDT": "ACWDT", "WAT": "WAT", "WIT": "WIT", "AKDT": "AKDT", "HAST": "HAST", "WAST": "WAST", "OESZ": "OESZ", "HNT": "HNT", "JST": "JST", "AWDT": "AWDT", "CDT": "CDT", "BOT": "BOT", "OEZ": "OEZ", "∅∅∅": "∅∅∅", "CLT": "CLT", "CLST": "CLST", "COT": "COT", "GMT": "GMT", "MST": "MST", "ART": "ART", "HKT": "HKT", "ACDT": "ACDT", "JDT": "JDT", "PDT": "PDT", "EDT": "EDT", "COST": "COST", "HADT": "HADT", "WESZ": "WESZ", "AEST": "AEST", "CAT": "CAT", "AWST": "AWST", "GYT": "GYT", "NZST": "NZST", "GFT": "GFT", "NZDT": "NZDT", "VET": "VET", "CST": "CST", "MESZ": "MESZ", "AEDT": "AEDT", "CHADT": "CHADT", "WARST": "WARST", "ARST": "ARST", "AKST": "AKST", "LHST": "LHST", "WEZ": "WEZ", "AST": "AST", "SAST": "SAST", "HKST": "HKST", "WART": "WART", "WIB": "WIB", "MDT": "MDT", "TMST": "TMST", "ChST": "ChST", "CHAST": "CHAST", "SGT": "SGT", "HAT": "HAT"},
+ timezones: map[string]string{"ACWST": "ACWST", "JST": "JST", "BOT": "BOT", "WAST": "WAST", "AEDT": "AEDT", "MEZ": "MEZ", "WARST": "WARST", "LHST": "LHST", "MST": "MST", "CHADT": "CHADT", "HADT": "HADT", "HAT": "HAT", "OESZ": "OESZ", "GYT": "GYT", "WAT": "WAT", "COT": "COT", "GFT": "GFT", "ADT": "ADT", "ACWDT": "ACWDT", "SAST": "SAST", "PDT": "PDT", "HAST": "HAST", "TMST": "TMST", "AEST": "AEST", "HNT": "HNT", "ACDT": "ACDT", "ECT": "ECT", "EST": "EST", "CLST": "CLST", "∅∅∅": "∅∅∅", "AWDT": "AWDT", "WITA": "WITA", "GMT": "GMT", "SGT": "SGT", "UYST": "UYST", "CST": "CST", "SRT": "SRT", "MDT": "MDT", "AKDT": "AKDT", "IST": "IST", "ChST": "ChST", "LHDT": "LHDT", "ACST": "ACST", "HKT": "HKT", "JDT": "JDT", "NZST": "NZST", "NZDT": "NZDT", "BT": "BT", "UYT": "UYT", "ARST": "ARST", "EDT": "EDT", "WART": "WART", "AST": "AST", "CAT": "CAT", "WEZ": "WEZ", "OEZ": "OEZ", "MYT": "MYT", "WIT": "WIT", "AKST": "AKST", "AWST": "AWST", "ART": "ART", "WESZ": "WESZ", "EAT": "EAT", "PST": "PST", "WIB": "WIB", "HKST": "HKST", "CHAST": "CHAST", "COST": "COST", "VET": "VET", "MESZ": "MESZ", "TMT": "TMT", "CLT": "CLT", "CDT": "CDT"},
}
}
@@ -117,7 +117,7 @@ func (yo *yo_BJ) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (yo *yo_BJ) MonthsNarrow() []string {
- return yo.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/yo_BJ/yo_BJ_test.go b/yo_BJ/yo_BJ_test.go
new file mode 100644
index 00000000..1724f001
--- /dev/null
+++ b/yo_BJ/yo_BJ_test.go
@@ -0,0 +1,1120 @@
+package yo_BJ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "yo_BJ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/yo_NG/yo_NG.go b/yo_NG/yo_NG.go
index 0e8aa515..3f1aae32 100644
--- a/yo_NG/yo_NG.go
+++ b/yo_NG/yo_NG.go
@@ -61,7 +61,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"SK", "LK"},
erasNarrow: []string{"", ""},
erasWide: []string{"Saju Kristi", "Lehin Kristi"},
- timezones: map[string]string{"UYST": "UYST", "CLST": "CLST", "HNT": "HNT", "EAT": "EAT", "TMST": "TMST", "AKST": "AKST", "NZDT": "NZDT", "UYT": "UYT", "VET": "VET", "HAST": "HAST", "SAST": "SAST", "OEZ": "OEZ", "AEST": "AEST", "EDT": "EDT", "WAT": "WAT", "WARST": "WARST", "LHST": "LHST", "BOT": "BOT", "WEZ": "WEZ", "WESZ": "WESZ", "COT": "COT", "MST": "MST", "ACDT": "ACDT", "OESZ": "OESZ", "HAT": "HAT", "WITA": "WITA", "SGT": "SGT", "JST": "JST", "MESZ": "MESZ", "CHAST": "CHAST", "ECT": "ECT", "AST": "AST", "PST": "PST", "JDT": "JDT", "NZST": "NZST", "WAST": "WAST", "WART": "WART", "WIT": "WIT", "GYT": "GYT", "SRT": "SRT", "ACWDT": "ACWDT", "ACST": "ACST", "MYT": "MYT", "COST": "COST", "ChST": "ChST", "ADT": "ADT", "BT": "BT", "AEDT": "AEDT", "CAT": "CAT", "WIB": "WIB", "MDT": "MDT", "ARST": "ARST", "AWST": "AWST", "LHDT": "LHDT", "CHADT": "CHADT", "HADT": "HADT", "ART": "ART", "TMT": "TMT", "AWDT": "AWDT", "CDT": "CDT", "ACWST": "ACWST", "HKST": "HKST", "AKDT": "AKDT", "PDT": "PDT", "CST": "CST", "GFT": "GFT", "EST": "EST", "∅∅∅": "∅∅∅", "HKT": "HKT", "IST": "IST", "GMT": "GMT", "MEZ": "MEZ", "CLT": "CLT"},
+ timezones: map[string]string{"MDT": "MDT", "CHADT": "CHADT", "JDT": "JDT", "HADT": "HADT", "WARST": "WARST", "WITA": "WITA", "SGT": "SGT", "OEZ": "OEZ", "CDT": "CDT", "AKDT": "AKDT", "AST": "AST", "IST": "IST", "ARST": "ARST", "SAST": "SAST", "MEZ": "MEZ", "WIB": "WIB", "GMT": "GMT", "MST": "MST", "VET": "VET", "EDT": "EDT", "PST": "PST", "BOT": "BOT", "UYT": "UYT", "UYST": "UYST", "GFT": "GFT", "ECT": "ECT", "ART": "ART", "NZDT": "NZDT", "∅∅∅": "∅∅∅", "OESZ": "OESZ", "WESZ": "WESZ", "COST": "COST", "BT": "BT", "HKT": "HKT", "HKST": "HKST", "AWST": "AWST", "WAT": "WAT", "CLT": "CLT", "AKST": "AKST", "ADT": "ADT", "EST": "EST", "HAT": "HAT", "ChST": "ChST", "GYT": "GYT", "CST": "CST", "ACWST": "ACWST", "WEZ": "WEZ", "HNT": "HNT", "LHST": "LHST", "AWDT": "AWDT", "JST": "JST", "PDT": "PDT", "MESZ": "MESZ", "ACWDT": "ACWDT", "HAST": "HAST", "EAT": "EAT", "LHDT": "LHDT", "MYT": "MYT", "ACST": "ACST", "CHAST": "CHAST", "CAT": "CAT", "WAST": "WAST", "WART": "WART", "SRT": "SRT", "NZST": "NZST", "TMT": "TMT", "TMST": "TMST", "AEST": "AEST", "ACDT": "ACDT", "COT": "COT", "AEDT": "AEDT", "CLST": "CLST", "WIT": "WIT"},
}
}
@@ -117,7 +117,7 @@ func (yo *yo_NG) MonthNarrow(month time.Month) string {
// MonthsNarrow returns the locales narrow months
func (yo *yo_NG) MonthsNarrow() []string {
- return yo.monthsNarrow[1:]
+ return nil
}
// MonthWide returns the locales wide month given the 'month' provided
diff --git a/yo_NG/yo_NG_test.go b/yo_NG/yo_NG_test.go
new file mode 100644
index 00000000..95fa4a08
--- /dev/null
+++ b/yo_NG/yo_NG_test.go
@@ -0,0 +1,1120 @@
+package yo_NG
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "yo_NG"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/yue/yue.go b/yue/yue.go
index 73c798ae..84001bb3 100644
--- a/yue/yue.go
+++ b/yue/yue.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"西元前", "西元"},
erasNarrow: []string{"西元前", "西元"},
erasWide: []string{"西元前", "西元"},
- timezones: map[string]string{"BT": "不丹時間", "TMT": "土庫曼標準時間", "CLST": "智利夏令時間", "HADT": "夏威夷-阿留申夏令時間", "EAT": "東非時間", "BOT": "玻利維亞時間", "WARST": "阿根廷西部夏令時間", "CDT": "中部夏令時間", "HNT": "紐芬蘭標準時間", "MST": "澳門標準時間", "CST": "中部標準時間", "WESZ": "西歐夏令時間", "AST": "大西洋標準時間", "PST": "太平洋標準時間", "NZST": "紐西蘭標準時間", "CHAST": "查坦群島標準時間", "GYT": "蓋亞那時間", "ACWST": "澳洲中西部標準時間", "WIB": "印尼西部時間", "AKST": "阿拉斯加標準時間", "AKDT": "阿拉斯加夏令時間", "SRT": "蘇利南時間", "EST": "東部標準時間", "COST": "哥倫比亞夏令時間", "IST": "印度標準時間", "GFT": "法屬圭亞那時間", "JDT": "日本夏令時間", "AEST": "澳洲東部標準時間", "ChST": "查莫洛時間", "ACST": "澳洲中部標準時間", "AWDT": "澳洲西部夏令時間", "LHST": "豪勳爵島標準時間", "COT": "哥倫比亞標準時間", "HAST": "夏威夷-阿留申標準時間", "WART": "阿根廷西部標準時間", "ARST": "阿根廷夏令時間", "AWST": "澳洲西部標準時間", "MEZ": "中歐標準時間", "UYST": "烏拉圭夏令時間", "ADT": "大西洋夏令時間", "GMT": "格林威治標準時間", "HAT": "紐芬蘭夏令時間", "ART": "阿根廷標準時間", "JST": "日本標準時間", "WAT": "西非標準時間", "VET": "委內瑞拉時間", "AEDT": "澳洲東部夏令時間", "ACDT": "澳洲中部夏令時間", "∅∅∅": "亞馬遜夏令時間", "LHDT": "豪勳爵島夏令時間", "EDT": "東部夏令時間", "SAST": "南非標準時間", "OESZ": "東歐夏令時間", "MYT": "馬來西亞時間", "PDT": "太平洋夏令時間", "CLT": "智利標準時間", "ACWDT": "澳洲中西部夏令時間", "CAT": "中非時間", "SGT": "新加坡標準時間", "WAST": "西非夏令時間", "TMST": "土庫曼夏令時間", "NZDT": "紐西蘭夏令時間", "CHADT": "查坦群島夏令時間", "HKT": "香港標準時間", "WEZ": "西歐標準時間", "WIT": "印尼東部時間", "MDT": "澳門夏令時間", "UYT": "烏拉圭標準時間", "ECT": "厄瓜多時間", "HKST": "香港夏令時間", "WITA": "印尼中部時間", "OEZ": "東歐標準時間", "MESZ": "中歐夏令時間"},
+ timezones: map[string]string{"CHAST": "查坦群島標準時間", "CHADT": "查坦群島夏令時間", "TMT": "土庫曼標準時間", "CLST": "智利夏令時間", "CDT": "中部夏令時間", "LHST": "豪勳爵島標準時間", "JST": "日本標準時間", "SAST": "南非標準時間", "OEZ": "東歐標準時間", "OESZ": "東歐夏令時間", "WARST": "阿根廷西部夏令時間", "ACWST": "澳洲中西部標準時間", "WAST": "西非夏令時間", "WIT": "印尼東部時間", "MDT": "山區夏令時間", "SGT": "新加坡標準時間", "GYT": "蓋亞那時間", "HKST": "香港夏令時間", "WART": "阿根廷西部標準時間", "VET": "委內瑞拉時間", "AKDT": "阿拉斯加夏令時間", "ADT": "大西洋夏令時間", "ACWDT": "澳洲中西部夏令時間", "AWDT": "澳洲西部夏令時間", "UYST": "烏拉圭夏令時間", "CST": "中部標準時間", "WIB": "印尼西部時間", "∅∅∅": "巴西利亞夏令時間", "GFT": "法屬圭亞那時間", "HAST": "夏威夷-阿留申標準時間", "EDT": "東部夏令時間", "AEDT": "澳洲東部夏令時間", "MST": "山區標準時間", "WITA": "印尼中部時間", "AWST": "澳洲西部標準時間", "PST": "太平洋標準時間", "WEZ": "西歐標準時間", "BT": "不丹時間", "ECT": "厄瓜多時間", "ACST": "澳洲中部標準時間", "HKT": "香港標準時間", "COT": "哥倫比亞標準時間", "AKST": "阿拉斯加標準時間", "AST": "大西洋標準時間", "IST": "印度標準時間", "WESZ": "西歐夏令時間", "LHDT": "豪勳爵島夏令時間", "JDT": "日本夏令時間", "EST": "東部標準時間", "HNT": "紐芬蘭標準時間", "UYT": "烏拉圭標準時間", "MESZ": "中歐夏令時間", "WAT": "西非標準時間", "ART": "阿根廷標準時間", "ARST": "阿根廷夏令時間", "EAT": "東非時間", "BOT": "玻利維亞時間", "COST": "哥倫比亞夏令時間", "TMST": "土庫曼夏令時間", "CAT": "中非時間", "HAT": "紐芬蘭夏令時間", "AEST": "澳洲東部標準時間", "ChST": "查莫洛時間", "NZDT": "紐西蘭夏令時間", "CLT": "智利標準時間", "SRT": "蘇利南時間", "MEZ": "中歐標準時間", "NZST": "紐西蘭標準時間", "GMT": "格林威治標準時間", "ACDT": "澳洲中部夏令時間", "PDT": "太平洋夏令時間", "MYT": "馬來西亞時間", "HADT": "夏威夷-阿留申夏令時間"},
}
}
diff --git a/yue/yue_test.go b/yue/yue_test.go
new file mode 100644
index 00000000..bd89d49e
--- /dev/null
+++ b/yue/yue_test.go
@@ -0,0 +1,1120 @@
+package yue
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "yue"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/yue_HK/yue_HK.go b/yue_HK/yue_HK.go
index 79b08c02..42b50d5c 100644
--- a/yue_HK/yue_HK.go
+++ b/yue_HK/yue_HK.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"西元前", "西元"},
erasNarrow: []string{"西元前", "西元"},
erasWide: []string{"西元前", "西元"},
- timezones: map[string]string{"MEZ": "中歐標準時間", "NZST": "紐西蘭標準時間", "COT": "哥倫比亞標準時間", "ADT": "大西洋夏令時間", "HAST": "夏威夷-阿留申標準時間", "WIT": "印尼東部時間", "AWST": "澳洲西部標準時間", "AWDT": "澳洲西部夏令時間", "SGT": "新加坡標準時間", "HKT": "香港標準時間", "MYT": "馬來西亞時間", "WESZ": "西歐夏令時間", "ECT": "厄瓜多時間", "OESZ": "東歐夏令時間", "MESZ": "中歐夏令時間", "TMST": "土庫曼夏令時間", "ACWST": "澳洲中西部標準時間", "CAT": "中非時間", "GMT": "格林威治標準時間", "EDT": "東部夏令時間", "WART": "阿根廷西部標準時間", "SAST": "南非標準時間", "WAST": "西非夏令時間", "WITA": "印尼中部時間", "IST": "印度標準時間", "HAT": "紐芬蘭夏令時間", "ART": "阿根廷標準時間", "ARST": "阿根廷夏令時間", "JDT": "日本夏令時間", "CDT": "中部夏令時間", "ChST": "查莫洛時間", "ACWDT": "澳洲中西部夏令時間", "HNT": "紐芬蘭標準時間", "WIB": "印尼西部時間", "LHST": "豪勳爵島標準時間", "AKDT": "阿拉斯加夏令時間", "UYST": "烏拉圭夏令時間", "COST": "哥倫比亞夏令時間", "OEZ": "東歐標準時間", "TMT": "土庫曼標準時間", "EST": "東部標準時間", "AST": "大西洋標準時間", "CHAST": "查坦群島標準時間", "CLT": "智利標準時間", "MST": "澳門標準時間", "AKST": "阿拉斯加標準時間", "VET": "委內瑞拉時間", "GYT": "蓋亞那時間", "PDT": "太平洋夏令時間", "BOT": "玻利維亞時間", "HADT": "夏威夷-阿留申夏令時間", "WAT": "西非標準時間", "MDT": "澳門夏令時間", "ACST": "澳洲中部標準時間", "LHDT": "豪勳爵島夏令時間", "AEDT": "澳洲東部夏令時間", "WARST": "阿根廷西部夏令時間", "BT": "不丹時間", "EAT": "東非時間", "SRT": "蘇利南時間", "UYT": "烏拉圭標準時間", "JST": "日本標準時間", "CLST": "智利夏令時間", "WEZ": "西歐標準時間", "CST": "中部標準時間", "AEST": "澳洲東部標準時間", "∅∅∅": "艾克夏令時間", "HKST": "香港夏令時間", "GFT": "法屬圭亞那時間", "ACDT": "澳洲中部夏令時間", "PST": "太平洋標準時間", "NZDT": "紐西蘭夏令時間", "CHADT": "查坦群島夏令時間"},
+ timezones: map[string]string{"JST": "日本標準時間", "AKDT": "阿拉斯加夏令時間", "SGT": "新加坡標準時間", "GMT": "格林威治標準時間", "UYT": "烏拉圭標準時間", "HKST": "香港夏令時間", "HNT": "紐芬蘭標準時間", "COT": "哥倫比亞標準時間", "EAT": "東非時間", "GFT": "法屬圭亞那時間", "ARST": "阿根廷夏令時間", "WESZ": "西歐夏令時間", "COST": "哥倫比亞夏令時間", "MST": "山區標準時間", "SRT": "蘇利南時間", "NZST": "紐西蘭標準時間", "AEDT": "澳洲東部夏令時間", "EDT": "東部夏令時間", "ACWST": "澳洲中西部標準時間", "WART": "阿根廷西部標準時間", "AWDT": "澳洲西部夏令時間", "SAST": "南非標準時間", "CAT": "中非時間", "ECT": "厄瓜多時間", "MESZ": "中歐夏令時間", "CDT": "中部夏令時間", "ACDT": "澳洲中部夏令時間", "CHAST": "查坦群島標準時間", "MEZ": "中歐標準時間", "HAT": "紐芬蘭夏令時間", "LHDT": "豪勳爵島夏令時間", "CLST": "智利夏令時間", "WITA": "印尼中部時間", "EST": "東部標準時間", "WEZ": "西歐標準時間", "ChST": "查莫洛時間", "MDT": "山區夏令時間", "AKST": "阿拉斯加標準時間", "AST": "大西洋標準時間", "PDT": "太平洋夏令時間", "IST": "印度標準時間", "CHADT": "查坦群島夏令時間", "JDT": "日本夏令時間", "VET": "委內瑞拉時間", "ACWDT": "澳洲中西部夏令時間", "ART": "阿根廷標準時間", "OEZ": "東歐標準時間", "OESZ": "東歐夏令時間", "BT": "不丹時間", "∅∅∅": "巴西利亞夏令時間", "WARST": "阿根廷西部夏令時間", "BOT": "玻利維亞時間", "WAT": "西非標準時間", "LHST": "豪勳爵島標準時間", "WIT": "印尼東部時間", "PST": "太平洋標準時間", "TMT": "土庫曼標準時間", "CST": "中部標準時間", "HKT": "香港標準時間", "CLT": "智利標準時間", "ADT": "大西洋夏令時間", "HAST": "夏威夷-阿留申標準時間", "HADT": "夏威夷-阿留申夏令時間", "AEST": "澳洲東部標準時間", "GYT": "蓋亞那時間", "WIB": "印尼西部時間", "TMST": "土庫曼夏令時間", "WAST": "西非夏令時間", "UYST": "烏拉圭夏令時間", "AWST": "澳洲西部標準時間", "NZDT": "紐西蘭夏令時間", "MYT": "馬來西亞時間", "ACST": "澳洲中部標準時間"},
}
}
diff --git a/yue_HK/yue_HK_test.go b/yue_HK/yue_HK_test.go
new file mode 100644
index 00000000..e8904660
--- /dev/null
+++ b/yue_HK/yue_HK_test.go
@@ -0,0 +1,1120 @@
+package yue_HK
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "yue_HK"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/zgh/zgh.go b/zgh/zgh.go
index ca367228..23284dbd 100644
--- a/zgh/zgh.go
+++ b/zgh/zgh.go
@@ -62,7 +62,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ⴷⴰⵄ", "ⴷⴼⵄ"},
erasNarrow: []string{"", ""},
erasWide: []string{"ⴷⴰⵜ ⵏ ⵄⵉⵙⴰ", "ⴷⴼⴼⵉⵔ ⵏ ⵄⵉⵙⴰ"},
- timezones: map[string]string{"ARST": "ARST", "GMT": "GMT", "CLT": "CLT", "HNT": "HNT", "IST": "IST", "ACST": "ACST", "LHST": "LHST", "CHAST": "CHAST", "PDT": "PDT", "WIB": "WIB", "CST": "CST", "MESZ": "MESZ", "WAT": "WAT", "WITA": "WITA", "TMST": "TMST", "EDT": "EDT", "COT": "COT", "JST": "JST", "HADT": "HADT", "OESZ": "OESZ", "AKDT": "AKDT", "AEDT": "AEDT", "SAST": "SAST", "MDT": "MDT", "ACDT": "ACDT", "MYT": "MYT", "ChST": "ChST", "CLST": "CLST", "VET": "VET", "TMT": "TMT", "EAT": "EAT", "UYT": "UYT", "UYST": "UYST", "WESZ": "WESZ", "GFT": "GFT", "ACWST": "ACWST", "ECT": "ECT", "EST": "EST", "AST": "AST", "WAST": "WAST", "ART": "ART", "∅∅∅": "∅∅∅", "CDT": "CDT", "AWDT": "AWDT", "CHADT": "CHADT", "AEST": "AEST", "GYT": "GYT", "SRT": "SRT", "PST": "PST", "COST": "COST", "LHDT": "LHDT", "AWST": "AWST", "ACWDT": "ACWDT", "HKT": "HKT", "WARST": "WARST", "BT": "BT", "HAT": "HAT", "WIT": "WIT", "MST": "MST", "JDT": "JDT", "HAST": "HAST", "HKST": "HKST", "OEZ": "OEZ", "NZDT": "NZDT", "CAT": "CAT", "SGT": "SGT", "NZST": "NZST", "WEZ": "WEZ", "ADT": "ADT", "WART": "WART", "AKST": "AKST", "BOT": "BOT", "MEZ": "MEZ"},
+ timezones: map[string]string{"GFT": "GFT", "CHADT": "CHADT", "JDT": "JDT", "TMST": "TMST", "LHST": "LHST", "MESZ": "MESZ", "IST": "IST", "HNT": "HNT", "WIB": "WIB", "OEZ": "OEZ", "HKT": "HKT", "EDT": "EDT", "WEZ": "WEZ", "GYT": "GYT", "SGT": "SGT", "AST": "AST", "MEZ": "MEZ", "SAST": "SAST", "WESZ": "WESZ", "MYT": "MYT", "ACWDT": "ACWDT", "AWDT": "AWDT", "JST": "JST", "CDT": "CDT", "CAT": "CAT", "ARST": "ARST", "EST": "EST", "BOT": "BOT", "EAT": "EAT", "BT": "BT", "CST": "CST", "VET": "VET", "ADT": "ADT", "PST": "PST", "AEDT": "AEDT", "ChST": "ChST", "CLT": "CLT", "WIT": "WIT", "HAST": "HAST", "LHDT": "LHDT", "WART": "WART", "WARST": "WARST", "ECT": "ECT", "WITA": "WITA", "HAT": "HAT", "COST": "COST", "UYST": "UYST", "ACST": "ACST", "CHAST": "CHAST", "ACWST": "ACWST", "MST": "MST", "TMT": "TMT", "AEST": "AEST", "OESZ": "OESZ", "WAT": "WAT", "WAST": "WAST", "SRT": "SRT", "AWST": "AWST", "NZST": "NZST", "COT": "COT", "AKST": "AKST", "AKDT": "AKDT", "PDT": "PDT", "GMT": "GMT", "UYT": "UYT", "∅∅∅": "∅∅∅", "ART": "ART", "HADT": "HADT", "NZDT": "NZDT", "MDT": "MDT", "CLST": "CLST", "ACDT": "ACDT", "HKST": "HKST"},
}
}
diff --git a/zgh/zgh_test.go b/zgh/zgh_test.go
new file mode 100644
index 00000000..ec2f57e3
--- /dev/null
+++ b/zgh/zgh_test.go
@@ -0,0 +1,1120 @@
+package zgh
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "zgh"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/zgh_MA/zgh_MA.go b/zgh_MA/zgh_MA.go
index 66a4d12c..2c63bef2 100644
--- a/zgh_MA/zgh_MA.go
+++ b/zgh_MA/zgh_MA.go
@@ -62,7 +62,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"ⴷⴰⵄ", "ⴷⴼⵄ"},
erasNarrow: []string{"", ""},
erasWide: []string{"ⴷⴰⵜ ⵏ ⵄⵉⵙⴰ", "ⴷⴼⴼⵉⵔ ⵏ ⵄⵉⵙⴰ"},
- timezones: map[string]string{"WIT": "WIT", "GYT": "GYT", "WART": "WART", "WAT": "WAT", "ART": "ART", "AWST": "AWST", "MST": "MST", "ADT": "ADT", "HAST": "HAST", "JDT": "JDT", "PST": "PST", "CHAST": "CHAST", "EST": "EST", "MYT": "MYT", "AKST": "AKST", "TMST": "TMST", "ARST": "ARST", "ACST": "ACST", "EDT": "EDT", "ECT": "ECT", "HNT": "HNT", "HAT": "HAT", "∅∅∅": "∅∅∅", "IST": "IST", "AWDT": "AWDT", "LHDT": "LHDT", "MDT": "MDT", "CHADT": "CHADT", "ACWST": "ACWST", "AEST": "AEST", "COT": "COT", "HADT": "HADT", "JST": "JST", "UYT": "UYT", "NZDT": "NZDT", "ACWDT": "ACWDT", "PDT": "PDT", "MEZ": "MEZ", "MESZ": "MESZ", "ChST": "ChST", "UYST": "UYST", "CST": "CST", "WAST": "WAST", "TMT": "TMT", "CDT": "CDT", "ACDT": "ACDT", "AKDT": "AKDT", "LHST": "LHST", "BOT": "BOT", "VET": "VET", "WESZ": "WESZ", "AST": "AST", "GMT": "GMT", "WITA": "WITA", "OEZ": "OEZ", "SRT": "SRT", "CLT": "CLT", "CAT": "CAT", "SGT": "SGT", "SAST": "SAST", "HKT": "HKT", "WEZ": "WEZ", "AEDT": "AEDT", "COST": "COST", "WARST": "WARST", "EAT": "EAT", "NZST": "NZST", "WIB": "WIB", "OESZ": "OESZ", "CLST": "CLST", "BT": "BT", "HKST": "HKST", "GFT": "GFT"},
+ timezones: map[string]string{"ACDT": "ACDT", "ECT": "ECT", "AKST": "AKST", "PDT": "PDT", "SGT": "SGT", "AEST": "AEST", "ChST": "ChST", "AWDT": "AWDT", "WESZ": "WESZ", "WIB": "WIB", "OEZ": "OEZ", "WIT": "WIT", "AEDT": "AEDT", "CLST": "CLST", "VET": "VET", "NZDT": "NZDT", "BOT": "BOT", "CDT": "CDT", "JST": "JST", "EST": "EST", "LHST": "LHST", "HKST": "HKST", "CAT": "CAT", "GYT": "GYT", "GFT": "GFT", "WITA": "WITA", "UYT": "UYT", "BT": "BT", "ACWST": "ACWST", "AWST": "AWST", "EDT": "EDT", "NZST": "NZST", "MYT": "MYT", "ACST": "ACST", "MEZ": "MEZ", "ADT": "ADT", "MST": "MST", "CHADT": "CHADT", "PST": "PST", "SAST": "SAST", "OESZ": "OESZ", "GMT": "GMT", "AST": "AST", "WEZ": "WEZ", "TMT": "TMT", "CST": "CST", "ART": "ART", "SRT": "SRT", "HKT": "HKT", "AKDT": "AKDT", "WAST": "WAST", "MDT": "MDT", "EAT": "EAT", "WART": "WART", "JDT": "JDT", "COT": "COT", "WAT": "WAT", "CLT": "CLT", "ACWDT": "ACWDT", "UYST": "UYST", "WARST": "WARST", "CHAST": "CHAST", "HAST": "HAST", "HADT": "HADT", "IST": "IST", "∅∅∅": "∅∅∅", "TMST": "TMST", "LHDT": "LHDT", "ARST": "ARST", "MESZ": "MESZ", "HNT": "HNT", "HAT": "HAT", "COST": "COST"},
}
}
diff --git a/zgh_MA/zgh_MA_test.go b/zgh_MA/zgh_MA_test.go
new file mode 100644
index 00000000..f80267d5
--- /dev/null
+++ b/zgh_MA/zgh_MA_test.go
@@ -0,0 +1,1120 @@
+package zgh_MA
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "zgh_MA"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/zh/zh.go b/zh/zh.go
index fed3a9ba..0b17440d 100644
--- a/zh/zh.go
+++ b/zh/zh.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"公元前", "公元"},
erasNarrow: []string{"公元前", "公元"},
erasWide: []string{"公元前", "公元"},
- timezones: map[string]string{"GMT": "格林尼治标准时间", "LHST": "豪勋爵岛标准时间", "MEZ": "中欧标准时间", "NZDT": "新西兰夏令时间", "WARST": "阿根廷西部夏令时间", "ART": "阿根廷标准时间", "PST": "北美太平洋标准时间", "CST": "北美中部标准时间", "WESZ": "西欧夏令时间", "IST": "印度时间", "HAT": "纽芬兰夏令时间", "ARST": "阿根廷夏令时间", "AWDT": "澳大利亚西部夏令时间", "LHDT": "豪勋爵岛夏令时间", "MESZ": "中欧夏令时间", "CHAST": "查坦标准时间", "EDT": "北美东部夏令时间", "SAST": "南部非洲时间", "JDT": "日本夏令时间", "HADT": "夏威夷-阿留申夏令时间", "ACDT": "澳大利亚中部夏令时间", "∅∅∅": "亚速尔群岛夏令时间", "ChST": "查莫罗时间", "CHADT": "查坦夏令时间", "ECT": "厄瓜多尔时间", "WITA": "印度尼西亚中部时间", "ACST": "澳大利亚中部标准时间", "AKST": "阿拉斯加标准时间", "AWST": "澳大利亚西部标准时间", "MYT": "马来西亚时间", "UYT": "乌拉圭标准时间", "UYST": "乌拉圭夏令时间", "WAST": "西部非洲夏令时间", "PDT": "北美太平洋夏令时间", "AEDT": "澳大利亚东部夏令时间", "GYT": "圭亚那时间", "ACWDT": "澳大利亚中西部夏令时间", "CLT": "智利标准时间", "AST": "大西洋标准时间", "WART": "阿根廷西部标准时间", "GFT": "法属圭亚那时间", "CDT": "北美中部夏令时间", "AEST": "澳大利亚东部标准时间", "CLST": "智利夏令时间", "CAT": "中部非洲时间", "SGT": "新加坡标准时间", "WIB": "印度尼西亚西部时间", "BOT": "玻利维亚时间", "HKT": "香港标准时间", "HNT": "纽芬兰标准时间", "SRT": "苏里南时间", "WEZ": "西欧标准时间", "WIT": "印度尼西亚东部时间", "TMST": "土库曼斯坦夏令时间", "COST": "哥伦比亚夏令时间", "ADT": "大西洋夏令时间", "HAST": "夏威夷-阿留申标准时间", "BT": "不丹时间", "EAT": "东部非洲时间", "TMT": "土库曼斯坦标准时间", "AKDT": "阿拉斯加夏令时间", "JST": "日本标准时间", "MDT": "北美山区夏令时间", "COT": "哥伦比亚标准时间", "WAT": "西部非洲标准时间", "OEZ": "东欧标准时间", "ACWST": "澳大利亚中西部标准时间", "MST": "北美山区标准时间", "NZST": "新西兰标准时间", "VET": "委内瑞拉时间", "EST": "北美东部标准时间", "HKST": "香港夏令时间", "OESZ": "东欧夏令时间"},
+ timezones: map[string]string{"HAST": "夏威夷-阿留申标准时间", "COT": "哥伦比亚标准时间", "MST": "北美山区标准时间", "CDT": "北美中部夏令时间", "WEZ": "西欧标准时间", "ChST": "查莫罗时间", "MDT": "北美山区夏令时间", "CLT": "智利标准时间", "ACWST": "澳大利亚中西部标准时间", "HAT": "纽芬兰夏令时间", "WESZ": "西欧夏令时间", "GMT": "格林尼治标准时间", "UYST": "乌拉圭夏令时间", "AWDT": "澳大利亚西部夏令时间", "AST": "大西洋标准时间", "COST": "哥伦比亚夏令时间", "CLST": "智利夏令时间", "GFT": "法属圭亚那时间", "VET": "委内瑞拉时间", "HKT": "香港标准时间", "OEZ": "东欧标准时间", "BT": "不丹时间", "LHST": "豪勋爵岛标准时间", "CHADT": "查坦夏令时间", "BOT": "玻利维亚时间", "TMST": "土库曼斯坦夏令时间", "OESZ": "东欧夏令时间", "MYT": "马来西亚时间", "ACWDT": "澳大利亚中西部夏令时间", "WITA": "印度尼西亚中部时间", "WIB": "印度尼西亚西部时间", "ACST": "澳大利亚中部标准时间", "ECT": "厄瓜多尔时间", "AWST": "澳大利亚西部标准时间", "ART": "阿根廷标准时间", "EST": "北美东部标准时间", "WART": "阿根廷西部标准时间", "WARST": "阿根廷西部夏令时间", "AEDT": "澳大利亚东部夏令时间", "CST": "北美中部标准时间", "PDT": "北美太平洋夏令时间", "MEZ": "中欧标准时间", "MESZ": "中欧夏令时间", "HADT": "夏威夷-阿留申夏令时间", "WAST": "西部非洲夏令时间", "PST": "北美太平洋标准时间", "EAT": "东部非洲时间", "CHAST": "查坦标准时间", "JDT": "日本夏令时间", "IST": "印度时间", "∅∅∅": "亚马逊夏令时间", "CAT": "中部非洲时间", "WAT": "西部非洲标准时间", "AKST": "阿拉斯加标准时间", "SGT": "新加坡标准时间", "GYT": "圭亚那时间", "AEST": "澳大利亚东部标准时间", "ACDT": "澳大利亚中部夏令时间", "HKST": "香港夏令时间", "ADT": "大西洋夏令时间", "NZST": "新西兰标准时间", "EDT": "北美东部夏令时间", "HNT": "纽芬兰标准时间", "UYT": "乌拉圭标准时间", "JST": "日本标准时间", "SAST": "南部非洲时间", "WIT": "印度尼西亚东部时间", "LHDT": "豪勋爵岛夏令时间", "AKDT": "阿拉斯加夏令时间", "NZDT": "新西兰夏令时间", "TMT": "土库曼斯坦标准时间", "SRT": "苏里南时间", "ARST": "阿根廷夏令时间"},
}
}
diff --git a/zh/zh_test.go b/zh/zh_test.go
new file mode 100644
index 00000000..a6518eed
--- /dev/null
+++ b/zh/zh_test.go
@@ -0,0 +1,1120 @@
+package zh
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "zh"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/zh_Hans/zh_Hans.go b/zh_Hans/zh_Hans.go
index 813f1551..51102966 100644
--- a/zh_Hans/zh_Hans.go
+++ b/zh_Hans/zh_Hans.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"公元前", "公元"},
erasNarrow: []string{"公元前", "公元"},
erasWide: []string{"公元前", "公元"},
- timezones: map[string]string{"VET": "委内瑞拉时间", "ACWDT": "澳大利亚中西部夏令时间", "AEDT": "澳大利亚东部夏令时间", "TMST": "土库曼斯坦夏令时间", "AKST": "阿拉斯加标准时间", "AKDT": "阿拉斯加夏令时间", "AWDT": "澳大利亚西部夏令时间", "WESZ": "西欧夏令时间", "CHAST": "查坦标准时间", "GFT": "法属圭亚那时间", "SRT": "苏里南时间", "ACWST": "澳大利亚中西部标准时间", "CHADT": "查坦夏令时间", "ACST": "澳大利亚中部标准时间", "IST": "印度时间", "OESZ": "东欧夏令时间", "PDT": "北美太平洋夏令时间", "BOT": "玻利维亚时间", "EST": "北美东部标准时间", "ADT": "大西洋夏令时间", "HKST": "香港夏令时间", "EAT": "东部非洲时间", "UYT": "乌拉圭标准时间", "AEST": "澳大利亚东部标准时间", "CLST": "智利夏令时间", "WART": "阿根廷西部标准时间", "WARST": "阿根廷西部夏令时间", "GMT": "格林尼治标准时间", "WITA": "印度尼西亚中部时间", "LHST": "豪勋爵岛标准时间", "UYST": "乌拉圭夏令时间", "AST": "大西洋标准时间", "WAT": "西部非洲标准时间", "BT": "不丹时间", "WIT": "印度尼西亚东部时间", "MST": "澳门标准时间", "∅∅∅": "亚马逊夏令时间", "TMT": "土库曼斯坦标准时间", "EDT": "北美东部夏令时间", "SGT": "新加坡标准时间", "WAST": "西部非洲夏令时间", "HAST": "夏威夷-阿留申标准时间", "NZDT": "新西兰夏令时间", "ECT": "厄瓜多尔时间", "CDT": "北美中部夏令时间", "MESZ": "中欧夏令时间", "NZST": "新西兰标准时间", "WIB": "印度尼西亚西部时间", "MYT": "马来西亚时间", "OEZ": "东欧标准时间", "AWST": "澳大利亚西部标准时间", "JST": "日本标准时间", "JDT": "日本夏令时间", "CAT": "中部非洲时间", "COT": "哥伦比亚标准时间", "ACDT": "澳大利亚中部夏令时间", "HAT": "纽芬兰夏令时间", "LHDT": "豪勋爵岛夏令时间", "WEZ": "西欧标准时间", "SAST": "南部非洲时间", "PST": "北美太平洋标准时间", "GYT": "圭亚那时间", "MEZ": "中欧标准时间", "ChST": "查莫罗时间", "HADT": "夏威夷-阿留申夏令时间", "ARST": "阿根廷夏令时间", "MDT": "澳门夏令时间", "ART": "阿根廷标准时间", "CLT": "智利标准时间", "HNT": "纽芬兰标准时间", "CST": "北美中部标准时间", "COST": "哥伦比亚夏令时间", "HKT": "香港标准时间"},
+ timezones: map[string]string{"BOT": "玻利维亚时间", "HAT": "纽芬兰夏令时间", "SGT": "新加坡标准时间", "SRT": "苏里南时间", "AST": "大西洋标准时间", "∅∅∅": "亚马逊夏令时间", "WAST": "西部非洲夏令时间", "ACWST": "澳大利亚中西部标准时间", "IST": "印度时间", "TMT": "土库曼斯坦标准时间", "HKST": "香港夏令时间", "JDT": "日本夏令时间", "PDT": "北美太平洋夏令时间", "MEZ": "中欧标准时间", "OESZ": "东欧夏令时间", "ACDT": "澳大利亚中部夏令时间", "EST": "北美东部标准时间", "COST": "哥伦比亚夏令时间", "AEST": "澳大利亚东部标准时间", "GYT": "圭亚那时间", "UYST": "乌拉圭夏令时间", "AWDT": "澳大利亚西部夏令时间", "GMT": "格林尼治标准时间", "CLST": "智利夏令时间", "AKDT": "阿拉斯加夏令时间", "HAST": "夏威夷-阿留申标准时间", "WIB": "印度尼西亚西部时间", "ChST": "查莫罗时间", "LHST": "豪勋爵岛标准时间", "JST": "日本标准时间", "WITA": "印度尼西亚中部时间", "CHADT": "查坦夏令时间", "VET": "委内瑞拉时间", "SAST": "南部非洲时间", "HNT": "纽芬兰标准时间", "BT": "不丹时间", "MST": "北美山区标准时间", "ACST": "澳大利亚中部标准时间", "WARST": "阿根廷西部夏令时间", "CHAST": "查坦标准时间", "PST": "北美太平洋标准时间", "GFT": "法属圭亚那时间", "ECT": "厄瓜多尔时间", "WEZ": "西欧标准时间", "COT": "哥伦比亚标准时间", "MDT": "北美山区夏令时间", "ARST": "阿根廷夏令时间", "MESZ": "中欧夏令时间", "HADT": "夏威夷-阿留申夏令时间", "AEDT": "澳大利亚东部夏令时间", "UYT": "乌拉圭标准时间", "HKT": "香港标准时间", "AKST": "阿拉斯加标准时间", "WESZ": "西欧夏令时间", "EAT": "东部非洲时间", "LHDT": "豪勋爵岛夏令时间", "ADT": "大西洋夏令时间", "ACWDT": "澳大利亚中西部夏令时间", "ART": "阿根廷标准时间", "CAT": "中部非洲时间", "WAT": "西部非洲标准时间", "WIT": "印度尼西亚东部时间", "CLT": "智利标准时间", "WART": "阿根廷西部标准时间", "NZST": "新西兰标准时间", "NZDT": "新西兰夏令时间", "EDT": "北美东部夏令时间", "TMST": "土库曼斯坦夏令时间", "MYT": "马来西亚时间", "CST": "北美中部标准时间", "OEZ": "东欧标准时间", "CDT": "北美中部夏令时间", "AWST": "澳大利亚西部标准时间"},
}
}
diff --git a/zh_Hans/zh_Hans_test.go b/zh_Hans/zh_Hans_test.go
new file mode 100644
index 00000000..42cc454c
--- /dev/null
+++ b/zh_Hans/zh_Hans_test.go
@@ -0,0 +1,1120 @@
+package zh_Hans
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "zh_Hans"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/zh_Hans_CN/zh_Hans_CN.go b/zh_Hans_CN/zh_Hans_CN.go
index d1d9bb6f..ac279464 100644
--- a/zh_Hans_CN/zh_Hans_CN.go
+++ b/zh_Hans_CN/zh_Hans_CN.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"公元前", "公元"},
erasNarrow: []string{"公元前", "公元"},
erasWide: []string{"公元前", "公元"},
- timezones: map[string]string{"ARST": "阿根廷夏令时间", "JDT": "日本夏令时间", "AKDT": "阿拉斯加夏令时间", "PDT": "北美太平洋夏令时间", "ACWST": "澳大利亚中西部标准时间", "HAT": "纽芬兰夏令时间", "SRT": "苏里南时间", "LHST": "豪勋爵岛标准时间", "WIT": "印度尼西亚东部时间", "CLST": "智利夏令时间", "ACWDT": "澳大利亚中西部夏令时间", "EDT": "北美东部夏令时间", "SGT": "新加坡标准时间", "IST": "印度时间", "AKST": "阿拉斯加标准时间", "UYST": "乌拉圭夏令时间", "AEST": "澳大利亚东部标准时间", "CAT": "中部非洲时间", "HKT": "香港标准时间", "GYT": "圭亚那时间", "COST": "哥伦比亚夏令时间", "ECT": "厄瓜多尔时间", "HAST": "夏威夷-阿留申标准时间", "WAT": "西部非洲标准时间", "WART": "阿根廷西部标准时间", "WITA": "印度尼西亚中部时间", "BOT": "玻利维亚时间", "WESZ": "西欧夏令时间", "ADT": "大西洋夏令时间", "WAST": "西部非洲夏令时间", "CHAST": "查坦标准时间", "HNT": "纽芬兰标准时间", "ACDT": "澳大利亚中部夏令时间", "TMT": "土库曼斯坦标准时间", "OESZ": "东欧夏令时间", "GMT": "格林尼治标准时间", "MST": "澳门标准时间", "AWST": "澳大利亚西部标准时间", "MYT": "马来西亚时间", "AEDT": "澳大利亚东部夏令时间", "EAT": "东部非洲时间", "TMST": "土库曼斯坦夏令时间", "ChST": "查莫罗时间", "EST": "北美东部标准时间", "WEZ": "西欧标准时间", "AST": "大西洋标准时间", "∅∅∅": "阿克里夏令时间", "WIB": "印度尼西亚西部时间", "ACST": "澳大利亚中部标准时间", "LHDT": "豪勋爵岛夏令时间", "NZST": "新西兰标准时间", "CDT": "北美中部夏令时间", "MEZ": "中欧标准时间", "MESZ": "中欧夏令时间", "CLT": "智利标准时间", "HADT": "夏威夷-阿留申夏令时间", "SAST": "南部非洲时间", "CST": "北美中部标准时间", "VET": "委内瑞拉时间", "HKST": "香港夏令时间", "GFT": "法属圭亚那时间", "CHADT": "查坦夏令时间", "COT": "哥伦比亚标准时间", "WARST": "阿根廷西部夏令时间", "OEZ": "东欧标准时间", "JST": "日本标准时间", "AWDT": "澳大利亚西部夏令时间", "UYT": "乌拉圭标准时间", "BT": "不丹时间", "MDT": "澳门夏令时间", "ART": "阿根廷标准时间", "PST": "北美太平洋标准时间", "NZDT": "新西兰夏令时间"},
+ timezones: map[string]string{"WIT": "印度尼西亚东部时间", "VET": "委内瑞拉时间", "ACWST": "澳大利亚中西部标准时间", "TMST": "土库曼斯坦夏令时间", "WESZ": "西欧夏令时间", "UYST": "乌拉圭夏令时间", "∅∅∅": "亚速尔群岛夏令时间", "MST": "澳门标准时间", "SAST": "南部非洲时间", "UYT": "乌拉圭标准时间", "ART": "阿根廷标准时间", "JST": "日本标准时间", "EST": "北美东部标准时间", "GYT": "圭亚那时间", "SGT": "新加坡标准时间", "BT": "不丹时间", "LHDT": "豪勋爵岛夏令时间", "SRT": "苏里南时间", "AST": "大西洋标准时间", "HADT": "夏威夷-阿留申夏令时间", "COT": "哥伦比亚标准时间", "CAT": "中部非洲时间", "HAT": "纽芬兰夏令时间", "HKT": "香港标准时间", "CHAST": "查坦标准时间", "WITA": "印度尼西亚中部时间", "PDT": "北美太平洋夏令时间", "NZST": "新西兰标准时间", "ACST": "澳大利亚中部标准时间", "GFT": "法属圭亚那时间", "HKST": "香港夏令时间", "ADT": "大西洋夏令时间", "EDT": "北美东部夏令时间", "CLST": "智利夏令时间", "EAT": "东部非洲时间", "ACDT": "澳大利亚中部夏令时间", "WART": "阿根廷西部标准时间", "AKST": "阿拉斯加标准时间", "HAST": "夏威夷-阿留申标准时间", "ECT": "厄瓜多尔时间", "AKDT": "阿拉斯加夏令时间", "AWST": "澳大利亚西部标准时间", "TMT": "土库曼斯坦标准时间", "ACWDT": "澳大利亚中西部夏令时间", "PST": "北美太平洋标准时间", "WEZ": "西欧标准时间", "AEST": "澳大利亚东部标准时间", "GMT": "格林尼治标准时间", "AWDT": "澳大利亚西部夏令时间", "HNT": "纽芬兰标准时间", "AEDT": "澳大利亚东部夏令时间", "CDT": "北美中部夏令时间", "WARST": "阿根廷西部夏令时间", "MDT": "澳门夏令时间", "JDT": "日本夏令时间", "IST": "印度时间", "OESZ": "东欧夏令时间", "ChST": "查莫罗时间", "CST": "北美中部标准时间", "MESZ": "中欧夏令时间", "NZDT": "新西兰夏令时间", "BOT": "玻利维亚时间", "WAST": "西部非洲夏令时间", "MYT": "马来西亚时间", "LHST": "豪勋爵岛标准时间", "MEZ": "中欧标准时间", "COST": "哥伦比亚夏令时间", "WIB": "印度尼西亚西部时间", "WAT": "西部非洲标准时间", "CHADT": "查坦夏令时间", "ARST": "阿根廷夏令时间", "OEZ": "东欧标准时间", "CLT": "智利标准时间"},
}
}
diff --git a/zh_Hans_CN/zh_Hans_CN_test.go b/zh_Hans_CN/zh_Hans_CN_test.go
new file mode 100644
index 00000000..c7260d4b
--- /dev/null
+++ b/zh_Hans_CN/zh_Hans_CN_test.go
@@ -0,0 +1,1120 @@
+package zh_Hans_CN
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "zh_Hans_CN"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/zh_Hans_HK/zh_Hans_HK.go b/zh_Hans_HK/zh_Hans_HK.go
index ba663464..14bc2d58 100644
--- a/zh_Hans_HK/zh_Hans_HK.go
+++ b/zh_Hans_HK/zh_Hans_HK.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"公元前", "公元"},
erasNarrow: []string{"公元前", "公元"},
erasWide: []string{"公元前", "公元"},
- timezones: map[string]string{"EST": "北美东部标准时间", "ART": "阿根廷标准时间", "GYT": "圭亚那时间", "WART": "阿根廷西部标准时间", "ARST": "阿根廷夏令时间", "MESZ": "中欧夏令时间", "WAT": "西部非洲标准时间", "BT": "不丹时间", "OEZ": "东欧标准时间", "UYT": "乌拉圭标准时间", "CLT": "智利标准时间", "VET": "委内瑞拉时间", "COST": "哥伦比亚夏令时间", "IST": "印度时间", "AKDT": "阿拉斯加夏令时间", "CDT": "北美中部夏令时间", "CST": "北美中部标准时间", "MEZ": "中欧标准时间", "SGT": "新加坡标准时间", "ACST": "澳大利亚中部标准时间", "SRT": "苏里南时间", "WAST": "西部非洲夏令时间", "OESZ": "东欧夏令时间", "MYT": "马来西亚时间", "JDT": "日本夏令时间", "BOT": "玻利维亚时间", "MST": "北美山区标准时间", "AST": "大西洋标准时间", "HADT": "夏威夷-阿留申夏令时间", "UYST": "乌拉圭夏令时间", "GFT": "法属圭亚那时间", "EAT": "东部非洲时间", "JST": "日本标准时间", "CAT": "中部非洲时间", "WIT": "印度尼西亚东部时间", "GMT": "格林尼治标准时间", "TMT": "土库曼斯坦标准时间", "AKST": "阿拉斯加标准时间", "PST": "北美太平洋标准时间", "NZST": "新西兰标准时间", "ADT": "大西洋夏令时间", "WARST": "阿根廷西部夏令时间", "WITA": "印度尼西亚中部时间", "AWST": "澳大利亚西部标准时间", "ChST": "查莫罗时间", "MDT": "北美山区夏令时间", "ACDT": "澳大利亚中部夏令时间", "AEDT": "澳大利亚东部夏令时间", "LHST": "豪勋爵岛标准时间", "WEZ": "西欧标准时间", "ACWST": "澳大利亚中西部标准时间", "AEST": "澳大利亚东部标准时间", "EDT": "北美东部夏令时间", "HAST": "夏威夷-阿留申标准时间", "NZDT": "新西兰夏令时间", "WESZ": "西欧夏令时间", "WIB": "印度尼西亚西部时间", "HNT": "纽芬兰标准时间", "∅∅∅": "巴西利亚夏令时间", "ECT": "厄瓜多尔时间", "SAST": "南部非洲时间", "HAT": "纽芬兰夏令时间", "PDT": "北美太平洋夏令时间", "AWDT": "澳大利亚西部夏令时间", "CHADT": "查坦夏令时间", "ACWDT": "澳大利亚中西部夏令时间", "HKST": "香港夏令时间", "CHAST": "查坦标准时间", "TMST": "土库曼斯坦夏令时间", "LHDT": "豪勋爵岛夏令时间", "CLST": "智利夏令时间", "COT": "哥伦比亚标准时间", "HKT": "香港标准时间"},
+ timezones: map[string]string{"CDT": "北美中部夏令时间", "ACST": "澳大利亚中部标准时间", "GFT": "法属圭亚那时间", "AWDT": "澳大利亚西部夏令时间", "ADT": "大西洋夏令时间", "BOT": "玻利维亚时间", "WART": "阿根廷西部标准时间", "CST": "北美中部标准时间", "AEDT": "澳大利亚东部夏令时间", "UYT": "乌拉圭标准时间", "EAT": "东部非洲时间", "AKST": "阿拉斯加标准时间", "WEZ": "西欧标准时间", "CHADT": "查坦夏令时间", "AST": "大西洋标准时间", "NZDT": "新西兰夏令时间", "HNT": "纽芬兰标准时间", "GYT": "圭亚那时间", "BT": "不丹时间", "HKT": "香港标准时间", "WITA": "印度尼西亚中部时间", "ARST": "阿根廷夏令时间", "EST": "北美东部标准时间", "EDT": "北美东部夏令时间", "IST": "印度时间", "AEST": "澳大利亚东部标准时间", "OESZ": "东欧夏令时间", "MST": "澳门标准时间", "MDT": "澳门夏令时间", "LHST": "豪勋爵岛标准时间", "CLST": "智利夏令时间", "JST": "日本标准时间", "PST": "北美太平洋标准时间", "COT": "哥伦比亚标准时间", "OEZ": "东欧标准时间", "ACDT": "澳大利亚中部夏令时间", "CHAST": "查坦标准时间", "TMST": "土库曼斯坦夏令时间", "MYT": "马来西亚时间", "AKDT": "阿拉斯加夏令时间", "WAT": "西部非洲标准时间", "WESZ": "西欧夏令时间", "ART": "阿根廷标准时间", "MEZ": "中欧标准时间", "PDT": "北美太平洋夏令时间", "MESZ": "中欧夏令时间", "HADT": "夏威夷-阿留申夏令时间", "WIB": "印度尼西亚西部时间", "TMT": "土库曼斯坦标准时间", "CAT": "中部非洲时间", "SRT": "苏里南时间", "HKST": "香港夏令时间", "CLT": "智利标准时间", "WIT": "印度尼西亚东部时间", "LHDT": "豪勋爵岛夏令时间", "ACWST": "澳大利亚中西部标准时间", "AWST": "澳大利亚西部标准时间", "SAST": "南部非洲时间", "HAT": "纽芬兰夏令时间", "SGT": "新加坡标准时间", "WAST": "西部非洲夏令时间", "WARST": "阿根廷西部夏令时间", "∅∅∅": "亚速尔群岛夏令时间", "ACWDT": "澳大利亚中西部夏令时间", "COST": "哥伦比亚夏令时间", "JDT": "日本夏令时间", "HAST": "夏威夷-阿留申标准时间", "NZST": "新西兰标准时间", "ChST": "查莫罗时间", "GMT": "格林尼治标准时间", "UYST": "乌拉圭夏令时间", "ECT": "厄瓜多尔时间", "VET": "委内瑞拉时间"},
}
}
diff --git a/zh_Hans_HK/zh_Hans_HK_test.go b/zh_Hans_HK/zh_Hans_HK_test.go
new file mode 100644
index 00000000..419355c6
--- /dev/null
+++ b/zh_Hans_HK/zh_Hans_HK_test.go
@@ -0,0 +1,1120 @@
+package zh_Hans_HK
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "zh_Hans_HK"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/zh_Hans_MO/zh_Hans_MO.go b/zh_Hans_MO/zh_Hans_MO.go
index a008a1fa..457f04c7 100644
--- a/zh_Hans_MO/zh_Hans_MO.go
+++ b/zh_Hans_MO/zh_Hans_MO.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"公元前", "公元"},
erasNarrow: []string{"公元前", "公元"},
erasWide: []string{"公元前", "公元"},
- timezones: map[string]string{"ADT": "大西洋夏令时间", "SGT": "新加坡标准时间", "AWDT": "澳大利亚西部夏令时间", "UYST": "乌拉圭夏令时间", "CAT": "中部非洲时间", "EST": "北美东部标准时间", "GFT": "法属圭亚那时间", "IST": "印度时间", "ACDT": "澳大利亚中部夏令时间", "PDT": "北美太平洋夏令时间", "MDT": "北美山区夏令时间", "WEZ": "西欧标准时间", "WART": "阿根廷西部标准时间", "WARST": "阿根廷西部夏令时间", "WIB": "印度尼西亚西部时间", "EDT": "北美东部夏令时间", "COT": "哥伦比亚标准时间", "JST": "日本标准时间", "AKDT": "阿拉斯加夏令时间", "PST": "北美太平洋标准时间", "UYT": "乌拉圭标准时间", "CLT": "智利标准时间", "GMT": "格林尼治标准时间", "SRT": "苏里南时间", "AKST": "阿拉斯加标准时间", "AWST": "澳大利亚西部标准时间", "NZST": "新西兰标准时间", "MST": "北美山区标准时间", "WESZ": "西欧夏令时间", "ARST": "阿根廷夏令时间", "CDT": "北美中部夏令时间", "CHAST": "查坦标准时间", "BT": "不丹时间", "CHADT": "查坦夏令时间", "OEZ": "东欧标准时间", "HAT": "纽芬兰夏令时间", "MYT": "马来西亚时间", "CST": "北美中部标准时间", "COST": "哥伦比亚夏令时间", "WITA": "印度尼西亚中部时间", "EAT": "东部非洲时间", "ACST": "澳大利亚中部标准时间", "LHST": "豪勋爵岛标准时间", "AEST": "澳大利亚东部标准时间", "TMST": "土库曼斯坦夏令时间", "WAST": "西部非洲夏令时间", "HKT": "香港标准时间", "NZDT": "新西兰夏令时间", "CLST": "智利夏令时间", "SAST": "南部非洲时间", "MESZ": "中欧夏令时间", "HKST": "香港夏令时间", "JDT": "日本夏令时间", "ECT": "厄瓜多尔时间", "GYT": "圭亚那时间", "WAT": "西部非洲标准时间", "WIT": "印度尼西亚东部时间", "ChST": "查莫罗时间", "AST": "大西洋标准时间", "∅∅∅": "巴西利亚夏令时间", "HNT": "纽芬兰标准时间", "TMT": "土库曼斯坦标准时间", "MEZ": "中欧标准时间", "ACWST": "澳大利亚中西部标准时间", "ACWDT": "澳大利亚中西部夏令时间", "ART": "阿根廷标准时间", "BOT": "玻利维亚时间", "VET": "委内瑞拉时间", "HADT": "夏威夷-阿留申夏令时间", "OESZ": "东欧夏令时间", "LHDT": "豪勋爵岛夏令时间", "AEDT": "澳大利亚东部夏令时间", "HAST": "夏威夷-阿留申标准时间"},
+ timezones: map[string]string{"WEZ": "西欧标准时间", "CST": "北美中部标准时间", "AST": "大西洋标准时间", "ART": "阿根廷标准时间", "CAT": "中部非洲时间", "WAT": "西部非洲标准时间", "CDT": "北美中部夏令时间", "CHAST": "查坦标准时间", "∅∅∅": "亚马逊夏令时间", "AKDT": "阿拉斯加夏令时间", "EAT": "东部非洲时间", "GYT": "圭亚那时间", "HKST": "香港夏令时间", "AKST": "阿拉斯加标准时间", "COT": "哥伦比亚标准时间", "OESZ": "东欧夏令时间", "MST": "北美山区标准时间", "CLST": "智利夏令时间", "ECT": "厄瓜多尔时间", "SAST": "南部非洲时间", "EST": "北美东部标准时间", "MEZ": "中欧标准时间", "HAST": "夏威夷-阿留申标准时间", "ACDT": "澳大利亚中部夏令时间", "ADT": "大西洋夏令时间", "ACWST": "澳大利亚中西部标准时间", "ACWDT": "澳大利亚中西部夏令时间", "IST": "印度时间", "HNT": "纽芬兰标准时间", "WIB": "印度尼西亚西部时间", "OEZ": "东欧标准时间", "AEST": "澳大利亚东部标准时间", "UYT": "乌拉圭标准时间", "HKT": "香港标准时间", "PDT": "北美太平洋夏令时间", "AEDT": "澳大利亚东部夏令时间", "MYT": "马来西亚时间", "WITA": "印度尼西亚中部时间", "JST": "日本标准时间", "COST": "哥伦比亚夏令时间", "WIT": "印度尼西亚东部时间", "CLT": "智利标准时间", "CHADT": "查坦夏令时间", "AWDT": "澳大利亚西部夏令时间", "ARST": "阿根廷夏令时间", "JDT": "日本夏令时间", "HAT": "纽芬兰夏令时间", "ACST": "澳大利亚中部标准时间", "GFT": "法属圭亚那时间", "GMT": "格林尼治标准时间", "ChST": "查莫罗时间", "UYST": "乌拉圭夏令时间", "VET": "委内瑞拉时间", "TMT": "土库曼斯坦标准时间", "BT": "不丹时间", "WART": "阿根廷西部标准时间", "WAST": "西部非洲夏令时间", "TMST": "土库曼斯坦夏令时间", "PST": "北美太平洋标准时间", "MESZ": "中欧夏令时间", "WESZ": "西欧夏令时间", "LHST": "豪勋爵岛标准时间", "WARST": "阿根廷西部夏令时间", "AWST": "澳大利亚西部标准时间", "BOT": "玻利维亚时间", "NZST": "新西兰标准时间", "SGT": "新加坡标准时间", "SRT": "苏里南时间", "HADT": "夏威夷-阿留申夏令时间", "NZDT": "新西兰夏令时间", "LHDT": "豪勋爵岛夏令时间", "MDT": "北美山区夏令时间", "EDT": "北美东部夏令时间"},
}
}
diff --git a/zh_Hans_MO/zh_Hans_MO_test.go b/zh_Hans_MO/zh_Hans_MO_test.go
new file mode 100644
index 00000000..ebb7ad3c
--- /dev/null
+++ b/zh_Hans_MO/zh_Hans_MO_test.go
@@ -0,0 +1,1120 @@
+package zh_Hans_MO
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "zh_Hans_MO"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/zh_Hans_SG/zh_Hans_SG.go b/zh_Hans_SG/zh_Hans_SG.go
index 78ccb48a..a7c1229d 100644
--- a/zh_Hans_SG/zh_Hans_SG.go
+++ b/zh_Hans_SG/zh_Hans_SG.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"公元前", "公元"},
erasNarrow: []string{"公元前", "公元"},
erasWide: []string{"公元前", "公元"},
- timezones: map[string]string{"ECT": "厄瓜多尔时间", "WART": "阿根廷西部标准时间", "ARST": "阿根廷夏令时间", "AKDT": "阿拉斯加夏令时间", "NZST": "新西兰标准时间", "VET": "委内瑞拉时间", "AEDT": "澳大利亚东部夏令时间", "OEZ": "东欧标准时间", "AKST": "阿拉斯加标准时间", "CHADT": "查坦夏令时间", "COT": "哥伦比亚标准时间", "HKST": "香港夏令时间", "CAT": "中部非洲时间", "WIT": "印度尼西亚东部时间", "GYT": "圭亚那时间", "AWDT": "澳大利亚西部夏令时间", "BOT": "玻利维亚时间", "AEST": "澳大利亚东部标准时间", "TMT": "土库曼斯坦标准时间", "NZDT": "新西兰夏令时间", "SGT": "新加坡标准时间", "LHST": "豪勋爵岛标准时间", "PST": "北美太平洋标准时间", "AWST": "澳大利亚西部标准时间", "WAT": "西部非洲标准时间", "BT": "不丹时间", "TMST": "土库曼斯坦夏令时间", "ACST": "澳大利亚中部标准时间", "CHAST": "查坦标准时间", "EDT": "北美东部夏令时间", "HADT": "夏威夷-阿留申夏令时间", "HAT": "纽芬兰夏令时间", "MEZ": "中欧标准时间", "CLT": "智利标准时间", "WESZ": "西欧夏令时间", "ACWST": "澳大利亚中西部标准时间", "GMT": "格林尼治标准时间", "ACDT": "澳大利亚中部夏令时间", "JST": "日本标准时间", "CST": "北美中部标准时间", "COST": "哥伦比亚夏令时间", "EAT": "东部非洲时间", "ChST": "查莫罗时间", "CLST": "智利夏令时间", "WAST": "西部非洲夏令时间", "GFT": "法属圭亚那时间", "OESZ": "东欧夏令时间", "SRT": "苏里南时间", "ADT": "大西洋夏令时间", "WITA": "印度尼西亚中部时间", "IST": "印度时间", "PDT": "北美太平洋夏令时间", "AST": "大西洋标准时间", "EST": "北美东部标准时间", "HAST": "夏威夷-阿留申标准时间", "HKT": "香港标准时间", "WIB": "印度尼西亚西部时间", "∅∅∅": "亚马逊夏令时间", "MDT": "澳门夏令时间", "UYST": "乌拉圭夏令时间", "ACWDT": "澳大利亚中西部夏令时间", "HNT": "纽芬兰标准时间", "ART": "阿根廷标准时间", "MESZ": "中欧夏令时间", "WARST": "阿根廷西部夏令时间", "SAST": "南部非洲时间", "UYT": "乌拉圭标准时间", "CDT": "北美中部夏令时间", "MYT": "马来西亚时间", "JDT": "日本夏令时间", "MST": "澳门标准时间", "LHDT": "豪勋爵岛夏令时间", "WEZ": "西欧标准时间"},
+ timezones: map[string]string{"∅∅∅": "亚速尔群岛夏令时间", "AKDT": "阿拉斯加夏令时间", "WITA": "印度尼西亚中部时间", "SAST": "南部非洲时间", "TMST": "土库曼斯坦夏令时间", "LHDT": "豪勋爵岛夏令时间", "GFT": "法属圭亚那时间", "MESZ": "中欧夏令时间", "GYT": "圭亚那时间", "ACST": "澳大利亚中部标准时间", "ACDT": "澳大利亚中部夏令时间", "AST": "大西洋标准时间", "ACWST": "澳大利亚中西部标准时间", "PST": "北美太平洋标准时间", "WESZ": "西欧夏令时间", "ChST": "查莫罗时间", "WARST": "阿根廷西部夏令时间", "AKST": "阿拉斯加标准时间", "AWST": "澳大利亚西部标准时间", "JST": "日本标准时间", "JDT": "日本夏令时间", "WAST": "西部非洲夏令时间", "WIB": "印度尼西亚西部时间", "AEDT": "澳大利亚东部夏令时间", "VET": "委内瑞拉时间", "ACWDT": "澳大利亚中西部夏令时间", "AWDT": "澳大利亚西部夏令时间", "SRT": "苏里南时间", "ADT": "大西洋夏令时间", "NZDT": "新西兰夏令时间", "CHADT": "查坦夏令时间", "HADT": "夏威夷-阿留申夏令时间", "CLT": "智利标准时间", "HKT": "香港标准时间", "NZST": "新西兰标准时间", "BOT": "玻利维亚时间", "TMT": "土库曼斯坦标准时间", "MYT": "马来西亚时间", "ECT": "厄瓜多尔时间", "ART": "阿根廷标准时间", "EDT": "北美东部夏令时间", "HAT": "纽芬兰夏令时间", "OESZ": "东欧夏令时间", "UYST": "乌拉圭夏令时间", "WIT": "印度尼西亚东部时间", "CST": "北美中部标准时间", "CDT": "北美中部夏令时间", "ARST": "阿根廷夏令时间", "EST": "北美东部标准时间", "MEZ": "中欧标准时间", "WEZ": "西欧标准时间", "COST": "哥伦比亚夏令时间", "EAT": "东部非洲时间", "BT": "不丹时间", "WART": "阿根廷西部标准时间", "CHAST": "查坦标准时间", "HAST": "夏威夷-阿留申标准时间", "WAT": "西部非洲标准时间", "HNT": "纽芬兰标准时间", "COT": "哥伦比亚标准时间", "LHST": "豪勋爵岛标准时间", "HKST": "香港夏令时间", "PDT": "北美太平洋夏令时间", "SGT": "新加坡标准时间", "UYT": "乌拉圭标准时间", "MST": "澳门标准时间", "MDT": "澳门夏令时间", "CAT": "中部非洲时间", "GMT": "格林尼治标准时间", "AEST": "澳大利亚东部标准时间", "IST": "印度时间", "OEZ": "东欧标准时间", "CLST": "智利夏令时间"},
}
}
diff --git a/zh_Hans_SG/zh_Hans_SG_test.go b/zh_Hans_SG/zh_Hans_SG_test.go
new file mode 100644
index 00000000..e186a901
--- /dev/null
+++ b/zh_Hans_SG/zh_Hans_SG_test.go
@@ -0,0 +1,1120 @@
+package zh_Hans_SG
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "zh_Hans_SG"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/zh_Hant/zh_Hant.go b/zh_Hant/zh_Hant.go
index 0312e91a..3d124e91 100644
--- a/zh_Hant/zh_Hant.go
+++ b/zh_Hant/zh_Hant.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"西元前", "西元"},
erasNarrow: []string{"西元前", "西元"},
erasWide: []string{"西元前", "西元"},
- timezones: map[string]string{"BOT": "玻利維亞時間", "TMST": "土庫曼夏令時間", "ARST": "阿根廷夏令時間", "EST": "東部標準時間", "LHST": "豪勳爵島標準時間", "WESZ": "西歐夏令時間", "UYST": "烏拉圭夏令時間", "CLST": "智利夏令時間", "ACWDT": "澳洲中西部夏令時間", "WAST": "西非夏令時間", "GYT": "蓋亞那時間", "AKDT": "阿拉斯加夏令時間", "MEZ": "中歐標準時間", "MST": "澳門標準時間", "AKST": "阿拉斯加標準時間", "ECT": "厄瓜多時間", "BT": "不丹時間", "GMT": "格林威治標準時間", "ACST": "澳洲中部標準時間", "CST": "中部標準時間", "AEDT": "澳洲東部夏令時間", "HKST": "香港夏令時間", "∅∅∅": "亞馬遜夏令時間", "ART": "阿根廷標準時間", "SRT": "蘇利南時間", "LHDT": "豪勳爵島夏令時間", "UYT": "烏拉圭標準時間", "WARST": "阿根廷西部夏令時間", "IST": "印度標準時間", "OESZ": "東歐夏令時間", "ChST": "查莫洛時間", "AWDT": "澳洲西部夏令時間", "CLT": "智利標準時間", "ACWST": "澳洲中西部標準時間", "SGT": "新加坡標準時間", "WIT": "印尼東部時間", "HNT": "紐芬蘭標準時間", "MESZ": "中歐夏令時間", "NZDT": "紐西蘭夏令時間", "HAT": "紐芬蘭夏令時間", "MYT": "馬來西亞時間", "GFT": "法屬圭亞那時間", "WIB": "印尼西部時間", "OEZ": "東歐標準時間", "PST": "太平洋標準時間", "AWST": "澳洲西部標準時間", "AEST": "澳洲東部標準時間", "WART": "阿根廷西部標準時間", "SAST": "南非標準時間", "AST": "大西洋標準時間", "ADT": "大西洋夏令時間", "HADT": "夏威夷-阿留申夏令時間", "EDT": "東部夏令時間", "COST": "哥倫比亞夏令時間", "COT": "哥倫比亞標準時間", "TMT": "土庫曼標準時間", "MDT": "澳門夏令時間", "EAT": "東非時間", "ACDT": "澳洲中部夏令時間", "JST": "日本標準時間", "PDT": "太平洋夏令時間", "CDT": "中部夏令時間", "NZST": "紐西蘭標準時間", "WAT": "西非標準時間", "HKT": "香港標準時間", "CHAST": "查坦群島標準時間", "VET": "委內瑞拉時間", "WITA": "印尼中部時間", "CHADT": "查坦群島夏令時間", "CAT": "中非時間", "HAST": "夏威夷-阿留申標準時間", "JDT": "日本夏令時間", "WEZ": "西歐標準時間"},
+ timezones: map[string]string{"AEDT": "澳洲東部夏令時間", "CLST": "智利夏令時間", "ACST": "澳洲中部標準時間", "AKST": "阿拉斯加標準時間", "ACWST": "澳洲中西部標準時間", "WITA": "印尼中部時間", "NZDT": "紐西蘭夏令時間", "SAST": "南非標準時間", "MYT": "馬來西亞時間", "SRT": "蘇利南時間", "CHADT": "查坦群島夏令時間", "WAST": "西非夏令時間", "AEST": "澳洲東部標準時間", "WART": "阿根廷西部標準時間", "EST": "東部標準時間", "AWST": "澳洲西部標準時間", "IST": "印度標準時間", "WESZ": "西歐夏令時間", "COST": "哥倫比亞夏令時間", "LHDT": "豪勳爵島夏令時間", "ACWDT": "澳洲中西部夏令時間", "VET": "委內瑞拉時間", "WIB": "印尼西部時間", "TMST": "土庫曼夏令時間", "HKT": "香港標準時間", "UYT": "烏拉圭標準時間", "ADT": "大西洋夏令時間", "MESZ": "中歐夏令時間", "OEZ": "東歐標準時間", "CHAST": "查坦群島標準時間", "GMT": "格林威治標準時間", "UYST": "烏拉圭夏令時間", "WIT": "印尼東部時間", "CDT": "中部夏令時間", "JDT": "日本夏令時間", "HADT": "夏威夷-阿留申夏令時間", "BOT": "玻利維亞時間", "WAT": "西非標準時間", "CAT": "中非時間", "ChST": "查莫洛時間", "GYT": "蓋亞那時間", "BT": "不丹時間", "AST": "大西洋標準時間", "HAST": "夏威夷-阿留申標準時間", "EAT": "東非時間", "HKST": "香港夏令時間", "ARST": "阿根廷夏令時間", "MEZ": "中歐標準時間", "CLT": "智利標準時間", "WARST": "阿根廷西部夏令時間", "∅∅∅": "亞速爾群島夏令時間", "ART": "阿根廷標準時間", "JST": "日本標準時間", "EDT": "東部夏令時間", "HNT": "紐芬蘭標準時間", "COT": "哥倫比亞標準時間", "CST": "中部標準時間", "ECT": "厄瓜多時間", "HAT": "紐芬蘭夏令時間", "TMT": "土庫曼標準時間", "OESZ": "東歐夏令時間", "PDT": "太平洋夏令時間", "SGT": "新加坡標準時間", "LHST": "豪勳爵島標準時間", "AWDT": "澳洲西部夏令時間", "MST": "澳門標準時間", "MDT": "澳門夏令時間", "AKDT": "阿拉斯加夏令時間", "PST": "太平洋標準時間", "NZST": "紐西蘭標準時間", "WEZ": "西歐標準時間", "ACDT": "澳洲中部夏令時間", "GFT": "法屬圭亞那時間"},
}
}
diff --git a/zh_Hant/zh_Hant_test.go b/zh_Hant/zh_Hant_test.go
new file mode 100644
index 00000000..116cf196
--- /dev/null
+++ b/zh_Hant/zh_Hant_test.go
@@ -0,0 +1,1120 @@
+package zh_Hant
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "zh_Hant"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/zh_Hant_HK/zh_Hant_HK.go b/zh_Hant_HK/zh_Hant_HK.go
index df7009d1..36dd1394 100644
--- a/zh_Hant_HK/zh_Hant_HK.go
+++ b/zh_Hant_HK/zh_Hant_HK.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"公元前", "公元"},
erasNarrow: []string{"", ""},
erasWide: []string{"公元前", "公元"},
- timezones: map[string]string{"HAT": "纽芬兰夏令时间", "AWST": "澳大利亚西部标准时间", "HADT": "夏威夷-阿留申夏令时间", "OESZ": "东欧夏令时间", "ACWDT": "澳大利亚中西部夏令时间", "CLST": "智利夏令时间", "CAT": "中部非洲时间", "EDT": "北美東部夏令時間", "WARST": "阿根廷西部夏令时间", "WAT": "西部非洲标准时间", "ACST": "澳大利亚中部标准时间", "UYST": "乌拉圭夏令时间", "GFT": "法属圭亚那时间", "EAT": "东部非洲时间", "ART": "阿根廷标准时间", "UYT": "乌拉圭标准时间", "AEDT": "澳大利亚东部夏令时间", "COST": "哥伦比亚夏令时间", "OEZ": "东欧标准时间", "ARST": "阿根廷夏令时间", "MYT": "马来西亚时间", "SRT": "蘇里南時間", "LHST": "豪勋爵岛标准时间", "CHADT": "查坦夏令时间", "SGT": "新加坡時間", "SAST": "南非時間", "PDT": "北美太平洋夏令時間", "AWDT": "澳大利亚西部夏令时间", "PST": "北美太平洋標準時間", "ACWST": "澳大利亚中西部标准时间", "COT": "哥伦比亚标准时间", "∅∅∅": "阿克里夏令时间", "WAST": "西部非洲夏令时间", "HKT": "香港标准时间", "HKST": "香港夏令时间", "IST": "印度時間", "AKDT": "阿拉斯加夏令时间", "BOT": "玻利维亚时间", "CLT": "智利标准时间", "AST": "大西洋标准时间", "ADT": "大西洋夏令时间", "TMT": "土库曼斯坦标准时间", "WART": "阿根廷西部标准时间", "WIB": "印度尼西亚西部时间", "HNT": "纽芬兰标准时间", "GYT": "圭亞那時間", "VET": "委内瑞拉时间", "ChST": "查莫罗时间", "NZST": "新西兰标准时间", "EST": "北美東部標準時間", "HAST": "夏威夷-阿留申标准时间", "GMT": "格林尼治标准时间", "AKST": "阿拉斯加标准时间", "MESZ": "中欧夏令时间", "TMST": "土库曼斯坦夏令时间", "JDT": "日本夏令时间", "NZDT": "新西兰夏令时间", "WESZ": "西欧夏令时间", "WITA": "印度尼西亚中部时间", "CDT": "中部夏令時間", "MEZ": "中欧标准时间", "CHAST": "查坦标准时间", "CST": "北美中部標準時間", "BT": "不丹时间", "MST": "澳门标准时间", "ACDT": "澳大利亚中部夏令时间", "LHDT": "豪勋爵岛夏令时间", "AEST": "澳大利亚东部标准时间", "ECT": "厄瓜多爾時間", "WIT": "印度尼西亚东部时间", "MDT": "澳门夏令时间", "JST": "日本标准时间", "WEZ": "西欧标准时间"},
+ timezones: map[string]string{"CLT": "智利标准时间", "CDT": "中部夏令時間", "AWDT": "澳大利亚西部夏令时间", "AST": "大西洋标准时间", "EST": "北美東部標準時間", "WAT": "西部非洲标准时间", "OESZ": "东欧夏令时间", "EAT": "东部非洲时间", "GFT": "法属圭亚那时间", "CHAST": "查坦标准时间", "ECT": "厄瓜多爾時間", "WIB": "印度尼西亚西部时间", "EDT": "北美東部夏令時間", "HAT": "纽芬兰夏令时间", "UYST": "乌拉圭夏令时间", "AEDT": "澳大利亚东部夏令时间", "LHDT": "豪勋爵岛夏令时间", "∅∅∅": "亚速尔群岛夏令时间", "MDT": "澳门夏令时间", "ACWDT": "澳大利亚中西部夏令时间", "HAST": "夏威夷-阿留申标准时间", "GYT": "圭亞那時間", "LHST": "豪勋爵岛标准时间", "WIT": "印度尼西亚东部时间", "MEZ": "中欧标准时间", "SAST": "南非時間", "WESZ": "西欧夏令时间", "TMT": "土库曼斯坦标准时间", "PST": "北美太平洋標準時間", "PDT": "北美太平洋夏令時間", "HNT": "纽芬兰标准时间", "CST": "北美中部標準時間", "SGT": "新加坡時間", "CLST": "智利夏令时间", "CHADT": "查坦夏令时间", "VET": "委内瑞拉时间", "ART": "阿根廷标准时间", "WITA": "印度尼西亚中部时间", "NZST": "新西兰标准时间", "CAT": "中部非洲时间", "AEST": "澳大利亚东部标准时间", "GMT": "格林尼治标准时间", "SRT": "蘇里南時間", "ACST": "澳大利亚中部标准时间", "HKT": "香港标准时间", "WAST": "西部非洲夏令时间", "UYT": "乌拉圭标准时间", "BT": "不丹时间", "JDT": "日本夏令时间", "MESZ": "中欧夏令时间", "COT": "哥伦比亚标准时间", "MYT": "马来西亚时间", "ARST": "阿根廷夏令时间", "JST": "日本标准时间", "NZDT": "新西兰夏令时间", "TMST": "土库曼斯坦夏令时间", "ADT": "大西洋夏令时间", "BOT": "玻利维亚时间", "ChST": "查莫罗时间", "MST": "澳门标准时间", "HKST": "香港夏令时间", "AKST": "阿拉斯加标准时间", "AKDT": "阿拉斯加夏令时间", "AWST": "澳大利亚西部标准时间", "HADT": "夏威夷-阿留申夏令时间", "WARST": "阿根廷西部夏令时间", "ACDT": "澳大利亚中部夏令时间", "ACWST": "澳大利亚中西部标准时间", "WEZ": "西欧标准时间", "OEZ": "东欧标准时间", "WART": "阿根廷西部标准时间", "IST": "印度時間", "COST": "哥伦比亚夏令时间"},
}
}
diff --git a/zh_Hant_HK/zh_Hant_HK_test.go b/zh_Hant_HK/zh_Hant_HK_test.go
new file mode 100644
index 00000000..fb0c8561
--- /dev/null
+++ b/zh_Hant_HK/zh_Hant_HK_test.go
@@ -0,0 +1,1120 @@
+package zh_Hant_HK
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "zh_Hant_HK"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/zh_Hant_MO/zh_Hant_MO.go b/zh_Hant_MO/zh_Hant_MO.go
index 0a6be98b..0256cb5d 100644
--- a/zh_Hant_MO/zh_Hant_MO.go
+++ b/zh_Hant_MO/zh_Hant_MO.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"公元前", "公元"},
erasNarrow: []string{"公元前", "公元"},
erasWide: []string{"公元前", "公元"},
- timezones: map[string]string{"CLT": "智利标准时间", "SAST": "南部非洲时间", "WIT": "印度尼西亚东部时间", "ACDT": "澳大利亚中部夏令时间", "TMT": "土库曼斯坦标准时间", "MYT": "马来西亚时间", "ACWST": "澳大利亚中西部标准时间", "AEST": "澳大利亚东部标准时间", "CAT": "中部非洲时间", "HKST": "香港夏令时间", "WITA": "印度尼西亚中部时间", "WEZ": "西欧标准时间", "AEDT": "澳大利亚东部夏令时间", "ChST": "查莫罗时间", "CLST": "智利夏令时间", "IST": "印度时间", "EAT": "东部非洲时间", "BOT": "玻利维亚时间", "HKT": "香港标准时间", "HAT": "纽芬兰夏令时间", "PDT": "北美太平洋夏令时间", "MDT": "北美山区夏令时间", "ECT": "厄瓜多尔时间", "WAT": "西部非洲标准时间", "GFT": "法属圭亚那时间", "UYST": "乌拉圭夏令时间", "COT": "哥伦比亚标准时间", "HAST": "夏威夷-阿留申标准时间", "WIB": "印度尼西亚西部时间", "PST": "北美太平洋标准时间", "GYT": "圭亚那时间", "ACWDT": "澳大利亚中西部夏令时间", "ART": "阿根廷标准时间", "JST": "日本标准时间", "UYT": "乌拉圭标准时间", "HADT": "夏威夷-阿留申夏令时间", "SGT": "新加坡标准时间", "WART": "阿根廷西部标准时间", "GMT": "格林尼治标准时间", "ARST": "阿根廷夏令时间", "CDT": "北美中部夏令时间", "NZDT": "新西兰夏令时间", "CHAST": "查坦标准时间", "WARST": "阿根廷西部夏令时间", "AKST": "阿拉斯加标准时间", "AWDT": "澳大利亚西部夏令时间", "MST": "北美山区标准时间", "EDT": "北美东部夏令时间", "AST": "大西洋标准时间", "OESZ": "东欧夏令时间", "MEZ": "中欧标准时间", "CHADT": "查坦夏令时间", "OEZ": "东欧标准时间", "ACST": "澳大利亚中部标准时间", "AKDT": "阿拉斯加夏令时间", "HNT": "纽芬兰标准时间", "TMST": "土库曼斯坦夏令时间", "JDT": "日本夏令时间", "SRT": "苏里南时间", "CST": "北美中部标准时间", "∅∅∅": "巴西利亚夏令时间", "WAST": "西部非洲夏令时间", "LHST": "豪勋爵岛标准时间", "LHDT": "豪勋爵岛夏令时间", "WESZ": "西欧夏令时间", "COST": "哥伦比亚夏令时间", "BT": "不丹时间", "AWST": "澳大利亚西部标准时间", "NZST": "新西兰标准时间", "VET": "委内瑞拉时间", "EST": "北美东部标准时间", "ADT": "大西洋夏令时间", "MESZ": "中欧夏令时间"},
+ timezones: map[string]string{"NZST": "新西兰标准时间", "OEZ": "东欧标准时间", "BT": "不丹时间", "CLST": "智利夏令时间", "ECT": "厄瓜多尔时间", "ART": "阿根廷标准时间", "MESZ": "中欧夏令时间", "MEZ": "中欧标准时间", "OESZ": "东欧夏令时间", "EAT": "东部非洲时间", "CHADT": "查坦夏令时间", "EDT": "北美东部夏令时间", "BOT": "玻利维亚时间", "AEDT": "澳大利亚东部夏令时间", "GYT": "圭亚那时间", "MST": "北美山区标准时间", "UYST": "乌拉圭夏令时间", "GFT": "法属圭亚那时间", "AWST": "澳大利亚西部标准时间", "EST": "北美东部标准时间", "JST": "日本标准时间", "ChST": "查莫罗时间", "WEZ": "西欧标准时间", "UYT": "乌拉圭标准时间", "WART": "阿根廷西部标准时间", "HNT": "纽芬兰标准时间", "∅∅∅": "亚马逊夏令时间", "CLT": "智利标准时间", "HKT": "香港标准时间", "PDT": "北美太平洋夏令时间", "WAT": "西部非洲标准时间", "COST": "哥伦比亚夏令时间", "TMST": "土库曼斯坦夏令时间", "AST": "大西洋标准时间", "AWDT": "澳大利亚西部夏令时间", "HADT": "夏威夷-阿留申夏令时间", "WAST": "西部非洲夏令时间", "GMT": "格林尼治标准时间", "WARST": "阿根廷西部夏令时间", "AKDT": "阿拉斯加夏令时间", "ACWDT": "澳大利亚中西部夏令时间", "WITA": "印度尼西亚中部时间", "SAST": "南部非洲时间", "SGT": "新加坡标准时间", "WIB": "印度尼西亚西部时间", "AEST": "澳大利亚东部标准时间", "MYT": "马来西亚时间", "HAST": "夏威夷-阿留申标准时间", "CHAST": "查坦标准时间", "ADT": "大西洋夏令时间", "WIT": "印度尼西亚东部时间", "LHST": "豪勋爵岛标准时间", "LHDT": "豪勋爵岛夏令时间", "TMT": "土库曼斯坦标准时间", "WESZ": "西欧夏令时间", "SRT": "苏里南时间", "ARST": "阿根廷夏令时间", "IST": "印度时间", "COT": "哥伦比亚标准时间", "MDT": "北美山区夏令时间", "ACST": "澳大利亚中部标准时间", "HKST": "香港夏令时间", "JDT": "日本夏令时间", "NZDT": "新西兰夏令时间", "ACDT": "澳大利亚中部夏令时间", "CAT": "中部非洲时间", "CDT": "北美中部夏令时间", "CST": "北美中部标准时间", "HAT": "纽芬兰夏令时间", "VET": "委内瑞拉时间", "AKST": "阿拉斯加标准时间", "ACWST": "澳大利亚中西部标准时间", "PST": "北美太平洋标准时间"},
}
}
diff --git a/zh_Hant_MO/zh_Hant_MO_test.go b/zh_Hant_MO/zh_Hant_MO_test.go
new file mode 100644
index 00000000..bf43b034
--- /dev/null
+++ b/zh_Hant_MO/zh_Hant_MO_test.go
@@ -0,0 +1,1120 @@
+package zh_Hant_MO
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "zh_Hant_MO"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/zh_Hant_TW/zh_Hant_TW.go b/zh_Hant_TW/zh_Hant_TW.go
index 445dbf64..26b8f9dd 100644
--- a/zh_Hant_TW/zh_Hant_TW.go
+++ b/zh_Hant_TW/zh_Hant_TW.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"公元前", "公元"},
erasNarrow: []string{"公元前", "公元"},
erasWide: []string{"公元前", "公元"},
- timezones: map[string]string{"MDT": "北美山区夏令时间", "WAT": "西部非洲标准时间", "OEZ": "东欧标准时间", "HAT": "纽芬兰夏令时间", "WIT": "印度尼西亚东部时间", "JDT": "日本夏令时间", "NZST": "新西兰标准时间", "MST": "北美山区标准时间", "CHAST": "查坦标准时间", "CLST": "智利夏令时间", "ECT": "厄瓜多尔时间", "AST": "大西洋标准时间", "IST": "印度时间", "GYT": "圭亚那时间", "VET": "委内瑞拉时间", "LHST": "豪勋爵岛标准时间", "HAST": "夏威夷-阿留申标准时间", "WAST": "西部非洲夏令时间", "HNT": "纽芬兰标准时间", "BT": "不丹时间", "OESZ": "东欧夏令时间", "GFT": "法属圭亚那时间", "AKST": "阿拉斯加标准时间", "AWST": "澳大利亚西部标准时间", "AEDT": "澳大利亚东部夏令时间", "CAT": "中部非洲时间", "ACWDT": "澳大利亚中西部夏令时间", "CLT": "智利标准时间", "EST": "北美东部标准时间", "EDT": "北美东部夏令时间", "PST": "北美太平洋标准时间", "WESZ": "西欧夏令时间", "AEST": "澳大利亚东部标准时间", "ChST": "查莫罗时间", "COST": "哥伦比亚夏令时间", "HADT": "夏威夷-阿留申夏令时间", "HKST": "香港夏令时间", "WIB": "印度尼西亚西部时间", "ACDT": "澳大利亚中部夏令时间", "ART": "阿根廷标准时间", "CST": "北美中部标准时间", "BOT": "玻利维亚时间", "ACWST": "澳大利亚中西部标准时间", "COT": "哥伦比亚标准时间", "ADT": "大西洋夏令时间", "TMT": "土库曼斯坦标准时间", "JST": "日本标准时间", "SGT": "新加坡标准时间", "WART": "阿根廷西部标准时间", "GMT": "格林尼治标准时间", "WITA": "印度尼西亚中部时间", "LHDT": "豪勋爵岛夏令时间", "NZDT": "新西兰夏令时间", "SAST": "南部非洲时间", "ARST": "阿根廷夏令时间", "MYT": "马来西亚时间", "MEZ": "中欧标准时间", "HKT": "香港标准时间", "PDT": "北美太平洋夏令时间", "UYT": "乌拉圭标准时间", "EAT": "东部非洲时间", "SRT": "苏里南时间", "WEZ": "西欧标准时间", "CHADT": "查坦夏令时间", "ACST": "澳大利亚中部标准时间", "TMST": "土库曼斯坦夏令时间", "UYST": "乌拉圭夏令时间", "∅∅∅": "巴西利亚夏令时间", "WARST": "阿根廷西部夏令时间", "AKDT": "阿拉斯加夏令时间", "AWDT": "澳大利亚西部夏令时间", "CDT": "北美中部夏令时间", "MESZ": "中欧夏令时间"},
+ timezones: map[string]string{"LHDT": "豪勋爵岛夏令时间", "CLST": "智利夏令时间", "PDT": "北美太平洋夏令时间", "TMST": "土库曼斯坦夏令时间", "WAT": "西部非洲标准时间", "HNT": "纽芬兰标准时间", "HAT": "纽芬兰夏令时间", "WART": "阿根廷西部标准时间", "PST": "北美太平洋标准时间", "WAST": "西部非洲夏令时间", "MST": "北美山区标准时间", "CLT": "智利标准时间", "AKST": "阿拉斯加标准时间", "ART": "阿根廷标准时间", "WESZ": "西欧夏令时间", "HAST": "夏威夷-阿留申标准时间", "∅∅∅": "巴西利亚夏令时间", "AKDT": "阿拉斯加夏令时间", "ACWST": "澳大利亚中西部标准时间", "ACWDT": "澳大利亚中西部夏令时间", "JST": "日本标准时间", "BOT": "玻利维亚时间", "MEZ": "中欧标准时间", "CAT": "中部非洲时间", "EAT": "东部非洲时间", "WEZ": "西欧标准时间", "SGT": "新加坡标准时间", "NZDT": "新西兰夏令时间", "GMT": "格林尼治标准时间", "ADT": "大西洋夏令时间", "COST": "哥伦比亚夏令时间", "AEDT": "澳大利亚东部夏令时间", "ACST": "澳大利亚中部标准时间", "VET": "委内瑞拉时间", "TMT": "土库曼斯坦标准时间", "EDT": "北美东部夏令时间", "OESZ": "东欧夏令时间", "BT": "不丹时间", "UYST": "乌拉圭夏令时间", "CDT": "北美中部夏令时间", "HKT": "香港标准时间", "HKST": "香港夏令时间", "CHAST": "查坦标准时间", "HADT": "夏威夷-阿留申夏令时间", "OEZ": "东欧标准时间", "GYT": "圭亚那时间", "WIT": "印度尼西亚东部时间", "WARST": "阿根廷西部夏令时间", "ARST": "阿根廷夏令时间", "JDT": "日本夏令时间", "CST": "北美中部标准时间", "ACDT": "澳大利亚中部夏令时间", "ECT": "厄瓜多尔时间", "AST": "大西洋标准时间", "IST": "印度时间", "EST": "北美东部标准时间", "LHST": "豪勋爵岛标准时间", "WITA": "印度尼西亚中部时间", "MYT": "马来西亚时间", "UYT": "乌拉圭标准时间", "AWDT": "澳大利亚西部夏令时间", "NZST": "新西兰标准时间", "COT": "哥伦比亚标准时间", "SRT": "苏里南时间", "AWST": "澳大利亚西部标准时间", "WIB": "印度尼西亚西部时间", "ChST": "查莫罗时间", "GFT": "法属圭亚那时间", "CHADT": "查坦夏令时间", "SAST": "南部非洲时间", "AEST": "澳大利亚东部标准时间", "MDT": "北美山区夏令时间", "MESZ": "中欧夏令时间"},
}
}
diff --git a/zh_Hant_TW/zh_Hant_TW_test.go b/zh_Hant_TW/zh_Hant_TW_test.go
new file mode 100644
index 00000000..b25db166
--- /dev/null
+++ b/zh_Hant_TW/zh_Hant_TW_test.go
@@ -0,0 +1,1120 @@
+package zh_Hant_TW
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "zh_Hant_TW"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/zu/zu.go b/zu/zu.go
index 94aabff8..8e2d9f9a 100644
--- a/zu/zu.go
+++ b/zu/zu.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"", ""},
erasWide: []string{"BC", "AD"},
- timezones: map[string]string{"WART": "Isikhathi saseNyakatho ne-Argentina esijwayelekile", "ART": "Isikhathi sase-Argentina esijwayelekile", "CST": "isikhathi sase-North American Central esijwayelekile", "BOT": "Isikhathi sase-Bolivia", "WESZ": "Isikhathi sasehlobo sase-Western Europe", "ACWDT": "Isikhathi sasemini sase-Australian Central West", "AEDT": "Isikhathi sasemini sase-Australian East", "ACDT": "esase-Austrilian Central Daylight Time", "PDT": "isikhathi sase-North American Pacific sasemini", "AWST": "I-Australian Western Standard Time", "HADT": "isikhathi sase-Hawaii-Aleutia sasemini", "BT": "esase-Bhutan Time", "WITA": "Isikhathi sase-Central Indonesia", "AKDT": "Isikhathi sase-Alaska sasemini", "EST": "isikhathi sase-North American East esijwayelekile", "EDT": "isikhathi sase-North American East sasemini", "SGT": "Isikhathi esivamile sase-Singapore", "OESZ": "Isikhathi sasehlobo sase-Eastern Europe", "MDT": "MDT", "CHAST": "Isikhathi esivamile sase-Chatham", "CAT": "Isikhathi sase-Central Africa", "HKT": "Isikhathi esivamile sase-Hong Kong", "HKST": "Isikhathi sehlobo sase-Hong Kong", "IST": "esase-India Standard Time", "ACST": "esase-Austrilian Central Standard Time", "AKST": "isikhathi sase-Alaska esijwayelekile", "UYST": "Isikhathi sase-Uruguay sasehlobo", "AEST": "Isikhathi esivamile sase-Australian East", "GFT": "Isikhathi sase-French Guiana", "CDT": "isikhathi sase-North American Central sasemini", "VET": "Isikhathi sase-Venezuela", "ADT": "isikhathi sase-Atlantic sasemini", "HAST": "isikhathi sase-Hawaii-Aleutia esijwayelekile", "GMT": "Isikhathi sase-Greenwich Mean", "HNT": "isikhathi sase-Newfoundland esijwayelekile", "JST": "Isikhathi esivamile sase-Japan", "NZST": "Isikhathi esivamile sase-New Zealand", "WIB": "Isikhathi sase-Western Indonesia", "OEZ": "Isikhathi esijwayelekile sase-Eastern Europe", "COT": "Isikhathi sase-Colombia esijwayelekile", "HAT": "isikhathi sase-Newfoundland sasemini", "TMST": "Isikhathi sehlobo sase-Turkmenistan", "JDT": "Isikhathi semini sase-Japan", "PST": "isikhathi sase-North American Pacific esijwayelekile", "LHST": "Isikhathi sase-Lord Howe esivamile", "MEZ": "Isikhathi esijwayelekile sase-Central Europe", "CLT": "Isikhathi sase-Chile esijwayelekile", "∅∅∅": "Isikhathi sase-Amazon sasehlobo", "SRT": "Isikhathi sase-Suriname", "MYT": "Isikhathi sase-Malaysia", "ChST": "Isikhathi esijwayelekile sase-Chamorro", "WAT": "Isikhathi esijwayelekile saseNtshonalanga Afrika", "LHDT": "Isikhathi sase-Lord Howe sasemini", "COST": "Isikhathi sase-Colombia sasehlobo", "ECT": "Isikhathi sase-Ecuador", "ARST": "Isikhathi sase-Argentina sasehlobo", "AWDT": "I-Australian Western Daylight Time", "NZDT": "Isikhathi sasemini sase-New Zealand", "WEZ": "Isikhathi esijwayelekile sase-Western Europe", "ACWST": "Isikhathi sase-Australian Central West esivamile", "EAT": "Isikhathi saseMpumalanga Afrika", "MST": "MST", "MESZ": "Isikhathi sasehlobo sase-Central Europe", "UYT": "Isikhathi sase-Uruguay esijwayelekile", "CLST": "Isikhathi sase-Chile sasehlobo", "TMT": "Isikhathi esivamile sase-Turkmenistan", "GYT": "Isikhathi sase-Guyana", "CHADT": "Isikhathi semini sase-Chatham", "WAST": "Isikhathi sasehlobo saseNtshonalanga Afrika", "WARST": "Isikhathi saseNyakatho ne-Argentina sasehlobo", "AST": "isikhathi sase-Atlantic esijwayelekile", "SAST": "Isikhathi esijwayelekile saseNingizimu Afrika", "WIT": "Isikhathi sase-Eastern Indonesia"},
+ timezones: map[string]string{"UYST": "Isikhathi sase-Uruguay sasehlobo", "EAT": "Isikhathi saseMpumalanga Afrika", "CLT": "Isikhathi sase-Chile esijwayelekile", "SRT": "Isikhathi sase-Suriname", "AKST": "isikhathi sase-Alaska esijwayelekile", "AKDT": "Isikhathi sase-Alaska sasemini", "IST": "esase-India Standard Time", "CAT": "Isikhathi sase-Central Africa", "WAT": "Isikhathi esijwayelekile saseNtshonalanga Afrika", "AEST": "Isikhathi esivamile sase-Australian East", "LHDT": "Isikhathi sase-Lord Howe sasemini", "VET": "Isikhathi sase-Venezuela", "AWDT": "I-Australian Western Daylight Time", "NZST": "Isikhathi esivamile sase-New Zealand", "WESZ": "Isikhathi sasehlobo sase-Western Europe", "BT": "esase-Bhutan Time", "ACWST": "Isikhathi sase-Australian Central West esivamile", "MESZ": "Isikhathi sasehlobo sase-Central Europe", "TMST": "Isikhathi sehlobo sase-Turkmenistan", "OEZ": "Isikhathi esijwayelekile sase-Eastern Europe", "LHST": "Isikhathi sase-Lord Howe esivamile", "CHAST": "Isikhathi esivamile sase-Chatham", "COT": "Isikhathi sase-Colombia esijwayelekile", "COST": "Isikhathi sase-Colombia sasehlobo", "AEDT": "Isikhathi sasemini sase-Australian East", "ECT": "Isikhathi sase-Ecuador", "AST": "isikhathi sase-Atlantic esijwayelekile", "TMT": "Isikhathi esivamile sase-Turkmenistan", "WAST": "Isikhathi sasehlobo saseNtshonalanga Afrika", "OESZ": "Isikhathi sasehlobo sase-Eastern Europe", "WIT": "Isikhathi sase-Eastern Indonesia", "CDT": "isikhathi sase-North American Central sasemini", "JDT": "Isikhathi semini sase-Japan", "SAST": "Isikhathi esijwayelekile saseNingizimu Afrika", "WEZ": "Isikhathi esijwayelekile sase-Western Europe", "MST": "isikhathi sase-North American Mountain esijwayelekile", "CST": "isikhathi sase-North American Central esijwayelekile", "WARST": "Isikhathi saseNyakatho ne-Argentina sasehlobo", "HKST": "Isikhathi sehlobo sase-Hong Kong", "PST": "isikhathi sase-North American Pacific esijwayelekile", "HADT": "isikhathi sase-Hawaii-Aleutia sasemini", "∅∅∅": "Isikhathi sase-Brasilia sasehlobo", "ADT": "isikhathi sase-Atlantic sasemini", "ACWDT": "Isikhathi sasemini sase-Australian Central West", "CLST": "Isikhathi sase-Chile sasehlobo", "CHADT": "Isikhathi semini sase-Chatham", "AWST": "I-Australian Western Standard Time", "ART": "Isikhathi sase-Argentina esijwayelekile", "WITA": "Isikhathi sase-Central Indonesia", "EDT": "isikhathi sase-North American East sasemini", "MEZ": "Isikhathi esijwayelekile sase-Central Europe", "UYT": "Isikhathi sase-Uruguay esijwayelekile", "MDT": "isikhathi sase-North American Mountain sasemini", "WART": "Isikhathi saseNyakatho ne-Argentina esijwayelekile", "HKT": "Isikhathi esivamile sase-Hong Kong", "BOT": "Isikhathi sase-Bolivia", "JST": "Isikhathi esivamile sase-Japan", "HAST": "isikhathi sase-Hawaii-Aleutia esijwayelekile", "WIB": "Isikhathi sase-Western Indonesia", "HNT": "isikhathi sase-Newfoundland esijwayelekile", "ChST": "Isikhathi esijwayelekile sase-Chamorro", "SGT": "Isikhathi esivamile sase-Singapore", "MYT": "Isikhathi sase-Malaysia", "ACST": "esase-Austrilian Central Standard Time", "NZDT": "Isikhathi sasemini sase-New Zealand", "PDT": "isikhathi sase-North American Pacific sasemini", "HAT": "isikhathi sase-Newfoundland sasemini", "GMT": "Isikhathi sase-Greenwich Mean", "ACDT": "esase-Austrilian Central Daylight Time", "ARST": "Isikhathi sase-Argentina sasehlobo", "EST": "isikhathi sase-North American East esijwayelekile", "GFT": "Isikhathi sase-French Guiana", "GYT": "Isikhathi sase-Guyana"},
}
}
diff --git a/zu/zu_test.go b/zu/zu_test.go
new file mode 100644
index 00000000..2dcabb62
--- /dev/null
+++ b/zu/zu_test.go
@@ -0,0 +1,1120 @@
+package zu
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "zu"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/zu_ZA/zu_ZA.go b/zu_ZA/zu_ZA.go
index 4112bfd1..77eddcd3 100644
--- a/zu_ZA/zu_ZA.go
+++ b/zu_ZA/zu_ZA.go
@@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"BC", "AD"},
erasNarrow: []string{"", ""},
erasWide: []string{"BC", "AD"},
- timezones: map[string]string{"GFT": "Isikhathi sase-French Guiana", "TMST": "Isikhathi sehlobo sase-Turkmenistan", "PDT": "isikhathi sase-North American Pacific sasemini", "CDT": "isikhathi sase-North American Central sasemini", "WAST": "Isikhathi sasehlobo saseNtshonalanga Afrika", "IST": "esase-India Standard Time", "HNT": "isikhathi sase-Newfoundland esijwayelekile", "AKST": "isikhathi sase-Alaska esijwayelekile", "CAT": "Isikhathi sase-Central Africa", "LHDT": "Isikhathi sase-Lord Howe sasemini", "NZDT": "Isikhathi sasemini sase-New Zealand", "UYT": "Isikhathi sase-Uruguay esijwayelekile", "CLT": "Isikhathi sase-Chile esijwayelekile", "AEST": "Isikhathi esivamile sase-Australian East", "∅∅∅": "∅∅∅", "SAST": "Isikhathi esijwayelekile saseNingizimu Afrika", "WITA": "Isikhathi sase-Central Indonesia", "MESZ": "Isikhathi sasehlobo sase-Central Europe", "AEDT": "Isikhathi sasemini sase-Australian East", "WAT": "Isikhathi esijwayelekile saseNtshonalanga Afrika", "BT": "esase-Bhutan Time", "ACST": "esase-Austrilian Central Standard Time", "SRT": "Isikhathi sase-Suriname", "WEZ": "Isikhathi esijwayelekile sase-Western Europe", "ACWDT": "Isikhathi sasemini sase-Australian Central West", "AST": "isikhathi sase-Atlantic esijwayelekile", "VET": "Isikhathi sase-Venezuela", "AWDT": "I-Australian Western Daylight Time", "HADT": "isikhathi sase-Hawaii-Aleutia sasemini", "SGT": "Isikhathi esivamile sase-Singapore", "WART": "Isikhathi saseNyakatho ne-Argentina esijwayelekile", "WIT": "Isikhathi sase-Eastern Indonesia", "OESZ": "Isikhathi sasehlobo sase-Eastern Europe", "PST": "isikhathi sase-North American Pacific esijwayelekile", "WARST": "Isikhathi saseNyakatho ne-Argentina sasehlobo", "EAT": "Isikhathi saseMpumalanga Afrika", "MDT": "MDT", "ACDT": "esase-Austrilian Central Daylight Time", "CHAST": "Isikhathi esivamile sase-Chatham", "AKDT": "Isikhathi sase-Alaska sasemini", "MYT": "Isikhathi sase-Malaysia", "COST": "Isikhathi sase-Colombia sasehlobo", "ECT": "Isikhathi sase-Ecuador", "ADT": "isikhathi sase-Atlantic sasemini", "WIB": "Isikhathi sase-Western Indonesia", "TMT": "Isikhathi esivamile sase-Turkmenistan", "LHST": "Isikhathi sase-Lord Howe esivamile", "CST": "isikhathi sase-North American Central esijwayelekile", "CLST": "Isikhathi sase-Chile sasehlobo", "GMT": "Isikhathi sase-Greenwich Mean", "JST": "Isikhathi esivamile sase-Japan", "NZST": "Isikhathi esivamile sase-New Zealand", "CHADT": "Isikhathi semini sase-Chatham", "JDT": "Isikhathi semini sase-Japan", "BOT": "Isikhathi sase-Bolivia", "ChST": "Isikhathi esijwayelekile sase-Chamorro", "EST": "isikhathi sase-North American East esijwayelekile", "COT": "Isikhathi sase-Colombia esijwayelekile", "HAST": "isikhathi sase-Hawaii-Aleutia esijwayelekile", "HKT": "Isikhathi esivamile sase-Hong Kong", "MST": "MST", "ARST": "Isikhathi sase-Argentina sasehlobo", "GYT": "Isikhathi sase-Guyana", "ART": "Isikhathi sase-Argentina esijwayelekile", "MEZ": "Isikhathi esijwayelekile sase-Central Europe", "UYST": "Isikhathi sase-Uruguay sasehlobo", "OEZ": "Isikhathi esijwayelekile sase-Eastern Europe", "AWST": "I-Australian Western Standard Time", "WESZ": "Isikhathi sasehlobo sase-Western Europe", "HKST": "Isikhathi sehlobo sase-Hong Kong", "HAT": "isikhathi sase-Newfoundland sasemini", "ACWST": "Isikhathi sase-Australian Central West esivamile", "EDT": "isikhathi sase-North American East sasemini"},
+ timezones: map[string]string{"HKST": "Isikhathi sehlobo sase-Hong Kong", "AKST": "isikhathi sase-Alaska esijwayelekile", "WEZ": "Isikhathi esijwayelekile sase-Western Europe", "WIB": "Isikhathi sase-Western Indonesia", "AEDT": "Isikhathi sasemini sase-Australian East", "WARST": "Isikhathi saseNyakatho ne-Argentina sasehlobo", "ACST": "esase-Austrilian Central Standard Time", "CDT": "isikhathi sase-North American Central sasemini", "PDT": "isikhathi sase-North American Pacific sasemini", "NZDT": "Isikhathi sasemini sase-New Zealand", "MST": "MST", "AWST": "I-Australian Western Standard Time", "AEST": "Isikhathi esivamile sase-Australian East", "CLT": "Isikhathi sase-Chile esijwayelekile", "HAT": "isikhathi sase-Newfoundland sasemini", "COST": "Isikhathi sase-Colombia sasehlobo", "HADT": "isikhathi sase-Hawaii-Aleutia sasemini", "∅∅∅": "Isikhathi sasehlobo sase-Azores", "JST": "Isikhathi esivamile sase-Japan", "SAST": "Isikhathi esijwayelekile saseNingizimu Afrika", "ChST": "Isikhathi esijwayelekile sase-Chamorro", "LHST": "Isikhathi sase-Lord Howe esivamile", "AWDT": "I-Australian Western Daylight Time", "MEZ": "Isikhathi esijwayelekile sase-Central Europe", "OEZ": "Isikhathi esijwayelekile sase-Eastern Europe", "OESZ": "Isikhathi sasehlobo sase-Eastern Europe", "GFT": "Isikhathi sase-French Guiana", "IST": "esase-India Standard Time", "ARST": "Isikhathi sase-Argentina sasehlobo", "GYT": "Isikhathi sase-Guyana", "ECT": "Isikhathi sase-Ecuador", "ACWST": "Isikhathi sase-Australian Central West esivamile", "AST": "isikhathi sase-Atlantic esijwayelekile", "MESZ": "Isikhathi sasehlobo sase-Central Europe", "HNT": "isikhathi sase-Newfoundland esijwayelekile", "SGT": "Isikhathi esivamile sase-Singapore", "WART": "Isikhathi saseNyakatho ne-Argentina esijwayelekile", "AKDT": "Isikhathi sase-Alaska sasemini", "CHADT": "Isikhathi semini sase-Chatham", "CLST": "Isikhathi sase-Chile sasehlobo", "ART": "Isikhathi sase-Argentina esijwayelekile", "WITA": "Isikhathi sase-Central Indonesia", "EST": "isikhathi sase-North American East esijwayelekile", "TMT": "Isikhathi esivamile sase-Turkmenistan", "TMST": "Isikhathi sehlobo sase-Turkmenistan", "MDT": "MDT", "ACWDT": "Isikhathi sasemini sase-Australian Central West", "EDT": "isikhathi sase-North American East sasemini", "PST": "isikhathi sase-North American Pacific esijwayelekile", "NZST": "Isikhathi esivamile sase-New Zealand", "SRT": "Isikhathi sase-Suriname", "VET": "Isikhathi sase-Venezuela", "EAT": "Isikhathi saseMpumalanga Afrika", "COT": "Isikhathi sase-Colombia esijwayelekile", "UYST": "Isikhathi sase-Uruguay sasehlobo", "LHDT": "Isikhathi sase-Lord Howe sasemini", "UYT": "Isikhathi sase-Uruguay esijwayelekile", "HAST": "isikhathi sase-Hawaii-Aleutia esijwayelekile", "GMT": "Isikhathi sase-Greenwich Mean", "CAT": "Isikhathi sase-Central Africa", "WAT": "Isikhathi esijwayelekile saseNtshonalanga Afrika", "MYT": "Isikhathi sase-Malaysia", "BOT": "Isikhathi sase-Bolivia", "WESZ": "Isikhathi sasehlobo sase-Western Europe", "CHAST": "Isikhathi esivamile sase-Chatham", "HKT": "Isikhathi esivamile sase-Hong Kong", "JDT": "Isikhathi semini sase-Japan", "ADT": "isikhathi sase-Atlantic sasemini", "WAST": "Isikhathi sasehlobo saseNtshonalanga Afrika", "WIT": "Isikhathi sase-Eastern Indonesia", "CST": "isikhathi sase-North American Central esijwayelekile", "ACDT": "esase-Austrilian Central Daylight Time", "BT": "esase-Bhutan Time"},
}
}
diff --git a/zu_ZA/zu_ZA_test.go b/zu_ZA/zu_ZA_test.go
new file mode 100644
index 00000000..19e814de
--- /dev/null
+++ b/zu_ZA/zu_ZA_test.go
@@ -0,0 +1,1120 @@
+package zu_ZA
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "zu_ZA"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '<nil>' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}